Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function Modul export parameter

Former Member
0 Likes
498

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

1 ACCEPTED SOLUTION
Read only

tarangini_katta
Active Contributor
0 Likes
463

Hi,

Using Export and Import statements u can achieve u r requirement.

Thanks,

2 REPLIES 2
Read only

Former Member
0 Likes
463

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

Read only

tarangini_katta
Active Contributor
0 Likes
464

Hi,

Using Export and Import statements u can achieve u r requirement.

Thanks,