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: 

Vendor number Mandatory in Create Purchase Order Screen

former_member207873
Participant
0 Kudos
829

Hi Experts,

Please have a look on to the below screen in purchase order creation.

When we give the condition type and click on the details button. The below screen will come.

I wanted to make the vendor mandatory while the user is creating purchase order. Now PO is getting created even without vendor number. How to achieve this?

8 REPLIES 8

SharathYaralkattimath
Contributor
0 Kudos
345

hi,

Check for any Badi's , else you can create implicit enhancements & throw a message pop-up.

Thanks,

Sharath

koolspy_ultimate
Active Contributor
0 Kudos
345

Hi try,

        SPRO - > Materials Management - > purchasing - purchase order -> define screen layout at document level.

Select me21n and click on details - > double click on Reference data, item and check vendor number as requires and go back to the screen layout and save it , tr will be generated.

Next time when you try to create po the vendor filed will be mandatory.

Regards,

Madhumahesh.

former_member188282
Active Participant
0 Kudos
345

HI,

Check with function may we have possibility through config level. Because in my screen the Vendor field is not available.

Other wise go to include LV69AF02.

Create implicit enhancement  in subroutine kbild_initialisieren.

check with below code.

loop at screen.

if screen-name = 'KOMV-LIFNR'.

screen-input = 1.

modify screen.

endif

endloop

Regards,

Rajesh.

raymond_giuseppi
Active Contributor
0 Kudos
345

You could try with BAdI ME_PROCESS_PIO_CUST, in method IF_EX_ME_PROCESS_PO_CUST~PROCESS_HEADER you could add a code like

METHOD if_ex_me_process_po_cust~process_header .
   INCLUDE mm_messages_mac.
   DATA: ls_header TYPE mepoheader.
   ls_header = im_header->get_data( ).
   IF ls_header-lifnr IS INITIAL.
     mmpur_metafield mmmfd_vendor.
     mmpur_message_forced 'E' '06' 049 ' ' ' ' ' ' ' '.
     im_header->invalidate( ).
     EXIT.
   ENDIF.

But did you first check available Customizing options ?

Regards,

Raymond

0 Kudos
345

Hello Raymond,

Will the above code work for the details of the pricing condition type. (Since it is item).

BR

0 Kudos
345

No, of course, you will be required to use another method like IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM, there use method IF_PURCHASE_ORDER_ITEM_MM~GET_CONDITIONS on IM_ITEM to get required data.

Regards,

Raymond

0 Kudos
345

Hello Raymond

Can you give  sample code for the same.

BR.

paul_max1
Explorer
0 Kudos
345

Set the field as mandatory in screen painter.