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: 

Validation on PO Release

Former Member
0 Kudos

Hi All,

Iam using the BADI ME_PROCESS_PO_CUST. I want to validate on custom fields added that i have already added. I want this validation to work on click of RELEASE button, so i added the validation in CHECK method, it gives error message but there two issues will explain u the same

1. If a PO with 2 line item is there and i have not updated the custom field and press the release button then it will show error signal on the 2nd item only.

But if we check in message log then it will show

why it is not showing the RED signal on both line item and 2nd issue

2. If a PO with 2 line item is there and i have not updated the custom field in the first line item only and press the release button then it will show error signal on the 2nd item only but in message it will show for the 1st item only

Kindly suggest why this is happening

Thanks,

Madhukar Shetty

3 REPLIES 3

Venkat_Sesha
Advisor
Advisor
0 Kudos

It could be because of some Clear or refresh or Appending issue.

Can you paste your BADI Code please. So that I can have a exact solution.

Thanks.

0 Kudos

Hi Venkat,

   METHOD if_ex_me_process_po_cust~check.
  IF ( sy-ucomm EQ 'MERELEASE' OR sy-ucomm EQ 'MESAVE' OR sy-ucomm EQ 'MECHECKDOC' )"
      AND sy-tcode EQ 'ME29N'. "
    DATA: lit_ekpo TYPE purchase_order_items,    " Item Object Instances
          lwa_ekpo TYPE purchase_order_item,     " Work Area for Item object Instances
          lwa_poitemdtl TYPE mepoitem.             " Item Details

    INCLUDE mm_messages_mac.

    REFRESH: lit_ekpo.
    CLEAR: lwa_ekpo.
    lit_ekpo = im_header->get_items( ).
    break madshett.
    LOOP AT lit_ekpo INTO lwa_ekpo.
      lwa_poitemdtl = lwa_ekpo-item->get_data( ).
      IF lwa_poitemdtl-pstyp EQ '9' AND lwa_poitemdtl-service_owner IS INITIAL.
        mmpur_message_forced 'E' 'Z4' '000' 'Enter Service owner for item' lwa_poitemdtl-ebelp ' ' ' '.
        ch_failed = 'X'.
      ENDIF.
    ENDLOOP.
  ENDIF.

ENDMETHOD.

Thanks

0 Kudos

Hi Madhukar

The problem could be here

mepoitem When loop the IT_EKPO

calling the Message when the PSTYP = '9'.

Debug here and see if you can make the message with any other Function module or something like thing like that.