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: 

Forcing PBO to happen

Former Member
0 Kudos

Hi All,

How can I force the PBO to happen manually? In my screen, I have a field which is attached to a custome search help. I want the PBO to fire again once the user select something from the serch help. Thanks in advance.

17 REPLIES 17

Former Member
0 Kudos

Hi ...

the customer search help should be placed in thr POV ... this is the process for search help ...

see the below for logic then

PROCESS ON VALUE-REQUEST( F4 ) statement   
Code to demonstrate how to perform a manual value help(F4) on a particular field using the PROCESS ON 
VALUE-REQUEST statement and how to return values back to a table control on the screen. For standard 
screen fields simply move the value to the appropriate screen field name. 

 
* Screen flow logic........

PROCESS BEFORE OUTPUT.
*MODULE PBO_MODULE.

PROCESS AFTER INPUT.
*MODULE PAI_MODULE.

PROCESS ON VALUE-REQUEST. "F4
  FIELD EKPO-EBELP MODULE help_ekpo.

 
 
  

* populate screen field from within PROCESS ON VALUE-REQUEST(F4) call
*&------------------------------------------------------------------*
*&      Module  help_responsibility  INPUT
*&------------------------------------------------------------------*
*       text
*-------------------------------------------------------------------*
MODULE help_ekpo INPUT.


**Transport values to table dynpro/screen table control
  DATA: l_stepl LIKE  sy-stepl,
        l_indx  LIKE  sy-stepl.
  DATA: dynpfields        LIKE dynpread OCCURS 5 WITH HEADER LINE.

* Adjust for scroling within table control
  CALL FUNCTION 'DYNP_GET_STEPL'
    IMPORTING
      povstepl        = l_stepl
    EXCEPTIONS
      stepl_not_found = 0
      OTHERS          = 0.

  l_indx = tc_ekpotable-top_line + l_stepl - 1. 
          "tc_ekpotable should already have been declared

  REFRESH dynpfields.
  CLEAR   dynpfields.
  dynpfields-fieldname  = 'EKPO-EBELN'.
  dynpfields-fieldvalue = '00010'   "wa_ekpo-ebeln.
  dynpfields-stepl      = l_stepl.
  APPEND dynpfields.
  dynpfields-fieldname  = 'EKPO-EBELP'.
  dynpfields-fieldvalue = '00020'   "wa_ekpo-ebelp.
  dynpfields-stepl      = l_stepl.
  APPEND dynpfields.

  CALL FUNCTION 'DYNP_VALUES_UPDATE'
    EXPORTING
      dyname     = 'SAPLZZ_EKKO'    "Program name
      dynumb     = '0100'           "Screen number 
    TABLES
      dynpfields = dynpfields
    EXCEPTIONS
      OTHERS     = 0.
ENDMODULE.                 " help_ekpo  INPUT




reward points if it is usefull ...

Girish

Former Member
0 Kudos

Hi,

What processing u need in ur PBO after user selects the value from Search Help.

Regards,

Himanshu

former_member673464
Active Contributor
0 Kudos

hi..

I think you don't need to trigger PBO manually.When user do some actions on the screen automatically PAI will be triggered .PBO is automatically triggered after the PAI processing of the previous screen and before the current screen is displayed. You can program the PBO processing of the screen in this block. At the end of the PBO processing, the screen is displayed.

regards,

veeresh

0 Kudos

Hi,

In my program, the first PBO will be fired during the first display. Then, if I press on the F4, the PAI fire will fire. When I select a value from the search help, the PBO fire again. This I will do some logic to populate some fields on the screen. However, the problem is, the SECOND time I click on the F4, PAI will execute, but PBO will not execute following that....

0 Kudos

Hi Mil,

I don't think it quite works the way you think.

1. PBO

2. after f4 POV occurs, which I believe is independent of pai and pbo

3. PAI will happen when you hit enter or another key (apart from f4)

4. PBO will always follow PAI unless you are jumping to another screen...unless there is a validation error on the screen in which case the error field or chain will be re-presented for editing until no error exists...and then PBO will occur

0 Kudos

Hi Neil,

Thanks for clearing that up. But is there a way to manually fire the PBO from F4 POV? In my F4 logic, I will popup a menu for use to choose their selection. There's a check button to click once the user done selecting their entries. I want the PBO to fire once the user click on the Check button (clicking on the Check button will also close the serch help menu). Thanks in advance.

0 Kudos

FOR THAT JUST ASSIGN A FN CODE FOR THE CHECK BOX IN THE LAYOUT .

YOU CAN SEE A FCODE INPUT FIELD IN THE PROPERTY WINDOW JUST ASSIGN SOME VALUE THERE. WHEN YOU CLICK THE CHECK BOX THE PAI WILL TRIGGER AND THEN PBO WILL TRIGGER.

REGARDS

SHIBA DUTTA

Former Member
0 Kudos

Hi Mil,

Neil is right, you really need not mannually trigger the PBO.

After the F4 event, the help value shows and then if you select one record, the value appeared in the corresponding feld.

And then, you could select the checkbox, and go to the other function to trigger the PAI.

Hope this helps

Bob

0 Kudos

I actually have my reason to manually trigger the PBO. It's kinda too long to explain here. I just need the way to manually trigger PBO. Please provide the code if anyone of you know it. I will really help me to solve my problem.

0 Kudos

Hi,

See when you select you value from F4 it goes to PAI, there you want to populate some more data on the screen which will happen when PBO gets called. SO I would suggest you to store the screen data at a global place like some variable declared using TABLES: and then you can call the same screen again also make sure the next screen for this screen is the same.

Regards,

Sesh

0 Kudos

hi Mil,

why not explain your reason? In my experience the more info you give on a post the better responses there are. If your reason turns out not to be as good as you think someone will be able to explain why it isn't a good idea. If there really is a good reason then again someone may well have a helpful idea to help to achieve the functionality.

Personally though, I doubt if what you are talking about is really worth doing. It is moving away from sap standard behaviour and usually that's a bad thing. Not always though so maybe this is a good case for doing something different.

Good luck.

Neil

0 Kudos

Hi Neil,

Your' right, let me explain in detail. I'm actually working on someone's program and I don't intend to modify the existing logic. In my screen, I have 2 fields, let's say Field A (Animal) and Field C (Color). In Field A, I had a custom search help attached. Whenever a user select an entry from the search help (let say Cat), the logic will auto populate Field A with 'Cat' and then auto popup another menu which contain yet another custom search help (let say 'white' & 'black'). Once the user select 'White' on the 2nd popup, the Field B is auto populated with 'White'. I need the PBO to fire for me to populate Field B, don't you think so?

0 Kudos

I think the sap-standard solution for the problem you are describing would be to have a single search help linked to the two fields. The hit-list would present you with a list of the values and when selecting a line both field values would be returned to your screen. i.e you would double click on a line containing CAT,WHITE and it would fill both of your screen fields at once.

Search helps are pretty complicated. I suggest you have a look at the sap help to try and get a handle on the options available.

0 Kudos

I agree with Neil, it sounds like what you require is a POV module with a search help that provides values for both fields at once.

However, it sounds like you're modifying someone else's program and don't really want to complicate matters. So here's a suggestion that I think in theory should work, but you should try it.

In your POV module for CAT, do an explicit

leave to screen 'XXXX'

command after CAT is returned, where 'XXXX' is your current screen (in effect you're leaving your current screen and going back to the same screen). This should invoke the PBO all over again. The caveat is you might lose some of the screen data that you already have, so be sure that you have some facilities in place to handle this (e.g. assign them to global variables that you'll recover in PBO, do an IMPORT/EXPORT process, etc.).

Again, this should work in theory. Let us know if it actually works.

0 Kudos

Has no-one ever used the function module "DYNP_VALUES_UPDATE". It used to work years ago (not sure if SAP have made it defunct now though). Allows you to update screen fields without re-calling the PBO.

Former Member
0 Kudos

Hi,

For more info, you could refer to the report checkbox event trigger.

For example:

parameter pq as checkbox user-command ...

Hope helps

Bob

Former Member
0 Kudos

Hi Mil

Yes, it's quite annoying that a F4 call fired from POV doesn't trigger PAI and PBO afterwards in some situations, eg. if you select an employee's initials with F4 and want to display the name of the employee on the screen right after the F4 call.

Or if you want to change the attributes of other screen fields (input/output/ invisible...) according to what have been chosen by the F4 selection.

I haven't found the one solution, but there's some workarounds that might help:

1) Call to <b>DYNP_VALUES_UPDATE</b> can force field values to the screen.

Problems: Text fields are always displayed in uppercase, at date fields have to be manually converted to the their output format.

2) <b>Use Listbox instead of normal input field.</b>

This way you can enter an FCODE at the field in screen-painter, and PAI/PBO will be triggered automatically.

Problems: This is only a useable solution with at one- or two-column list and with a limited amount of rows.

3) <b>LEAVE SCREEN.</b>

This will re-enter the screen and run the PBO (see previous post from Efrain for more details).

Problems: Cannot be used in sub-screens.

Regards,

Poul Bundgaard