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: 

Multiple mandatory fields in table control

Former Member
0 Kudos

Hi experts,

i have created a table control. there are multiple fields in that table control . Now i want my few fields to be mandatory. Below u can find the logic which i have used to achieve this. But the problem is when i save the data. i does not allow me to go to back screen . and show error to fill the mandatory field again.

i tried doing it from table control > attrributes> display> input>required . but the input>required is not in editable mode. so i was unable to it that way.

MODULE INIT_TAB OUTPUT.

     LOOP AT SCREEN.

     IF SCREEN-NAME = 'ZTASK-VENDOR_NUMBER' OR SCREEN-NAME = 'ZTASK-VENDOR_NAME' OR SCREEN-NAME = 'ZTASK-APPROVAL_CAT' OR SCREEN-NAME ='ZTASK-SUPPLIER_TYPE' OR SCREEN-NAME = 'ZTASK-REEVAL_DATE' OR SCREEN-NAME = 'ZTASK-TERMS_N_COND'.

     SCREEN-REQUIRED = '1'.

     MODIFY SCREEN.

     ENDIF.

     ENDLOOP.

ENDMODULE.





PROCESS BEFORE OUTPUT.

  LOOP AT IT_OUT WITH CONTROL DATA CURSOR DATA-CURRENT_LINE.

  MODULE VENDOR.

  MODULE STATUS_0101.

  MODULE INIT_TAB.

  ENDLOOP.

*

PROCESS AFTER INPUT.

  LOOP AT IT_OUT.

  MODULE USER_COMMAND_0101.

  ENDLOOP.

Thanks in advance,

Aakash

4 REPLIES 4

VenkatRamesh_V
Active Contributor
0 Kudos

Hi,

Try,

PROCESS AFTER INPUT.

MODULE ICON AT EXIT-COMMAND.

Hope it helpful,

Regards,

Venkat.

ipravir
Active Contributor
0 Kudos

Hi,

Have you try with ON-EXIT command?

Write your LEAVE SCREEN code on ON-EXIT command and set the back button function type as ON-EXIT.

Regards,

Praveer.

Former Member
0 Kudos

Hi praveer,

Thanks for the reply.

Problem solved.

Regards,

Aakash

pranab_kumarjha
Explorer
0 Kudos

Hi Aakash,

Along with the suggestion above to use the exit command handling which only can override your mandatory clause, have you tried to make it mandatory on screen(not via the Control tab) by using the Screen Editor (from Layout button) and selecting the field coulmn,

There you will have this option of editing it to input and mandatory in change mode. Below I am showing in display mode but it becomes editable in change mode.