‎2006 Nov 28 9:11 AM
i am reading date from text file in the fromat(yyyymmdd) 20061128, i want to change this format to 28.11.2006 how can i do this.
regards
martin
‎2006 Nov 28 9:27 AM
data: g_date(10) type c.
concatenate date6(2) '.' date4(2) '.' date+0(4) into g_date.
‎2006 Nov 28 9:12 AM
Please check FM
<b>CONVERSION_EXIT_PDATE_OUTPUT</b>
Also make sure that your user setting default is DD.MM.YYYY. You can do this by going to transaction SU01 give your user name and under the tab Default ,make sure your user format is DD.MM.YYYY
Message was edited by:
Dominic Pappaly
‎2006 Nov 28 9:14 AM
using wrtie statement u can change
WRITE sy-datum TO l_string1 USING EDIT MASK '__-__-____'.
‎2006 Nov 28 9:26 AM
i dont want to write this value, i am passing this value using BDC using work area, how can i change this value before passing.
‎2006 Nov 28 10:07 AM
Hi Martin,
Write Sy-datum to l_date
this statement won't display.
just it converts the to default format of the use settings.(own data)
If you want to see the output
the Sample Code follows
data : l_string1(10) type c.
WRITE sy-datum TO l_string1 .
write : / l_string1.
Thanks
Sekhar.
‎2006 Nov 28 1:14 PM
Hi Martin,
If you are using this date value in the BDC then you need to convert this as per the user settings. not in the specific format DD.MM.YYYY, because if this program will be exectued by the different users. Their user setting may not be DD.MM.YYYY.
So, try like this...
DATA: lv_date like sy-datum,
write file-date to lv_date.
Here the date will be wirtten to lv_date based on the user setting. You can check this while changing your user setting in tcode SU01.
Hope this will slove you problem.
Regards,
Satya.
‎2006 Nov 28 9:27 AM
data: g_date(10) type c.
concatenate date6(2) '.' date4(2) '.' date+0(4) into g_date.
‎2006 Nov 28 9:28 AM
Hi,
For BDC,you need to pass it as character.
data v1(10).
v2 = '20061128'.
concatenate v26(2)'.' v24(2) '.' v2+0(4) into v1.
‎2006 Nov 28 9:56 AM
hi,
please 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
so if u dont want 'AUG', just put that months number there.
Regards,
Anver
<b><i>
if hlped pls mark points</i></b>
‎2006 Nov 28 10:19 AM
First check whether in the user settings the date format is ddmmyyyy then you can use simply write to statement other wise you just off set the date format like
if lv_date has date in 20061128
then use concatenate lv_date6(2) '.' lv_date4(2) '.' lv_date+0(4) to lv_date1.
this will give the format 28.11.2006 .
Br,
Ravi
‎2006 Nov 28 12:51 PM
when i am using contatenate for 20061128 then it will result in 28.11.20
the last 06 is not comming , what can i do...
‎2006 Nov 28 12:53 PM
‎2006 Nov 28 10:21 AM
hi,
PARAMETERS: P_DATE LIKE SY-DATUM.
DATA: T_MONTHS LIKE STANDARD TABLE OF T247 WITH HEADER LINE.
DATA: DATE LIKE AUSP-ATWRT.
CALL FUNCTION 'MONTH_NAMES_GET'
TABLES
MONTH_NAMES = T_MONTHS.
READ TABLE T_MONTHS WITH KEY MNR = P_DATE+4(2).
DATE(2) = P_DATE+6(2).
DATE+2(3) = T_MONTHS-KTX.
DATE5(2) = P_DATE2(2).
WRITE DATE.
or
Date = YYYYMMDD
Concatenate date4(2) / date6(2) / date(4) into Date2.
or
data : l_date(10) type c .
concatenate sy-datum6(2) '/' sy-datum4(2) '/' sy-datum(4) into l_date.
write : l_date.
or
data :l_date(10) type c
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
DATE_INTERNAL = SY-DATUM
IMPORTING
DATE_EXTERNAL = l_date.
Regards,
Laxmi.