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

Date format

Former Member
0 Likes
1,501

Hi,

How can I dispaly the date in this format DD.MM.YYYY, using the following

CONCATENATE 'The period' s_budat-low 'to' s_budat-high

INTO v_head SEPARATED BY space.

I'm getting the date as: The period 20080301 to 20080331.

Can you please help me.

1 ACCEPTED SOLUTION
Read only

peter_ruiz2
Active Contributor
0 Likes
1,389

hi shaheen,

use this


data:
  low(10) type c,
  high(10) type c.

concatenate s_budat-low+4(2) s_budat-low+6(2) s_budat-low(4)
into low separated by '.'. 

concatenate s_budat-high+4(2) s_budat-high+6(2) s_budat-high(4)
into high separated by '.'.

concatenate 'The period' low high into v_head separated by space.

11 REPLIES 11
Read only

Former Member
0 Likes
1,389

Something like this

Data: w_from(10),

w_to(10).

write s_budat-low to w_from using edit mask '__:__:____'.

write s_budat-high to w_to using edit mask '__:__:____'.

CONCATENATE 'The period' w_from 'to' w_to

INTO v_head SEPARATED BY space.

Read only

Former Member
0 Likes
1,389

Hi Shaheen,

Follow this code refrence..

CONCATENATE it_excel-budat_0044(2) '.' it_excel-budat_0046(2) '.' it_excel-budat_004+0(4)

INTO it_excel-budat_004.

Where it_excel-budat is the field where you can replace your own field..

Reward If solved!

Amit.

Read only

peter_ruiz2
Active Contributor
0 Likes
1,390

hi shaheen,

use this


data:
  low(10) type c,
  high(10) type c.

concatenate s_budat-low+4(2) s_budat-low+6(2) s_budat-low(4)
into low separated by '.'. 

concatenate s_budat-high+4(2) s_budat-high+6(2) s_budat-high(4)
into high separated by '.'.

concatenate 'The period' low high into v_head separated by space.

Read only

Former Member
0 Likes
1,389

you need to format the date in some field first

e.g. concatenate s_budat6(2) s_budat4(2) s_budat+0(4) into datelow separated by space.

Read only

Former Member
0 Likes
1,389

try like this,

CONCATENATE 'The period' s_budat-low6(2) '.' s_budat-low4(2) '.' s_budat-low0(4) 'to' s_budat-high6(2) '.' s_budat-high4(2) '.' s_budat-high0(4)

INTO v_head SEPARATED BY space.

Read only

Former Member
0 Likes
1,389

use this function module..

CONVERSION_EXIT_PDATE_OUTPUT.

Regards

Sugumar G

Read only

former_member386202
Active Contributor
0 Likes
1,389

Hi,

Use FM CONVERT_DATE_TO_EXTERNAL

Regards,

Prashant

Read only

Former Member
0 Likes
1,389

Hi,

write your_date to v_head.

reward points pls...

james lising

Read only

Former Member
0 Likes
1,389

Hi,

First of all declare the variable

w_date2 type d,

w_date3 type d.

and

move your s_budat-low and s_budat-high to w_date2 to w_date3 respectively then convert them to your required format by using following code.

CLEAR: w-date2, w-date3,

w-date4, w-date5.

w-date2+4(4) = l_itab1-begda(4).

w-date22(2) = l_itab1-begda4(2).

w-date2(2) = l_itab1-begda+6(2).

w-date3+4(4) = l_itab1-endda(4).

w-date32(2) = l_itab1-endda4(2).

w-date3(2) = l_itab1-endda+6(2).

then u can use the following code of yours

CONCATENATE 'The period' w-date2 to w-date3

INTO v_head SEPARATED BY space.

the above code will work for you.

regard points if helpful...

Cheers,

Brahma

Read only

Former Member
0 Likes
1,389

Hello khan-

First split date into 3 variables and then concatenate.

data:v_d(2) type c, "** day

v_m(2) type c, "**Month

v_y(4) type c, "** Year

v_str type string." ** new string.

constants:c_1 type c value '.'.

v_d = sy-datum+6(2).

v_m = sy-datum+4(2).

v_y = sy-datum+0(4).

concatenate v_d c_1 v_m c_1 v_y into v_str.

Cheers,

~Srini...

Read only

Former Member
0 Likes
1,389

Hi try this,

data: g_date1(10) type c.

data: g_date2(10) type c.

data: g_dat(50) type c.

DATA: g_date type sy-datum.

SELECT-OPTIONS : s_date for g_date.

INITIALIZATION.

s_date-low = sy-datum.

s_date-high = sy-datum + 10.

s_date-option = 'EQ'.

s_date-sign = 'I'.

APPEND s_date.

START-of-SELECTION.

CONCATENATE s_date-low6(2) s_date-low4(2) s_date-low+0(4)

into g_date1 SEPARATED BY '.'.

CONCATENATE s_date-high6(2) s_date-high4(2) s_date-high+0(4)

into g_date2 SEPARATED BY '.'.

CONCATENATE 'The period' g_date1 'To' g_date2 into g_dat SEPARATED BY space.

write: s_date-low , s_date-high.

write:/ g_dat.

regards,

venkatesh