cancel
Showing results for 
Search instead for 
Did you mean: 

Configure field selection for equipment user-fields

cegaraujo
Participant
0 Kudos

Hi everybody.

After follow and deploy the helpful guide from available here in SCN (http://scn.sap.com/docs/DOC-54073#), I have one additional question: after creation of user-field, Is it possible, even using ABAP, to configure field selection for the new user field?

I've attached few pictures to make myself clear.

Thanks in advance.

Carlos Araujo

Accepted Solutions (0)

Answers (1)

Answers (1)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Carlos,

It is not possible from here (spro). But these requirements can be well met from within the screen-exit itself. i.e. through codes written in the PBO and PAI modules. I have already touched upon this aspect in the same document after Step4 and below Almost done. I have provided a sample code there to make the fields to Display mode if the tcode is 'IE03' .

  • This Display code can be  extended to other situations also and to individual z-fields through other IF syntaxes.
  • In the same manner simple codes can make all your Zfields Required (means Mandatory), Hide also.


For example a code like:

IF equi-eqtyp = 'A' .
     LOOP AT SCREEN.
       IF screen-name CS 'equi-zzito_zfield'.
         screen-active = '0'.
         MODIFY SCREEN.
       ENDIF.
     ENDLOOP.
   ENDIF.

in PBO Module hides the zfield if the Equipment category is 'A' .

Similarly a code like

IF equi-eqtyp = 'A' and equi-zzito_zfield IS INITIAL.
     MESSAGE: 'Please fill zfield' TYPE 'I' DISPLAY LIKE 'E'.
   ENDIF.

in PAI Module will make the Zfield mandatory if the Equipment category is 'A'..

For making zfields mandatory, I recommend user-exit IEQM0003 . Put the following code in include ZXEQMU02:

IF data_equi-eqtyp = 'A' and data_equi-zzito_zfield IS INITIAL.
     MESSAGE: 'Please fill zfield' TYPE 'E' DISPLAY LIKE 'I'.
   ENDIF.

This code makes the Zfield mandatory if the Equipment category is 'A' and stops SAVE event of the Equipment.

These are tested codes, Adopt it to your situation.

Regards

KJogeswaraRao

cegaraujo
Participant
0 Kudos

Hi .

Thanks for your piece of code to make mandatory field, very useful and works fine considering screen validation. However, I need also validate when running a function module. I mean, if I run ITOB_EQUIPMENT_MODIFY_SINGLE and zfield is empty, error message must be shown.


I hope to made myself clear. Thanks for any additional hint.


All the best.


Carlos Araujo

EAM Consultant



jogeswararao_kavala
Active Contributor
0 Kudos

The last part of the reply is meant for this (user-exit IEQM0003).