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

Some help with sm30 table.

Former Member
0 Likes
1,391

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
Read only

Former Member
0 Likes
1,336

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
Read only

Former Member
0 Likes
1,336

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

Read only

0 Likes
1,336

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

Read only

0 Likes
1,336

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.

Read only

0 Likes
1,336

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

Read only

Former Member
0 Likes
1,336

first break the Join and check .

regards

Prabhu

Read only

Former Member
0 Likes
1,337

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 .

Read only

0 Likes
1,336

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

Read only

0 Likes
1,336

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

Read only

0 Likes
1,336

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

Read only

0 Likes
1,336

Try this

CHANGE YOUR INSERT STATEMENT TO

INSERT ZPLATFORM FROM TABLE WA_ZPLATFORM.

Regards,

Ravi

Read only

0 Likes
1,336

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

Read only

0 Likes
1,336

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

Read only

0 Likes
1,336

Somebody know how to refresh sm30 table???