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

How to trigger 'save' event without pressing SAVE button

Former Member
2,615

Hi, i want to execute my 'save' event without press the SAVE button.

I want to simulate press the button with abap code and sy-ucomm = 'SAVE'.

Is there a function module for this functionality

Thanks

Reward Points

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
1,670

And when will this event be triggered? Nothing will happen in a dialog screen (module pool) if the user doesn't perform some sort of action. If the simulation should start directly after opening transaction, write some code in de PBO.

sounds to me like an odd requirement. Please elaborate on your requirement?

9 REPLIES 9
Read only

Sm1tje
Active Contributor
0 Likes
1,671

And when will this event be triggered? Nothing will happen in a dialog screen (module pool) if the user doesn't perform some sort of action. If the simulation should start directly after opening transaction, write some code in de PBO.

sounds to me like an odd requirement. Please elaborate on your requirement?

Read only

Former Member
0 Likes
1,670

Hi , i have an event in the PAI, i realize some actions ( with my code) , after that, i need to push two buttons dinamically ( Without the user push any button), i need to push both buttons dinamically.

Thanks

Read only

Sm1tje
Active Contributor
0 Likes
1,670

Well, than just forget about the buttons and create some code at the end of the PAI event which you have already coded (i realize some actions ( with my code)). Just do a perform event_xxx and perform event_yyy. The code which will be executed (processed) will look exactly the same as if you had created it when pushing buttons:

CASE OK_CODE.

WHEN 'AAA'.

  • let's say this is done with your code

perform event_aaa.

perform: event_xxx, event_yyy.

WHEN 'XXX'.

perform event_xxx.

WHEN'YYY'.

perform event_yyy.

ENDCASE.

Helpful?

Read only

Former Member
0 Likes
1,670

Thanks, but i have this code in a user exit. I need to change the sy-ucomm.

By example sy-ucomm = 'ACCR', and after that the SAP standard transaction simulate to push the ACCR button without pushing that button.

Thanks for your answer

Read only

Sm1tje
Active Contributor
0 Likes
1,670

Well, in that case, try and copy the coding for the actual SY-UCOMM to your PAI event. This should do the trick and the user exit should be processed.

Good luck.

Read only

Former Member
0 Likes
1,670

You need to trigger the PBO somehow.

Maybe you can change the sy-ucomm and then leave screen to the same screen.

But I don't know if it could mess up the transaction actions

Read only

Former Member
0 Likes
1,670

Hi JosAngel Garc Luna ,

Try the below FM's :

HRMGE_OS_OVRVW_PROCESS_UCOMM

HRMGE_CI_OVRVW_PROCESS_UCOMM

NF_EM_SET_SY_UCOMM

OM_EM_SET_SY_UCOMM

OM_OO_HANDLE_UCOMM

HR_COMMON_UCOMM

HR_DETAIL_UCOMM

Thanks,

Greetson

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,670

Use method set_new_ok_code of class cl_gui_cfw.

CALL METHOD cl_gui_cfw=>set_new_ok_code
  EXPORTING new_code = new_code
  IMPORTING rc = rc.

Look also at [SAP Control Framework|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIGOF/BCCIGOF.pdf]

Regards

Read only

Former Member
0 Likes
1,670

Hi,

when u create the save u also give the controls rite like 'ctrls' .once u gave u also use this 'ctrls'.