microsoft / ABAP-SDK-for-Azure

ABAP Libraries for SAP native Integration with Azure Services
MIT License
176 stars 61 forks source link

Dose ABAP SDK support upload Excel xls file to Blob? #124

Closed yunbozhang-msft closed 1 year ago

yunbozhang-msft commented 1 year ago

We have a requirement to upload an Excel file to a blob, but there doesn't seem to be a method in the SDK that supports uploading Excel files, and we don't want to use CSV. Are we not supporting it now? Because we cannot upload xls files to Blob through ABAP now, the files are garbled after uploading.

vikasbansal2022 commented 1 year ago

Thanks @zhangyunbo1994 for reaching out.

Yes, you can send XLS data as well to BLOB with latest version. You can download the file from BLOB and you should be able to see content.

Please let us know if you still face issue or having difficulties.

Regards, Vikas

yunbozhang-msft commented 1 year ago

Thanks for your support @vikasbansal2022 !

But in the source code, we not found send_xls method, https://github.com/microsoft/ABAP-SDK-for-Azure/blob/master/src/zadf/zadf_service_blob/zcl_adf_service_blob.clas.abap#L128

I only found send PDF, csv or txt... coule you please point that send xls method? Thanks!

vikasbansal2022 commented 1 year ago

Hi @zhangyunbo1994

The source code doesn't have 'XLS' Method. However, you can send the XLS file XTSRING Data using ZCL_ADF_SERVICE_BLOB~SEND Method.

Regards, Vikas XLS Sample Program.txt

MartinPankraz commented 1 year ago

For completeness I'd like to mention this blog series on the matter.

sky5685610 commented 1 year ago

hi

I have copied the coding and tried to execute ZADF_DEMO_AZURE_BLOB, however with dump as below: dump

vikasbansal2022 commented 1 year ago

Hi @sky5685610 ,

Please use attached demo program for BLOB. If you still face issue. Please share your program or we can have call to discuss on this.

Regards, XLS.Sample.Program (6).txt

Vikas

sky5685610 commented 1 year ago

hi

still exception when I run your demo, the screenshot is as below: image 1675240139585

sky5685610 commented 1 year ago

when I debug the program, I found it import data from a table called "ZADF_CON_INDX", do I need to insert data to it?

vikasbansal2022 commented 1 year ago

Hi ,

you don't need to maintain entry in ZADF_CON_INDX. This index table will have entry automatically once you have maintained entry in TMG ZADF_CONFIG and maintain sas key in that table.

sky5685610 commented 1 year ago

hi

it read key from ZADF_CON_INDX, which is null, so it throw the exception, the exception is here as below:

image

By the way, your demo is SAS, is there any demo for AAD?

vikasbansal2022 commented 1 year ago

Hi @sky5685610 ,

Please maintain table ZADF_CONFIG with SM30 TMG ZADF_CONFIG with sas key/Token. it will auto populate ZADF_CON_INDX.

I will look for AAD demo and get back to you.

Regards, Vikas

sky5685610 commented 1 year ago

hi

I maintain table ZADF_CONFIG with SM30 with saskey/Token, however it doesn't auto populate ZADF_CON_INDX. There is null in table ZADF_CON_INDX.

image image

vikasbansal2022 commented 1 year ago

Hi @sky5685610 ,

Can we connect via call. Looks like you have some steps missing in your configuration. Please follow attached document for setting up the AAD. As well as you can use attached program for AAD BLOB demo.

BLOB_AAD_DEMO.txt

ABAP SDK Implementation Guide for Azure Active Directory (3).pdf

Regards, Vikas. vikasbansal@microsoft.com

sky5685610 commented 1 year ago

hi

It's ok, how can connect, is it possible for you to use Microsoft Teams?

vikasbansal2022 commented 1 year ago

Hi @sky5685610 ,

As discussed please follow guide 'https://docs.abapgit.org/guide-install.html' to download SDK code to your system using GITHUB Pull via ZABAPGIT instead of copying the code from txt files.

Regards, Vikas

sky5685610 commented 1 year ago

hi, I have pull the coding to our ECC System, however, the dump is also existing when I run the program. I check the "zadf_config" table, there is no event existing.

yunbozhang-msft commented 1 year ago

Hi @vikasbansal2022 any suggestions for @sky5685610 's question? Thanks for your support!

vikasbansal2022 commented 1 year ago

Hi @zhangyunbo1994 @zhangyunbo1994,

Since Zhuang is doing the fresh import. Whatever TOBJ is created manually under ZDEV1 package better delete them and do the fresh pull from GITHUB.

Follow below document doing the fresh pull from GITHUB.

https://github.com/microsoft/ABAP-SDK-for-Azure/blob/78dfdc3f29de58e2cc5cf0f49124176091820019/ABAP%20SDK%20for%20Azure%20-%20Github.pdf

Regards, Vikas

yunbozhang-msft commented 1 year ago

Hi @sky5685610 , have you try Vikas's provided steps? if delete them and then do fresh pull, can this issue have been resolved? thanks!

sky5685610 commented 1 year ago

hi

one data element is using by other z table in our ECC system, I don't want to delete it

yunbozhang-msft commented 1 year ago

Hi @vikasbansal2022 sorry to bother you again, as @sky5685610 do not want to delete data from table, do you have another suggestion base on this scenario? Thanks!

vikasbansal2022 commented 1 year ago

Hi @sky5685610 ,

If it is only one data element you can change the package of that data element same as that of SDK package in which SDK data element is stored.

so that you don't get Data Package conflict issue. Once your pull is finished to can make the package back to original.

Regards, Vikas

sky5685610 commented 1 year ago

hi

Thank you for your support, this issue has been solved this morning, I compare my coding and SDK, and found there're something different between "if_http_client" and "cl_rest_http_client". It works fine when I changed to cl_rest_http_client. The coding is as below image image

yunbozhang-msft commented 1 year ago

Thanks @sky5685610 for your sharing, happy to hear your issue is fixed, and also thanks @vikasbansal2022 to support this case. I will close this issue. Thanks!