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

trigger PAI from within program

Former Member
0 Likes
905

Hi all,

I Have a program that should not wait for PAI, but should go automatically and process PAI.

How do I reach this end?

Thanks in advance,

HProkoph

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
864

Hi,

You can achieve this by using FM SAPGUI_SET_FUNCTIONCODE or by using SET USER-COMMAND statement.

Code anyone of the above in PBO and check.

Regards

Karthik D

6 REPLIES 6
Read only

deepak_dhamat
Active Contributor
0 Likes
864

pass

sy-ucomm = 'ENTER' .

Read only

0 Likes
864

I try:

&----


*& Module ENTER_PAI OUTPUT

&----


  • text

----


MODULE ENTER_PAI OUTPUT.

sy-ucomm = 'ENTER'.

ENDMODULE. " ENTER_PAI OUTPUT

but it doesnt go to the PAI.

Only if I click on the Button.

Any Ideas?

Regards HProkoph

Read only

0 Likes
864

Hi,

Once again, I dont understand your requirement.

You want to code with Enter key as the event?

Or are you trying to debug some code and try to find out how the PAI is triggered?

You can have a function code (sy-ucomm) associated with your ENTER Key.

Go to the GUI Status, and in the Function Keys, You will buttons on the Standard Toolbar. The first button (tick mark in Green background is the button for Enter). So you can assign a function code saying 'ENTER' and activate the PF-STATUS.

Now you can start coding like


if sy-ucomm = 'ENTER'.
---
endif.

Read only

0 Likes
864

If you want some operation to be performed as soon as the you get the screen, then write the code in the PBO itself.

The name suggest PAI- Process After Input. so, if you give some input, then the control will take to the PAI event.

If you want to press the "ENTER" key, for the same, then you have to use,

Case Sy-ucomm.

when 'back'

      • your Code if any **

others.

-


______-----

____

here comes your automatic PAI code.

-


______-----

-


_____---

endcase.

Read only

Former Member
0 Likes
864

Hi,

You PAI (PROCESS AFTER INPUT) is triggered only after some event or input.

Try pressing Enter if there is no explicit mouse click event.

Read only

Former Member
0 Likes
865

Hi,

You can achieve this by using FM SAPGUI_SET_FUNCTIONCODE or by using SET USER-COMMAND statement.

Code anyone of the above in PBO and check.

Regards

Karthik D