11-03-2020 1:48 AM
Hi I have the date field from the file coming as 22-jun-2020 this needs to be updated to table TCURR-GDATU field
pls suggest.
11-03-2020 3:40 PM
You could try FM CONVERSION_EXIT_SDATE_INPUT to convert to a SAP internal YYYYMMDD format and then use one of the other answers given.
You might have to replace '-' with space to get results.
11-03-2020 2:31 AM
You need to have a logic to convert it to TCURR-GDATU format
For example: Your date = 22-Jun-2020 => 20200622 (YYYYMMDD)
Then we will have 99999999 - 20200622 = 79799377
And the same if you want to convert TCURR-GDATU to normal date
Example in TCURR we have GDATU = 80029898 => 99999999 - 80029898 = 19970101
Then we have the normal date is 01-Jan-1997
11-03-2020 8:05 AM
I don't think that it's a valid ISO 8601 date format, probably it comes from Excel.
If you process an Excel XLSX file, you should directly read the internal format by using abap2xlsx. Otherwise you'd have to bother with all regional date formats if you work for international users, that would be a never ending story...
11-03-2020 1:41 PM
To convert date from text, look at oprions of class CL_ABAP_DATFM or build you own logic:
There are statements dedicated to inverted date
CONVERT date odate INTO INVERTED-DATE idate.
CONVERT INVERTED-DATE idate INTO DATE odate.
But first did you consider using
11-03-2020 3:40 PM
You could try FM CONVERSION_EXIT_SDATE_INPUT to convert to a SAP internal YYYYMMDD format and then use one of the other answers given.
You might have to replace '-' with space to get results.
11-03-2020 11:00 PM
09-06-2022 10:06 AM
DATA: lv_date TYPE sy-datlo,
lv_c8 TYPE char8,
lv_datu TYPE tcurr-gdatu.
lv_date = '20220906'. "Fill lv_date with user-input etc.
lv_c8 = lv_date. "Convert to char8
lv_datu = 99999999 - lv_c8. "To complementary
SELECT SINGLE * FROM tcurr INTO @DATA(ls_tcurr) WHERE gdatu = @lv_datu.
Example!