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

Former Member
18,557

Hi.

this function don't work correctly.

the sy-subrc is initial but the values of dynpro fields there aren't modified.

Regards Angela

1 ACCEPTED SOLUTION
Read only

8,737

DYNP_UPDATE_FIELDS will make you all happy while DYNP_VALUES_UPDATE makes everyone sad...

19 REPLIES 19
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
8,737

Can you please post your code?

Regards,

Rich Heilman

Read only

Former Member
0 Likes
8,737

HI,

Look at the below Program ..

  data: dyname like d020s-prog value 'TESTPROG',
        dynumb like d020-dnum value '100'.
  data: begin of dynpfields occurs 3.
          include structure dynpread.
  data: end of dynpfields.
  move 'TABNAME' to dynpfields-fieldname.
  move 'Testtable' to dynpfields-fieldvalue.
  append dynpfields.
  move 'FIELDNAME' to dynpfields-fieldname.
  move 'Testfield' to dynpfields-fieldvalue.
  append dynpfields.
  call function 'DYNP_VALUES_UPDATE'
       exporting
             dyname     = dyname
             dynumb     = dynumb
       tables
             dynpfields = dynpfields
       exceptions
             invalid_abapworkarea = 01
             invalid_dynprofield  = 02
             invalid_dynproname   = 03
             invalid_dynpronummer = 04
             invalid_request      = 05
             no_fielddescription  = 06
             undefind_error       = 07.

Regards

Sudheer

Read only

8,737

this is not your code, believe me.

Read only

Former Member
0 Likes
8,737

Use the function module DYNP_VALUES_UPDATE and update the internal table for dynp_values

Read only

Former Member
0 Likes
8,737

Hi Angela,

DATA: BEGIN OF dynprofelder OCCURS 10.

INCLUDE STRUCTURE dynpread.

DATA: END OF dynprofelder.

REFRESH dynprofelder.

dynprofelder-fieldname = 'SCREEN-NAME1'.

dynprofelder-fieldvalue = SCREEN-NAME1.

APPEND dynprofelder.

dynprofelder-fieldname = 'SCREEN-NAME2'.

dynprofelder-fieldvalue = 'SCREEN-NAME2.

APPEND dynprofelder.

call function 'DYNP_VALUES_UPDATE'

exporting

dyname = sy-cprog

dynumb = sy-dynnr

tables

dynpfields = dynprofelder

exceptions

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

undefind_error = 7

others = 8.

Regards,

Ajith

MArk if useful.

Read only

anversha_s
Active Contributor
0 Likes
8,737

hi,

chk this.

DATA: BEGIN OF dynprofelder OCCURS 0.

INCLUDE STRUCTURE dynpread.

DATA: END OF dynprofelder.

REFRESH dynprofelder.

dynprofelder-fieldname = 'SCREEN_FIELD_NAME'.

dynprofelder-fieldvalue = int_orient-ddtext. "screen field value

APPEND dynprofelder.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

TABLES

dynpfields = dynprofelder

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

undefind_error = 7

OTHERS = 8.

pls mark all helpful answers.

rgds

anver

Read only

Former Member
0 Likes
8,737

Hi.

Thank you for all the your answers.

But I know to use the function. But it doesn't work. In other words the dynpro fields aren't updated.

Regards Angela

Read only

0 Likes
8,737

Angela,

CAn u post your code??

Regards,

Ajith

Read only

0 Likes
8,737

Hi Ajith.

This my code:

data:pgwrite like d020s-prog,

dywrite like d020s-dynum,

lt_fields like standard table of dynpread with header line,

lv_tab like z01hrag_campi-tabname.

lt_fields-fieldname = 'P0001-BEGDA'.

lt_fields-fieldvalue = '20060501'.

append lt_fields.

lt_fields-fieldname = 'P0001-PERSK'.

lt_fields-fieldvalue = '13'.

append lt_fields.

if not lt_fields[] is initial.

call function 'DYNP_VALUES_UPDATE'

exporting

dyname = pgwrite

dynumb = dywrite

tables

dynpfields = lt_fields

exceptions

invalid_abapworkarea = 01

invalid_dynprofield = 02

invalid_dynproname = 03

invalid_dynpronummer = 04

invalid_request = 05

no_fielddescription = 06

undefind_error = 07.

endif.

Thank you.

Angela

Read only

0 Likes
8,737

Hello,

I've the same problem.

My code is equal to Angela's code.

My question is:

the FM DYNP_VALUES_UPDATE can be used only for HELP operations?

Can I use it simply for update the screen fields after the read of the values from tables.

Regards,

Mara

Read only

0 Likes
8,737

Hello,

I had the same issue together with GENERATE DYNPRO.

The dynamic created fields are not updated correctly in dynpro PBO event. No way to fix it with with the FM DYNP_VALUES_UPDATE.

My solution was:

- creating a dynamic data structure according to the dynpro fields (e.g. method within class CL_GUI_ALV_GRID)

- field-symbol assigning this dynamic structure (e.g. <UI>)

- naming all field in Dynpro with Prefix "<UI>-"

This works fine. You can transfer fields to dynpro an backwards with the field-symbol <UI>.

Regards,

Joerg

Read only

0 Likes
8,737

Joerg.

Can you send me a example code to do this:

My solution was:

- creating a dynamic data structure according to the dynpro fields (e.g. method within class CL_GUI_ALV_GRID)

- field-symbol assigning this dynamic structure (e.g. <UI>)

- naming all field in Dynpro with Prefix "<UI>-"

This works fine. You can transfer fields to dynpro an backwards with the field-symbol <UI>.

Thanks,

Joao

Read only

0 Likes
8,737

Hi,

Are your fields declared in the corresponding generated program ?

If they are not then DYNP_VALUES_READ will work, but you will always lost the content by pressing the ENTER key.

Read only

0 Likes
8,737

Hi Angela,

DYNP VALUES UPDATE is used to change the screen fields values without a PBO or PAI event, i.e. ON INPUT, ON REQUEST, ON VALUE-REQEST, ON HELP-REQUEST.

For instance, user chooses a value in field a using the F4 value-request. Here you have the chance to update field b depending on the value entered in field a.

I could not see the event in your program triggering the DYNP VALUES UPDATE.

Hope it helps

Clemens

Read only

Former Member
0 Likes
8,737

try using this function module.

CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'

EXPORTING

functioncode = '/00'

EXCEPTIONS

function_not_supported = 1.

Regards,

RK

Read only

8,738

DYNP_UPDATE_FIELDS will make you all happy while DYNP_VALUES_UPDATE makes everyone sad...

Read only

0 Likes
8,737

Thank you very much. This really works.

Read only

0 Likes
8,737

DYNP_UPDATE_FIELDS Works great in my OO Concept

Read only

0 Likes
8,737

yes,

DYNP_UPDATE_FIELDS works on custom dynpro (remember to user proper dynnr/repid) and custom F4 search help (with Exit) on it, but there is trick - one need to use:

" CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'. " afterwards.

(don't specify any value of "dummy" function code - just call it as specified above)