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: 

Prepopulate Item details in ME21N

Former Member
0 Kudos

I have requirement where I need to call transaction ME21N with most of the item details populated. User will change the quantity and save it. I tried the BADI ME_PROCESS_PO_CUSt~OPEN . I was able to populate only the header

5 REPLIES 5

raymond_giuseppi
Active Contributor
0 Kudos

I didn't find any "new item" event, so you may try to use method PROCESS_ITEM there use IM_ITEM->GET_DATA and GET_PREVIOUS DATA when the second method raise the NO_DATA exception, fill some default values and execute a SET_DATA.

Regards,

Raymond

0 Kudos

Thanks for the response.. Process_item method will not get triggered while calling ME21N. Only Open method will get triggered.

0 Kudos

Will be called each time a new item is created, don't expect any method to set data to item that exist only as initial dummy lines in a table control (GET_PREVIOUS DATA to identify new items)

NB: In OPEN method you could use a IM_HEADER->GET_ITEMS to get list of items, but in case of creation, ME21N, you should receive an empty internal table.

Regards,
Raymond

0 Kudos

We will create new item after opening ME21N transaction. My requirement is to have it populated while opening the transaction. For eg We have option of default values which will populate automatically when we open ME21N. Default values will populate same values across all line items. I need to populate different values in different line items.

0 Kudos

Ok if your actual requirement is creation a new item : use OPEN method, once you insure to be in creation mode, use method IM_HEADER->CREATE_ITEM.

Regards,

Raymond