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: 

Enable and disable Custom tab on Header in ME21N using enhancment MM06E005

Former Member
0 Kudos

Hello All,

I am working on enhancement to create a custom tab in header of Purchase order (ME21N/ME22N AND mE23N) using enhancement MM06E005.
I have two custom fields for Date and Vendor on the header and both the fields mandatory.


my requirment is to enable and disable the custom tab for any perticular purchase document type (EKKO-BSART).

I tried using below mentioned code in PBO event of custom tab

    IF GV_BSART NE 'ZCTN'.
      LOOP AT SCREEN.
        IF SCREEN-NAME EQ 'EKKO-ZLIFNR_ZIN' OR
           SCREEN-NAME EQ 'EKKO-ZCP_DATE' OR
          SCREEN-INVISIBLE = 1.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDIF.


but as the fields are mandatory system is throwing an error to fill the mandatory fields even though the fields are hidden.
Please help, i tried searcing it on other posts but could not find any thing useful.

Thanks,
Rajeev.

1 ACCEPTED SOLUTION

nabheetscn
Active Contributor
0 Kudos

Hi Rajeev

Make Screen-input = 0 and screen-required = 0.

Is the error you are getting from PAI..? If yes then you need to put an if astatement their if gv_bsart ne ZCTN

Nabheet

3 REPLIES 3

nabheetscn
Active Contributor
0 Kudos

Hi Rajeev

Make Screen-input = 0 and screen-required = 0.

Is the error you are getting from PAI..? If yes then you need to put an if astatement their if gv_bsart ne ZCTN

Nabheet

0 Kudos

Hi Nabheet,

Thanks for the quick response.

I am not able to hide the tab but all the fields are getting hidden by making screen-invisible = 1.

Adding the check for gv_bsart in PAI has solved the problem for error message raised by system for mandatory fields.

Thanks,

Rajeev

0 Kudos

Hi Rajeev

Tab you can not hide using this enhancement.

Nabheet