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

Problem in using for all entries

Former Member
0 Likes
885

Hi,

I am populating one field of an internal table for all entries existing in that internal table.That field is getting populated but rest of the fields changed to its default values.

Please check the code

SELECT amatnr awerk almenge01 almenge02 almenge03 almenge04 almenge05 almenge06 a~lmenge07

almenge08 aprueflos aart acharg bvcode bvdatum

INTO CORRESPONDING FIELDS OF TABLE i_out

FROM qals AS a INNER JOIN qave AS b

ON aprueflos = bprueflos

WHERE a~matnr IN s_matnr

AND a~werk IN s_werk

AND a~art IN s_art

  • AND a~stat33 = 'X'

AND b~vcodegrp IN s_vcdgrp

AND b~vcode IN s_vcode

AND b~vdatum IN s_vdatum.

I am getting error here i_out is getting populated in teh first select statement

SELECT mncod

INTO CORRESPONDING FIELDS OF TABLE i_out

FROM qmsm

FOR ALL ENTRIES IN i_out

WHERE qmnum = i_out-qmnum.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
839

Try changing your query in the following way....


SELECT a~matnr a~werk a~lmenge01 a~lmenge02 a~lmenge03 a~lmenge04
a~lmenge05 a~lmenge06 a~lmenge07
a~lmenge08 a~prueflos a~art a~charg b~vcode b~vdatum
<b>c~mncod</b>
FROM qals AS a INNER JOIN qave AS b
ON a~prueflos = b~prueflos
<b>join qmsm as c
ON a~prueflos = c~qmnum</b>
INTO CORRESPONDING FIELDS OF TABLE i_out
WHERE a~matnr IN s_matnr
AND a~werk IN s_werk
AND a~art IN s_art
* AND a~stat33 = 'X'
AND b~vcodegrp IN s_vcdgrp
AND b~vcode IN s_vcode
AND b~vdatum IN s_vdatum.

with the above you can do the two steps only once .

you need not to go for for all entries .

Regards

vijay

7 REPLIES 7
Read only

Former Member
0 Likes
839

Hai Mukesh

qmnum field not declared/Select in i_out at the above select query

check it and try again

Thanks & regards

Sreeni

Read only

Former Member
0 Likes
839

Hi Mukesh,

u should specify a different internal table in the addition

"INTO CORRESPONDING FIELDS OF TABLE <b>i_out</b>"

Read only

Former Member
0 Likes
839

SELECT mncod

INTO CORRESPONDING FIELDS OF TABLE <b>i_out</b>---->wrong

FROM qmsm

FOR ALL ENTRIES IN i_out

WHERE qmnum = i_out-qmnum.

how u can select into same table for all entries of same table....

Read only

0 Likes
839

send me solution not my problem

Read only

0 Likes
839

declare internal table i_out1 same as i_out.

SELECT amatnr awerk almenge01 almenge02 almenge03 almenge04 almenge05 almenge06 a~lmenge07

almenge08 aprueflos aart acharg bvcode bvdatum

INTO CORRESPONDING FIELDS OF TABLE i_out

FROM qals AS a INNER JOIN qave AS b

ON aprueflos = bprueflos

WHERE a~matnr IN s_matnr

AND a~werk IN s_werk

AND a~art IN s_art

  • AND a~stat33 = 'X'

AND b~vcodegrp IN s_vcdgrp

AND b~vcode IN s_vcode

AND b~vdatum IN s_vdatum.

<b>i_out1[] = i_out[].

SELECT mncod

INTO CORRESPONDING FIELDS OF TABLE i_out1

FROM qmsm

FOR ALL ENTRIES IN i_out

WHERE qmnum = i_out-qmnum.</b>

Read only

Former Member
0 Likes
839

Hi Mukesh,

In your first internal table <b>i_out</b> there is no field seleced <b>qmnum[/b, but you used for all entries while selecting data from <b>qmsm</b> table with WHERE clause WHERE qmnum = i_out-qmnum.

select qmnum field and put it into i_out internal table.

I hope it helps you, if the same please reward points

Regards

Prabhu

Read only

Former Member
0 Likes
840

Try changing your query in the following way....


SELECT a~matnr a~werk a~lmenge01 a~lmenge02 a~lmenge03 a~lmenge04
a~lmenge05 a~lmenge06 a~lmenge07
a~lmenge08 a~prueflos a~art a~charg b~vcode b~vdatum
<b>c~mncod</b>
FROM qals AS a INNER JOIN qave AS b
ON a~prueflos = b~prueflos
<b>join qmsm as c
ON a~prueflos = c~qmnum</b>
INTO CORRESPONDING FIELDS OF TABLE i_out
WHERE a~matnr IN s_matnr
AND a~werk IN s_werk
AND a~art IN s_art
* AND a~stat33 = 'X'
AND b~vcodegrp IN s_vcdgrp
AND b~vcode IN s_vcode
AND b~vdatum IN s_vdatum.

with the above you can do the two steps only once .

you need not to go for for all entries .

Regards

vijay