‎2007 Nov 05 8:14 PM
Here in one report program I'm having
<b>Parameters: matnr for mara-matnr.
parametere: werks type t001w-werks.</b>
My requirement is " when material is provided, the relevent plant will automatcallu get selected or viewed at the selection screen."
Plz help me solving this problem.
Thanks.
‎2007 Nov 05 8:19 PM
You can do like this:
at selection-screen.
get the werks based on your material into variable l_werks.
call this FM to update the field on the screen
DATA BEGIN OF LNA_DYNPF OCCURS 1.
INCLUDE STRUCTURE DYNPREAD.
DATA END OF LNA_DYNPF.
LNA_DYNPF-FIELDNAME = 'P_WERKS'. " field name
LNA_DYNPF-FIELDVALUE = l_werks. " value
APPEND LNA_DYNPF.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = l_cporg " your program
DYNUMB = '1000' " your screen
TABLES
DYNPFIELDS = LNA_DYNPF
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
UNDEFIND_ERROR = 7
OTHERS = 8.Regards,
Naimesh Patel
‎2007 Nov 05 8:23 PM
Check the below program :
REPORT zz_temp.
tables : marc.
data v_werks like marc-werks.
Parameters: matnr like mara-matnr.
Parameters: werks like t001w-werks.
at selection-screen on matnr.
if not matnr is initial.
select single werks from marc into v_werks
where matnr = matnr.
if sy-subrc eq 0.
werks = v_werks.
endif.
endif.
Thanks
Seshu