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

cl_gui_cfw=>set_new_ok_code and function type

viktoru
Product and Topic Expert
Product and Topic Expert
0 Likes
2,466

Hi experts!

I'm using the cl_gui_cfw=>set_new_ok_code method to set a new ok code within an event handler for a toolbar function (cl_gui_toolbar). Unfortunately it's not possible to set the function type of the new ok code, like 'E' = Exit-Command. Therefore I can't use a toolbar button like the cancel button (F12) in the sap gui. Does anybody know how to set a new ok code with a function type within an event handler for a toolbar function.

Thanks in advance!

Regards,

Viktor

4 REPLIES 4
Read only

Former Member
0 Likes
1,818

To work your case I have an alternate way.

Raise some other ok_code (non-error) and call the routine which is being called if the Error ok_code is set.

Read only

0 Likes
1,818

This message was moderated.

Read only

viktoru
Product and Topic Expert
Product and Topic Expert
0 Likes
1,818

Hi Kishore,

the problem is: there is a dynpro with some fields and a toolbar control (cl_gui_toolbar). The toolbar contains a close button for the dynpro. The close button works fine except one case: if the user has an invalid input in a dynpro field and want to leave the dynpro (without correction of invalid input), then the close button doesn't work. Therefore some dynpro fields have a convertion exit maintained in the screen painter and if the value of a field is invalid, the convertion exit sends an error message and interrupts the pai execution. The only way to handle this is the use of an ok code with the type 'E'=Exit-Command. But that is not possible with the method set_new_ok_code.

Cloud you please describe a litte bit more how can your proposal help in my case?

Thanks and regards,

Viktor

Read only

Aiolos
Active Participant
0 Likes
1,818

Hi Viktor,

i dont think you can achieve this, coz the exit type 'E' can be only set in GUI.