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: 

PAI is not triggered after I choose value in F4

0 Kudos
2,499

Hello experts,

I fight with the following problem:

On my screen I use input field (ucf_s_coi_afd03_ct-xrproc_param) and I coded the F4 help for it manually


PROCESS ON VALUE-REQUEST.
  FIELD ucf_s_coi_afd03_ct-xrproc_param
      MODULE req_xrproc_param_2006.

After I press f4 on this field, the values are correctly listed but after I choose one value (double click), I would expect that the PAI is triggered but it is not. I have to press ENTER, only then.

Is there a way how to trigger the PAI after the value is chosen?

I found one way, but I don't want to use it:

If I change the input field into "List box" or "List box with key", then I can assign function code to it and if I do that, then it works - PAI is triggered after value is chosen. However, I don't want to use list box, I need standard input field.

Any ideas?

Regards,

Tomas

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos
629

may be you can try with Respond to double click option, just check the option for the input field and see..

Enable the F2 function in the status.

16 REPLIES 16

former_member200170
Participant
0 Kudos
629

Hi Tomas,

When you create a list box in SE51, you need to assign the Function Code to that. You see this on the right side of the screen as Fct screen. Then you need to do the coding according to you functinality .

Case sy-ucomm.

WHEN 'SELECT'.

****your code.

endcase.

This should work.

Thanks,

Manjula.S

0 Kudos
629

Hi Manjula,

thank you for your solution.

I know about this but I don't want to use it, since I do not want to use listbox. I need standard input field. Thank you anyway.

Tomas

christine_evans
Active Contributor
0 Kudos
629

The PAI is never called automatically in this situation. Try adding the following to the end of your POV module to reset your OK_CODE (or whatever variable your are using to hold your SY-UCOMM value). This has always worked for me to trigger the PAI immediately.

*   Trigger the PAI immediately to get the VAT rate / amoount
*    for the VAT code.
     ok_code = 'XXXX'.
     SUPPRESS DIALOG.

former_member188685
Active Contributor
0 Kudos
630

may be you can try with Respond to double click option, just check the option for the input field and see..

Enable the F2 function in the status.

0 Kudos
629

Still cannot make it work...perhaps I have to live with this small UI missbehavior:)

0 Kudos
629

>

> Still cannot make it work...perhaps I have to live with this small UI missbehavior:)

Have you tried resetting the OK_CODE as I suggested above? Not forgetting the SUPPRESS DIALOG bit. This does work. For example, on one of my screens, they can pick a tax code from a search help and because I've added this bit of code to the end of the POV, immediately (without their having to press ENTER) the PAI fires to fill the tax rate field.

0 Kudos
629

Yes, I tried it, but it did not work. Perhaps its caused that my screen is subscreen which is nested into another screen...

I had now another idea ... I tried to investigate available parameters of the F4 function 'F4IF_INT_TABLE_VALUE_REQUEST' whether there might be something usefull, but did not find anything yet.

I call the F4 in the following way.

 
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING  retfield   = ucf2_cs_fld-xrproc_param
               value_org  = 'S'
    TABLES     value_tab  = lt_value
               return_tab = lt_return_tab
    EXCEPTIONS OTHERS     = 1.
  CHECK sy-subrc IS INITIAL.

0 Kudos
629

No, it doesn't work for subscreens, perhaps because a subscreen cannot have its own OK_CODE defined but needs to use the OK_CODE of the main screen.

0 Kudos
629

Hi, the ok_code of our main screen is "GD_OKCODE", but somehow it is not available on my subscreen. Our application is quite big and when calling the subscreen deeper and deeper (there are many nested screens), gd_okcode become not defined, don't know why and how exactly. There is only "OK_CODE" available and if I clear this one, it does not work.

But I tried this on normal screen and the solution really works there, so thank you for it anayway.

I think, I now give up trying since its not worth it for such small issue.

0 Kudos
629

How did you find that out? SUPPRESS DIALOG to trigger the PAI event, doesn't really seem logical, though, it really works :-). Helped me, rewarding points.

0 Kudos
629

>

> How did you find that out? SUPPRESS DIALOG to trigger the PAI event, doesn't really seem logical, though, it really works :-). Helped me, rewarding points.

I found it a while ago the same way you did by using the search key on a website; on this occasion it was http://sapfans.com. I've no idea why it works but since it does I'm not going to worry about it. I'm glad it's helped you but don't think you can give points since this is not your thread.....

0 Kudos
629

Rather than triggering the PBO in order to fill in other fields on the screen from your POV event, the usual approach I've seen is to call the function DYNP_VALUES_UPDATE (which is quite well documented) e.g. you could get a customer number from your F4 dropdown, then retrieve their name and address and populate that data back into the screen all from within the "process on value-request" module logic.

Jonathan

0 Kudos
629

>

> Rather than triggering the PBO in order to fill in other fields on the screen from your POV event, the usual approach I've seen is to call the function DYNP_VALUES_UPDATE (which is quite well documented) e.g. you could get a customer number from your F4 dropdown, then retrieve their name and address and populate that data back into the screen all from within the "process on value-request" module logic.

>

> Jonathan

The original problem (or at least my orignal problem) which was solved by the SUPPRESS DIALOG was how to trigger my PAI validation - not the PBO though that of course follows on afterwards - immediately on selecting a value from a search help in order to carry out a further check on the value selected. I've used DYNP_VALUES_UPDATE in other situations, but it was not a suitable solution for me here.

0 Kudos
629

There is a function module which seems to be exactly what you are searching for, the name

is SAPGUI_SET_FUNCTIONCODE.

A quote from the documentation of this function module: "This module simulates user input

in the command field. This enables you to run screen sequences without user input."

If you place this function module call after your call of the search help, you can trigger PAI.

Regards,

Karsten

629

Hi Karste,

thank you very much. It really works.


CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'.

This simple call really triggers the PAI which is what I need - it actuallly simulates

pressing ENTER.

Kind regards,

Tomas

Former Member
0 Kudos
629

hi,

F4 trigger POV.so PAI will not trigger.