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

global class

Former Member
0 Likes
310

hai all,

can any one tell me how to define an internal table in the global class.

and occurs specificataion

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
294

Hello

There are two ways:

(1) Use a table type from the DDIC

(2) Define a table type definition yourself

Example (1): instance attribute mt_return

mt_return TYPE bapirettab. " table type of bapiret2

Example (2): type definition in types section of class

TYPES:

ty_t_kna1 TYPE STANDARD TABLE OF kna1.

mt_customers TYPE ty_t_kna1.

In both cases you will always need a corresponding workarea to read or fill the itab. Fortunately header lines are no longer possible within classes!!!


DATA:
  ls_return        TYPE bapiret2,
  ls_customer   LIKE LINE OF mt_customers.

 LOOP AT me->mt_return INTO ls_return.
...
 

  READ TABLE me->mt_customers INTO ls_customer INDEX ...
...

Regars

Uwe

Read only

Former Member
0 Likes
294

Hi Upender,

In Global class , we can declare a internal table using Table type,

before go to SE24(for create the global class),

we should create table type in SE11.

after that we should mention that table type in to associated type tab in SE24.

after that we can use internal table in class method.

Regards,

Vijay

Edited by: Vijay.V on Jan 4, 2008 2:50 PM