‎2009 Mar 12 11:30 PM
Hi ,
i have an internal table
DATA: BEGIN OF tbl_infile OCCURS 0,
Aufnr(12) type c,
budat(8) TYPE c,
tubes(13) type c,
srap(13) type c,
batches(13) type c,
runmin(13) type c,
stopmin(13) type c,
END OF tbl_infile.
here the date from file comes into internal table as 140409 i want to change this to 14.04.2009 and place back into internal table how to change the internal table ?
Thanks in advance
‎2009 Mar 13 3:39 AM
Hi,
This is very simple:
1.Change the lenght of the budat from 8 to 10
2.either use the FM 'CONVERT_DATE_TO_EXTERNAL' to convert the date or
use the below snippet
3.Declare 3 local variable of type c each of lenght 2
data:var1(2) tyep c,
var2(2) tyep c,
var3(2) tyep c,4.extract the dd,mm and yy using the offset from the budat
var1 = budat+0(2).
var2 = budat+2(2).
var3 = budat+4(2).5.finally concatenate the above 3 variable into budat of internal table.
concatenate var1 '.' var2 '.' var3 into budat.Hope this might solve your problem.
Pooja
Edited by: Pooja Gupta on Mar 13, 2009 4:46 AM
‎2009 Mar 12 11:39 PM
first change the structure of table to make budat char10. Then use a conversion exit.
In se37
type conversion_exit_date* and hit f4
now check which one is appropriate for u
‎2009 Mar 12 11:54 PM
Set the data type of budat as d and use the function modue CONVERSION_EXIT_SDATE_OUTPUT. Do read the function module documentation.
Rugmani
‎2009 Mar 13 3:39 AM
Hi,
This is very simple:
1.Change the lenght of the budat from 8 to 10
2.either use the FM 'CONVERT_DATE_TO_EXTERNAL' to convert the date or
use the below snippet
3.Declare 3 local variable of type c each of lenght 2
data:var1(2) tyep c,
var2(2) tyep c,
var3(2) tyep c,4.extract the dd,mm and yy using the offset from the budat
var1 = budat+0(2).
var2 = budat+2(2).
var3 = budat+4(2).5.finally concatenate the above 3 variable into budat of internal table.
concatenate var1 '.' var2 '.' var3 into budat.Hope this might solve your problem.
Pooja
Edited by: Pooja Gupta on Mar 13, 2009 4:46 AM
‎2009 Mar 13 3:50 AM
Hi,
Changing date format:-
1. This has to do with your USER SETTINGS.
2. Change Your User SETTING
i.e., Change the DATE FORMAT to DD.MM.YYYY
3. To Do This ,
On any screen, follow the menu
A) SYSTEM--->USER PROFILE -->OWN DATA
B) THEN A NEW SCREEN WILL GET OPENED
C) Goto DEFAULTS Tab
D) There is one section for Date Format
Change the format as per requirement ie. DD.MM.YYYY
E) Press The save Button.
4. TO NOTICE THE CHANGE, LOGIN ONCE AGAIN.
AND THEN CHECK.Or you can use code to print date as per your requirement:-
loop at tbl_infile.
write : / tbl_infile-budat dd/mm/yyyy.
endloop.
Hope this helps you.
Regards,
Tarun