‎2007 Nov 19 4:44 AM
Hi friends,
i have a small problem ... pls any one give the solution...
PONumber Movement
-
-
po100 351
po100 101
po110 351
po120 351
po120 101
po130 351
po140 351
is a table (say ZTAB01)
now i want to retrieve the PONumbers having only 351 movements ( ie., po110, po130 and po140 ) ti an itab and ponumbers of both movements 351 & 101 (ie po100,po120)
How to write the select on this scenario.
advance tanks,
sekhar.
‎2007 Nov 19 4:48 AM
For only 351 movement
SELECT PO
INTO TABLE IT_PO_351
FROM ZTAB
WHERE MOVEMENT = '351'.For both 351 and 101.
SELECT PO
INTO TABLE IT_PO_BOTH
FROM ZTAB
WHERE MOVEMENT IN ('101' , '351').Regards,
Naimesh Patel
‎2007 Nov 19 4:49 AM
loop at itab into wa .
if ( movement = 351 or 101 ) and ( po = 100 or 110 ).
endif.
endloop.
Message was edited by:
Karthikeyan Pandurangan
‎2007 Nov 19 4:50 AM
Hi
Ur select query shud be
Select <PO number>
from ZTAB01
into table itab
where <movement> = '351'.
Select <PO number>
from ZTAB01
into table itab
where <movement> in (351,101).
Thanks
Vasudha
Message was edited by:
Vasudha L
Message was edited by:
Vasudha L
‎2007 Nov 19 4:50 AM
select ponumber from ZTAB01
into corresponding fields of table itab1
where movement eq '351'.
select ponumber from ZTAB01
into corresponding fields of table itab1
where movement in (351, 101) .
‎2007 Nov 19 4:58 AM
Hi Sekhar,
Try this.
types : begin of struct,
po_num type ztab01-ponumber,
end of struct.
data : itab_num1 type standard table of struct with header line,
itab_num2 type standard table of struct with header line,
itab_temp type standard table of struct with header line.
********for the first case.
select ponumber from ztab01
into table itab_num1
where movement = 351.
*************for the second case.
select ponumber from ztab01
into table itab_temp "temporary internal table.
where movement = 101.
now to get ponumbers for the second case do this.
loop at itab_num1.
read table itab_temp with key po_num = itab_num1-po_num.
if sy-subrc = 0.
move itab_temp to itab_num2.
append itab_num2.
clear itab_num2.
endif.
clear itab_temp.
clear itab_num1.
endloop.
I hope this will solve your problem.
Reward points if it helps.