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

SET user-command for EXIT-Command

Clemenss
Active Contributor
0 Likes
1,048

Hi friends,

after execution of a certain function in a subscreen, I want to set an OK-CODE (BACK) which i defined as an exit code in the STATUS.

I tried METHOD cl_gui_cfw=>set_new_ok_code with 'BACK', also FUNCTION 'SAPGUI_SET_FUNCTIONCODE' with '=BACK', nothing seems to work.

any idea?

TIA and Regards,

Clemens

4 REPLIES 4
Read only

Former Member
0 Likes
701

how about:

OK-CODE = '=BACK'.

/wg

Read only

Clemenss
Active Contributor
0 Likes
701

Sorry, I don't remeber the solution - it was not the one recommended.

Issue resolved.

Regards,

Clemens

Read only

michael_beier2
Newcomer
0 Likes
701

How can this thread be closed as answered, as there is no solution?

Please reopen and i would be happy if someone could provide an answer.

Read only

sascha_ries
Advisor
Advisor
0 Likes
701

Today I was experiencing the same problem. While searching for a solution, I found this rather old post, which is still not answered. That's why I think sharing this snippet might be useful to others, too.

    CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
      EXPORTING
        functioncode           = '/ETEST'

      EXCEPTIONS
        function_not_supported = 1
        OTHERS                 = 2.

This will trigger PAI, fill sy-ucomm with TEST and treat it as an exit-command. It is not necessary to define the function code in a GUI status.

Best Regards,

Sascha