2016 Jun 17 7:18 AM
Hi everyone,
I am taking input from a text file in BDC. Declaring time in char10 as SAP standard time format accepts only 6 chars in length type,but it's not getting stored properly. I need to convert this string into standard sap time format. The way we have FM CONVERSION_EXIT_IDATE_INPUT for date conversion, do we have something for TIME as well?
I found CONVERT_TIME_INPUT in google, but on using this got error saying output type is not same as required one.
Please help.
Regards,
Chetna D
2016 Jun 17 7:32 AM
How come it is 10? Including separator?
You can also just remove the separator then condense?
DATA: time TYPE char10.
time = '23:59:59'.
REPLACE ALL OCCURRENCES OF ':' IN time WITH space.
CONDENSE time.
2016 Jun 17 7:32 AM
How come it is 10? Including separator?
You can also just remove the separator then condense?
DATA: time TYPE char10.
time = '23:59:59'.
REPLACE ALL OCCURRENCES OF ':' IN time WITH space.
CONDENSE time.
2016 Jun 17 7:36 AM
Hi,
Soryy,not 10. I am taking input from BDC file as 8 chars like: 10:10:10
Now in order to store it in sap custom table, wherein data type for time is erzet (input length 6, output length 8), I need to convert it in SAP standard format.
So i was wondering just like date has FM to convert string into standard sap date format, do we have one for time as well ?
Or is the way you have suggested work here ?
Regards,
Chetna D
2016 Jun 17 7:40 AM
Actually using the FM CONVERT_TIME_INPUT, its already giving the correct output. Not just sure why its showing error on your side. But yes, you can also use my suggestion. Then just move the value of time to your erzet type field. you can try below and check.
DATA: tm TYPE char10,
final type erzet.
tm = '23:59:59'.
REPLACE ALL OCCURRENCES OF ':' IN tm WITH space.
CONDENSE tm.
MOVE tm TO final.
WRITE final.
2016 Jun 17 8:19 AM
2016 Jun 17 7:36 AM
Hi Chetna,
Just do this in simple way as below.
Declare one variable(wk_time) with type sy-uzeit.
Let's say your input time variable is wk_input(char10).
CONCATENATE wk_input+0(2) wk_input+3(2) wk_input+6(2) into wk_time.
Try this.
Regards,
Manivel S
2016 Jun 17 9:39 AM
Thank you all for responding and solving the problem
Regards,
Chetna D