cancel
Showing results for 
Search instead for 
Did you mean: 

Problem With Mandatory fields in iw21 Notification

0 Kudos

Hello All,

I have a requirement where in i have  to add custom fields in a custom additional tab through CMOD Project.

I have implemented the same.

Now, i have to make certain fields mandatory here. I have implemented a logic to make the screen custom fields in the additional custom tab mandatory by using the following code in PBO section.

IF VIQMEL-ZZFAULT_SOURCE EQ 'TSR' .

  LOOP AT SCREEN.

    IF        SCREEN-NAME = 'QMEL-ZZAUDIT_NUM'.

              SCREEN-REQUIRED = '1'.

              MODIFY SCREEN.

    ENDIF.

  ENDLOOP.

Now , this logic works only when we go to this tab. However if we don't enter this tab and try to save the notification, the custom mandatory fields do not act as mandatory and saves the notification.

Kindly suggest.

I want these fields to act mandatory through out the transaction.

Accepted Solutions (0)

Answers (2)

Answers (2)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Kunal,


Even standard fields marked mandatory through configuration settings (OIAL), have this problem, Their mandatory feature works only when user enters the tab. As Paul rightly said we need to use user-exit QQMA0014 or IWOC0002 for this. User-Exit QQMA0014 triggers when the Notification is Saved, whereas the other exit triggers when there is a change of Status. For your Application QQMA0014 is best suited. Put these following lines in the include ZXQQMU20 of this exit, and your problem is solved.


IF I_VIQMEL-ZZAUDIT_NUM IS INITIAL.

MESSAGE 'Filling Audit Number field is mandatory' TYPE 'E' DISPLAY LIKE 'I '

ENDIF.


This will eliminate the need for any code in PBO.


Related post:

KJogeswaraRao

paul_meehan
Advisor
Advisor
0 Kudos

Hi,

The PBO will not be executed unless the tab is activated. An option would be to also add the mandatory checking into exit QQMA0014. Then you can prevent notification being saved unless the fields contain a value.

-Paul