spreadsheetimporter / ui5-cc-spreadsheetimporter

A UI5 Component to integrate a Spreadsheet Upload for UI5 Apps.
https://spreadsheet-importer.com/
Apache License 2.0
82 stars 16 forks source link

[Bug]: Importing Edm.Time in ODataV2 fails #543

Closed tthurnreiter closed 4 months ago

tthurnreiter commented 5 months ago

OData Version

OData V2

Draft

not relevant

Scenario

Freestyle

Environment

VS Code

UI5 Spreadsheet Component

0.33.4

What happened?

Hi,

I have a problem with importing Edm.Time fields into our ODataV2 (CAP) Backend. The request fails.

The origin of my problem seems to be this line:

https://github.com/spreadsheetimporter/ui5-cc-spreadsheetimporter/blob/981cff9bbbddcbca3f3355cd09d07dbec49512f8/packages/ui5-cc-spreadsheetimporter/src/controller/Parser.ts#L76

It seems like ODataV2 accepts time strings only in a "12:55:00" format, at least it seems to work this way on our side. It looks like this is a format that ODataV4 also accepts, so maybe a simple fix would be to modify the substring() to include the seconds part of the ISODate.

Thanks in advance!

Relevant log output

2024-04-30 16:26:56.715300 Request failed with status code 500: POST [snip]- [{"code":"500","message":"Cannot set parameter at row: 1. Wrong input for TIME type","persistent":true,"targets":["/Operation('id-1714487215253-622')"],"type":"Error"}] sap.ui.model.odata.ODataMessageParser

Spreadsheet Component Init

this.spreadsheetUpload = oController.getOwnerComponent().createComponent({
            usage: "spreadsheetImporter",
            async: false,
            componentData: {
                context: this,
                tableId: sFullTableId,
                skipColumnsCheck: true,
                showBackendErrorMessages: true,
                debug: true,
            },
        });
        this.spreadsheetUpload.openSpreadsheetUploadDialog();

Manifest

No response

marianfoo commented 5 months ago

Hi @tthurnreiter thank you for your bug report. Seems like a simple fix. Let me have a look Cheers

marianfoo commented 4 months ago

Changed according to your suggestion. Was not able to recreate the error but adding the seconds did work too. Fixed with version 0.34.1, please look at the breaking changes: https://docs.spreadsheet-importer.com/pages/CHANGELOGSPREADSHEETIMPORTER/

tthurnreiter commented 4 months ago

I can confirm that with 0.34.1 importing Time works for us now. Thanks for the fast response.