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

Display date horizontally adnd dynamically increase

Former Member
0 Kudos
444

Hi friends,

I have one issue. Avtually i have a

SELECT-OPTION: Date FOR j_1iexchdr.

we shall give 01.02.1010 TO 10.02.2010.

The date should be printed horizontally at output.

like :

transporter name 01.02.2010 02.02.2010 03.02.2010 04.02.2010 ................................10.02.2010

These date should be dynamically increased corresponding to input of date.

Regards,

Swapnika

Edited by: Swapnika Panse on Feb 19, 2010 6:17 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Kudos
407

Hi Swapnika,

I think you can use a WHILE loop for this as follows:

data: v_date type sy-datum.

v_date = sel_option-low.

while v_date <= sel_option-high.

write: v_date.

v_date = v_date + 1. "will increment date correctly

endwhile.

Hope this helps! Please revert if you need anything else.

Cheers,

Shailesh.

Always provide feedback for helpful answers

6 REPLIES 6
Read only

Former Member
0 Kudos
407

hi,

Write your date without the next line in the loop.


loop
write : v_date.
endloop.

regards

Ritesh

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Kudos
407

Hello,

I think this should work:

DATA:
V_DATE TYPE DATUM,
V_COL TYPE I.

WRITE: S_SATE-LOW.

DO.

V_DATE = S_DATE-LOW + 1.

V_COL = V_COL + 10.

WRITE AT V_COL V_DATE.

IF V_DATE LE S_DATE-HIGH.
EXIT.
ENDIF.

ENDDO.

BR,

Suhas

Read only

Former Member
0 Kudos
408

Hi Swapnika,

I think you can use a WHILE loop for this as follows:

data: v_date type sy-datum.

v_date = sel_option-low.

while v_date <= sel_option-high.

write: v_date.

v_date = v_date + 1. "will increment date correctly

endwhile.

Hope this helps! Please revert if you need anything else.

Cheers,

Shailesh.

Always provide feedback for helpful answers

Read only

Former Member
0 Kudos
407

see the below code for your requirement.

SELECT-OPTIONS: s_date FOR sy-datum.

DATA: gv_date TYPE sy-datum.

gv_date = s_date-low.

WRITE: gv_date.

WHILE gv_date LT s_date-high.

gv_date = gv_date + 1.

WRITE: gv_date.

ENDWHILE.

It will give u the same output as you want.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Kudos
407
WRITE: gv_date.

Infact it will give only one date as output. The remaining dates will be overwritten

Write this code in the editor & try.

Cheers,

Suhas

Read only

0 Kudos
407

Hi ,

You can try the following code fragment.

select-options : so_date for sy-datum.

data: lv_date type sy-datum,

lv_date2(10) type c,

lv_date1 type string.

lv_date = so_date-low.

while lv_date LE so_date-high.

write lv_date to lv_date2.

concatenate lv_date1 lv_date2 into lv_date1 separated by space.

call function 'BKK_ADD_WORKINGDAY'

exporting

i_date = lv_date

i_days = 1

importing

e_date = lv_date.

endwhile.

write lv_date1.

Regards,

Kiran