‎2006 Aug 29 7:36 PM
hi experts,
plz help me how to code for the below given description.
items counted:
count the entries using the selection from LAGP where LAGP-IDATU >= start date, LAGP-IDATU <= finish date, LINV-LGNUM=LAGP-LGNUM and LINV-LGTYP=LAGP-LGTYP (for all selected storage types).
regards,
siri.
‎2006 Aug 29 7:40 PM
data: i_lagp type standard table of lagp,
data: ws_count type i.
select * from lagp into i_lagp
for all entries in i_storage
where LGNUM = i_storage-LGNUM
idatu >= start_date and idatu <= finish_date.
describe table i_lagp lines ws_count.
Regards,
Prakash.
‎2006 Aug 29 7:38 PM
DATA: L_CNT TYPE I,
L_START_DATE LIKE LAGP-IDATU,
L_END_DATE LIKE LAGP-IDATU.
SELECT COUNT( * ) INTO L_CNT
FROM LAGP WHERE LGNUM = LINV-LGNUM
AND LGTYP = LINV-LGTYP
AND IDATU >= L_START_DATE
AND IDATU <= L_END_DATE
‎2006 Aug 29 7:40 PM
data: i_lagp type standard table of lagp,
data: ws_count type i.
select * from lagp into i_lagp
for all entries in i_storage
where LGNUM = i_storage-LGNUM
idatu >= start_date and idatu <= finish_date.
describe table i_lagp lines ws_count.
Regards,
Prakash.
‎2006 Aug 29 7:43 PM
If you need the data from LAGP for later use, then use the method proposed by Prakash. If you only want a count then use the aggregate function SELECT COUNT( * ) for performance reasons.
‎2006 Aug 29 7:44 PM
‎2006 Aug 29 7:53 PM
hi
plz close the thread if your question has been answered..
Thanks,
Abdul Hakim
‎2006 Aug 29 7:42 PM
Hi
Use SELECT COUNT(*) variant for achiving your o/p..
Cheers,
Abdul Hakim
‎2006 Aug 29 9:36 PM
I think from the description there is a INNER JOIN on LAGP and LINV that needs to be done..
select a~lgnum into table itab1
from LAGP as a INNER JOIN LINV as b
on algnum = blgnum and
algtyp = blgtyp
where a~idatu >= start_date and
a~idatu <= finish_date.
describe itab1 lines l_lines.