Skip to Content
0
Former Member
May 27, 2007 at 12:59 PM

Badi ME_PROCESS_REQ_CUST Sample Code required for changing the values

2272 Views

Dear Friends,

I am new to the Badi technology. We would like to populate/change the standard field values, (Purchasing group) during Purchase Requisition creation/change.

Method --> PROCESS_ITEM.

I tried the following code, but system blnaks out all the field values entered during PR creation.

Appreciate, if you could provide me some sample code which can be of help.

Reg

Kumar

-


Sample code----


METHOD if_ex_me_process_req_cust~process_item .

DATA: k_mereqitem TYPE mereq_item,

om_data type mereq_item,

om_datax type mereq_itemx,

k_mereqitem = im_item->get_data( ).

check im_count = 1.

if k_mereqitem-bsart = 'ST' and

k_mereqitem-loekz = ' '.

om_data-pstyp = '5'. " assign default item category code

om_data-bnfpo = k_mereqitem-bnfpo.

om_data-WERKS = k_mereqitem-WERKS.

om_datax-pstyp = 'X'.

call method im_item->set_datax

exporting im_datax = om_datax.

call method im_item->set_data

exporting im_data = om_data.

endif.

ENDMETHOD.