Application Development and Automation 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: 
Read only

Problem on Obligatory Fields on Back Button

Former Member
0 Likes
1,829

Hi All,

I am having a problem with the obligatory fields when I click on the BACK button. It requires me to fill in entries for all required fields even if I want to click on the BACK button.

Thanks in advance.

Regards,

Arlis

Hi All,

I am having a problem with the obligatory fields when I click on the BACK button. It requires me to fill in entries for all required fields even if I want to click on the BACK button.

Thanks in advance.

Regards,

Arlis

3 REPLIES 3
Read only

Former Member
0 Likes
1,018

Hi,

Give the function type for the button as 'E' and write your code in the MODULE <module_name> AT EXIT-COMMAND.

Read only

0 Likes
1,018

Thanks Nitwick. I thought I already have one set for my GUI-STATUS and that it is not working.

Read only

Former Member
0 Likes
1,018

Hello Arlis,

The module with AT EXIT-COMMAND will do well to fix your issue;

what really happens is; when you validate certain fields using FIELD <field-name> MODULE <validate_fields>, and when you click 'BACK' or 'EXIT'; it will gonig to check the fields against the validate_fields module and then the error message which you have specified keeps popping up hampering you to get back to the desired screen.

All you can do is to; put sy-ucomm or ok_code like sy-ucomm, in the validate_fields module, so as to easily get back to the desired screen.

For instance;


MODULE validate_fields INPUT.
  IF NOT <field-name> IS INITIAL.
    SELECT * FROM trdir INTO TABLE t_table WHERE name = <field-name>.
    IF sy-subrc = 0.
      fl_flag = 'Y'.
    ELSE.
      fl_flag = 'N'.
      MESSAGE 'Invalid Program Name' TYPE 'E'.
    ENDIF.
  ELSEIF ok_code EQ 'BACK'.
    LEAVE TO SCREEN 0.
  ENDIF.
ENDMODULE.

I hope, it'll gonna help you fix the issue.

Kind Regards,

Zahack