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

function module for date

Former Member
0 Likes
1,151

Hi Friends,

Is any function module is available which can convert the date format from yyyymmdd to dd.mm.yyyy??

9 REPLIES 9
Read only

Former Member
0 Likes
1,051

Do u want to change the date format means go to transaction SU01 ehter the user name & in default tab specify the date format which u want logoff & sign in again.

Now it will display the date in ur required format.

Read only

Former Member
0 Likes
1,051

u can this Fm

CONVERSION_EXIT_PDATE_OUTPUT

but what are ur system date settings in su3 default date formats.

is it dd/mm/yyyy or dd.mm.yyyy

or mm/dd/yyyy or mm.dd.yyyy

if it is mm/dd/yyy then u need to write logic to display it in dd/mm/yyyy

date = sy-datum. "YYYYMMDD

DATA VAL(10) TYPE C.

as concatenate date6(2) DATE4(2) DATE+0(4) INTO VAL SEPARATED BY '/' or('.').

if ur default format in su3 is dd/mm/yyyy then the function module CONVERSION_EXIT_PDATE_OUTPUT

will do ur job .

regards,

vijay

Message was edited by:

Vijay

Read only

Former Member
0 Likes
1,051

Hi salil ,

use the function module SLS_MISC_CONVERT_TO_DATE

WITH THIS FUNCTION MODULE you can convert into any format

Read only

Former Member
0 Likes
1,051

use this

call function '/OBIZ/CONVERTDATE'

exporting

wrk_date = date_in

importing

ext_date = date_out

Read only

Former Member
0 Likes
1,051

Hi,

Use the FM:

<b>CONVERT_DATE_TO_EXTERNAL</b> Converts date from system storage format to users specified display format

or you can do it this way:

DATA: VDATE(10) TYPE C.

CONCATENATE sy-datum6(2) sy-datum4(2)

sy-datum+0(4) INTO VDATE

SEPARATED BY '.' .

Hope this helps.

Reward if helpful.

Regards,

Sipra

Read only

Former Member
0 Likes
1,051

use this

concatenate wrk_date6(2) wrk_date4(2) wrk_date+0(4) into ext_date

separated by '.'.

Read only

anversha_s
Active Contributor
0 Likes
1,051

hi,

chk this.

data = sy-datum

take variables V1, V2, V3.
V1 = date+0(4).
V2 = date+4(2) 
V3 = date+6(2)

Concatenate V3 V2 V1 into date separated by '.'

Now, date will have DD.MM.YYYY

rgds

anver

Read only

p291102
Active Contributor
0 Likes
1,051

Hi,

CALL FUNCTION 'BAPI_AR_ACC_GETKEYDATEBALANCE'

EXPORTING

COMPANYCODE = bukrs

CUSTOMER = ikna1-kunnr

KEYDATE = pdate

BALANCESPGLI = 'X'

  • NOTEDITEMS = ' '

  • IMPORTING

  • RETURN =

TABLES

KEYBALANCE = itab_key_bal.

Thanks,

Star Shankar

Read only

p291102
Active Contributor
0 Likes
1,051

Hi,

example:

ON CHANGE OF REGUH-ZALDT OR T001-PERIV.

CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'

EXPORTING

I_DATE = REGUH-ZALDT

I_PERIV = T001-PERIV

IMPORTING

E_GJAHR = REGUD-GJAHR.

XXX_REGUH-ZALDT = REGUH-ZALDT.

ENDON.

Thanks,

Star shankar