07-06-2015 12:00 PM
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
07-06-2015 12:06 PM
Hi,
Try,
PROCESS AFTER INPUT.
MODULE ICON AT EXIT-COMMAND.
Hope it helpful,
Regards,
Venkat.
07-06-2015 12:06 PM
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.
07-06-2015 12:26 PM
07-06-2015 12:37 PM
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.