‎2006 Jul 09 2:08 PM
this work
SELECT SINGLE SUM( mzubb )
SUM( magbb )
FROM s033
INTO (z_mzubb , z_magbb )
WHERE werks = <ls_mard>-werks
AND lgort = <ls_mard>-lgort
AND matnr = <ls_mard>-matnr
AND sptag BETWEEN date and date_e.
<b>and this dont work in the same prog
i mean i dont have data in is033 (in se16 i get value)</b>
SELECT mblnr
sptag
matnr
lgort
werks
mzubb
magbb
FROM s033
INTO CORRESPONDING FIELDS OF TABLE is033
WHERE werks = <ls_mard>-werks
AND lgort = <ls_mard>-lgort
AND matnr = <ls_mard>-matnr
AND sptag BETWEEN date and date_e.
‎2006 Jul 09 2:16 PM
Try the GROUP BY CLAUSE addition
SELECT SINGLE SUM( mzubb )
SUM( magbb )
FROM s033
INTO (z_mzubb , z_magbb )
WHERE werks = <ls_mard>-werks
AND lgort = <ls_mard>-lgort
AND matnr = <ls_mard>-matnr
AND sptag BETWEEN date and date_e
<b>GROUP BY WERKS LGORT MATNR </b>.
Regards,
Ravi
‎2006 Jul 09 2:16 PM
Use second select statement to have <b>sptag</b> in internal table for your further processing.
Regds
Manohar
‎2006 Jul 09 2:16 PM
Try the GROUP BY CLAUSE addition
SELECT SINGLE SUM( mzubb )
SUM( magbb )
FROM s033
INTO (z_mzubb , z_magbb )
WHERE werks = <ls_mard>-werks
AND lgort = <ls_mard>-lgort
AND matnr = <ls_mard>-matnr
AND sptag BETWEEN date and date_e
<b>GROUP BY WERKS LGORT MATNR </b>.
Regards,
Ravi
‎2006 Jul 09 2:32 PM
Ah but in order to use the group by you would need to have those fields in the select.... (SQL 1/1) and using select single would then still limit you to the first row...
‎2006 Jul 09 6:44 PM
You should remove select single. and should added by group clause of the fields you have added in your select query.