In your SAP Consultant life, you will probably have a lot of situations when your SAP extractor will be not exactly matching your needs. In this situation (missing trigger could be a NO-GO) you can always enhance your structure and fill your field by using the RSU5_SAPI_BADI.
First of all, let me explain my example. Assume that we have a 0BPARTNER_ATTR extractor which by default don’t have field 'BUSINESS_STATUS' which we want to have. This field is available in our but000:

Our BUSINESS_STATUS field is filled in BDT, and can contain few different values, if we look at content of but000 then we see one entry:

Lets check rsa3:

We have luck, because the field in this extractor has been filled by default, and we don’t need any additional steps to get this working. Let’s assume that in the case of '1′ our client needs an 'A' value in the BW system. Let’s go to se18, and create a new implementation in RSU5_SAPI_BADI.

Let’s open our new class ZCL_IM_0BPARTNER_ATTR_BS and implement some code now:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
class zcl_im_0bpartner_attr_bs definition public final create public . public section. interfaces if_ex_rsu5_sapi_badi . protected section. private section. endclass. class zcl_im_0bpartner_attr_bs implementation. method if_ex_rsu5_sapi_badi~data_transform. check i_datasource = '0BPARTNER_ATTR'. data: lt_tab type standard table of bus000_bw. lt_tab = corresponding #( c_t_data ). "Of course you can do this in more fancy ways than loop, this is just a explanation loop at lt_tab reference into data(lr_tab). if lr_tab->business_status = 1. lr_tab->business_status = 'A'. endif. endloop. c_t_data = lt_tab. endmethod. method if_ex_rsu5_sapi_badi~hier_transform. endmethod. endclass. |
Now save and activate Badi and code. Go to rsa3 and check result:

Tadaaaa, everything is working as expected 🙂 I hope you get some value from this