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

regarding date formate.

former_member530652
Participant
0 Likes
1,023

i have date in the internal table with the format yyyymmdd (8 character format)

now i want to conver it into another format like dd.mm.yyyy(10 character format)

can u help..??

i have date in the internal table with the format yyyymmdd (8 character format)

now i want to conver it into another format like dd.mm.yyyy(10 character format)

can u help..??

8 REPLIES 8
Read only

Former Member
0 Likes
1,003

Hi,

CALL FUNCTION 'CONVERT_DATE_TO_INTERN_FORMAT'

EXPORTING

datum = lv_date1

dtype = 'DATS'

IMPORTING

idate = lv_date2.

write lv_date2.

Check the link for more

https://forums.sdn.sap.com/click.jspa?searchID=11664956&messageID=4805923

Regards,

Raj.

Read only

Former Member
0 Likes
1,003

Hi,

Check this:

regards,

kumar

Read only

Former Member
0 Likes
1,003

date = '20070520'.

data : yr(4) type n,

mt(2) type n,

dt(2) type n.

yr = date+0(4).

mt = date+4(2).

dt = date+6(2).

concatenate all the values to some varible you will get

the sequence of concatenate is dt mt ur.

Regards,

madan.

Read only

Former Member
0 Likes
1,003

data: v_date like sy-datum value '20080512'.

data: v_date_result(10).

concatenate v_date6(2) v_date4(2) v_date+0(4) into v_date_result separated by '.'.

Read only

Former Member
0 Likes
1,003

Hi,

u can try like this........

present format is s_date = yyyymmdd.

concatenate s_date6(2) '.' s_date4(2) '.' s_date+0(4) into n_date.

where n_date(10) type c.

Regards,

kk.

Read only

Former Member
0 Likes
1,003

Hi Sandeep,

Try this logic.I will check this logic.For me it is working fine...can u check it once..

data: lv_date like sy-datum.

write sy-datum using edit mask '__.__.__' to lv_date..

Here instead of sy-datum u have to use ur internal table field ok...

Reward points if helpful..

Kiran Kumar.G.A

Read only

Former Member
0 Likes
1,003

hi sandeep ,

try this one program,

DATA:w_indate TYPE d ,

w_temp TYPE d ,

w_outdate(10) TYPE c.

w_indate = sy-datum .

WRITE: 'Input date is ', w_indate .

CALL FUNCTION 'DATE_CONV_EXT_TO_INT'

EXPORTING

i_date_ext = w_indate

IMPORTING

E_DATE_INT = w_temp

EXCEPTIONS

ERROR = 1

.

write: / w_temp .

w_temp = w_indate .

CONCATENATE w_temp6(2) w_temp4(2) w_temp+0(4) INTO w_outdate separated by '.' .

WRITE: / 'Output date is ', w_outdate .

it will give you desired format.

Regard ,

sandeep patel

  • reward point if useful

Edited by: Sandeep patel on May 12, 2008 2:28 PM

Read only

Former Member
0 Likes
1,003

Here is the simplest logic which will take the user's setting of date ie, date will be displayed according to the user's setting

Data: v_date(10) type c.

write sy-datum to v_date.

write v_date.

V_Date will contain your desired formate

Reward points if helpful.

Regards

Bikas