Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem in using for all entries

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.

Tags:
replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question