cancel
Showing results for 
Search instead for 
Did you mean: 

Download excel from WD with Dropdown list

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Mohinder,

Can you share the code for the transformation which you created.

Regards,

Arun K

Former Member
0 Kudos

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