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

DYNP_VALUES_UPDATE not working

Former Member
0 Likes
4,512

Hello All,

I am using FM DYNP_VALUES_UPDATE to fill the 'Description' based on some other value after FM f4if_int_table_value_request.

But i am facing the below problem.

data:

     lt_dynpread TYPE STANDARD TABLE OF dynpread.

     ls_dynpread TYPE dynpread.

ls_dynpread-fieldname  =  'GT_YBUT00000KMIA6_D-YORG1'.

ls_dynpread-fieldvalue = ls_return-fieldval.

APPEND ls_dynpread TO lt_dynpread.

        CALL FUNCTION 'DYNP_VALUES_UPDATE'

          EXPORTING

            dyname                     = sy-cprog     " prog id

            dynumb                     = sy-dynnr     " screen no

          TABLES

            dynpfields                 = lt_dynpread

           EXCEPTIONS

             INVALID_ABAPWORKAREA       = 1

             INVALID_DYNPROFIELD        = 2

             INVALID_DYNPRONAME         = 3

             INVALID_DYNPRONUMMER       = 4

             INVALID_REQUEST            = 5

             NO_FIELDDESCRIPTION        = 6

             UNDEFIND_ERROR             = 7

             OTHERS                     = 8.

        IF sy-subrc <> 0.

        ENDIF.

Please help me how to get the correct 'Description' value against selected value from f4 help.

Thanks,

Sampath

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,565

since you want to update screen fields in table control you should give index of current line.

use FM "DYNP_GET_STEPL" to get step loop index.

and pass this index.

ls_dynpread-fieldname  =  'GT_YBUT00000KMIA6_D-YORG1'.

ls_dynpread-fieldvalue = ls_return-fieldval.

ls_dynpread-stepl = lw_stepl.

APPEND ls_dynpread TO lt_dynpread.

and call 'DYNP_VALUES_UPDATE'.

Hello All,

I am using FM DYNP_VALUES_UPDATE to fill the 'Description' based on some other value after FM f4if_int_table_value_request.

But i am facing the below problem.

data:

     lt_dynpread TYPE STANDARD TABLE OF dynpread.

     ls_dynpread TYPE dynpread.

ls_dynpread-fieldname  =  'GT_YBUT00000KMIA6_D-YORG1'.

ls_dynpread-fieldvalue = ls_return-fieldval.

APPEND ls_dynpread TO lt_dynpread.

        CALL FUNCTION 'DYNP_VALUES_UPDATE'

          EXPORTING

            dyname                     = sy-cprog     " prog id

            dynumb                     = sy-dynnr     " screen no

          TABLES

            dynpfields                 = lt_dynpread

           EXCEPTIONS

             INVALID_ABAPWORKAREA       = 1

             INVALID_DYNPROFIELD        = 2

             INVALID_DYNPRONAME         = 3

             INVALID_DYNPRONUMMER       = 4

             INVALID_REQUEST            = 5

             NO_FIELDDESCRIPTION        = 6

             UNDEFIND_ERROR             = 7

             OTHERS                     = 8.

        IF sy-subrc <> 0.

        ENDIF.

Please help me how to get the correct 'Description' value against selected value from f4 help.

Thanks,

Sampath

5 REPLIES 5
Read only

Former Member
0 Likes
2,566

since you want to update screen fields in table control you should give index of current line.

use FM "DYNP_GET_STEPL" to get step loop index.

and pass this index.

ls_dynpread-fieldname  =  'GT_YBUT00000KMIA6_D-YORG1'.

ls_dynpread-fieldvalue = ls_return-fieldval.

ls_dynpread-stepl = lw_stepl.

APPEND ls_dynpread TO lt_dynpread.

and call 'DYNP_VALUES_UPDATE'.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,565

In a table control the LS_DYNPREAD-STEPL (current line index) is a required field in those FM parameters, you can get it when calling FM DYNP_GET_STEPL in the POV, call it just before the F4xx FM.

  1. DYNP_GET_STEPL " Get current line
  2. DYNP_VALUES_READ " Get other current field values in the current line record if required
  3. F4IF_INT_TABLE_VALUE_REQUEST " Execute the F4/search
  4. DYNP_VALUES_UPDATE " Update dependant field on the current line record

Regards,

Raymond

Read only

Former Member
0 Likes
2,565

Hi Sampath,

Try this below code:

DATA:

lt_sel TYPE TABLE OF dynpread,

ls_sel TYPE TABLE OF dynpread.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

     EXPORTING

       ddic_structure = "your_structure_name"

       retfield       = "field_name"

       dynpprog       = sy-repid

       dynpnr         = sy-dynnr

       dynprofield    = "fieldname"

       value_org      = 'S'

     TABLES

       value_tab      = "your_internal_table"

       return_tab     = lt_sel.


READ TABLE lt_sel INTO ls_sel INDEX 1.

IF sy-subrc = 0.

   ls_dynpread-fieldname  =  'GT_YBUT00000KMIA6_D-YORG1'.

   ls_dynpread-fieldvalue = ls_return-fieldval.

   APPEND ls_dynpread TO lt_dynpread.

ENDIF.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

     EXPORTING

       dyname                     = sy-cprog

       dynumb                     = sy-dynnr

     TABLES

       dynpfields                 = lt_dynpread.

Read only

Former Member
0 Likes
2,565

You need to call the FM DYNP_GET_STEPL before calling 'DYNP_VALUES_UPDATE

Check this code.


http://www.sapdev.co.uk/dialog/value_request.htm

Read only

Former Member
0 Likes
2,565

Hello All,

Thank you very much for your quick response.

Now it is working fine.

-Sampath