Application Development 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: 

Dates

Former Member
0 Kudos

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

for the select-options.

1 ACCEPTED SOLUTION

anversha_s
Active Contributor
0 Kudos

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

anversha_s
Active Contributor
0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

i wnat to set it to like.

data: d like sy-datum.

select-options : s_date like d.

0 Kudos

hi,

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

rgd

anver

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.