Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

help needed

Former Member
0 Likes
755

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
712

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.

7 REPLIES 7
Read only

Former Member
0 Likes
712

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

Read only

Former Member
0 Likes
713

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.

Read only

0 Likes
712

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.

Read only

0 Likes
712

thankx friens,

siri

Read only

0 Likes
712

hi

plz close the thread if your question has been answered..

Thanks,

Abdul Hakim

Read only

abdul_hakim
Active Contributor
0 Likes
712

Hi

Use SELECT COUNT(*) variant for achiving your o/p..

Cheers,

Abdul Hakim

Read only

Former Member
0 Likes
712

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.