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
945

hi ,

i have date format coming from the file as yyyymmdd , now i want to convert this in bdc program to user specfic date ( having 10 char) how can i do it . any FM avaiable.

thanks

sridhar

9 REPLIES 9
Read only

Former Member
0 Likes
886

Hi

You can easly use the statament WRITE:

Create a variable where you'll write the date:

DATA: W_DATE(10) TYPE C.

WRITE <DATE> TO W_DATE.

Transfer W_DATE to BDC

Max

Read only

Former Member
0 Likes
886

write sy-datum to v_date. "v)date should be of 10 char length

or use the func mod:

CONVERT_DATE_TO_EXTERNAL

Regards,

Ravi

Read only

Former Member
0 Likes
886

CONVERT_DATE_TO_EXTERNAL function will do the job.

Regards,

Ravi

Read only

Former Member
0 Likes
886

data: l_date type d value '20060704',

l_text(10) type c.

Write l_date to l_text dd/mm/yyyy.

Read only

Former Member
0 Likes
886

Hello, Please check FM:

CONVERSION_EXIT_PDATE_OUTPUT

Best regards, Murugesh AS

Read only

Former Member
0 Likes
886

Hi Sridhar,

Welcome to SDN........

1)Use Function module <b>CONVERT_DATE_TO_EXTERNAL</b>.

or

2) DATA V_DATE(10).

<b>WRITE SY-DATUM TO V_DATE.</b>

Note: Plz mark all helpful answers and close the thread if it is solved.

Thanks,

Vinay

Read only

Former Member
0 Likes
886

Hai Sridhar

Check the following Code

DATA: v_date(10) TYPE c.

CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'

EXPORTING

date_internal = '20060604'

IMPORTING

date_external = v_date

EXCEPTIONS

date_internal_is_invalid = 1

OTHERS = 2.

if sy-subrc = 0.

write 😕 v_date.

endif.

Thansk & regards

Sreeni

Read only

Former Member
0 Likes
886

if the date format is in YYYYMMDD,

data : v_externaldate type sy-datum,

data : v_internal_date(10) type c.

write 😕 v_externaldate to v_internal_date.

this WRITE TO will convert date to user logged date format

i.e., with / or . or someother values.

regards

srikanth

Read only

Former Member
0 Likes
886

Hi,

CONVERT_DATE_TO_EXTERNAL will solve your problem.

Regs,

Venkat Ramanan