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: 

error message in badi me_process_po_cust doesn't lock the screen

former_member241865
Discoverer
0 Kudos

Hi all,

I have a problem: in badi me_process_po_cust, method process_header I check the purchasing group.

if it is not correct, I throw an error message, but after this the fields in me22n are editable yet.

How can I lock the whole screen until the user sets the right value in field purchasing group?

Thank you in advance.

7 REPLIES 7

Former Member
0 Kudos

Use method CHECK instead, worked for me. There's a reason why not header method, but I don't remember why.

Code goes like

METHOD if_ex_me_process_po_cust~check.

.....

data:  ls_header              TYPE mepoheader.

CALL METHOD im_header->get_data

    RECEIVING

      re_data = ls_header.

  lt_items = im_header->get_items( ).

  IF ls_header-EKGRP = 'whatever'.

       MESSAGE ID 'Zxx' TYPE 'E' NUMBER 'nnn'.

       EXIT.

ENDIF.

Hope this helps.

former_member195402
Active Contributor
0 Kudos

Hi Rory,

please read the documentation of BADI ME_PROCESS_PO_CUST:

If you want to check fields in method PROCESS_HEADER and throw error messages, you have to use macros mmpur_metafield and mmpur_message_forced.

Regards,

Klaus

0 Kudos

I've tried with the macros, but the result is the same, the field are editable yet...

former_member1200644
Participant
0 Kudos

Hi,

Please try this in your code.

include mm_messages_mac.

IF <CHECK CONDITION>

    mmpur_message 'E' 'ME' '015' '' '' '' ''.

ENDIF.

It is help for you.

Regards,

Nilesh

0 Kudos

I've tried it, but the field of me22n are editable yet.

0 Kudos

Hi ,

Please try code in ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER_REFKEYS.



data: LS_HEADER type mepoheader.

     LS_HEADER = IM_HEADER->get_data( ).

   if sy-tcode = 'ME21N' or sy-tcode = 'ME22N'.
          loop at screen.
            if screen-name = 'MEPO1222-EKGRP' .
               screen-input = 0.
               modify screen.
             endif.
          endloop.
   endif.



Regards,

Nilesh

0 Kudos

Hi,

Please write your logic in ME_PROCESS_PO_CUST->CHECK method. Then, I hope you will get it.

Regards,

Suresh