10-19-2007 8:11 AM
Hi All,
I am using a search help H_WERKS_MATNR in the selection screen.This shows all the plants in which the material enterd by the user is present.I want to know how to pass this material no to the search help as input parameter.
Thanks,
Rakesh.
10-19-2007 11:18 AM
Hi Rakesh,
A search help has the following parameters
Import parameters: Parameters with which context information from the processed input template (screen) may be copied to the help process.
Export parameters: Parameters with which values from the hit list may be returned to the input template.
In your case, the Material No. should be assigned as an Import parameter to the Search help
Reward points for useful answers.
10-21-2007 6:06 AM
Hi,
I think u need to input Material number as input and according to that u want Plants matching that material number on other parameters or select-options of selection screen then u can achieve it by other way:
U need to use structure DYNPREAD , then Select and then function module F4IF_INT_TABLE_VALUE_REQUEST.
parameters: p_matnr type mara-matnr, material
p_werks type mara-werks. plant
at selection-screen on value-request for p_werks.
data: begin of help_item occurs 0,
matnr type mara-matnr,
werks type mara-werks,
end of help_item.
data: dynfields type table of dynpread with header line.
dynfields-fieldname = 'P_matnr'.
append dynfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
tables
dynpfields = dynfields.
read table dynfields with key fieldname = 'P_matnr'.
p_matnr = dynfields-fieldvalue.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = p_matnr
importing
output = p_matnr.
select matnr werks from vbap into table help_item
where matnr = p_matnr.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'WERKS'
dynprofield = 'P_WERKS'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = help_item.
Regards,
Vijay Mekala