Application Development and Automation 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: 
Read only

Reversing posting key using bapi_acc_gl_posting_post

Former Member
0 Likes
962
BELNR(ACCOUNTING DOC NUMBER)
BSCHL(POSTING KEY)
                          0100000000          40
                          0100000001  50

Hi,

   i am getting the above output.Now i want to revrese(INTERCHANGE) the posting key for the corresponding BELNR, i.e 40 in place of 50 and vice versa

using ' BAPI_ACC_GL_POSTING_POST'.

Please advice.

Vinit.

7 REPLIES 7
Read only

RaymondGiuseppi
Active Contributor
0 Likes
876

And what is the problem, did you try a simple "multiply item_cur-amt_doccur by '-1.00'." or similar trick ?

Regards,

Raymond

Read only

0 Likes
876

Hi Raymond,

                  i am new to this  and hence m not getting what u are saying. According to the requirement,

i just want to reverse the values in the posting key fields by using ' BAPI_ACC_GL_POSTING_POST' as mentioned above.Will u please explain me in detail.

Regards,

Vinit.

Read only

0 Likes
876

Just read the current document and map data to BAPI, I don't know easy tool to perform this except generating mapping FM via BDBS when SAP did not create those.

But where does this document to reverse come from  ?

Regards,

Raymond

Read only

0 Likes
876

I guess you are not passing the entries in the right way. Can you explain the problem the briefly?

Manu

Read only

0 Likes
876

     Hi Raymond,

                       the images shown above are of the actual scenario.After clicking on the checkbox 'Overwrite with Accural Posting' in the selection screen  following changes are expected  in the output.In the posting key field (PK) '40' should get replaced by '50'  and vice versa..i.e the posting key should get reversed.

Bapi used here is 'bapi_acc_gl_posting_post'.

Please advice or suggest any other way  for getting the output as per the requirement.

Regards,

Vinit.

Read only

manukapur
Active Participant
0 Likes
876

Pass the amount as negative value. The bapi takes care of the posting keys. You don't have to specify anything extra.

Regards,

Manu

Read only

Sudhakargadde
Participant
0 Likes
876

hello Vinit,

Please read the relevant data for the BAPI form the tables  BKPF and BSEG based on the number BELNR. and passed to 'BAPI_ACC_GL_POSTING_POST' and commit the work using 'BAPI_TRANSACTION_COMMIT'.

Thank and Regards

Sudhakar