Link Between Accounting With Material Number 

Where is the link between the two (Material Document & Accounting Document)?
How to list those material documents only, for which accounting documents are generated? 

Resolution:

You need to create a simple query using SQ01 

The following are the steps on how to do it:

STEP 1

SAP query way to extract your information.

Create an infoset SQ02 with a single table MKPF. (include key fields in the field group)

STEP 2

From Extras

Create an additional field called zawkey (like bkpf-belnr) which will concatenate the MM document number MKPF-MBLNR and MKPF_MJAHR. The sequencing shall be number 1.
You may use this code below and paste also (this needs authorization as well)

data: zzawkey like bkpf-awkey.
clear: zawkey, zzawkey.
concatenate mkpf-mblnr mkpf-mjahr into zzawkey.
zawkey = zzawkey.

Add another field called ACCDOCNO (accounting document number) with sequencing number 2 with following code.

data: zaccdocno like bkpf-belnr..
clear: zaccdocno, accdocno.
select belnr from bkpf into zaccdocno where
bukrs = ccode and
GJAHR = MKPF-MJAHR and
awkey = zawkey.
.
endselect.
accdocno = zaccdocno.

Step 3

Include the additional fields into the field group.

STEP 4
Click on the selection tab and create a parameter called ccode with a description Company Code and against

LIKE BKPF-BUKRS 
Extras OBLIGATORY 

STEP 5

Click on the selection tab and create a selection criteria pdate with a description Posting Date for the field MKPF-BUDAT

Extras OBLIGATORY 

STEP 6

Save, Generate and assign the infoset to a user group.

STEP 7

Create a SQ01 query under the user group with all the fields in the infoset and Execute. Enter a company code and one date of a working day where you expect material transactions.

The result will be all the material documents and their corresponding accounting documents, if available. If you want to see only those material document that do not have corresponding accounting document, then while you are in the selection screen say accounting document number is not equal to blank.

Get help for your SAP FI/CO problems
SAP FICO Forum - Do you have a SAP FI/CO Question?

SAP Books
SAP FICO Books  - Certification, Interview Questions and Configuration

SAP FICO Tips
SAP FI/CO Tips and Financial Accounting/Controlling Discussion Forum

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.