cancel
Showing results for 
Search instead for 
Did you mean: 

Cross entity badi

shaila_kasha
Contributor
0 Kudos

hi Experts,

I wrote a cross ET badi to copy payment term field value from company code to , other cc and all purchasing orgs.

The badi is working for copying payment terms from company code to purchasing org , but when I write data in exact same way for writing zterm in Bp_compny , if more than 1 cc exist for that vendor, it is not working . Only updates po but not other cc,

Please provide of any hints.

Accepted Solutions (1)

Accepted Solutions (1)

shaila_kasha
Contributor
0 Kudos

Hi all,

thank you for your inputs.

I was able to solve the issue:

While writing PO, payment terms, usmd_fag was automatically set to abap_true

however while Company code, flag was set to true only for the CC i am changing , after i set the flag for all CC in the loop. it is working.

Also, they key filled up for both CC and PO is just the BP_header (BP#)

Thank You again. Shaila.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Shaila,

Since the BP_CUS_CC will be common for all the company codes, please use the Single Entity badi. In the CT_DATA you will get all the company code for the given BP. In this badi, you can copy the vaues between the Company codes.

loga201
Contributor
0 Kudos

Hi,

It would be great if you can add some more details..what you mean by 'write data in exact same way for writing zterm in Bp_compny'.

Thank you
shaila_kasha
Contributor
0 Kudos

Thank you for the post.

I used the below write_data method to write the data back to the UI for both Company code data and purchasing organization data. However this statement does not work for CC data, and works only for PO data to update payment terms. the condition is user should be updating CC , payment terms for one of the main CC and at this time - Payment terms should be copied to all CC and PO of that vendor.

i_entity = 'BP_PORG' " Or BP_COMPNY
it_key = lt_key "has BP # from header data
it_attribute = lt_attribute "ZTERM_M or ZTERM
it_data = "internal table with all PO or CC for that vendor , 1 or more entries

TRY.
io_write_data->write_data(
EXPORTING

i_entity

it_key

it_attribute

it_data ).

CATCH cx_usmd_write_error.

puneet_gupta1
Explorer
0 Kudos

Hi shaila.. is the relevant key filled up for Company code entity while writing to the entity ?

Regards