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: 

Badi AC_DOCUMENT for updating prctr

Former Member
0 Kudos

Hi ,

I am trying to update the profit center ( prctr ) through the BADI AC_DOCUMENT.

I have written the below code but its not posting and is giving me an error that document saved but not posted . Below is the code

  • In the variable I am passing the profit center which I am getting from Z table

_________________________________________________________________

DATA: ex_item type ACCIT,

wa_ex_item type ACCIT_SUB.

LOOP AT im_document-item INTO ex_item.

wa_ex_item-mandt = ex_item-mandt.

wa_ex_item-awtyp = ex_item-awtyp.

wa_ex_item-awref = ex_item-awref.

wa_ex_item-aworg = ex_item-aworg.

wa_ex_item-posnr = ex_item-posnr.

wa_ex_item-prctr = l_prctr.

APPEND wa_ex_item to ex_document-item.

endloop.

__________________________________________________________________

2 REPLIES 2

Former Member
0 Kudos

Hi,

Check that for which condition the message is triggering.

Try to check the condition.

Regards

Sandipan

Former Member
0 Kudos

The issue got resolved using the User Exit EXIT_SAPLV60B_008