cancel
Showing results for 
Search instead for 
Did you mean: 

How to Convert Internal table data to XLSM - Macro enabled sheet and Vice versa....

jhon_jhon
Explorer
0 Kudos

Hi

We have a requirement on 'XLSM' Macro enabled excel file data , We will receive data from Java in XSTRING mode and same needs to read and Populate to internal table , After validating we have to convert data to XSTRING and send it to Java back.

I was unable to achieve this requirement, Can anybody suggest on this.

Thanks

Jhon

Accepted Solutions (0)

Answers (1)

Answers (1)

Sandra_Rossi
Active Contributor
0 Kudos

It should be easy with abap2xlsx

jhon_jhon
Explorer
0 Kudos

HI Sandra Rossi

Thanks for your answer , I am unable to read byte array data in SAP which is passing from Java thru webservice to SAP.

Please do let me know steps to read Byte array data in SAP.

Thanks

Jhon

mmcisme1
Active Contributor
0 Kudos

Agree with Sandra -

Anyway bit array:

Please search sap bit array. You'll find a very nice blog and many questions about it. I search via Google.

jhon_jhon
Explorer
0 Kudos

Hi Michelle

Thanks for your time, I have tried several ways but couldn't get a way to read Java byte array (Data is being sent by Java thru web-service) , I have called transformations/ FM to convert xstring to string ...but actual data is not being populated to internal table...Could you help me on this.

Data is receiving in byte array from Java , the same is saving on SAP RAWSTRING data element on Ztable , While Processing this byte array , I am getting special characters and unreadable format data.

thanks

Jhon

Sandra_Rossi
Active Contributor
0 Kudos

The question is not about Java byte array, not even Abap Ddic rawstring (Abap xstring), it's about knowing the code page (AKA character set) used to encode the characters into bytes at the Java side.

Usually it's UTF-8 (i.e. not always).

At ABAP side, decode the bytes into characters using the class CL_ABAP_CODEPAGE.

jhon_jhon
Explorer
0 Kudos

Hi Sandra,

I was able to save Excel data on presentation server using SCM_XSTRING_BINARY and GUI_UPLOAD Function modules , but GUI_UPLOAD won't work in background and data is receiving thru web service (Java) and we are restricted not to use Application server.

I have to save Excel Xstring data in Z-table for further processing , Able to convert Xstring to Solix_Tab , Not sure how to get data in readable format , tried FM's Binary_text/Binary_Ftext..... No luck.

Thanks

Jhon

Sandra_Rossi
Active Contributor
0 Kudos

To save an XSTRING variable into a database table, declare a column with type RAWSTRING, no need of an internal table.

You have to use an XSTRING variable containing the XLSX/XLSM file to be able to use ABAP2XLSX.

Sorry, I can't answer your too much general question "how to get data in readable format".

jhon_jhon
Explorer
0 Kudos

Hi Sandra,

I was saving Xstring in database table with type RAWSTRING , My question is , I am failing to get data from XSTRING , while converting Xstring to Binary / ASCII which is of file Excel (xls/xlsx) , I could see all special characters and are of non readable format.

As I stated , Using GUI_Download , I was able to get data / save file on Presentation server , But Over the fly thru web service I have to read Xstring of Excel data.

Do post the steps to get Excel Xstring raw data to readable format.

Thanks

John

jhon_jhon
Explorer
0 Kudos

Any help on this would be appreciated.......... 🙂