Application Development 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: 

passing data from internal table in function module

Former Member
0 Kudos

Hi all,

I have data in an internal table in my function module and have to pass it my implementation program in badi. How do i do it?

My problem here is i am not able to declare any internal table in my changing parameters to pass it back.

3 REPLIES 3

Former Member
0 Kudos

Hi,

Gothrough the following links,

https://forums.sdn.sap.com/click.jspa?searchID=15750380&messageID=4753768

Regards,

Harish

uwe_schieferstein
Active Contributor
0 Kudos

Hello Abhinay

Presumably your problem is that you need to define an itab within your BAdI implementing class. Fortunately ABAP-OO no longer allows itabs having header lines. Thus, itab must be defined using table types.

An itab having no header line can be used to fill or retrieve data from TABLES parameters (or CHANGING) in function modules, .e.g:


METHOD if_ex_me_process_po_cust~check.

  DATA: lt_dfies    TYPE STANDARD TABLE OF mara.  " no header line. Or use table type:
    "        lt_dfies     TYPE ddfields.  " table type

    CALL FUNCTION 'DDIF_FIELDINFO_GET'
      EXPORTING
        tabname              = 'MARA'
*       FIELDNAME            = ' '
*       LANGU                = SY-LANGU
*       LFIELDNAME           = ' '
*       ALL_TYPES            = ' '
*       GROUP_NAMES          = ' '
*       UCLEN                =
*     IMPORTING
*       X030L_WA             =
*       DDOBJTYPE            =
*       DFIES_WA             =
*       LINES_DESCR          =
      TABLES
        DFIES_TAB            = lt_dfies   " itab without header line 
*       FIXED_VALUES         =
      EXCEPTIONS
*       NOT_FOUND            = 1
*       INTERNAL_ERROR       = 2
        OTHERS               = 3.
  

ENDMETHOD.

Regards

Uwe

0 Kudos

Hello Uwe Schieferstein ,

In ecc 6.0 when i use tables while defining function modules it says tables is obsolete.How do i do it now?

Regards,

C.A