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

Dynpro: PROCESS ON VALUE-REQUEST: with FIELD and module

Former Member
0 Likes
5,764

Hello,

I have a problem with dynpro-programming:

This is the coding on my dynpro:

PROCESS ON VALUE-REQUEST.

   FIELD zmepo_badi_9000-ateil
   MODULE suchhilfe_ateil.

At the dynpro there are two fields: ateil and kstar

In Module suchhilfe_ateil I want to get back the value of  zmepo_badi_9000-ateil and
zmepo_badi_9000-kstar. In suchhilfe_ateil I`m using the FB 
F4IF_INT_TABLE_VALUE_REQUEST to get a F4 help.

I both fields on Dynpro are empty there is no problem: both fields get filled.

But when the Dynpro is filled and I want to change it with the help of F4, the value of kstar doesn`t change. It`s still the same as before.

It only works if kstar is empty. Then the correct value gets in the correct field.

Here is a part of the coding of    MODULE suchhilfe_ateil:

            zmepo_badi_9000-z_kstar     = lv_kstar.
            zmepo_badi_9000-ateil       = lv_ateil.

*           "Setze Enter
            CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
              EXPORTING
                functioncode           = '/00'
              EXCEPTIONS
                function_not_supported = 1.

in lv_kstar is the correct value, but on the dynpro it does not change.

I hope anybody can help me!

Thank you.

3 REPLIES 3
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,485

Remove those move and force ok_code, better use FM DYNP_VALUES_UPDATE to update the screen without triggering a PAI/PBO cycle. Parameters are very similar to DYNP_VALUES_READ that you should already use to read current value of the other field (e.g. : read z_kstar when F4 executed on ateil)

Regards,

Raymond

Read only

0 Likes
2,485

Hello,

thanks for your reply. Now It works, but I have still a problem.

There is a third field I have to fill (same dynpro): Z_ZIELPREIS

If I use 'DYNP_VALUES_UPDATE' it doesn`t fill a value in
ZMEPO_BADI_9000-Z_ZIELPREIS. When I put it in directly, it works, but I have to put Enter when I`m back on the dynpro, than the correct value appears. That would be ok perhaps. But when I restart the F4-Help without Enter, the dynpro-field 'ZMEPO_BADI_9000-Z_ZIELPREIS'  has a value. That is not good. Perhaps you can help me again.

Why does DYNP_VALUES_UPDATE not update Z_ZIELPREIS?

Or: How to get the value of Z_ZIELPREIS directly into the Dynpro-Field without Enter? Thanks

                  zmepo_badi_9000-z_zielpreis = lv_netwr_eur.
*                 MOVE 'ZMEPO_BADI_9000-Z_ZIELPREIS'     TO dflin-fieldname.
*                 MOVE lv_netwr_eur     TO dflin-fieldvalue.
*                 APPEND dflin TO dftab.
*                 CLEAR dflin.

                  MOVE 'ZMEPO_BADI_9000-Z_KSTAR'     TO dflin-fieldname.
                  MOVE lv_kstar     TO dflin-fieldvalue.
                  APPEND dflin TO dftab.
                  CLEAR dflin.

                  MOVE 'ZMEPO_BADI_9000-ATEIL'       TO dflin-fieldname.
                  MOVE lv_ateil     TO dflin-fieldvalue.
                  APPEND dflin TO dftab.
                  CLEAR dflin.

                  CALL FUNCTION 'DYNP_VALUES_UPDATE'
                    EXPORTING
                      dyname     = sy-repid
                      dynumb     = sy-dynnr
                    TABLES
                      dynpfields = dftab.
IF sy-subrc = 0.
                  

               CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
                      EXPORTING
                        functioncode           = '/00'
                      EXCEPTIONS
                        function_not_supported = 1.
                  ENDIF.

Read only

0 Likes
2,485

The FM DYNP_VALUES_UPDATE will update the field(s) of the screen, not the field(s) of the Abap program. Only the PAI will move those value(s) to the program field(s) after user interaction and not in case of an exit function code, like with a standard searh help.

Regards,

Raymond