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: 

IF_EX_ME_PROCESS_PO_CUST ~FIELDSELECTION_ITEM

Former Member
0 Kudos

Hello folks,

i want to check the field LABNR in the tr me21n / me22n.

In case of a special vendor it should not be allowed to be changed - only displayed.

i have the correct methods, the metafiled 74 - Fieldstatus should be '*'

but in debugging sap is not "jumping" to the correct method to get it runnig through my logic. (it looks like everything is activated correct)

in other cases the badi is still "working":

IF_EX_ME_PROCESS_PO_CUSTPROCESS_ITEM and IF_EX_ME_PROCESS_PO_CUSTPROCESS_SCHEDULE

(the implemented includes in the methods are working pretty well.)

Does somebody knows this problem? It looks like i missed to activate smthg...

thanks for your help in advance!

tom

3 REPLIES 3

Former Member
0 Kudos

Hi, did you find a solution? - just having the same problem. Would apreciate some help!

Regards,

Markus

Peranandam
Contributor
0 Kudos

Hi Tom,

BADI 'ME_PROCESS_PO_CUST' is not a correct one for doing validation for your requirement.

use customer exit for your requirment.

Enhancement MM06E005 is having Component EXIT_SAPMM06E_017 .

implement include available in the above specifed component and do validation as per your requirement.

i have tested by creating project in CMOD. it is working for me . see the sample code i have implemented in exit.

field-symbols: <fs> type any.

*--- I_EKPO is having changed values of LABNR .

if I_EKPO is not initial.

*--validate changes of LABNR for the your special vendor

if I_EKKO-lifnr = '0000001014'.

*-- table TEKPO will have existing value of LABNR.

READ table tekpo with key EBELN = I_EKPO-EBELN.

if TEKPO- LABNR ne I_EKpo- LABNR.

*---here assign existing value if LABNR value is changed

I_EKpo- LABNR = TEKPO- LABNR .

IF sy-subrc = 0.

ASSIGN ('(SAPLMEPO)ekpo') TO <fs>.

IF sy-subrc <> 0.

ASSIGN ('(SAPMM06E)ekpo') TO <fs>.

IF sy-subrc <> 0.

EXIT.

ENDIF.

ENDIF.

<fs> = I_EKPO.

ENDIF.

endif.

endif.

in the above logic i have assigned existing LABNR value if they changed value for particular vendor.

You can also trigger error message by rising exception.

if you are working on ECC version you can disable the that field by implementing implicit enhancement.

Let me know if you need any clarification.

This question is belongs to enhancement category. pls choose correct forum category for getting proper response.

Cheers...

Regards,

Peranandam

uwe_schieferstein
Active Contributor
0 Kudos

Hello Tom

Without knowing exactly when FIELDSELECTION_ITEM is triggered I would try the following implementation:


METHOD IF_EX_ME_PROCESS_PO_CUST ~FIELDSELECTION_ITEM.
* define local data
  DATA:
    ls_header     TYPE mepoheader,
    ls_item         TYPE mepoitem.

  ls_header = im_header->get_data( ).
  CHECK ( ls_header-lifnr = '<specific vendor>' ).

  " Now modify CH_FIELDSELECTION as required.

  " QUESTION: Do we need to check the item instance?
ENDMETHOD.

Regards

Uwe