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 change

Former Member
0 Likes
710

How can we change date in SAP defined format in any SAP functionality

Thanx,

Subramanyam

6 REPLIES 6
Read only

Former Member
0 Likes
692

use write statement

write date as 'mm/dd/yyyy', keep the cursor on write statement and press F1 ,you get documenentation.

Read only

0 Likes
692

I think you have sent me to change date in reports.

I need change date in Transaction like MB1C for the field 'document date' and 'posting date'

Thanx,

Subramanyam.

Read only

0 Likes
692

use offset command if you are getting date from table ,if you are getting data from file then use like this .

let me say one example :

data : v_date like sy-datum.

data : v_mon(2) type c,

v_day(2) type c,

v_year(4) type c,

v_fdate(10) type c.

start-of-selection.

v_date = sy-datum .

  • V_Date contains 20070616

  • use offset here

v_year = v_date+0(4). " v_year has 2007

v_mon = v_date+4(2) . ' V_mon has 06

v_day = v_date+6(2) , " v_daya has 16

*now concatenate as what ever you want

concatenate v_mon '/' v_day '/' v_year into v_fdate.

write:/ v_fdate. " move the value to system

Reward Points if it is helpful

Thanks

Seshu

Read only

0 Likes
692

Hi,

You should not use seperator as the system field length is only 8.

There are two options, one is to control from the program other is to maintain it in user record.

You can specify default date format in the user record as below:

1. System -> User profile -> Own data -> under defaults tab specify the default format.

2. Controlling in program:

You can use statements like

concatenate v_field6(2) v_field4(2) v_field+0(4) into v_date.

Hope this will help.

Regards,

Srilatha.

Read only

Former Member
0 Likes
692

<b>Menu</b>

System -> User profile -> Own data -> under defaults tab specify the default format.

<b>Then re-login into SAP otherwise the date format will not get changed</b>

Regards,

Sail

Read only

Former Member
0 Likes
692

Hi Subramanyam,

Why can't we use these Function modules : CONVERT_DATE_TO_INTERNAL

CONVERT_DATE_TO_EXTERNAL.

convert_date_to_internal : converts date from mm/dd/yyyy to yyyymmdd

convert_date_to_external : vice-versa of internal conversion.

All the very best to you.

- Mohan.