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 problem

Former Member
0 Likes
478

Hi ,

For BDC i m getting date in the format '1/1/2006', but i want to convert it to '01/01/2006', hoe can i achive this?

Thanx

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
458

Hello,

Make use of this FM:

CONVERT_DATE_TO_INTERNAL.

Vasanth

4 REPLIES 4
Read only

Former Member
0 Likes
458

You having a laugh. You cannot write someting to resolve this yourself.

Maybe u should call yourself unlucky ABAP.

Read only

Former Member
0 Likes
459

Hello,

Make use of this FM:

CONVERT_DATE_TO_INTERNAL.

Vasanth

Read only

Former Member
0 Likes
458

refer code below,



data: v_month(2) type c,
v_day(2) type c,
v_year(4) type c,
v_date(12),
date(10) value '11/2/2006'.
 
split date at '/' into v_month v_day v_year.
 
if v_day+1 is initial. 
v_day+1 = v_day.
v_day+0(1) = 0.
endif.
 
if v_month+1 is initial. 
v_month+1 = v_month.
v_month+0(1) = 0.
endif.
 
concatenate v_month v_day v_year into v_date separated by '/'.
write:/ v_date.
 

reward if useful.

Read only

Former Member
0 Likes
458

Hi Lucky,

try with this

To set the date in the required format

SET COUNTRY 'US'.

write: / sy-datum.

SET COUNTRY 'IN'.

write: / sy-datum.

data: date_mask TYPE c LENGTH 6.

WRITE sy-datum to date_mask ddmmyy.

write : / date_mask." YYMMDD.

If helps reward points.