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

Using Internal Table in ABAP OO.

senthil_kumar29
Participant
0 Likes
2,371

Hi,

I am using a internal table, I am calling a FM, which require Internal table as its parameter. Since Internal table with header line is not supported in ABAP OO. How to attain this.

Thanq For Ur time.

Cheers,

Sam

5 REPLIES 5
Read only

Peter_Inotai
Active Contributor
0 Likes
1,206

Hi,

You can pass the parameter like this, you have to add [], in this case it will be onl;y the tabel body....or you define your internal table without header line:

imput_patameter_tab = my_itab[]  

.

Best regards,

Peter

Read only

Former Member
0 Likes
1,206

Hi

Declare table type in ddic as same type of internal table . use this as ur exporting parameter type

Regards

Read only

Former Member
0 Likes
1,206

Declare the internal table without header line and pass that to the function module,

it should not be a problem..

Read only

Former Member
0 Likes
1,206

Hello,

Use body to map it.

i.e use itab[] instead of only itab.

Regards,

Deepu.k

Read only

aris_hidalgo
Contributor
0 Likes
1,206

Hi,

Please look at my example below.


TYPES: BEGIN OF t_vbak,
          vbeln TYPE vbak-vbeln,
          posnr TYPE vbap-posnr,
          erdat TYPE vbak-erdat,
          ernam TYPE vbak-ernam,
          auart TYPE vbak-auart,
          kunnr TYPE vbak-kunnr,
          vkgrp TYPE vbak-vkgrp,
         END OF t_vbak.

DATA: gt_vbak     TYPE STANDARD TABLE OF t_vbak,
      gt_vbak_dum LIKE gt_vbak.

*CLASS DEFINITIONS
*----------------------------------------------------------------------*
*       CLASS lcl_get_so DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_get_so DEFINITION.
  PUBLIC SECTION.
    METHODS: get_sales_orders
                EXPORTING
                   ex_vbak LIKE gt_vbak.
ENDCLASS.                    "lcl_get_so DEFINITION

*CLASS IMPLEMENTATIONS
*----------------------------------------------------------------------*
*       CLASS lcl_get_so IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_get_so IMPLEMENTATION.
  METHOD get_sales_orders.
    SELECT vbak~vbeln vbap~posnr vbak~erdat
           vbak~ernam vbak~auart vbak~kunnr
           vbak~vkgrp
      FROM vbak
     INNER JOIN vbap
        ON vbak~vbeln = vbap~vbeln
      INTO TABLE gt_vbak
     WHERE vbak~erdat IN s_erdat
       AND vbak~ernam IN s_ernam
       AND vbak~auart IN s_auart
       AND vbak~vkgrp IN s_vkgrp
       AND vbak~kunnr = p_kunnr.

    IF NOT gt_vbak[] IS INITIAL.
      ex_vbak[] = gt_vbak[].
    ELSE.
      MESSAGE i000 WITH 'No data found for given criteria'.
      LEAVE TO SCREEN 0.
    ENDIF.
  ENDMETHOD.                    "get_sales_orders
ENDCLASS.                    "lcl_get_so IMPLEMENTATION

*----------------------------------------------*
* START-OF-SELECTION                           *
*----------------------------------------------*
START-OF-SELECTION.

  DATA: o_get_so         TYPE REF TO lcl_get_so.
  CREATE OBJECT: o_get_so.

*Get sales orders
    CALL METHOD o_get_so->get_sales_orders
      IMPORTING
        ex_vbak = gt_vbak_dum.

Hope it helps...

Please award points if it helps...