Skip to Content
0
Former Member
Aug 11, 2007 at 10:46 PM

Function Module

15 Views

I developing a sample function module.

Here is the source code.


*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(KUNNR) LIKE  KNA1-KUNNR
*"     VALUE(NAME1) LIKE  KNA1-NAME1
*"  EXPORTING
*"     REFERENCE(GT_KNA1) LIKE  KNA1-LAND1
*"  EXCEPTIONS
*"      INVALID_DATA
*"----------------------------------------------------------------------


  select single * into wa_kna1
         from kna1
         where kunnr = kunnr
         and   name1 = name1.

  if sy-subrc eq 0.
    gt_kna1 = wa_kna1-land1.
  else.
    raise invalid_data.
  endif.

endfunction.

Here is what in the global data .

tables: spfli,
        kna1.

data: wa_spfli like spfli.

data: wa_kna1 like kna1.

When i am testing the function module i am getting a exception raised every time ...

let me know to fix this one...