10-12-2006 6:23 PM
Hello
How can I pass values from a screen when the user click on matchcode. The user does not use enter before the click on matchcode.
Thank you
10-12-2006 6:29 PM
Hi
U should manage it in POV process or (for selection-screen) AT SELECTION-SCREEN event.
Here use fm DYNP_VALUES_READ to read the value from the screen and then pass it to matchcode. You can use fm F4IF_FIELD_VALUE_REQUEST to call match code.
You can obtain the same risult building a particular structre in dictionary, this structure has to have those two fields and you have to assign the search help.
After you have to use this structure to build your screen.
Max
10-12-2006 6:29 PM
Hi
U should manage it in POV process or (for selection-screen) AT SELECTION-SCREEN event.
Here use fm DYNP_VALUES_READ to read the value from the screen and then pass it to matchcode. You can use fm F4IF_FIELD_VALUE_REQUEST to call match code.
You can obtain the same risult building a particular structre in dictionary, this structure has to have those two fields and you have to assign the search help.
After you have to use this structure to build your screen.
Max
10-12-2006 6:31 PM
Here is a good example program, you enter a sales document number and do F4 help on the line number, search help will give you the line number and materials for that sales document number
report zrich_0002 .
parameters: p_vbeln type vbak-vbeln,
p_posnr type vbap-posnr.
at selection-screen on value-request for p_posnr.
data: begin of help_item occurs 0,
posnr type vbap-posnr,
matnr type vbap-matnr,
arktx type vbap-arktx,
end of help_item.
data: dynfields type table of dynpread with header line.
dynfields-fieldname = 'P_VBELN'.
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_VBELN'.
p_vbeln = dynfields-fieldvalue.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = p_vbeln
importing
output = p_vbeln.
select posnr matnr arktx into table help_item
from vbap
where vbeln = p_vbeln.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'POSNR'
dynprofield = 'P_POSNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = help_item.
Regards,
Rich Heilman