‎2012 Oct 25 1:20 PM
Hi frndz,
I m posting the values for AP Open items and AR open items through bapi_acc_document_post.
I am able to do successful posting.
But i've to achieve the following things after successful posting.
Document type Posting keys T-code
KR 31, 40 FB60 (AP Invoice)
KG 21, 50 FB65 (AP credit Memo)
DR 01,50 FB70 (AR Invoice)
DG 11,40 FB75 (AR Credit Memo)
Even i am passing DOC_TYPE value in header i am unable to get the exact posting keys in final result.
I am getting only 21,50 for both the doc types KR and KG.
And getting only 01,50 for both the doc types DR and DG.
Even though the postings were successful docs were created with above posting keys..
I've gone through some posts in SCN, where experts told to use badi.
Please suggest me how to achieve this.
note: above two AP and AR are two individual requirements
thanks in advance.
Ramana
‎2012 Oct 25 1:31 PM
The posting key as derived within this BAPI is not dependent on the document type, but rather on the account type (AR/AP/GL) and sign of the amount to be posted. Positive amounts ("Soll") will be posted with keys 01 for AR, 21 for AP and 40 for G/L, negative amounts ("Haben") with keys 11 for AR, 31 for AP and 50 for G/L.
Maybe you need to work on sending the correct amounts (positive/negative) to the BAPI.
Thomas
‎2012 Oct 25 1:26 PM
Hi Ramana,
The posting keys are automatically determined by the BAPI transaction itself. There is no need to pass the posting keys. Depending on the senario's you will have the posting keys. Still if you are unsure, just reverse the currency amounts for KR and DR document types, and you will get the correct posting keys.
Regards,
Hardik Mehta
‎2012 Oct 25 1:33 PM
Thanks for the quick reply hardik,
I am alredy posting throuth the offset entry. Means for each record in the final internal table i am adding on entry with reverse amount and constant GL account and Profit center.with these two line items i am posting as a single document. Same thing for all the document types. still i am getting the same posting keys..
Regards,
Ramana
‎2012 Oct 25 1:31 PM
The posting key as derived within this BAPI is not dependent on the document type, but rather on the account type (AR/AP/GL) and sign of the amount to be posted. Positive amounts ("Soll") will be posted with keys 01 for AR, 21 for AP and 40 for G/L, negative amounts ("Haben") with keys 11 for AR, 31 for AP and 50 for G/L.
Maybe you need to work on sending the correct amounts (positive/negative) to the BAPI.
Thomas
‎2012 Oct 25 1:39 PM
Thanks thomas,
It makes sense to me.
But the load file which i got from Functional containing all the values positive.
So, do i need to change these values to positive or negative based on doc types before posting?
Regards,
Ramana
‎2012 Oct 25 1:46 PM
Yes, if you expect KR to be posted as 31 and 40, then you need to send the AP related amounts as negative, and the GL related amounts as positive values. I guess it would be cleaner if your functional person already prepares the correct input data, rather than manipulating amounts later in the program code.
Thomas
‎2012 Oct 25 1:50 PM