‎2007 Feb 22 2:29 PM
Hello Friends ,
I am tryin to copy a table of 12 fields with a MANDT primary key field in the table . Here is the code below . But it is not getting any data from the table to the internal table . Please advise .
REPORT Ztest.
tables: Ztab.
DATA: t_itab TYPE TABLE OF Ztab with header line.
data: lindex like sy-tabix.
start-of-selection.
SELECT * FROM Ztab
INTO corresponding fields of TABLE t_zyms .
IF NOT t_itab[] IS INITIAL.
insert Ztab FROM table t_itab.
ENDIF.
end-of-selection.
‎2007 Feb 22 2:34 PM
Hello,
REPORT Ztest.
tables: Ztab.
DATA: t_itab TYPE TABLE OF Ztab with header line.
data: lindex like sy-tabix.
start-of-selection.
SELECT * FROM Ztab
INTO corresponding fields of TABLE <u><b><i>t_itab</i></b></u> .
IF NOT t_itab[] IS INITIAL.
insert Ztab FROM table t_itab.
ENDIF.Vasanth
‎2007 Feb 22 2:31 PM
Check your table name ins elect query.
SELECT * FROM Ztab
INTO corresponding fields of TABLE <b>t_zyms</b> .
I think it should be t_itab.
Regards,
amit
Reward all helpful replies.
‎2007 Feb 22 2:32 PM
start-of-selection.
SELECT * FROM Ztab
INTO corresponding fields of TABLE <b>t_itab</b> .
‎2007 Feb 22 2:34 PM
Hello,
REPORT Ztest.
tables: Ztab.
DATA: t_itab TYPE TABLE OF Ztab with header line.
data: lindex like sy-tabix.
start-of-selection.
SELECT * FROM Ztab
INTO corresponding fields of TABLE <u><b><i>t_itab</i></b></u> .
IF NOT t_itab[] IS INITIAL.
insert Ztab FROM table t_itab.
ENDIF.Vasanth
‎2007 Feb 22 2:34 PM
REPORT Ztest.
tables: Ztab.
DATA: t_itab TYPE TABLE OF Ztab with header line.
data: lindex like sy-tabix.
start-of-selection.
SELECT * FROM Ztab
INTO corresponding fields of TABLE<b> t_itab</b> .
IF NOT t_itab[] IS INITIAL.
insert Ztab FROM table t_itab.
ENDIF.
end-of-selection.
Hppe this solves.
‎2007 Feb 22 2:35 PM
Table t_itab is of type Ztab and not t_zyms .
You need to change the table name in the query to t_itab .
Regards,
Saumya
‎2007 Feb 22 3:37 PM
sorry i mispelt that it is t_itab . But still not working . Please advise
‎2007 Feb 22 3:46 PM
Hi,
check the table for entries. check the code in debug mode adn try to change ur select statement to know where its goign wrong!
regards,
madhu
‎2007 Feb 22 3:43 PM
try to READ the contents and then insert.
have u checked in debugging. do u geetting value to internal table.
‎2007 Feb 22 3:50 PM
I am not getting any value in the internal table. I am runnin in debug mode and there is not value in internal table after the select query is executed in the debug mode.
I tried the code with other tables which did not have MANDT field as primary key and it worked .
Please advise
‎2007 Feb 22 3:57 PM
Thank you folks i think i was using the wrong table name My bad
I will reward poiints
‎2007 Feb 22 4:23 PM
Hi,
Can you please explain what are you trying to achieve from the below code??? you are fetching data from table Ztab and same data you are again trying to insert into Ztab.... this will definitely not happen.....
Data fetching you can do with the below code:
REPORT Ztest.
tables: Ztab.
DATA: t_itab TYPE TABLE OF Ztab with header line.
data: lindex like sy-tabix.
start-of-selection.
SELECT * FROM Ztab INTO TABLE t_itab .
IF NOT t_itab[] IS INITIAL.
insert <table> FROM table t_itab.
ENDIF.
end-of-selection.