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

sele ction screen

Former Member
0 Likes
679

In Select-options in lower field the first date of the current month and in higher field last date of the current field should be displayed. how we can write code for this?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
654

Hi,

ravi's code will work fine with one small correction

INTIALIZATION.

<b>CONCATENATE sy-datum0(4) '01' sy-datum4(2) INTO v_low.</b>

call function 'LAST_DAY_OF_MONTHS'
exporting DAY_IN = sy-datum
importing LAST_DAY_OF_MONTH = s_date-high.
s_date-sign = 'I'.
s_date-option = 'BT'.
s_date-low = v_low.
APPEND s_date

Hi,

ravi's code will work fine with one small correction

INTIALIZATION.

<b>CONCATENATE sy-datum0(4) '01' sy-datum4(2) INTO v_low.</b>

call function 'LAST_DAY_OF_MONTHS'
exporting DAY_IN = sy-datum
importing LAST_DAY_OF_MONTH = s_date-high.
s_date-sign = 'I'.
s_date-option = 'BT'.
s_date-low = v_low.
APPEND s_date

5 REPLIES 5
Read only

Former Member
0 Likes
654

initialization.

concatenate sy-datum4(4) sy-datum2(2) '01' into s_date-low.

call function 'LAST_DAY_OF_MONTHS'

exporting DAY_IN = sy-datum

importing LAST_DAY_OF_MONTH = s_date-high.

s_date-sign = 'I'.

s_date-option = 'BT'.

append s_date.

Read only

Former Member
0 Likes
654

Hi,

In the INITIALIZATION event you can write this.

S_date-low = .1st date of the month (concatenate ..day(01)..month..year )..

s_date-high = last date ,, ,, day (last) month year

s_date-option = EQ.

append s_date.

Regards,

Anji

Read only

rahulkavuri
Active Contributor
0 Likes
654

hi sorry previous one doesnt work as they were lot of code errors in that, check this one, its working perfectly

tables: ekko.

select-options: s_datum for ekko-aedat.

data: temp type int2, firs(2), sec(2).

initialization.

firs = sy-datum+4(2). " this will get present month

temp = firs.

sec = firs + 1. " this will get next month first day

unpack sec to sec.

*concatenate this into a date..

concatenate sy-datum(4) firs '01' into s_datum-low.

concatenate sy-datum(4) sec '01' into s_datum-high.

append s_datum.

Read only

Former Member
0 Likes
655

Hi,

ravi's code will work fine with one small correction

INTIALIZATION.

<b>CONCATENATE sy-datum0(4) '01' sy-datum4(2) INTO v_low.</b>

call function 'LAST_DAY_OF_MONTHS'
exporting DAY_IN = sy-datum
importing LAST_DAY_OF_MONTH = s_date-high.
s_date-sign = 'I'.
s_date-option = 'BT'.
s_date-low = v_low.
APPEND s_date

Read only

Former Member
0 Likes
654

data : dat type d,

dat1 type d.

dat = sy-datum.

dat1 = sy-datum.

dat+6(2) = 01.

dat4(2) = dat4(2) + 1.

dat1+6(2) = 01.

s_test-low = dat1.

s_test-high = dat - 1.

append s_test.

Regards,

Rusidar S