Skip to Content
0

Cross entity badi

May 17, 2017 at 03:49 AM

100

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Shaila kasha Jul 17, 2017 at 06:13 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Loga Nathan Duraisamy May 17, 2017 at 02:44 PM
0

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
Show 2 Share
10 |10000 characters needed characters left characters exceeded

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.

0

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

Regards

0
senthil kumar May 26, 2017 at 07:06 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded