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

select-option: date

Former Member
0 Likes
1,129

Hi abaper's,

I need date (formate 06/2007 ) in select-options. my requirement is

Date (SPMON) Default = Current Month + 1

this is very urgent. please give me any idea...............

--Anji

4 REPLIES 4
Read only

Former Member
0 Likes
599

allow ur user to put only month and year

write select-option: s_date for s111-spmon.

for month + 1.

spmon+(6) = sy-datum.

spmon+4(2) = spmon + 1.

Edited by: saathi s on May 2, 2008 8:47 AM

Read only

Former Member
0 Likes
599

Hi,

Use the below code.

data: v_date(7), v_month(2) type n, v_year(4) type n.

select-options: s_date for v_date.

initialization.

v_month = sy-datum+4(2) + 1.

if sy-datum+4(2) = 12.

v_year = sy-datum+0(4) + 1.

else.

v_year = sy-datum+0(4).

endif.

CONCATENATE v_month '/' v_year into s_date-low.

append s_date.

Read only

peter_ruiz2
Active Contributor
0 Likes
599

hi,

use this code.


Parameter: p_date type mcperiod.

initialization.
  p_date = sy-datum + 1.

Read only

Former Member
0 Likes
599

Hi,

Have a look on the following code,it adds/subtracts the months to current date.

tables: ekko.

select-options: date1 for ekko-aedat.

data: var1 type sy-datum.

load-of-program.

  • This gives the previous month and next month

CALL FUNCTION 'HR_PT_ADD_MONTH_TO_DATE'

EXPORTING

dmm_datin = sy-datum

dmm_count = '1'

dmm_oper = '-' " Operation (add/subtract)

dmm_pos = 'B' " Set date in the beginning or end of month

IMPORTING

DMM_DAOUT = VAR1

EXCEPTIONS

UNKNOWN = 1

OTHERS = 2.

write:/ sy-datum.

write:/ var1.

initialization.

date1-low = var1.

date1-high = sy-datum.

append date1.

Reward,if useful.

Thanks,

Chandu