06-28-2006 12:19 PM
Hi
i'm trying to insert some lines into table whice i crated
but always it give me one line although the shipment number have more than one line.
this is the code i write in the screen of the table:
SELECT *
FROM VTTK JOIN vttp ON VTTKTKNUM = vttpTKNUM
JOIN likp ON vttpvbeln = likpvbeln
Join KNA1 ON likpkunnr = KNA1kunnr
INTO CORRESPONDING FIELDS OF Zplatform
WHERE vttk~TKNUM = Zplatform-TKNUM .
endselect.
Zpaltform is the name of the table and the code above give one line.
i even try with internal table but it give me nothing.
i'll be more then happy the get some help here.
thanks.
06-28-2006 12:57 PM
Hi,
Use This
SELECT *
FROM VTTK JOIN vttp ON VTTK~TKNUM = vttp~TKNUM
JOIN likp ON vttp~vbeln = likp~vbeln
Join KNA1 ON likp~kunnr = KNA1~kunnr
INTO CORRESPONDING FIELDS OF TABLE Zplatform
WHERE vttk~TKNUM = Zplatform-TKNUM .
06-28-2006 12:24 PM
Change your SELECt to this
SELECT *
FROM VTTK JOIN vttp ON VTTKTKNUM = vttpTKNUM
JOIN likp ON vttpvbeln = likpvbeln
Join KNA1 ON likpkunnr = KNA1kunnr
INTO CORRESPONDING FIELDS OF Zplatform
WHERE vttk~TKNUM = Zplatform-TKNUM .
<b>append zplatform.</b>
endselect.
OR
SELECT *
FROM VTTK JOIN vttp ON VTTKTKNUM = vttpTKNUM
JOIN likp ON vttpvbeln = likpvbeln
Join KNA1 ON likpkunnr = KNA1kunnr
INTO CORRESPONDING FIELDS OF <b> table </b> Zplatform
WHERE vttk~TKNUM = Zplatform-TKNUM .
Your values are not getting appended to the table.
Regards,
Ravi
06-28-2006 12:48 PM
Well the code you gave me didn't help,
Zplatform is the table i've created in se11 with maintenance (sm30) now when write this one
SELECT *
FROM VTTK JOIN vttp ON VTTKTKNUM = vttpTKNUM
JOIN likp ON vttpvbeln = likpvbeln
Join KNA1 ON likpkunnr = KNA1kunnr
INTO CORRESPONDING FIELDS OF Zplatform
WHERE vttk~TKNUM = Zplatform-TKNUM .
append zplatform.
endselect.
the abap editor tell me that : "TO itab." expected after "ZPLATFORM".
any idea plz...
06-28-2006 12:49 PM
1) u have to select data into internal table.
2) after this insert data into ztable from internal table using insert or modify command.
u cant directly use select statement to insert data into dbtab.
06-28-2006 12:53 PM
Whichever program you are writing this select statement, you will have to declare a internal table like this
DATA ZPLATFORM TYPE TABLE OF ZPLATFORM WITH HEADER LINE.
Then it will NOT give a syntax error.
Regards,
Ravi
06-28-2006 12:30 PM
06-28-2006 12:57 PM
Hi,
Use This
SELECT *
FROM VTTK JOIN vttp ON VTTK~TKNUM = vttp~TKNUM
JOIN likp ON vttp~vbeln = likp~vbeln
Join KNA1 ON likp~kunnr = KNA1~kunnr
INTO CORRESPONDING FIELDS OF TABLE Zplatform
WHERE vttk~TKNUM = Zplatform-TKNUM .
06-28-2006 1:19 PM
well i tryng anything ( or maybe not) and still it's not work.
this is the last code i write :
SELECT *
FROM VTTK JOIN vttp ON VTTKTKNUM = vttpTKNUM
JOIN likp ON vttpvbeln = likpvbeln
Join KNA1 ON likpkunnr = KNA1kunnr
INTO CORRESPONDING FIELDS OF table WA_Zplatform
WHERE vttk~TKNUM = lv_tknum.
INSERT INTO zplatform VALUES WA_Zplatform.
Zplatform is the table i created in se 11.
WA_Zplatform i declare like this:
BEGIN OF wa_Zplatform occurs 0,
wa_Zplatform like Zplatform,
END OF wa_Zplatform.
plz help...
06-28-2006 1:25 PM
Hi,
if you want to store table of values , change the insert statement like this:
Data : WA_Zplatform like Zplatform occurs 0 with header line.
INSERT (dbtabname) FROM TABLE itab.
INSERT zplatform FROM TABLE WA_Zplatform
Laxman
06-28-2006 1:33 PM
06-28-2006 1:33 PM
Try this
CHANGE YOUR INSERT STATEMENT TO
INSERT ZPLATFORM FROM TABLE WA_ZPLATFORM.
Regards,
Ravi
06-28-2006 1:38 PM
This should work.
data: izplatform type table of zplatform.
SELECT * INTO CORRESPONDING FIELDS OF table iZplatform
FROM VTTK
inner JOIN vttp
ON VTTK~TKNUM = vttp~TKNUM
inner JOIN likp
ON vttp~vbeln = likp~vbeln
inner Join KNA1
ON likp~kunnr = KNA1~kunnr
WHERE vttk~TKNUM = lv_tknum.
loop at izplatform.
insert zplatform from izplatform.
endloop.
Regards,
Rich Heilman
06-28-2006 3:38 PM
<b>Rich Heilman</b> your post was very helpful.
one litttle thing is how can i refersh the sm 30 table
so after i type shipment number and then enter the records that was added in the background will be visible to the user.
no after i use the code of Rich Heilman the records are visible just if i exit the sm 30 and enter again.
thanks very much.
06-29-2006 6:35 AM