‎2009 Feb 13 2:22 PM
Hi. How can be that the FM DYNP_VALUES_READ returns a table with no rows? The screen is a normal one, and the FM does not return with an exception. This is, more or less, the scenario:
There is a normal screen with some fields and a table control.
One of the fields in the table control has a customer search help (Z..) attached to the dynpro field
This search help has an exit
Inside the exit it has implemented the SELECT step
In this step, the FM DYNP_VALUES_READ, with proper dyname and dynumb parameters is called, but returns an empty table.
The dyname and dynumb are the same program and dynpro with the table control that called the search help.
Am I incorrectly understanding how does DYNP_VALUES_READ works?
Thanks in advance for any help you can give me.
Edited by: Andres Rodriguez Guapacha on Feb 13, 2009 3:30 PM
Added the fact that the search help is linked to the dynpro field directly, not via the data element.
‎2009 Feb 16 4:34 PM
Hi. Your ideas were of great help, however I found a fastest hack to the variable:
field-symbols <fs> type matnr. " or any other type
data local_variable type matnr. " or any other type
data external_variable type string value '(program)field'.
assign (external_variable) to <fs>.
local_variable = <fs>.
Pretty ugly I know, but it works like a charm. And with all this time constraint...
Thanks for the help, anyway.
‎2009 Feb 14 6:20 AM
Hi Andres,
I guess you need to populate the dynpfield table with the values of the screen fields for which you need to read the value.
Have a look at the function module documentation. Also have a look at the example code.
Example:
data: dyname like d020s-prog value 'TESTPROG',
dynumb like d020s-dnum value '100'.
data: begin of dynpfields occurs 3.
include structure dynpread.
data: end of dynpfields.
move 'TABNAME' to dynpfields-fieldname.
append dynpfields.
move 'FIELDNAME' to dynpfields-fieldname.
append dynpfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = dymame
dynumb = dynumb
translate_to_upper = 'X'
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.
Hope this will help.
Thanks,
Samantak.
‎2009 Feb 14 11:04 AM
Hi,
Use:-
DATA : DYNAME LIKE D020S-PROG,
DYNUMB LIKE D020S-DNUM.
DATA : DYNPFIELDS LIKE STANDARD TABLE OF DYNPREAD WITH HEADER LINE.
DYNAME = SY-REPID,
DYNUMB = SY-DYNNR.
DYNPFIELDS-FIELDNAME = <the name of the parameter you need to find out>
APPEND DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = DYNAME
dynumb = DYNUMB
TABLES
dynpfields = DYNPFIELDS.
READ DYNPFIELDS INDEX 1.
MOVE DYNPFIELDS-VALUE TO <PARAMETER>.
"here you insert the code to run the search help, and it depends on which search help you need.
Hope this helps you.
Regards,
Tarun
‎2009 Feb 16 4:34 PM
Hi. Your ideas were of great help, however I found a fastest hack to the variable:
field-symbols <fs> type matnr. " or any other type
data local_variable type matnr. " or any other type
data external_variable type string value '(program)field'.
assign (external_variable) to <fs>.
local_variable = <fs>.
Pretty ugly I know, but it works like a charm. And with all this time constraint...
Thanks for the help, anyway.