‎2009 May 18 2:02 PM
hi
i need help...
i have programing a function modul.
the type from the export parameter is during runtime to known.
how i do assign my export parameter the right type during runtime and output in same format?
function z_wwi_get_st_kg.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" REFERENCE(PF_MATNR) TYPE MATNR
*" EXPORTING
*" REFERENCE(P_ST_GE)
*" REFERENCE(P_EINHEIT)
*"----------------------------------------------------------------------
data lf_yykeid type ymm_keid.
data lf_meinh type lrmei.
data lf_brgew type brgew.
data lf_gewei type gewei.
data lf_umrez type umrez.
"Konsumenteneinheit lesen
select single yykeid
from mara
into lf_yykeid
where matnr eq pf_matnr.
"Wenn nicht KG dann ST
if lf_yykeid ne 'KG'.
lf_meinh = 'ST'.
else.
lf_meinh = lf_yykeid.
endif.
"Stückartikel oder Gewichtsartikel
case lf_meinh.
when 'ST' .
select single umrez
from marm
into lf_umrez
where matnr eq pf_matnr
and meinh eq 'HE'.
clear lf_meinh.
lf_meinh = 'CU'.
* get reference of lf_umrez into p_st_ge.
* get reference of lf_meinh into p_einheit.
when 'KG'.
select single brgew gewei
from marm
into (lf_brgew, lf_gewei)
where matnr eq pf_matnr
and meinh eq 'HE'.
* get reference of lf_brgew into p_st_ge.
* get reference of lf_gewei into p_einheit.
endcase.
endfunction.
thx anu
Edited by: marty anujit on May 18, 2009 3:02 PM
‎2009 May 18 2:19 PM
Hi,
Using Export and Import statements u can achieve u r requirement.
Thanks,
‎2009 May 18 2:08 PM
Hi,
function module is fixed and reuse component..
you will not decide the export parameter is during runtime ..
instead you can assign the structure having field name and field value..
so the export paramater is now having field name and field value you can use this in the programm by
field name..
Regards,
Prabhudas
‎2009 May 18 2:19 PM
Hi,
Using Export and Import statements u can achieve u r requirement.
Thanks,