01-05-2015 5:52 AM
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
01-05-2015 6:02 AM
Hi Deepthi,
Check the below BADI,
1. ME_PROCESS_PO -> CHECK Method
Or
2. ME_PROCESS_PO_CUST.
Regards.
Praveer.
01-05-2015 6:09 AM
thanks for your reply , i found the suitable badi, but i want the code for this requirement.
thanks,
01-05-2015 6:16 AM
check that particular field is INITIANL or not
If initial
Messsge " please enter pR number" type E.
endif
01-05-2015 6:43 AM
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.
01-05-2015 6:43 AM
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.
01-05-2015 6:55 AM
thanks Utkarsha Khadke and Praveer Kumar Sen
i will try your code.