‎2009 Oct 12 1:49 PM
Hello,
On selection screen I have to create F4 selection.
I used the following code:
SELECT *
FROM ekbe
INTO CORRESPONDING FIELDS OF TABLE ekbe_lt
WHERE ebeln = p_ebeln AND
bewtp = 'D' AND
vgabe = '9'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'SO_LBLNI-LOW'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'C'
multiple_choice = 'X'
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = ekbe_lt
FIELD_TAB =
return_tab = lt_return
DYNPFLD_MAPPING =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3
.
I want to show the ekbe_lt table in the F4 window in ALV format, and then after clicking on a row,
return the belnr value to field 'SO_LBLNI-LOW'.
The problem is that i get no values found, eventhough ekbe_lt has lines.
Also it is important that the list will be in ALV format.
Thanks
Yifat
‎2009 Oct 12 2:06 PM
t_dynpfields-fieldname = 'P_EBELN'.
append t_dynpfields.
w_repid = sy-repid.
"call the below function module befre your code
call function 'DYNP_VALUES_READ'
exporting
dyname = w_repid
dynumb = sy-dynnr
tables
dynpfields = t_dynpfields
exceptions
others.
clear : w_dynprofld.
read table t_dynpfields index 1.
p_ebeln = t_dynpfields-fieldvalue.
SELECT *
FROM ekbe
INTO CORRESPONDING FIELDS OF TABLE ekbe_lt
WHERE ebeln = p_ebeln AND
bewtp = 'D' AND
vgabe = '9'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'SO_LBLNI-LOW'
* PVALKEY = ' '
* DYNPPROG = ' '
* DYNPNR = ' '
* DYNPROFIELD = ' '
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
value_org = 'C'
* multiple_choice = 'X'
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = ekbe_lt
* FIELD_TAB =
return_tab = lt_return
* DYNPFLD_MAPPING =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3
.
Prabhudas
‎2009 Oct 12 2:06 PM
t_dynpfields-fieldname = 'P_EBELN'.
append t_dynpfields.
w_repid = sy-repid.
"call the below function module befre your code
call function 'DYNP_VALUES_READ'
exporting
dyname = w_repid
dynumb = sy-dynnr
tables
dynpfields = t_dynpfields
exceptions
others.
clear : w_dynprofld.
read table t_dynpfields index 1.
p_ebeln = t_dynpfields-fieldvalue.
SELECT *
FROM ekbe
INTO CORRESPONDING FIELDS OF TABLE ekbe_lt
WHERE ebeln = p_ebeln AND
bewtp = 'D' AND
vgabe = '9'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'SO_LBLNI-LOW'
* PVALKEY = ' '
* DYNPPROG = ' '
* DYNPNR = ' '
* DYNPROFIELD = ' '
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
value_org = 'C'
* multiple_choice = 'X'
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = ekbe_lt
* FIELD_TAB =
return_tab = lt_return
* DYNPFLD_MAPPING =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3
.
Prabhudas
‎2009 Oct 12 2:49 PM
Yifat,
on the event at selecton-screen on value request cannot read value from a screen field directly.
so you need dynpro value read FM as suggested above..