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

Dates

Former Member
0 Likes
1,241

Develpoe a program how to set month first and last date by default

for the select-options.

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
1,209

hi,

check this sample code...


tables: mkpf.

data date like sy-datum.
data date1 like sy-datum.
select-options: s_date for mkpf-budat.
initialization.

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum              " ---> input
IMPORTING
EV_MONTH_BEGIN_DATE = date      " ---> begin date
EV_MONTH_END_DATE = date1       " ---> enddate
.
s_date-option = 'EQ'.
s_date-sign = 'I'.
s_date-low = date.
s_date-high = date1.

append s_date.

rgds

Anver

12 REPLIES 12
Read only

anversha_s
Active Contributor
0 Likes
1,210

hi,

check this sample code...


tables: mkpf.

data date like sy-datum.
data date1 like sy-datum.
select-options: s_date for mkpf-budat.
initialization.

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum              " ---> input
IMPORTING
EV_MONTH_BEGIN_DATE = date      " ---> begin date
EV_MONTH_END_DATE = date1       " ---> enddate
.
s_date-option = 'EQ'.
s_date-sign = 'I'.
s_date-low = date.
s_date-high = date1.

append s_date.

rgds

Anver

Read only

0 Likes
1,209

sorry use this fm.

data:f_date type sy-datum,

l_date type sydatum.

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'

EXPORTING

iv_date = sy-datum

IMPORTING

EV_MONTH_BEGIN_DATE = f_date

EV_MONTH_END_DATE = l_date.

write:/ f_date,

/ l_date.

kishan negi

Read only

0 Likes
1,209

without using any predefined table . generally i want pls help to me.

Read only

0 Likes
1,209

it is helpful to me what ever u send .thankful to you.

Read only

0 Likes
1,209

Hi Madahv,

with out using any variables it is not possibel.

any way v have to find the end date and begdate.

also need the function module.

and finally we have to append the data to select options.

so for all these v need the variable.

chk my code. it is using minimum variable.

u can folllw that. no prblem at all.

Rgds

Anver

if hlped pls mark points

Read only

0 Likes
1,209

You are using mkpf_budat .without using that one .i want generally.

Read only

0 Likes
1,209

i wnat to set it to like.

data: d like sy-datum.

select-options : s_date like d.

Read only

0 Likes
1,209

hi,

<b>select-options: s_date for sy-datum.</b>

rgd

anver

Read only

Former Member
0 Likes
1,209

SELECT-OPTIONS: S_DATE FOR SY-DATUM.

INITIALIZATION.

S_DATE-LOW = S_DATE-HIGH = SY-DATUM.

S_DATE-LOW+6(2) = '01'.

CALL FUNCTION 'LAST_DAY_OF_MONTHS'

EXPORTING

day_in = S_DATE-HIGH

IMPORTING

LAST_DAY_OF_MONTH = S_DATE-HIGH

EXCEPTIONS

DAY_IN_NO_DATE = 1

OTHERS = 2

.

APPEND S_DATE.

START-OF-SELECTION.

Read only

Former Member
0 Likes
1,209

Hi,

In the select-options : s_date DEFAULT firstdate TO lastdate ... OPTION op ... SIGN s use this options

Read only

Former Member
0 Likes
1,209

Hi,

Here is the syntax-

select-options s_date for mara-ersda default '1/11/2006' to '30/11/2006'.

Hope this helps.

Regds,

Seema.

Read only

Former Member
0 Likes
1,209

create new program...simply copy this code and pase and activate & execute.....

code:

data: b_date like sy-datum.

data: l_date like sy-datum.

select-options: date for sy-datum.

initialization.

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'

EXPORTING

iv_date = sy-datum

IMPORTING

EV_MONTH_BEGIN_DATE = b_date

EV_MONTH_END_DATE = l_date

.

date-low = b_date.

date-high = l_date.

date-sign = 'I'.

date-option = 'BT'.

append date.

Regards,

Ramesh.