2017 Oct 25 12:28 AM
Dear Experts,
I'm having trouble reading an Excel file from application server. I tried implementing this solution https://wiki.scn.sap.com/wiki/display/Snippets/Reading+Excel+file+from+Application+Server+into+ABAP+...
but I'm still facing some issue with the structure of I_DATA1
I'm not sure how schould I be defining it
This is my type definition :
types:begin of i_data,
A type string,
B type string,
C type string,
D type string,
end of i_data.
My Excel file has 4 columns
Please advise me .
Regards,
Houriya
2017 Nov 22 3:59 PM
Dear community,
After debugging the program, I came across the things that were missing :
1 - if you plan to reproduce the same example giving by Praveen Singh, in the function module ZEXCEL_TO_ABAP,
* while loading the XML data you need to put 'c_shared_str_xml' variable instead of the variable 'c_sheet_xml'.
*while loading the sheet data you need to put 'c_sheet_xml' variable instead of the variable 'c_shared_str_xml'.
2 - When it comes to the XLST Transformation, it needs to have the same name of the internal table and its fields.
Dear Experts,
I'm having trouble reading an Excel file from application server. I tried implementing this solution https://wiki.scn.sap.com/wiki/display/Snippets/Reading+Excel+file+from+Application+Server+into+ABAP+...
but I'm still facing some issue with the structure of I_DATA1
I'm not sure how schould I be defining it
This is my type definition :
types:begin of i_data,
A type string,
B type string,
C type string,
D type string,
end of i_data.
My Excel file has 4 columns
Please advise me .
Regards,
Houriya
2017 Oct 25 4:37 AM
hi
use this fm TEXT_CONVERT_XLS_TO_SAP
example:
DATA:LT_RAW TYPE TRUXS_T_TEXT_DATA,
LV_FILE TYPE RLGRAP-FILENAME.
REFRESH:CT_UPLOAD[].
CLEAR LV_FILE.
LV_FILE = PA_FILE.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR = 'X'
I_TAB_RAW_DATA = LT_RAW
I_FILENAME = LV_FILE
TABLES
I_TAB_CONVERTED_DATA = CT_UPLOAD
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2.
adv: in ur code dont use string.
use char or text with length
2017 Oct 25 4:38 AM
like below.
TYPES:BEGIN OF TY_UPLOAD,
PERNR TYPE TEXT8,
SPL_ALW TYPE TEXT15,
LEV_WG TYPE TEXT15,
END OF TY_UPLOAD,
TT_UPLOAD TYPE STANDARD TABLE OF TY_UPLOAD.
DATA:GT_UPLOAD TYPE TT_UPLOAD.
2017 Oct 25 8:44 AM
2017 Oct 26 9:18 AM
2017 Oct 26 11:56 AM
2017 Oct 27 5:41 AM
2017 Oct 27 7:24 AM
Limitations of function module TEXT_CONVERT_XLS_TO_SAP :
2017 Nov 03 4:22 AM
use dataset coding techinics
open data set
read dataset
close dataset.
using these u can read data from application server
2017 Nov 03 4:24 AM
EX:
here lv_str is application server file path in AL11.
OPEN DATASET LV_STR FOR INPUT IN BINARY MODE.
DO.
READ DATASET LV_STR INTO LS_STR.
IF SY-SUBRC = 0.
APPEND LS_STR TO LT_STR.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET LV_STR.
2017 Nov 07 8:50 PM
I'm pretty sure OP already knows this. It's part of the code in the Wiki referenced in the original question.
Sorry but I don't see how generic information about OPEN DATASET (which is available in ABAP Help) could possibly help OP in reading Excel format.
2017 Oct 25 6:28 AM
2017 Oct 25 6:32 AM
Your transformation should reflect the name of your internal table and names of its fields.
2017 Oct 25 8:43 AM
I used the same transformation as described in the link I shared , in fact my real strcuture is very different I'm just trying to re-do the same example but it's not working.
What would you do if you were using the same transformation?
2017 Oct 26 6:54 AM
I'd debug it and see how the transformation handles my data.
2017 Oct 25 9:39 AM
2017 Nov 22 3:59 PM
Dear community,
After debugging the program, I came across the things that were missing :
1 - if you plan to reproduce the same example giving by Praveen Singh, in the function module ZEXCEL_TO_ABAP,
* while loading the XML data you need to put 'c_shared_str_xml' variable instead of the variable 'c_sheet_xml'.
*while loading the sheet data you need to put 'c_sheet_xml' variable instead of the variable 'c_shared_str_xml'.
2 - When it comes to the XLST Transformation, it needs to have the same name of the internal table and its fields.
2017 Dec 03 7:21 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |