‎2007 Jun 16 1:31 PM
How can we change date in SAP defined format in any SAP functionality
Thanx,
Subramanyam
‎2007 Jun 16 1:38 PM
use write statement
write date as 'mm/dd/yyyy', keep the cursor on write statement and press F1 ,you get documenentation.
‎2007 Jun 16 1:50 PM
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.
‎2007 Jun 16 1:56 PM
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
‎2007 Jun 16 5:29 PM
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.
‎2007 Jun 16 5:32 PM
<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
‎2007 Jun 18 7:54 AM
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.