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

Date Range problem

Former Member
0 Likes
817

hi,

on selection screen i am enetring the date range.

i.e 01.05.2006 to 10.05.2006

for this date range i am fetching material numbers to my itab.

actually there is no material numbers for the date range 02.05.2006 to 03.05.2006 but i nedd to display material number under that particular date only like below.

01.05.2006 02.05.2006 03.05.2006 04.05.2006 05.05.2006

1234 1567 4562

but for me output is coming like below.

01.05.2006 02.05.2006 03.05.2006 04.05.2006 05.05.2006

1234 1567 4562

how to solve this problem

Title edited by: Alvaro Tejada Galindo on Jun 3, 2008 3:43 PM

9 REPLIES 9
Read only

Former Member
0 Likes
797

Use UNDER .

SELECT-OPTIONS: s_date FOR mara-ersda.

DATA: BEGIN OF it_mara OCCURS 0,

matnr LIKE mara-matnr,

ERSDA LIKE mara-ERSDA,

END OF it_mara.

SELECT matnr ersda FROM mara INTO TABLE it_mara

WHERE ersda IN s_date.

LOOP AT it_mara.

WRITE: it_mara-ERSDA.

write:/ it_mara-matnr UNDER IT_MARA-ERSDA.

ENDLOOP.

Regards,

Jagadish

Read only

Former Member
0 Likes
797

HI.

r u getting out put by classical report(used by write statement)?

If yes means ,try to follow this code.

DATA: carrid TYPE spfli-carrid,

connid TYPE spfli-connid.

WRITE: 10 'Carrier', 40 'Connection'.

ULINE.

SELECT carrid connid

FROM spfli

INTO (carrid,connid).

WRITE: / carrid UNDER 'Carrier',

connid UNDER 'Connection'.

ENDSELECT

Reward all helpfull answers.

Regards.

Jay

Read only

Former Member
0 Likes
797

"Think"...

Why didn't you think and try to use a more meaningful thread subject?!

Read only

Former Member
0 Likes
797

Hi,

I don't quite get your question. You want to display material number under that particular date only like below but your output is coming out the same as you wanted ? Lolz, please correct me if i'm wrong. I don't see any differences between the way you want it to display with the output going to u..

Your statements :-

"02.05.2006 to 03.05.2006 but i nedd to display material number under that particular date only like below.

01.05.2006 02.05.2006 03.05.2006 04.05.2006 05.05.2006

1234 1567 4562

but for me output is coming like below.

01.05.2006 02.05.2006 03.05.2006 04.05.2006 05.05.2006

1234 1567 4562"

Regards,

Loo

Read only

0 Likes
797

hi,

01.05.2006 02.05.2006 03.05.2006 04.05.2006 05.05.2006

1234----


1567 4562

but for me output is coming like below.

01.05.2006 02.05.2006 03.05.2006 04.05.2006 05.05.2006

1234 1567 4562"

Read only

0 Likes
797

hi use this..it will works.

write:/ 10 itab-field1,

20 itab-field2,

30 itab-field3,

40 itab-field4 ,

50 itab-field5 .

regards,

venkat.

Read only

Former Member
0 Likes
797

Hi,

i have tried with this code i got the output plz once try with this one.

data: begin of it_mara occurs 0,

matnr like mara-matnr,

ersda like mara-ersda,

end of it_mara.

select-options : s_ersda for mara-ersda default '20010101' to '20010125'.

select matnr ersda from mara into table it_mara where ersda in s_ersda.

sort it_mara by ersda.

loop at it_mara.

write: it_mara-ersda .

write:/ it_mara-matnr under it_mara-ersda.

sy-linno = '3'.

endloop.

in the above program i haven't used top-of-page event so that's why my output start at 3rd line in the list.

so i made sy-linno = 3.

reward if helpful.

Thanks ,

S.gangireddy.

Read only

0 Likes
797

hi,

its ok

but if there is no material numebr for the dates 20010102 to 20010124 then how will display the material numbers for that particular dates.

i.e 20010101----


20010125

1234 -


5678

Read only

0 Likes
797

REPORT zp_example NO STANDARD PAGE HEADING LINE-SIZE 300.

TABLES : mara.

SELECT-OPTIONS : s_date FOR sy-datum.

DATA : it_mara TYPE TABLE OF mara WITH HEADER LINE,

date LIKE sy-datum,

m type i value 1.

WHILE ( s_date-low LE s_date-high ).

WRITE : s_date-low.

SELECT * FROM mara INTO it_mara WHERE ersda = s_date-LOW.

WRITE 😕 IT_MARA-MATNR UNDER S_DATE-LOW .

ENDSELECT.

ADD 1 TO s_date-low.

sy-linno = 1. " <----- check the number according to your page heading

ENDWHILE.