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

Force calling 2 OK codes simutaneously

former_member194669
Active Contributor
0 Likes
2,023

All,

I am having Module pool , My requirement is in the Module pool screen there 2 buttons

Convert

Thou

Whenever user presses the "Convert" button i need to triiger 2 ok_codes one after the other ie First i needs to trigger "Convert" then PBO will come then i needs to trigger "Thou"

I should not have to  put  code currently in "Thou" in  the "Convert" code.

My question is how to call 2 OK code 1 after the other.

Thanks

aRs

7 REPLIES 7
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,420

Why don't you call the two forms one after one

CASE OK_CODE.

  WHEN  'CONVERT'.

    PERFORM CONVERT.

    PERFORM THOU.

  WHEN 'THOU'.

    PERFORM THOU.

ENDCASE.

Else you can go to tricks like storing a flag in PAI during first processing of ok_code and then (In PBO) if flag is set use a SUPPRESS DIALOG to trigger PAI. (... )

Regards,

Raymond

Read only

0 Likes
1,420

Raymond,

"

Else you can go to tricks like storing a flag in PAI during first processing of ok_code and then (In PBO) if flag is set use a SUPPRESS DIALOG to trigger PAI."

Could you please explain this little bit particularly SUPPRESS DIALOG

Thanks

aRs

Read only

Former Member
0 Likes
1,420

Hi,

You can also use the FM SAPGUI_SET_FUNCTIONCODE to force your new ok-code when pressing CONVERT...

Kr,

Manu.

Read only

0 Likes
1,420

Manu,

This i have used in PBO. but then also system not moving to PAI after this

Ie After the First ok_code "Convert" control comes in PBO here i am used this ..As  per my knowledge system has to go for PAI after this. but that's not happening

Thanks

aRs

Read only

0 Likes
1,420

No you can use it in your PAI... the screen flow will go to PBO+PAI to reprocess your new code..

eg.

MODULE pai_user_command.

     CASE sy-ucomm.

          WHEN 'CONVERT'.

               perform some_routine.

               CALL FUNCTION SAPGUI_SET_FUNCTIONCODE

                    EXPORTING functioncode = '=THOU'...

          WHEN 'THOU'.

               "...

      ENDCASE.

ENDMODULE.

should work...

Kr,

Manu.

added: have made a quick test: confirmed, this is fully working

Read only

manuelhildemaro_ramossanc
Active Participant
0 Likes
1,420

Hi aRs,

You can also use cl_gui_cfw=>set_new_ok_code( ). 

Regards,

Manuel H.

Read only

0 Likes
1,420

Manuel,

Used cl_gui_cfw=>set_new_ok_code( ) , but no use.

Thanks

aRs