Application Development and Automation 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: 
Read only

T-Code: ME51N Problem while implementing check for Material Group

Former Member
0 Likes
588

Hi All,

I am trying to put an ABAP check in user exit: EXIT_SAPLMEREQ_008 for the T-Code: ME51N .

Following is the code i am using but while changing the Material Group i am getting screen locked.

Please help me out and suggest if User Exit is not correct.

if sy-tcode = 'ME51N' or sy-tcode = 'ME52N'.

     select name low from tvarvc into table it_tvarvc where name = 'SAP_SCMA_CJPR'.

     loop at im_eban_changes into wa_eban_changes.

       loop at it_tvarvc.

         if wa_eban_changes-matkl eq it_tvarvc-low.

           if wa_ebkn_changes-ps_psp_pnr is initial.

             v_flag1 = 'Y'.

           endif.

         endif.

       endloop.

       loop at im_ebkn_changes into wa_ebkn_changes where banfn = wa_eban_changes-banfn

                                                      and bnfpo = wa_eban_changes-bnfpo.

         if wa_ebkn_changes-sakto is initial.

           v_flag = 'Y'.

           exit.

         endif.

       endloop.

     endloop.

   endif.

   if v_flag1 = 'Y'.

     message e000(zv) with 'Please enter Valid Project Code.'.

   endif.

   if v_flag = 'Y'.

     message e000(zv) with 'Not a valid GL Alignment.' 'Please Enter' 'valid material group - Line Item' wa_ebkn_changes-bnfpo.

   endif.

1 ACCEPTED SOLUTION
Read only

former_member199637
Participant
0 Likes
427

Hello Pratyush,

To have custom validation in ME51N or ME52N (enjoy transaction) you can use BAdI ME_PROCESS_REQ_CUST. For your case you can implement your logic in method PROCESS_ITEM

Regards,

Puneet Desai

1 REPLY 1
Read only

former_member199637
Participant
0 Likes
428

Hello Pratyush,

To have custom validation in ME51N or ME52N (enjoy transaction) you can use BAdI ME_PROCESS_REQ_CUST. For your case you can implement your logic in method PROCESS_ITEM

Regards,

Puneet Desai