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: 

Delivery address as mandatory field in ME51N (PR)

Former Member
0 Kudos
1,267

We have a requirement to make the Delivery Address a mandatory field for Purchase Requistions raised via ME51N.

Can anyone please suggest a Badi or User Exit that we can use to check that the field has been populated when saving?

Thanks in advance

Jan

3 REPLIES 3

Former Member
0 Kudos
206

Hi Jan,

I think this can be achieved by doing some configuration change through SPRO. Follow this path in SPRO and look whether you can set devlivery address field mandatory:

SPRO-> Materials Management-> Purchasing->Purchase Requisition->Define Screen Layout at document Level or OMF2 transaction. In the table control select ME51 and press details icon. From the resulting screen select Field Selection Group and for each group you can find fields which can be set mandatory, optional, display only.

You can take help of functional consultant for above settings.

Hope this helps.

Ramesh.

Former Member
0 Kudos
206

Hi Ramesh,

Thanks for your reply. According to our Business Analyst, the delivery field is one of two fields that cannot be made mandatory in this way.

However, I have managed to solve the problem myself using method Check in Badi ME_PROCESS_REQ_CUST, thanks to another post in this forum. The code is as follows, in case it helps anyone else:

data: it_items type mmpur_requisition_items,

wa_item type mmpur_requisition_item,

v_items type ref to if_purchase_requisition_item,

w_item_data type mereq_item.

call method im_header->get_items

receiving

re_items = it_items.

loop at it_items into wa_item.

v_items = wa_item-item.

call method v_items->get_data

receiving

re_data = w_item_data.

if w_item_data-adrn2 = ''.

message e083(zmm) with 'Item '

w_item_data-bnfpo

'Delivery Address is Mandatory'.

endif.

endloop.

Jan

0 Kudos
206

hi ,

I tried your way for making it mandatory but I am always getting w_item_data-adrn2 or w_item_data-adrnr as initial even if the address is filled . This adrnr is generated after the posting doc is generated.

Can you help with this.

Thanks.