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: 

disabling all fields of a tab in CV02n

Former Member
0 Kudos


Dear Abapers,

We use vistex system to maintain the materials. So, some of the materials are maintained from Vistex.

If a material is maintained in Vistex, then in CV02n under object links tab, if the user tries to change or delete that data an error should be shown. There is a table control in this tab which contains material data. If this material data is vistex controlled, it shouldn't be available to change.

I have implemented the badi   if_ex_document_main02~d101_before_pai which gets triggered whenever that tab is clicked. This badi is also getting triggered when I click on save.

Is there a way by which I can block all the fields in a particular tab to display mode. ie if the materials shown are vistex controlled, they shouldn't be allowed to change.

16 REPLIES 16

Former Member
0 Kudos

You said your BADI gets triggered on save also. Why not you are putting a error message on save for your case. Else you can give Information message and Leave program.

Cheers,

Prakash

0 Kudos

Hi,

There are 5 tabs in the transacton. But I want the error in only one of the tabs. I have already tried what you said. The problem is, the error message pops up If I make changes in other tabs also. But, the requirement is that the error should come only if changes are made in object links tab.

0 Kudos

The  tab for which you want to put the error message use name of that in your condition. I think its possible. Or you can check that SYST structure. There must be some difference in execution of each tab. Capture that in your IF statement.

Cheers,

Prakash

0 Kudos

I have already used system field sy-ucomm to do what you said. I only want to disable the table control which is present in that tab. I checked in the screen structure to disable the table control and make it to display mode. But there there is no field for table control in the screen structure.

0 Kudos

Hi Tharun

If you check the method it has a okcode as parameter check its values before performing your checks. For that tab it will have unique value

Nabheet

0 Kudos

and inside the method do a loop at screen. screen-input = 0.modify screen

Nabheet

0 Kudos

Yes, both OKCODE and SY-UCOMM will have function code of that tab and is unique which could be of use. But how will I disable the table control in that tab? the contents of the table control shouln't be available to change. The table control should be greyed out. That's the requirement.

0 Kudos

In loop at screen, we won't get the table control. It works only for fields. In my case its a table control. And the fields of the table control are not available in the screen structure.

0 Kudos

Hi tharun,

please see this code and change according to your field name, in field name put the name of your tab

name, and in condition put your requirements

IF field-name NE 'X'.

     LOOP AT SCREEN .

      CASE SY-UCOMM.

         WHEN 'condition'.

           SCREEN-ACTIVE = 0.

           MODIFY SCREEN.

       ENDCASE.

     ENDLOOP.

     CLEAR : your fields name that is to be grayed out.

   ENDIF.

0 Kudos

Could you please elaborate what the field-name should be. My tab name is Object Links.

0 Kudos

Hi Tharun,

you have to use PB_LINKS in place of field-name.

0 Kudos

Hi,

Even that is not working.

0 Kudos

Hi Tharun,

could you explain how you have choosen this badi, i think you have to look it another way

Go to SE80, put the name of the program of CV02n transaction, first choose program in drop down list in se80, put the program code in it and press the spectacles button (for display).

Now it will display the tree hirarchy, not choose SCREENS into it, then expand it.

Second  screen no 0101, CONTAINS the filled where you wants to have your restrictions,

put your required code in flow logic and then please tell me what happens.

0 Kudos

Hi,

Its standard SAP. Asks access key If I try to add code in flow logic.

0 Kudos

Hi,

talk to your BASIS team, and they will provide you the access code,

before that read about SCREEN EXITS and FIELD EXISTS

0 Kudos

We usually don't go for modification of standard SAP. Its risky. Thats why I am trying to sort it throught the exits.