‎2006 Feb 01 7:52 PM
I have a selection screen with 2 parameters, param2 has a search help exit for filter data depending of param1 value, the problem is i don't know how to get the input value of param1 in the exit function module. The search help has an input param of same data element por param1. Can anybody help me please.
Thank you
Leonardo
‎2006 Feb 01 8:08 PM
If I understand you correctly, then this sample should help you. This is a sample only. These two fields actually have this functionality built in, but is being overriden in this sample.
report zrich_0002 .
parameters: p_werks type t001w-werks,
p_lgort type t001l-lgort.
at selection-screen on value-request for p_lgort.
* Internal Table for storage location help
data: begin of help_char occurs 0,
lgort type t001l-lgort,
LGOBE type t001l-LGOBE,
end of help_char.
data: dynfields type table of dynpread with header line.
dynfields-fieldname = 'P_WERKS'.
append dynfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
tables
dynpfields = dynfields
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.
read table dynfields with key fieldname = 'P_WERKS'.
select * into corresponding fields of table help_char
from t001l
where werks = dynfields-fieldvalue.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'LGORT'
dynprofield = 'P_LGORT'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = help_char.
Regards,
Rich Heilman
‎2006 Feb 01 8:07 PM
you can use function module DYNP_VALUE_READ for getting the value of the parameters in the same program.
Hope this helps.
‎2006 Feb 01 8:08 PM
If I understand you correctly, then this sample should help you. This is a sample only. These two fields actually have this functionality built in, but is being overriden in this sample.
report zrich_0002 .
parameters: p_werks type t001w-werks,
p_lgort type t001l-lgort.
at selection-screen on value-request for p_lgort.
* Internal Table for storage location help
data: begin of help_char occurs 0,
lgort type t001l-lgort,
LGOBE type t001l-LGOBE,
end of help_char.
data: dynfields type table of dynpread with header line.
dynfields-fieldname = 'P_WERKS'.
append dynfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
tables
dynpfields = dynfields
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.
read table dynfields with key fieldname = 'P_WERKS'.
select * into corresponding fields of table help_char
from t001l
where werks = dynfields-fieldvalue.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'LGORT'
dynprofield = 'P_LGORT'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = help_char.
Regards,
Rich Heilman
‎2006 Feb 01 9:07 PM
Thank you friends, my problem was solved. function module DYNP_VALUES_READ was very helpful.
Thanks..
Leonardo