Application Development 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: 

Some help with sm30 table.

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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 .

13 REPLIES 13

Former Member
0 Kudos

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

0 Kudos

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...

0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

first break the Join and check .

regards

Prabhu

Former Member
0 Kudos

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 .

0 Kudos

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...

0 Kudos

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

0 Kudos

OK but my itab don't fill with data and this is stange.

0 Kudos

Try this

CHANGE YOUR INSERT STATEMENT TO

INSERT ZPLATFORM FROM TABLE WA_ZPLATFORM.

Regards,

Ravi

0 Kudos

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

0 Kudos

<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.

0 Kudos

Somebody know how to refresh sm30 table???