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

BADI AC_DOCUMENT- CHANGE INITIAL not updating BSEG custom field

0 Kudos
2,361

Hi ,

My requirement is to update BSEG custom field (ZMATKL) during Accounting document creation from MIGO.I have implemented BADI AC_DOCUMENT-CHANGE_INITIAL and added below code ,it updated ACCTIT-ZMATKL ,but value is not getting updated in BSEG-ZMATKL.

DATA:it_accit TYPE accit_t.

DATA:wa_accit TYPE accit.

DATA:it_sub_t TYPE accit_sub_t.

DATA:wa_accit_sub TYPE accit_sub.

it_accit = im_document-item[].
LOOP AT it_accit INTO wa_accit.
wa_accit-zmatkl = '12161904'.

MODIFY it_accit FROM wa_accit.

MOVE-CORRESPONDING wa_accit TO wa_accit_sub.

APPEND wa_accit_sub TO it_sub_t.
ENDLOOP.

ex_document-item[] = it_sub_t[].

Please help to understand ,what I am doing incorrect.

0 REPLIES 0