Abap , search helpten formları oto doldurma
REPORT ZRICH_002.
parameters: p_bukrs type t001–bukrs,
p_butxt type t001–butxt,
p_ort01 type t001–ort01,
p_land1 type t001–land1.data: dynfields type table of dynpread with header line.
data: return type table of ddshretval with header line.at selection-screen on value-request for p_bukrs.
call function ‘F4IF_FIELD_VALUE_REQUEST’
exporting
tabname = ‘T001’
fieldname = ‘BUKRS’
dynpprog = sy–cprog
dynpnr = sy–dynnr
dynprofield = ‘P_BUKRS’
tables
return_tab = return
exceptions
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
others = 5.read table return with key fieldname = ‘P_BUKRS’.
* Add it back to the dynpro.
dynfields–fieldname = return–retfield.
dynfields–fieldvalue = return–fieldval.
append dynfields.* Get the company code from db and add to dynpro
data: xt001 type t001.clear xt001.
select single * into xt001
from t001
where bukrs = return–fieldval.dynfields–fieldname = ‘P_BUTXT’.
dynfields–fieldvalue = xt001–butxt.
append dynfields.dynfields–fieldname = ‘P_ORT01’.
dynfields–fieldvalue = xt001–ort01.
append dynfields.dynfields–fieldname = ‘P_LAND1’.
dynfields–fieldvalue = xt001–land1.
append dynfields.* Update the dynpro values.
call function ‘DYNP_VALUES_UPDATE’
exporting
dyname = sy–cprog
dynumb = sy–dynnr
tables
dynpfields = dynfields
exceptions
others = 8.start-of-selection.