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

Question about the code

Former Member
0 Likes
554

Hi,

I am new to abap. So can any body explain me the below code

data: t_datapak_2000 type standard table of data_package_structure,

t_datapak_2001 type standard table of data_package_structure.

data: s_datapak type data_package_structure.

loop at DATA_PACKAGE into s_datapak.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
531

Is that the code? O_o


data: t_datapak_2000 type standard table of data_package_structure,
"declare a table of structure data_package_structure
t_datapak_2001 type standard table of data_package_structure.
"declare another table with the same structure

data: s_datapak type data_package_structure.
"declase an structure, the same of the above tables

loop at DATA_PACKAGE into s_datapak.
"begins to loop at the contents of table data_package, the into adition is because every line of the table will go into this structure
"so you can use the data in each line, this is known as a work area

4 REPLIES 4
Read only

Former Member
0 Likes
532

Is that the code? O_o


data: t_datapak_2000 type standard table of data_package_structure,
"declare a table of structure data_package_structure
t_datapak_2001 type standard table of data_package_structure.
"declare another table with the same structure

data: s_datapak type data_package_structure.
"declase an structure, the same of the above tables

loop at DATA_PACKAGE into s_datapak.
"begins to loop at the contents of table data_package, the into adition is because every line of the table will go into this structure
"so you can use the data in each line, this is known as a work area

Read only

Former Member
0 Likes
531

data: t_datapak_2000 type standard table of data_package_structure,

t_datapak_2001 type standard table of data_package_structure.

you are creating two internal tables like the structure data_package_structure

data: s_datapak type data_package_structure.

you are creating a work area like the structure data_package_structure

loop at DATA_PACKAGE into s_datapak.

You are passing the header line of the internal table DATA_PACKAGE to the work area s_datapak

Read only

Former Member
0 Likes
531

Hi Amrutha,

This code is creating two internal tables t_datapak_2000 and t_datapak_2001 of type data_package_structure with out header lines.

s_datapak is a structure of type data_package_structure which can be used to as work area when working around about created internal tables.

Looping the internal table DATA_PACKAGE by moving work area into s_datapak for each iteration.

Thanks,

Vinay

Read only

Former Member
0 Likes
531

hi,


data: t_datapak_2000 type standard table of data_package_structure, 
"---> Internal table declaration of  type data_package_structure
t_datapak_2001 type standard table of data_package_structure.
"---> Internal table declaration of  type data_package_structure

data: s_datapak type data_package_structure.
"---> Work area declaration of  type data_package_structure