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

Former Member
0 Likes
5,780

hello ..people

i am using the badi AC_DOCUMENT, Method CHANGE_INITIAL and i want to read parameter IM_DOCUMENT.

i have ready to entry code in method only want to know...what code i need for to read an object ?

i need to read ITEM and ITEM_AMOUNTS.

greetigs ... Ramiro

hello ..people

i am using the badi AC_DOCUMENT, Method CHANGE_INITIAL and i want to read parameter IM_DOCUMENT.

i have ready to entry code in method only want to know...what code i need for to read an object ?

i need to read ITEM and ITEM_AMOUNTS.

greetigs ... Ramiro

4 REPLIES 4
Read only

Former Member
0 Likes
4,210

Implement this code in CHANGE_INITIAL.


DATA: t_items   TYPE accit_t,
      wa_item   TYPE accit,
      t_amounts TYPE acccr_t,
      wa_amount TYPE acccr.

t_items = im_document-item.
t_amounts = im_document-item_amounts.

LOOP AT i_items INTO wa_item.
...
...
ENDLOOP.

LOOP AT t_amounts INTO wa_amount.
...
...
ENDLOOP.

Connect the two tables (items & item_amounts) using the following fields:

AWTYP

AWREF

AWORG

POSNR

Read only

0 Likes
4,210

Hello Sam,

Your sample code for CHANGE_INITIAL is very helpful for me.

I am now on developing "Change Accounting Document" using interface name "IF_EX_AC_DOCUMENT" for call-up point 3 level substitution.

Unfortunately it isn't working after I implemented below code.

method IF_EX_AC_DOCUMENT~CHANGE_AFTER_CHECK.

data: t_items type accit_t,

wa_item type accit,

t_amounts type acccr_t,

wa_amount type acccr,

ex_item type ACCIT_SUB_T,

wo_item type ACCIT_SUB.

t_items = im_document-item.

t_amounts = im_document-item_amounts.

loop at t_items into wa_item.

wa_item-xref3 = 'test'.

endloop.

ex_item = ex_document-item.

loop at ex_document-item into wo_item.

wo_item-xref3 = 'test'.

modify ex_document-item from wo_item.

endloop.

endmethod.

Where is the problem in above source code?

Please help me.

Best regards,

JK.Kim

Read only

0 Likes
4,210

Hello JinKoo,

Its a very old thread, but: did you solve your issue?

I got similar problem trying to change KOSTL in a Parked FI document, so, It seems that this BAdI is not suitable for document changes.

Regards,

José Gabriel.

Read only

Former Member
0 Likes
4,210

thanks ..SAM ..

it`s correct your code ...

i was try with the next code:

FIELD-SYMBOLS: <ITEM> TYPE ANY,

<ITEM_AMOUNTS> TYPE ANY.

DATA: a_im_document-item type acc_document-item,

a_im_document-item_amounts type acc_document-item_amounts.

a_im_document-item = im_document-item.

a_im_document-item_amounts = im_document-item_amounts.

read table a_im_document-item assigning <ITEM>

index 1.

.....

read table a_im_document-item_amounts

assigning<ITEM_AMOUNTS> index 1.

......

greetings