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 on me21n

Former Member
0 Kudos

Hi,

i have a requirement that, make the field (Purchase Requisition) as a mandatory field for specific document types in me21n.

i struck in how to write the code to make purchase requisition as mandatory, if any one knows please reply me.


Thanks & Regards,

Deepthi

6 REPLIES 6

ipravir
Active Contributor
0 Kudos

Hi Deepthi,

Check the below BADI,

1. ME_PROCESS_PO -> CHECK Method

Or

2. ME_PROCESS_PO_CUST.

Regards.

Praveer.

Former Member
0 Kudos

thanks for your reply , i found the suitable badi, but i want the code for this requirement.

thanks,

Former Member
0 Kudos

check that particular field is INITIANL or not

If initial

Messsge " please enter pR number" type E.

endif

Former Member
0 Kudos

As far as the code is concerned you can just check if the variable containing the Purchase Requisition is Initial and if yes, give out an Error message.

Beware the error message to be of type 'E' since it should stop further processing until the PR number is entered.

ipravir
Active Contributor
0 Kudos

Hi Deepthi,

Use the CHECK Method of ME_PROCESS_PO BADI.

You will get the IM_HEADER as Import parameter,

Data; LE_TEMS type PURCHASE_ORDER_ITEMS

CALL method IM_HEADER->GET_ITEMS

Return

RE_ITEMS = LE_ITEMS.

Read the LT_ITEMS, and check the PR No.

Data: items type Purchase_order_item.

data: l_data type mepoitem.

Loop at LT_ITEMS into items,

     call methods items->get_data

     return

     re_data     = l_data.

    

     if l_data-BANFN eq space.

          message. '' type 'E'.

     endif.

endloop.

regards.

Praveer.


Former Member
0 Kudos

thanks Utkarsha Khadke and Praveer Kumar Sen  

i will try your code.