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

insert into ZTAB

Former Member
0 Likes
802

itab werks char 8

lgort char 8

lgobe char 8

select werks lgort lgobe

from T001L

into corresponding fields of itab.

endselect.

how i can insert the data from T001L

werks is 4

lgort 4

lgobe 16

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
768

HI Rani,

Declare like this:

data: begin of itab occurs 0,

werks like t001l-werks,

lgort like t001l-lgort,

lgobe like t001l-lgobe,

end of itab.

select werks lgort lgobe

from T001L

into table itab.

REgards,

Ravi

6 REPLIES 6
Read only

Former Member
0 Likes
769

HI Rani,

Declare like this:

data: begin of itab occurs 0,

werks like t001l-werks,

lgort like t001l-lgort,

lgobe like t001l-lgobe,

end of itab.

select werks lgort lgobe

from T001L

into table itab.

REgards,

Ravi

Read only

0 Likes
768

i cant i must it to be char 8

Read only

0 Likes
768

Hi

SELECT WERKS LGORT LGOBE FROM T001L INTO (ITAB-WERKS, ITAB-LGORT, ITAB-LGOBE) WHERE ........

Anyway the field T001L-LGOBE is long 16 CHAR and so you can't store it in a variable long 8 char

But you can try to do this:

SELECT * FROM T001L WHERE

MOVE: T001L-WERKS TO ITAB-WERKS,

T001L-LGORT TO ITAB-LOGORT,

T001L-LGOBE(8) TO ITAB-LGOBE

Max

Read only

0 Likes
768

Declare another internal table as i have mentioned earlier.

then after that,

data: begin of itab2 occurs 0,

werks like t001l-werks,

lgort like t001l-lgort,

lgobe like t001l-lgobe,

end of itab2.

data: begin of itab occurs 0,

werks(8),

lgort(8),

lgobe(8),

end of itab.

loop at itab2.

move itab2-werks to itab-werks.

move itab2-lgort to itab-lgort.

move itab2-lgobe to itab-lgobe.

append itab.

clear itab.

endloop.

Read only

Former Member
0 Likes
768
data : begin og itab occurs 0,
        werks(8),
        lgort(8),
        lgobe(8),
       end of itab.

select werks lgort lgobe into table itab from T001L.
Read only

naimesh_patel
Active Contributor
0 Likes
768

Hello,

data: begin of itab occurs 0,

WERKS like T001L-WERKS,

LGORT like T001L-LGORT,

LGOBE like T001L-LGOBE,

twerks char 8,

tlgort char 8 ,

tlgobe char 8,

end of itab.

select werks lgort lgobe

from T001L

into corresponding fields of itab.

endselect.

Loop at itab.

itab-twreks = itab-werks.

SHIFT itab-twreks RIGHT DELETING TRAILING space.

itab-tlogbe = itab-logbe+0(8).

modify itab.

endloop.

Regards,

Naimesh