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: 

Unable to exit or go back from a program

Former Member
0 Kudos

I am unable to exit or go back on a program after it's executed. I would need to use the "/n" to exit out of the program. Why and how can I fix this? Thanks.

1 ACCEPTED SOLUTION

Jelena
Active Contributor
0 Kudos

Delete your GUI status and copy GUI status from a demo program. You are clearly missing functions for all the navigation buttons, so no wonder they are not working. Just look at any ALV program that does work.

13 REPLIES 13

sabirshah1
Participant
0 Kudos

IF it is customized program , assign fcodes to the BACK AND EXIT ICON and put condition.

DATA : ucomm type sy_ucomm.

ucomm = sy-ucomm .

IF sy-ucomm = 'EXIT' OR

    sy-ucomm = 'BACK'.

Leave Program.

Endif.

0 Kudos

Type "SY_UCOMM" is unknown.

There is a ALV in the program.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = SY-CPROG
       I_CALLBACK_PF_STATUS_SET       = 'PFSTATUS'
       IT_FIELDCAT                                   = itab_fieldcat[]
       i_save                                             = 'A'
       IT_SORT                                         = IT_SORT
     TABLES
       T_OUTTAB                                      = itab_output.

0 Kudos

Comment out the line "I_CALLBACK_PF_STATUS_SET" in your function call.

thanga_prakash
Active Contributor
0 Kudos

Hello Shawn,

Go to GUI status of the screen and check whether Function code is assigned to BACK icon, if it is assigned, check whether it is active.

If the function code is black then it means it is active, if it is red it means it is inactive. Click on function code icon and activate them.

Regards,

Thanga

0 Kudos

I looked at the Menu Bars and all it has is "GUI Status" in SE41

Interface Objects

       Status

           ZNEWSTATUS           GUI Status

       Menu Bars

           GUI Status

           GUI Status

       Function Key Settings

           GUI Status

               Pushbutton Settings

                   GUI Status

           GUI Status

               Pushbutton Settings

                   GUI Status

0 Kudos

Hello Shawn,

Go to transaction SE41 --> go to change mode of the GUI status --> Under function keys you will find Back icon with a function code assigned.

In case if it not assigned, assign a function code and write logic for that function code in your program to exit.

If it has a function code already assigned, check whether function code is black then it means it is active, if it is red it means it is inactive. Click on function code icon and activate them.

Regards,

Thanga

0 Kudos

0 Kudos

I tried that and it's still not working. I push on the back button but nothing is happening. I have to input "/n" to exit.

0 Kudos

Copy the PF status 'STANDARD' of program SAPLSALV to your program in SE41.

Regards,

Gautham.

0 Kudos

Hello Shawn,

There is no function codes available for any ICON in your GUI.

If your report is an ALV report? If yes, copy the GUI status of standard ALV output to your GUI status.

If it is other than ALV, then assign a Function code to BACK icon and write an action for that fucntion code in your Z* program under PAI.

Regards,

Thanga

Patrick_vN
Active Contributor
0 Kudos

Then the problem might be a missing (or non triggered) user-command. Try debugging and see where you end up in the code. Normally you should see a case (or if) command that deals with sy-ucomm (or the ok-code that you can find on the bottom of the element list of the screen).

Jelena
Active Contributor
0 Kudos

Delete your GUI status and copy GUI status from a demo program. You are clearly missing functions for all the navigation buttons, so no wonder they are not working. Just look at any ALV program that does work.

Chintu6august
Contributor
0 Kudos

Hi,

if you are using custom GUI status then you have to define functionality for the buttons in USER-COMMAND event or you can copy the GUI status from demo programs provided by SAP i.e

copy  PF status 'STANDARD' of program SAPLSALV to your program using SE41 (menu painter).

thanks!!