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: 

How to trigger PBO after POV?

ArcherZhang
Advisor
Advisor
0 Kudos

Hi gurus,

I have requirement that a field with a multiple selection F4 in TMG, if select multiple values from F4 then need display those selected values in TMG. 

TMG only have 'Overview' screen as below screenshot:

Click 'New Entries',

F4 popup a multiple selection window:

 

If i ticked 2 and 4 line, this two entries should display on screen, but it not. I must click 'Enter' to trigger 'PBO' event, those value will display out.

How to achieve my requirement? thanks.

Regards,

Archer

1 ACCEPTED SOLUTION

phillip_manning2
Explorer
0 Kudos

Hi Archer,

What you need to do is simulate the user pressing enter on the screen. A PBO is only ever triggered after a PAI event.

You can use CL_GUI_CFW=>SET_NEW_OK_CODE( '/00' ) to trigger a PAI.

You could also use the 'DYNP_UPDATE_FIELDS' function module to update screen fields outside of a PBO event. This module is normally used to update things like description fields after an F4 without the user having to press enter. You are in a table control here, so be sure to supply the correct step loop.

Hope that helps.

Phil

10 REPLIES 10

Former Member
0 Kudos

Hi,

Can we modify the internal table for the TMG, in the POV based on the return table of the F4 help. So that it remains even after you press enter.

It is just a suggestion, I have never used it before.

Hope this helps.

phillip_manning2
Explorer
0 Kudos

Hi Archer,

What you need to do is simulate the user pressing enter on the screen. A PBO is only ever triggered after a PAI event.

You can use CL_GUI_CFW=>SET_NEW_OK_CODE( '/00' ) to trigger a PAI.

You could also use the 'DYNP_UPDATE_FIELDS' function module to update screen fields outside of a PBO event. This module is normally used to update things like description fields after an F4 without the user having to press enter. You are in a table control here, so be sure to supply the correct step loop.

Hope that helps.

Phil

0 Kudos

hi Phillip,

You are right. Now, those selected value indeed displayed on screen, but when click 'SAVE' button, values not saved in DB.

If i directly type some values on screen, it can be SAVE in DB.

I need more time to debug what`s difference between this two kind of value. If you know, please tell me.

regards,

Archer

0 Kudos

Hi Zhang,

EXTRACT internal table contains the records for TMG, try to update the same and check data is updating or not into DB table.

Regards,

Praveer.

ipravir
Active Contributor
0 Kudos

Hi Zhang,

You can try with

cl_gui_cfw=>set_new_ok_code class/method.

write code in POV module for trigger PBO event.

Regards,

Praveer.

0 Kudos

Hi,

You can use the FM DYNP_VALUES_UPDATE to update the values in the screen field.

Please refer the documentation of the FM for more info.

Regards,

SPR

shadab_maldar
Active Participant
0 Kudos

Hi Archer,

you can use the command leave to screen or call screen in POV, in this case after you modify your internal table, the cursor again goes back to PBO.Than you will get multiple values into your TMG screen.

Regards,

Shadab.

ArcherZhang
Advisor
Advisor
0 Kudos

Hi @ Praveer,

Below is my code:

PROCESS ON VALUE-REQUEST.

   FIELD ZAR_USERINFO-USERID MODULE LIST_HELP.




MODULE list_help INPUT.

   DATA: i_itab TYPE STANDARD TABLE OF zar_user,

         return_tab TYPE STANDARD TABLE OF ddshretval,

         ls_return LIKE LINE OF return_tab.

   SELECT * FROM zar_user INTO TABLE i_itab.

   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

     EXPORTING

*     DDIC_STRUCTURE  = ' '

       retfield        = 'USERID'

*     PVALKEY         = ' '

       dynpprog        = sy-repid

       dynpnr          = sy-dynnr

       dynprofield     = 'ZAR_USERINFO-USERID'

*     STEPL           = 0

*     WINDOW_TITLE    =

*     VALUE           = i_itab

       value_org       = 'S'

       multiple_choice = 'X'

*     DISPLAY         = ' '

*     CALLBACK_PROGRAM       = ' '

*     CALLBACK_FORM   = ' '

*     CALLBACK_METHOD =

*     MARK_TAB        = i_itab

*   IMPORTING

*     USER_RESET      =

     TABLES

       value_tab       = i_itab

*     FIELD_TAB       =

       return_tab      = return_tab

*     DYNPFLD_MAPPING =

*   EXCEPTIONS

*     PARAMETER_ERROR = 1

*     NO_VALUES_FOUND = 2

*     OTHERS          = 3

     .

   IF sy-subrc EQ 0.

     GET CURSOR FIELD f LINE l OFFSET o.

     LOOP AT return_tab INTO ls_return.

       extract+3(5) = ls_return-fieldval.

       MODIFY extract INDEX l.

       l = l + 1.

     ENDLOOP.

   ENDIF.

   CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'

      EXPORTING

        FUNCTIONCODE                 = '/00'

      EXCEPTIONS

        FUNCTION_NOT_SUPPORTED       = 1

        OTHERS                       = 2.

ENDMODULE.                 " LIST_HELP  INPUT


After i debugging, i found this snapshot in FORM 'update_tab.',

Those IF conditions always make a result 'neuer' as 'N' for extract value from F4,

make 'neuer' as 'J' for extract value from manually input. Then 'J' will save in DB.

i really do not know <table2_x> and <vim_xextract_enti> where comes from, when assigned value to it?


IF status-type EQ einstufig AND status-action EQ hinzufuegen.

     IF ( ( x_header-bastab EQ space OR x_header-texttbexst EQ space )

            AND <table2_x> EQ <initial_x>

          OR x_header-bastab NE space AND x_header-texttbexst NE space

            AND <vim_xextract_enti> EQ <initial_x>

          OR ( vim_special_mode EQ vim_upgrade OR

            vim_single_entry_function NE space ) )

         AND <xact> EQ leer.            "int943578/2000

       neuer = 'J'.

     ELSE.

       neuer = 'N'.

     ENDIF.

   ENDIF.

ArcherZhang
Advisor
Advisor
0 Kudos

the center of TMG is a table control, 'DYNP_VALUES_UPDATE' definitely not works to it.

After debugging, i eventually changed standard module 'MODULE LISTE_UPDATE_LISTE' to my custom one, done a little change base original code. i need more test to avoid bug.

Thanks all guys.

Regards,

Archer

sriram_korlepara
Participant
0 Kudos

Hi Archer,

I have a requirement, that one of the field values should be defaulted in when you press 'New Entries' button in TMG one field should have auto incremented values.

Eg:

Record id Record Name

1             abc

2             def

User is going to enter only Record Name the record id should be auto populated. I tried with event '5' (create Entry). I am partially succesful. But these values will be shown once it saved to the database. User would n't be able to see the default values while entering the entries in TMG.

Any suggestions?

Thanks

Ram