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

problem in code

Former Member
0 Likes
1,229

Hi experts,

See the following code.

TYPES: BEGIN OF TY_S_SENDERLINE,

LINE(4096) TYPE C,

END OF TY_S_SENDERLINE,

TY_T_SENDER TYPE TY_S_SENDERLINE OCCURS 0

DATA: EXCEL_TAB1 TYPE ty_t_sender.

So here i want to create work area for EXCEL_TAB1..

How can i create?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,061

I guess this is what you are expecting:

TYPES: BEGIN OF TY_S_SENDERLINE,
         LINE(4096) TYPE C,
       END OF TY_S_SENDERLINE.
DATA: TY_T_SENDER TYPE STANDARD TABLE OF TY_S_SENDERLINE.
DATA: EXCEL_TAB1 TYPE ty_S_senderLINE.

Here TY_T_SENDER is Internal table and EXCEL_TAB1 is work area

Kind Regards

Eswar

9 REPLIES 9
Read only

Former Member
0 Likes
1,061

DATA: EXCEL_TAB1 TYPE line of ty_t_sender.

santhosh

Read only

Former Member
0 Likes
1,062

I guess this is what you are expecting:

TYPES: BEGIN OF TY_S_SENDERLINE,
         LINE(4096) TYPE C,
       END OF TY_S_SENDERLINE.
DATA: TY_T_SENDER TYPE STANDARD TABLE OF TY_S_SENDERLINE.
DATA: EXCEL_TAB1 TYPE ty_S_senderLINE.

Here TY_T_SENDER is Internal table and EXCEL_TAB1 is work area

Kind Regards

Eswar

Read only

0 Likes
1,061

Hi All,

Thanks.

Read only

0 Likes
1,061

Each time, I use internal tables in my code and need the according workarea, I code the following:


* definition of internal table ITAB
DATA: itab TYPE tabletype.


* definition of workarea for ITAB
DATA: wa LIKE LINE OF itab.

Read only

0 Likes
1,061

So how can i make loop for EXCEL_TAB1?

Read only

0 Likes
1,061

You have to define a workarea, the LOOP statement then puts all records of EXCEL_TAB1 into the workarea in a sequence.


LOOP AT excel_tab1 INTO <your_workarea>.
* do what you want to do with >your_workarea>
ENDLOOP.

Read only

Former Member
0 Likes
1,061

Hi code like below,

TYPES: BEGIN OF TY_S_SENDERLINE,

LINE(4096) TYPE C,

END OF TY_S_SENDERLINE,

data:TY_T_SENDER TYPE TY_S_SENDERLINE OCCURS 0."internal table

*DATA: EXCEL_TAB1 TYPE TY_S_SENDERLINE." work area

data: wa_EXCEL_TAB1 type TY_S_SENDERLINE." work area

Regs

Manas Ranjan Panda

Read only

gopi_narendra
Active Contributor
0 Likes
1,061

data : excel_tab2 type standard table of ty_s_senderline. is the internal table

data : excel_tab1 type ty_s_senderline. is the work area

Regards

- Gopi

Read only

Former Member
0 Likes
1,061

hi

good

Write like this

data: EXCEL_TAB1 like TY_S_SENDERLINE.

thanks

mrutyun^