cancel
Showing results for 
Search instead for 
Did you mean: 

Date to Month and Year

Former Member
0 Kudos

Hi Guru's

We have a requirement of taking the input in date/month/year format in the DSO and the output to be displayed in the report is in month/year in the report.

We dont want to do any changes/modification in the DSO level.

Any ideas on how to do it.

Thanks

Krishna

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member181964
Active Contributor
0 Kudos

Hi,

Using the following code you can do it, but in columns you want to display the month, it is mot possible, i.e. JAN-08, FEB-08 like that it is not possible without adding new InfoObject in DSO. It works for Text variables.

'ZDATE_U' = Normal Variable for Calday user entry.

'ZMONTH_E'. = Customet Exit for Calmonth

when 'ZMONTH_E'.

DATA: zdtt(8) TYPE c,

w_mnth(3) TYPE c.

LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZDATE_U'.

CLEAR l_s_range.

w_day = loc_var_range-low+6(2).

w_mon = loc_var_range-low+4(2).

w_year = loc_var_range-low+0(4).

CASE w_mon.

WHEN '01'.

w_mnth = 'JAN'.

WHEN '02'.

w_mnth = 'FEB'.

WHEN '03'.

w_mnth = 'MAR'.

WHEN '04'.

w_mnth = 'APR'.

WHEN '05'.

w_mnth = 'MAY'.

WHEN '06'.

w_mnth = 'JUN'.

WHEN '07'.

w_mnth = 'JUL'.

WHEN '08'.

w_mnth = 'AUG'.

WHEN '09'.

w_mnth = 'SEP'.

WHEN '10'.

w_mnth = 'OCT'.

WHEN '11'.

w_mnth = 'NOV'.

WHEN '12'.

w_mnth = 'DEC'.

ENDCASE.

  • CONCATENATE w_day '-' w_mnth '-' w_year INTO zdtt.

  • CONCATENATE w_mnth '-' w_year INTO zdtt.

CONCATENATE w_mnth '-' w_year+2(2) INTO zdtt.

l_s_range-low = zdtt.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

APPEND l_s_range TO e_t_range.

ENDLOOP.

Thanks

Reddy

Former Member
0 Kudos

hello,

u can try to use some functions in CKF which can trim the first 3 chars of date.

or u can set offsets in variable on date, in the query to give value, from 4 onwards.this may just dispaly mm/yyyy.

Regards,

Dhanya