Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

field in BAPI for posting key..

Former Member
0 Kudos

hi,

I went thru the forum and found some info in one of the posts but still has my doubt.

I am trying to post GL line items using BAPI_ACC_DOCUMENT_POST. Where and how do we pass the posting key or debit credit indicator ? I dont find any relevant field in the BAPI for this. In one of the posts I read that i can do it in SHKZG but I dont find in any of the structures in the BAPI. Am I missing something ?

thks

9 REPLIES 9

naimesh_patel
Active Contributor
0 Kudos

You need to use the field ACCT_KEY in the ACCOUNTGL parameter.

Based on the entry providedin the ACCT_KEY system will look into the table T030B to get the Posting key combination.

Regards,

Naimesh Patel

0 Kudos

Hi Nimesh,

Acct_key seems to be like a 3 chr field...is this the correct field...in my requirement i am reading lines from a flat file and if a particular column has 'D' it indicates its a debit and so I should set the posting key to 40. If it is C then I should set the posting key to 50. I hope I am clear..

thks

0 Kudos

hi,

there is no separate field for posting key. It will be derived from the amount: if you enter a positive amount => it will be a debit entry, posting key 40 will be used. if you enter a negative amount => it will be a credit entry, posting key 50 will be used. Of course this is only true for G/L accounts, for vendor the posting keys 21/31 will be used, for customers 01/11 (29/39 and 09/19 in case of special G/L).

hope this helps

ec

0 Kudos

Ok Eric, info is useful.

But just now I noticed one more field in the structure BAPIACGL09 which is used in BAPI_ACC_DOCUMENT_POST which is DE_CRE_IND. Can this be the one which I am looking for ??

thks

0 Kudos

no, it showing to BSEG-TBTKZ (normal debit credit indicator is BSEG-SHKZG), this is from SAPHelp for the above field:

Determines whether the invoice or credit memo involves a subsequent debit or a subsequent credit.

Use

Subsequent debits or credits occur if further invoices or credit memos are received in respect of goods which have already been invoiced. It is only the invoiced value that changes as a result: the invoiced quantity is not affected.

0 Kudos

Hi ,

Eric is right!! I have also used this bapi couple of times and there is no separate field for posting key it will be decided by the amount sign.Please go head and post without filling posting keys.

Thanks

Sudharshan

0 Kudos

Hey all thanks....As Eric said, there is no seperate posting key..I just used + and - and it worked..thanks..

former_member188685
Active Contributor
0 Kudos

ACCOUNTRECEIVABLE

ACCOUNTPAYABLE

just check the two parameters.

Former Member
0 Kudos

Hello,

If Im not mistaken I believe that using that FM you will be only able to post documents this the standard posting keys, which are 31 or 41 (not sure, but I believe). Check for any SAP notes on that FM!!

Hope this helps!

Gabriel P,.