‎2010 May 05 12:26 PM
I have created a selection screen from where I am inputting two values sales organization and distribution channel.
I want these two values for F4 help of the third input which is Area.
PARAMETERS : p_vkorg TYPE VBAK-VKORG OBLIGATORY,
p_vtweg TYPE VBAK-VTWEG OBLIGATORY.
SELECT-OPTIONS: so_state FOR KNVH-KUNNR,
Now when I am writing the Select query the fields that I am entering on the selection screen are not getting fetched into their respective parameters.
SELECT KUNNR
FROM KNVH
INTO TABLE I_KNVH_KUNNR
WHERE VKORG = P_VKORG " this is showing blank
AND VTWEG = P_VTWEG " this is showing blank
AND HITYP = 'S'
AND HZUOR = 04
What may be the reason? How can I make my query work?
‎2010 May 05 12:48 PM
data: it_dynpfields TYPE STANDARD TABLE OF dynpread,
wa_dynpfields TYPE dynpread.
REFRESH it_dynpfields.
CLEAR wa_dynpfields.
wa_dynpfields-fieldname = 'P_VKORG'.
APPEND wa_dynpfields TO it_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = '<Report Name>'
dynumb = '1000'
TABLES
dynpfields = it_dynpfields
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 EQ 0.
READ TABLE it_dynpfields INTO wa_dynpfields
WITH KEY fieldname = 'P_VKORG'.
MOVE wa_dynpfields-fieldvalue TO p_uname.
ENDIF
‎2010 May 05 12:31 PM
Hi,
use function module DYNP_VALUES_READ to get those entered values.
Regards,
Raghava Channooru
‎2010 May 05 12:48 PM
data: it_dynpfields TYPE STANDARD TABLE OF dynpread,
wa_dynpfields TYPE dynpread.
REFRESH it_dynpfields.
CLEAR wa_dynpfields.
wa_dynpfields-fieldname = 'P_VKORG'.
APPEND wa_dynpfields TO it_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = '<Report Name>'
dynumb = '1000'
TABLES
dynpfields = it_dynpfields
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 EQ 0.
READ TABLE it_dynpfields INTO wa_dynpfields
WITH KEY fieldname = 'P_VKORG'.
MOVE wa_dynpfields-fieldvalue TO p_uname.
ENDIF
‎2010 May 05 1:27 PM
How do I do it for both the field. Do i simply need to append the other one to internal table and then pass it on or do i have to code the same separately for the other one too?
This code and the select query is in inside the perform
INITIALIZATION .
AT SELECTION SCREEN ON VALUE REQUEST FOR SO_STATE LOW.
PERFORM f_value_request_state.
.
‎2010 May 05 1:30 PM
at that instance the values will not be filled . i dont think you will be able to get the values using above mentioned function @ that event. but i think you dont have to code the inputs for the search help
‎2010 May 05 1:34 PM
Use this FM in event At Selection-Screen Output.
Write your select query and use the FM to fetch the values. Yes append the two values.
‎2010 May 05 12:52 PM
is this code is after at selection screen or start of selection
‎2010 May 05 1:28 PM
Hi,
You should use the FM before your SELECT statement.
Thanks,
Shashidhar
‎2010 May 05 1:30 PM
Hi,
APPEND the two values to the internal table and pass it to the FM.
Thanks,
Shashidhar
‎2010 May 05 1:33 PM
The FM works in AT SELECTION-SCREEN ON VALUE-REQUEST.
I have tested it.
Please let me know if you have any questions.
Thanks,
Shashidhar