Application Development 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: 

BADI USER/EXIT for inserting cust. data after the Pruch. Requsitio is SAVED

Former Member
0 Kudos

Hi all,

Is there any BADI or USER EXIT available for the transaction ME51N to save

some customer data fields in a separta Z table , after the data is saved from the

Purcahse requistion .

I have used the customer exit MEREQ001 for additing the customer filelds with TABLE CONTROL.

I am not able to save the data from the table control . Any suggestion on this will be apprecitated .

Best Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You have to use 'EXIT_SAPLMEREQ_003' to import data from screen to your tables and use 'EXIT_SAPLMEREQ_001' to send data to screen.use the below code like below:

EXIT_SAPLMEREQ_001:

tables : ci_ebandb.

data : i_mereq_item type mereq_item.

if im_req_item is initial.

clear: ci_ebandb.

else.

i_mereq_item = im_req_item->get_data( ).

move-corresponding i_mereq_item to ci_ebandb.

endif.

EXIT_SAPLMEREQ_003

data : i_mereq_item type mereq_item.

if not im_req_item is initial.

i_mereq_item = im_req_item->get_data( ).

move-corresponding ci_ebandb to i_mereq_item .

call method im_req_item->set_data( i_mereq_item ).

endif.

Also set the flag EX_CHANGED = 'X' to transafer the changes to database

Regards,

Himanshu

2 REPLIES 2

Former Member
0 Kudos

Hi,

You have to use 'EXIT_SAPLMEREQ_003' to import data from screen to your tables and use 'EXIT_SAPLMEREQ_001' to send data to screen.use the below code like below:

EXIT_SAPLMEREQ_001:

tables : ci_ebandb.

data : i_mereq_item type mereq_item.

if im_req_item is initial.

clear: ci_ebandb.

else.

i_mereq_item = im_req_item->get_data( ).

move-corresponding i_mereq_item to ci_ebandb.

endif.

EXIT_SAPLMEREQ_003

data : i_mereq_item type mereq_item.

if not im_req_item is initial.

i_mereq_item = im_req_item->get_data( ).

move-corresponding ci_ebandb to i_mereq_item .

call method im_req_item->set_data( i_mereq_item ).

endif.

Also set the flag EX_CHANGED = 'X' to transafer the changes to database

Regards,

Himanshu

Former Member
0 Kudos

Thanks for your response,

I am not using ci_ebandb ie we have not appended the EBAN table.

We have created our own Z-table . For each item in eban table, the

z-table will n number of records.

This Z table we have used the subsceen of the user exit MEREQ001 with a table control.

My problem is how to save the data from the table control in database while saving the requisition.

Best Regards

Edited by: Hari on Feb 1, 2011 6:50 PM