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: 

Problem in using for all entries

Former Member
0 Kudos

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

former_member188685
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hai Mukesh

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

check it and try again

Thanks & regards

Sreeni

Former Member
0 Kudos

Hi Mukesh,

u should specify a different internal table in the addition

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

Former Member
0 Kudos

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

0 Kudos

send me solution not my problem

0 Kudos

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>

Former Member
0 Kudos

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

former_member188685
Active Contributor
0 Kudos

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