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

system date conversion to character

Former Member
0 Likes
1,610

hi

can any body tell me if user insert sy-datum through selection screen i want that date in character to convert (yyyymmdd) format ,is there any function module for that conversion,sy-datum to character,or if any other procedure so plz tell me it's urgent

gaurav upadhyaya

8 REPLIES 8
Read only

Former Member
0 Likes
1,137

data:date like sy-datum.

data:date1(8) type c.

date1 = date.

Read only

Former Member
0 Likes
1,137

Hi,

Declare a field of type character length 10(8) depends on your requirement, and use the following to convert sy-datum to character,

data: v_date(10).

write sy-datum to v_date using edit mask '__.__.____'.

Rgds,

Read only

Former Member
0 Likes
1,137

Hai Gaurav

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

data : v_char_date(8) type c.

v_char_date = v_date.

write 😕 v_char_date.

Regards

Sreeni

Message was edited by: Sreenivasulu Ponnadi

Read only

Former Member
0 Likes
1,137

Hi Gaurav,

You can use the FM : HR_IN_CHG_INR_WRDS

Reward points for the helpful solution.

Regards,

Harini

Read only

Former Member
0 Likes
1,137

parameters : date like sy-datum.

data : data(8) type c.

data = date.

Now using the command split data and concatenate data you can convert it into any format.

Read only

Former Member
0 Likes
1,137

Hi Gaurav,

Yes u can do this using the following FM-

CONVERT_DATE_TO_EXTERNAL

Regards,

Seema

Read only

Former Member
0 Likes
1,137

u can use the FM :

convert_date_to_internal.

here u pass the date formats and the dates u want to change , for both source and target.

Read only

Former Member
0 Likes
1,137

Hi,

You can try to use the following FMs:

CONVERSION_EXIT_PDATE_OUTPUT

CONVERSION_EXIT_PDATE_INPUT

Best regards!

Nina