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: 

Simulate Button Click

Former Member
0 Kudos

Good afternoon everyone,

I have a abap report program that uses screen painter to design the screens. I have one screen

that has a button. I want to simulate an event of clicking tha button. Is there a command I can

do that?

Thanks for any input and let me know any questions you have.

Stephen

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try this..

CALL METHOD cl_gui_cfw=>set_new_ok_code 
EXPORTING new_code = 'Pass your function code'.

Thanks

Naren

4 REPLIES 4

former_member156446
Active Contributor
0 Kudos

check the function code of the button and use that...

and say if sy-ucomm = <f. code>

search in forums, you will get may sample codes...

Former Member
0 Kudos

Hi,

Try this..

CALL METHOD cl_gui_cfw=>set_new_ok_code 
EXPORTING new_code = 'Pass your function code'.

Thanks

Naren

faisal_altaf2
Active Contributor
0 Kudos

Hi, Stephen.

Please Follow the code bellow.

Flow Logic

PROCESS AFTER INPUT.
 MODULE USER_COMMAND.

FctCode is SAVE

MODULE user_command INPUT.
  DATA: ok_code LIKE sy-ucomm.

  CASE ok_code.
    WHEN 'SAVE'.
      CLEAR: ok_code.
      " Your Code on Click Here.
    WHEN OTHERS.
  ENDCASE.

ENDMODULE.

Please Reply if any Issue,

Best Regards,

Faisal

Former Member
0 Kudos

Hi stephen ,

Just assign the function code to the button which u want it to trigger event. For exaple xyz.

In PAI event, Write the code

if sy-ucomm eq 'xyz'.

" Write the event u want to do , for example

call screen 5000.

endif...

I hope , It explains little...

Thanks