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

intenal table problem

Nawanandana
Active Contributor
0 Likes
604

hi all

DATA: BEGIN OF IT_ITAB,

kk like MSEG-dmbtr,

gg like MSKA-kalab,

dd like VBRK-netwr,

END OF IT_ITAB,

supoose that i have internal table like that (IT_ITAB )it has KK, GG and DD variable....so i want to run that internal table another month that mean same intenal table run two manth and get the data in to one internal table. so tel me how should i do it.? when i excute the program i want to run same internal table separatly and get the data only one internal table

regard

nawa

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
569

Hi,

Your question is not very Clear..

DATA: BEGIN OF IT_ITAB occurs 0,

kk like MSEG-dmbtr,

gg like MSKA-kalab,

dd like VBRK-netwr,

END OF IT_ITAB,

DATA: BEGIN OF IT_ITAB1 occurs 0,

kk like MSEG-dmbtr,

gg like MSKA-kalab,

dd like VBRK-netwr,

END OF IT_ITAB1,

Process IT_TAB --

Process IT_TAB1 --

APPEND LINES OF IT_TAB1 to IT_TAB.

Another solution : - if you want both the data in a Single table but still be able to distinguish then add another field

DATA: BEGIN OF IT_ITAB1 occurs 0,

TABL(1),

kk like MSEG-dmbtr,

gg like MSKA-kalab,

dd like VBRK-netwr,

END OF IT_ITAB1,

When you are filling the data in this table fill the field TABL with the Value '1' or "2"

when you want to process use

loop at it_tab1 where TABLE = '1'.

endloop.

loop at it_tab1 where TABLE = '2'.

endloop.

Hope this answers your question...

if so Kindly reward points ...

Regards,

Gaurav

4 REPLIES 4
Read only

Former Member
0 Likes
570

Hi,

Your question is not very Clear..

DATA: BEGIN OF IT_ITAB occurs 0,

kk like MSEG-dmbtr,

gg like MSKA-kalab,

dd like VBRK-netwr,

END OF IT_ITAB,

DATA: BEGIN OF IT_ITAB1 occurs 0,

kk like MSEG-dmbtr,

gg like MSKA-kalab,

dd like VBRK-netwr,

END OF IT_ITAB1,

Process IT_TAB --

Process IT_TAB1 --

APPEND LINES OF IT_TAB1 to IT_TAB.

Another solution : - if you want both the data in a Single table but still be able to distinguish then add another field

DATA: BEGIN OF IT_ITAB1 occurs 0,

TABL(1),

kk like MSEG-dmbtr,

gg like MSKA-kalab,

dd like VBRK-netwr,

END OF IT_ITAB1,

When you are filling the data in this table fill the field TABL with the Value '1' or "2"

when you want to process use

loop at it_tab1 where TABLE = '1'.

endloop.

loop at it_tab1 where TABLE = '2'.

endloop.

Hope this answers your question...

if so Kindly reward points ...

Regards,

Gaurav

Read only

Former Member
0 Likes
569

Hi

You can use the same Internal table any number of times.

first fetch data and move that data into another internal tables

Then REFRESH and CLEAR the Internal table and again use it and populate data into it. and again move this data to another ITAb and again clear and REFRESH it and use.

Reward points if useful

Regards

Anji

Read only

Former Member
0 Likes
569

hi,

DATA: BEGIN OF IT_ITAB,

kk like MSEG-dmbtr,

gg like MSKA-kalab,

dd like VBRK-netwr,

END OF IT_ITAB.

data : it_tab1 like it_tab with header line.

first get the data in it_itab and move them to it_tab1.refresh and clear it_itab and again get it in it_itab and move to it_itab1,then u will get all of ur data into it_itab1.

Read only

Former Member
0 Likes
569

HI,

If you want the data for each month in columns

kk/01 | gg/01 | dd/01 | kk/02 | gg/02 | dd/02

You need to construct a dynamic internal table. Refer

<a href="http://www.sap-img.com/ab030.htm">http://www.sap-img.com/ab030.htm</a>

Or else You can append any number of months record into the same internal table.

Regards

Rusidar