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

how to trim date variable

Former Member
0 Likes
1,322

hi,

i have a variable which contains date in the format created_date(YYYYMMDDhhmmssmmmuuun)

but i want the date in (YYYYMMDDhhmmss) format only. how can i extract first 14 characters of the date.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,009

use the offset ..

get the date as ... date+0(14)

6 REPLIES 6
Read only

Former Member
0 Likes
1,009

This fm CONVERSION_EXIT_PDATE_INPUT

Read only

Former Member
0 Likes
1,010

use the offset ..

get the date as ... date+0(14)

Read only

Former Member
0 Likes
1,009

HI,

Try this way

DATA : L_DATE TYPE CHAR14.

l_date = date(14).

Read only

Former Member
0 Likes
1,009

Hi Vishal

Check the thread,and see the Anirban answer to the thread.Might be helpful to you.

Regards

Sachin

Read only

Former Member
0 Likes
1,009

Hi,

Take a variable of required length and assign date to it.

it itself truncates the char exceeding the length.

ex:

data: w_str like sy-datum,

w_str1(5) type c.

w_str = sy-datum.

w_str1 = w_str.

write:/ w_str1.

Regards,

Mdi.Deeba

Read only

Former Member
0 Likes
1,009

thanks srini