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

define internal table without OCCURS.

Former Member
0 Likes
1,421

HI all,

In my program:

i have defined as below:

DATA: BEGIN OF r_tang OCCURS 0,

sign(1) TYPE c,

option(2) TYPE c,

low TYPE ekko-bsart,

high TYPE ekko-bsart,

END OF r_tang.

DATA: wa_tang LIKE r_tang.

and data appending as follows:

LOOP AT itab INTO wa_itab.

wa_tang-sign = 'I'.

wa_tang-option = 'EQ'.

wa_tang-low = wa_itab-bsart.

APPEND wa_tang TO r_tang.

ENDLOOP.

I want to define the above without OCCURS 0.

How can i do the same without effecting the functionality?

Please help me out.

thanks,

chinmay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,226

Hi

Define a TABLE TYPE either in your program or in the data dictionary and then use that for reference.

Cheers

VJ

9 REPLIES 9
Read only

Former Member
0 Likes
1,226

*--this is a types definition.

types : begin of t_tang,

sign(1) TYPE c,

option(2) TYPE c,

low TYPE ekko-bsart,

high TYPE ekko-bsart,

end of t_tang.

*here i am doing internal table & its work area *definition using the above defined types.

data : r_tang type standard table of t_tang,

wa_tang type t_tang.

do your loop here.

this way you can do.

regards

srikanth

added comments

Message was edited by: Srikanth Kidambi

Read only

0 Likes
1,226

types: BEGIN OF ty_tang OCCURS 0,

sign(1) TYPE c,

option(2) TYPE c,

low TYPE ekko-bsart,

high TYPE ekko-bsart,

END OF ty_tang.

data : r_tang type standard table of ty_tang,

wa_tang type ty_tang.

LOOP AT itab INTO wa_itab.

wa_tang-sign = 'I'.

wa_tang-option = 'EQ'.

wa_tang-low = wa_itab-bsart.

APPEND wa_tang TO r_tang.

ENDLOOP.

Read only

Former Member
0 Likes
1,227

Hi

Define a TABLE TYPE either in your program or in the data dictionary and then use that for reference.

Cheers

VJ

Read only

Former Member
0 Likes
1,226

Types : BEGIN OF tang,

sign(1) TYPE c,

option(2) TYPE c,

low TYPE ekko-bsart,

high TYPE ekko-bsart,

END OF tang.

data : r_tang type standard table of tang with header line.

You can avoid header line part if you are creatign work area explictly (like wa_tang).

Regds,

M

Read only

Former Member
0 Likes
1,226

Hi chinmay,

You can declare liek below forst dclare types.


<b>Types : BEGIN OF tp_tang,
           sign(1) TYPE c,
           option(2) TYPE c,
           low TYPE ekko-bsart,
           high TYPE ekko-bsart,
         END OF tp_tang.

data : r_tang type standard table of tp_tang,
       wa_tang type tp_tang.</b>

It doesnt effect ur functionality.

Thanks&Regards,

Siri

Message was edited by: Srilatha T

Read only

Former Member
0 Likes
1,226

Hi chinmay,

1. Simple.

2. data : wa_tang like table of <b>BSART_RAN</b> with header line.

regards,

amit m.

Read only

suresh_datti
Active Contributor
0 Likes
1,226

HI,

You can use the following..


types: BEGIN OF types typ_tang,
sign(1) TYPE c,
option(2) TYPE c,
low TYPE ekko-bsart,
high TYPE ekko-bsart,
END OF typ_tang.
data t_tang tpe table of typ_rang initial size 0.
data wa_tang type typ_tang.
...

regards,

Suresh Datti

Read only

Former Member
0 Likes
1,226

Hi,

try this../.

<b>
types: BEGIN OF r_tang ,
sign(1) TYPE c,
option(2) TYPE c,
low TYPE ekko-bsart,
high TYPE ekko-bsart,
END OF r_tang.</b>

<b>data: it_tang type table of r_tang

DATA: wa_tang type r_tang.</b>

and data appending as follows:
LOOP AT itab INTO wa_itab.
wa_tang-sign = 'I'.
wa_tang-option = 'EQ'.
wa_tang-low = wa_itab-bsart.

<b>APPEND wa_tang TO it_tang.</b>
ENDLOOP.

Regards

vijay

Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,226

types: BEGIN OF typ_tang ,

sign(1) TYPE c,

option(2) TYPE c,

low TYPE ekko-bsart,

high TYPE ekko-bsart,

END OF r_tang.

DATA: r_tang type table of typ_tang,

wa_tang LIKE line of r_tang.