Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

error while downloading the xml file

Former Member
0 Likes
2,607

i am having a internal table which contains data in xml format but i am unable to download the data into local system by using 'GUI_DOWNLOAD' fn. module

its error its showing is as :

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

-


A name contained an invalid character. Error processing resource 'file:///D:/XX.XML'. Line 4, Position 4

MOD/><RPTSX/><MANDT/><SYPSY/><SYSID/><SAPRL/></T682><T682><KVEWE>A</KV...

i am having a internal table which contains data in xml format but i am unable to download the data into local system by using 'GUI_DOWNLOAD' fn. module

its error its showing is as :

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

-


A name contained an invalid character. Error processing resource 'file:///D:/XX.XML'. Line 4, Position 4

MOD/><RPTSX/><MANDT/><SYPSY/><SYSID/><SAPRL/></T682><T682><KVEWE>A</KV...

3 REPLIES 3
Read only

athavanraja
Active Contributor
0 Likes
1,399

it means, the xml is not downloaded properly.

post your code which download xml. we will see whats going wrong.

Raja

assign points and close previous threads

Read only

Former Member
0 Likes
1,399

hello Durairaj,

i am fwd the code go thru it and check why the xml file is not downloading,

and after downloading the file i want that file to be in displayed in .pdf.

REPORT ZCCSV_TO_XML.

DATA : BEGIN OF TABLE OCCURS 0,

TABNAME(15) TYPE C,

END OF TABLE.

DATA : BEGIN OF HEADER_NAMTAB OCCURS 0,

NAMTAB TYPE STRING,

END OF HEADER_NAMTAB.

DATA : BEGIN OF CONVERT_ITAB_TO_XML OCCURS 0,

FIELDNAME(255) TYPE C,

END OF CONVERT_ITAB_TO_XML .

DATA : BEGIN OF CONVERT_XML_TO_ITAB OCCURS 0,

FIELDNAME(255) TYPE C,

END OF CONVERT_XML_TO_ITAB.

DATA DREF TYPE REF TO DATA.

DATA TNAME LIKE DD02L-TABNAME.

DATA BEGIN OF ZDFIES OCCURS 0.

INCLUDE STRUCTURE DFIES.

DATA END OF ZDFIES.

DATA: xml_out TYPE string .

DATA: xml_TO_ITAB TYPE string .

data : wa_indx type indx.

DATA : DETAIL(30).

DATA : DATA1 TYPE STRING.

DATA : COMMA . "VALUE ','.

DATA : DBTAB1(15) TYPE C.

FIELD-SYMBOLS: <ITAB> TYPE ANY TABLE,

<WA> TYPE ANY,

<WA1> TYPE ANY .

SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME,

SKIP 1.

PARAMETERS : SPOOL RADIOBUTTON GROUP rad1 DEFAULT 'X',

CSV RADIOBUTTON GROUP rad1 ,

XMLTOPDF RADIOBUTTON GROUP rad1.

SELECTION-SCREEN : SKIP 1,

END OF BLOCK b1.

TABLE-TABNAME = 'T681'.

APPEND TABLE.

TABLE-TABNAME = 'T682'.

APPEND TABLE.

IF SPOOL = 'X'.

  • PERFORM SPOOL.

ELSEIF CSV = 'X'.

PERFORM CSV.

ELSEIF XMLTOPDF = 'X'.

PERFORM XMLTOPDF.

ENDIF.

&----


*& Form CSV

&----


form CSV .

LOOP AT TABLE.

dbtab1 = TABLE-TABNAME.

TNAME = dbtab1.

PERFORM GETFIELDS.

LOOP AT HEADER_NAMTAB.

WRITE: HEADER_NAMTAB-NAMTAB, COMMA.

ENDLOOP.

PERFORM GET_DETAIL_LIST.

ENDLOOP.

endform. " CSV

form XMLTOPDF .

LOOP AT TABLE.

PERFORM GET_DETAIL_LIST.

ENDLOOP.

endform. " XMLTOPDF

************************************************************************

  • GETTING THE HEADER OF THE TABLE *

************************************************************************

FORM GETFIELDS.

REFRESH HEADER_NAMTAB.

CALL FUNCTION 'GET_FIELDTAB'

EXPORTING

LANGU = SY-LANGU

ONLY = SPACE

TABNAME = TNAME

WITHTEXT = 'X'

TABLES

FIELDTAB = ZDFIES

EXCEPTIONS

INTERNAL_ERROR = 01

NO_TEXTS_FOUND = 02

TABLE_HAS_NO_FIELDS = 03

TABLE_NOT_ACTIV = 04.

CASE SY-SUBRC.

WHEN 0.

LOOP AT ZDFIES.

HEADER_NAMTAB-NAMTAB = ZDFIES-SCRTEXT_M.

APPEND HEADER_NAMTAB.

ENDLOOP.

WHEN OTHERS.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-SUBRC.

ENDCASE.

ENDFORM. " GETFIELEDS

&----


*& Form GET_DETAIL_LIST

&----


form GET_DETAIL_LIST .

CREATE DATA DREF TYPE STANDARD TABLE OF (TABLE)

WITH NON-UNIQUE DEFAULT KEY.

ASSIGN DREF->* TO <ITAB> .

SELECT * FROM (TABLE) INTO TABLE <ITAB>.

CALL TRANSFORMATION ('ID')

SOURCE tab = <ITAB>[]

RESULT XML xml_out.

*----


Convert to TABLE

CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'

EXPORTING

i_string = xml_out

i_tabline_length = 100

TABLES

et_table = CONVERT_ITAB_TO_XML.

*----


Download

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filetype = 'ASC'

filename = 'D:\XX.XML'

TABLES

data_tab = CONVERT_ITAB_TO_XML

.

endform.

Read only

0 Likes
1,399

check this thread