on 11-07-2013 9:07 PM
Hi
I am working on Download excel from WD application. I checked Kruthika's post where an XML is generated and then tags are manipulated by Code.
{
APPEND INITIAL LINE TO P_T_XML_DATA
ASSIGNING <FS_XML>.
MOVE : '<?xml version="1.0"?>' TO <FS_XML>-TDLINE.
CONCATENATE TEXT <FS_XML>-TDLINE CL_ABAP_CHAR_UTILITIES=>NEWLINE INTO TEXT .
APPEND INITIAL LINE TO P_T_XML_DATA
ASSIGNING <FS_XML>.
MOVE : '<?mso-application progid="Excel.Sheet"?>' TO <FS_XML>-TDLINE.
CONCATENATE TEXT <FS_XML>-TDLINE CL_ABAP_CHAR_UTILITIES=>NEWLINE INTO TEXT . }
Similarly, for whole code and then,
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
TEXT = TEXT
IMPORTING
BUFFER = XTEXT.
WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE(
I_FILENAME = 'filename.XLS' "** String Variable
I_CONTENT = XTEXT "** File Type
I_MIME_TYPE = 'EXCEL' ).
at time of generation, I get a 'Strict Parse Error'. Is it because there is listbox for one of the headers?
I checked project from ABAP2XLS did find what I needed, I have to show a file generated from Application with formatted cells , with Columns having lists.
I looked at transformation 'XLST' but didnt work, since source to be supplied which I added in Source.
Thanks
Mohinder
Hi
Was able to work around using transformation. XML code copied and pasted between XSLT generated code in transfromation and then taking result back from Call transformation.
Steps: Create a transformation,
<?sap.transform simple?>
<?mso-application progid="Excel.Sheet"?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<?mso-application progid="Excel.Sheet"?>
<tt:root name="table"/>
<tt:template>
->>>>>>>>>>>>>>Copy paste your XML code<--------------
</tt:template>
</tt:transform>
<Closing thread as anwsered>
Thanks
Mohinder
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arun,
Which code you are looking for ?
Is it how to call dummy transformation? When you have XML ready and need to create transformation way I did in my reply by pasting in required area. Below is code of how to call.
DATA: ITAB TYPE STANDARD TABLE OF CHAR1,
XTEXT TYPE XSTRING,
XMLSTR TYPE STRING.
CALL TRANSFORMATION Z_XML_TRANSFORMATION
SOURCE TABLE = ITAB
RESULT XML XMLSTR.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
TEXT = XMLSTR
IMPORTING
BUFFER = XTEXT.
Thanks
Mohinder
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.