‎2007 Jun 21 8:59 AM
Hello All,
My requirement is as below:
I have a screen (dailog) which consists of screen elements and an ALV grid below.
My requirement is to add a button in the application toolbar which reads the screen contents and saves them in a local excel sheet. Upon the click of the button , i have called the FM 'DYNP_VALUES_READ' in PAI to read the screen contents. But it doesn't return me any thing. Can' i use the FM 'DYNP_VALUES_READ' in PAI ? Kindly suggest me how to do this?
Thanks & Regards,
Sri
‎2007 Jun 21 9:07 AM
Hi,
We use FM 'DYNP_VALUES_READ' for selection screen events.
But in case of screen u need not use the FM.
Because u already have the values (which u want to process) in PAI.
FM 'DYNP_VALUES_READ' is used for screen where before PAI u want to check the values on screen.
Regards,
Ranjit Thakur.
<b>Please Mark The Helpful Answer.</b>
‎2007 Jun 21 9:04 AM
HI,
You can use this in the PAI also but you need to pass the correct values
Please look at this sample code
*This function module gets the values on screen.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = l_program_name
dynumb = l_dynpro_number
TABLES
dynpfields = l_dynp_value_tab
EXCEPTIONS
invalid_abapworkarea = 04
invalid_dynprofield = 08
invalid_dynproname = 12
invalid_dynpronummer = 16
invalid_request = 20
no_fielddescription = 24
undefind_error = 28.
READ TABLE l_dynp_value_tab INDEX 1.
l_functd1_value = l_dynp_value_tab-fieldvalue.The table l_dynp_value_tab will contain the value.
Kindly reward points if helpful.
Regards
Sudheer
‎2007 Jun 21 9:09 AM
Hi Sudheer ,
i have pasted my code below.
DATA: ok_code TYPE sy-ucomm,
l_tab_dynp TYPE dynpread_tabtype.
CASE ok_code.
WHEN '&F03'.
SET SCREEN 0.
WHEN '&F12'.
SET SCREEN 0.
WHEN '&F15'.
SET SCREEN 0.
WHEN 'EXPORT'.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = '0100'
TRANSLATE_TO_UPPER = ' '
REQUEST = ' '
PERFORM_CONVERSION_EXITS = ' '
PERFORM_INPUT_CONVERSION = ' '
DETERMINE_LOOP_INDEX = ' '
START_SEARCH_IN_CURRENT_SCREEN = ' '
START_SEARCH_IN_MAIN_SCREEN = ' '
START_SEARCH_IN_STACKED_SCREEN = ' '
START_SEARCH_ON_SCR_STACKPOS = ' '
SEARCH_OWN_SUBSCREENS_FIRST = ' '
SEARCHPATH_OF_SUBSCREEN_AREAS = ' '
TABLES
dynpfields = l_tab_dynp
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
but l_tab_dynp doesn't contacin any value.
‎2007 Jun 21 9:07 AM
Hi,
We use FM 'DYNP_VALUES_READ' for selection screen events.
But in case of screen u need not use the FM.
Because u already have the values (which u want to process) in PAI.
FM 'DYNP_VALUES_READ' is used for screen where before PAI u want to check the values on screen.
Regards,
Ranjit Thakur.
<b>Please Mark The Helpful Answer.</b>