‎2010 Jun 29 12:24 PM
Hi ALL,
SELECT mast~matnr
INTO gw_mat-matnr
FROM mast
INNER JOIN stko
ON maststlnr = stkostlnr
AND maststlal = stkostlal
UP TO 1 ROWS
WHERE mast~matnr = gw_mat-matnr
AND mast~werks = gw_mat-werks
AND ( maststlan = 'Y' or maststlan = '1')
AND stko~stlty = 'M'
AND stko~loekz = space.
Now this query is fetching only one row . In table MAST 2 rows are there for the field mast-stlan (i.e) for 'Y' AND '1'. So more than one rows has to be filled in gw_mat-matnr that is my requirement without using inernal table. Because gw_mat-matnr is used in many places and also this is a standard program. please suggest me to proceed.
Regards
R.vijay
‎2010 Jun 29 12:39 PM
In the select query, when you use UP TO 1 ROWS, only one row will be fetched. Thats the reason. Also gw_mat looks like a work area and not a internal table. I dont understand how you can expect two records to be fetched into a work area or a structure.
‎2010 Jun 29 1:38 PM
Dear
you have used UP TO 1 ROWS...which means it will selet only one row as you mentioned 1..
Please remove that stmt and check...
‎2010 Jun 29 3:41 PM
As you can see from the replies, this is very basic, please try solving things yourself before asking, the learning curve will be much steeper.
For problems with SAP standard code visit the SAP Support Portal.
Thread locked.
Thomas