Application Development 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: 

function module for date conversion

Former Member
0 Kudos
2,197

Is there any function module to convert date of

yyyymmdd to dd.mm.yyyy format?

EX: 20060510 to 10.05.2006

Thanks.

13 REPLIES 13

Former Member
0 Kudos
619

hiii

this will solve ur cause

<b>CONVERSION_EXIT_PDATE_OUTPUT</b>

u can look over these ones too

call function 'RP_CALC_DATE_IN_INTERVAL'

exporting

date = sy-datum

days = 3

months = 0

signum = '+'

years = 0

importing

calc_date = wa_date.

SALP_CALC_DATE

IN_RECTYPE D (for Days)

IN_NBR_DWXMQY 10 (no of days)

IN_DATE (start date)

call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'

exporting

i_date_from = FROMDATE

i_date_to = TODATE

  • I_FLG_SEPARATE = ' '

IMPORTING

E_DAYS = EDAYS

E_MONTHS = EMONTHS

E_YEARS = EYEARS.

try this too

<b>CONVERT_DATE_TO_INTERN_FORMAT</b>

also in se 37 type

<b>conversiondate</b>

and search for ur function module

u vcan fetch it easily

hope this helps

Thanks & regards

Naresh

Message was edited by: Naresh Kumar Amaragani

Message was edited by: Naresh Kumar Amaragani

Former Member
0 Kudos
619

hi

THIS IS WAHT U WANT

PDOT_DATE_CONVERT

plz reward if satisfied

rahulkavuri
Active Contributor
0 Kudos
619

from yyyymmdd to dd/mm/yyyy use this

CONVERSION_EXIT_PDATE_OUTPUT

from dd/mm/yyyy to yyyymmdd use this

CONVERSION_EXIT_PDATE_INPUT

These are also avaliable for date conversion, just go to se37 and check their functionality and use them according to ur requirement

CONVERSION_EXIT_PDATE_INPUT

CONVERSION_EXIT_IDATE_INPUT

CONVERSION_EXIT_IDATE_OUTPUT

CONVERSION_EXIT_LDATE_OUTPUT

Message was edited by: Rahul Kavuri

Message was edited by: Rahul Kavuri

former_member188685
Active Contributor
0 Kudos
619

hi,

try this fm...

CONVERT_DATE_TO_INTERNAL

Regards

vijay

0 Kudos
619

hi,

use

CONVERT_DATE_TO_INTERNAL

Other similar FM is CONVERT_DATE_TO_EXTERNAL which is used to convert in external format.

Hope this helps

Regards,

Richa

Former Member
0 Kudos
619

if both the input & output formats are fixed always,

why dont you use offset to populate output field

data : v_input(8) type c,

v_output(10) type c.

v_input = '20060101'. " yyyymmdd format

concatente v_input+6(2)

'.'

v_input+4(2)

'.'

v_input+0(4)

into v_output.

now v_output will have date in dd.mm.yyyy format.

if you need any specific user logged in format,

search for DATECONVERT* in SE37 to get associated function module.

regards

srikanth

Former Member
0 Kudos
619

HI

GOOD

CONVERT_DATE_TO_EXTERNAL Converts date from system storage format to users specified display format

HR_SEN_CRULE_0100_DATE Increase/decrease DATE by a specific number of Days/Months/Years

DATE_CHECK_PLAUSIBILITY Check to see if a date is in a valid format for SAP. Works well when validating dates being passed in from other systems.

DATE_COMPUTE_DAY Returns a number indicating what day of the week the date falls on. Monday is returned as a 1, Tuesday as 2, etc.

DATE_GET_WEEK will return the week that a date is in.

DATE_IN_FUTURE Calculate a date N days in the future.

THANKS

MRUTYUN

rahulkavuri
Active Contributor
0 Kudos
619

These are two types of conversion according to ur requirement

report zrich_0003.

data: datum(10) type c.

call function 'CONVERT_DATE_TO_EXTERNAL'

exporting

date_internal = sy-datum

importing

date_external = datum.

write:/ datum.

report zrich_0003.

data: c_datum(10) type c value '02.28.2006'.

data: d_datum type sy-datum.

call function 'CONVERT_DATE_TO_INTERNAL'

exporting

date_external = c_datum

importing

date_internal = d_datum.

write:/ d_datum.

refer

Former Member
0 Kudos
619

Hi,

Try these FMs

CONVERSION_EXIT_SDATE_OUTPUT & CONVERSION_EXIT_SDATE_INPUT.

Hope it helps and solves your problem.

Do reward me if it helps you.

I got it you can try with this FM CONVERSION_EXIT_PDATE_OUTPUT.

It exactly works for your requirement.

Regards,

Sampath

Former Member
0 Kudos
619

Hi,

u can use this function module "SLS_MISC_CONVERT_TO_DATE" which will change the date format to user defined format.

u have to pass two parameters

1. Date ( p_date ) .

2. Format ( p_date_format ) ie. dd.mm.yyyy

hope this will solve ur problem.

Thankx.

Former Member
0 Kudos
619

Hi,

u can use CONVERT_DATE_TO_EXTERNAL,

CONVERT_DATE_TO_INTERNAL.

Regards

Anitha

Former Member
0 Kudos
619

Hi ,

u can use CONVERT_DATE_TO EXTERNAL.

CONVERT_DATE_TO_INTERNA

Thanks

Anitha

anversha_s
Active Contributor
0 Kudos
619

hi,

pls try this.

data:lcdate(11).
 
call function 'converstion_exit_idate_output'
exporting
input = sy-datum
importing
output = lcdate.
 
concatenate lcdate(2) lcdate+2(3) lcdate+5(4) into lcdate seperated by '.'.

--lcdate is your required format.

sample data ..sy-datum = 20060830

lcdate = 30.AUG.2006

regards

Anver

<b><i>if hlped pls mark points</i></b>