How to convert ALV output into XML format.

Advertisement

Hi all,
I just want to know how to convert an ALV output into a XML format, this is really urgent.
regards,
Ruchika saini

Advertisement

This program exports an internal table to an XML file. *----
Report ZPRUEBA_MML_13 *
Export an internal table to XML document *
NO BORRAR ESTE CODIGO *
REPORT ZPRUEBA_MML_13.
PANTALLA SELECCION *
     PARAMETERS: GK_RUTA TYPE RLGRAP-FILENAME.
PANTALLA SELECCION *
TYPE TURNOS *
TYPES: BEGIN OF TURNOS,
     LU LIKE T552A-TPR01,
     MA LIKE T552A-TPR01,
     MI LIKE T552A-TPR01,
     JU LIKE T552A-TPR01,
     VI LIKE T552A-TPR01,
     SA LIKE T552A-TPR01,
     DO LIKE T552A-TPR01,
END OF TURNOS.
TYPE TURNOS *
TYPE SOCIO *
TYPES: BEGIN OF SOCIO,
     NUMERO LIKE PERNR-PERNR,
     REPOSICION LIKE PA0050-ZAUVE,
     NOMBRE LIKE PA0002-VORNA,
     TURNOS TYPE TURNOS,
END OF SOCIO.
TYPE SOCIO *
ESTRUCTURA ACCESOS *
DATA: BEGIN OF ACCESOS OCCURS 0,
     SOCIO TYPE SOCIO,
END OF ACCESOS.
ESTRUCTURA ACCESOS *
START OF SELECTION *
START-OF-SELECTION.
     PERFORM LLENA_ACCESOS.
     PERFORM DESCARGA_XML.
END-OF-SELECTION.
END OF SELECTION *
FORM LLENA_ACCESOS *
FORM LLENA_ACCESOS.
REFRESH ACCESOS.
CLEAR ACCESOS.
MOVE: '45050' TO ACCESOS-SOCIO-NUMERO,
               'MOISES MORENO' TO ACCESOS-SOCIO-NOMBRE,
               '0' TO ACCESOS-SOCIO-REPOSICION,
               'T1' TO ACCESOS-SOCIO-TURNOS-LU,
               'T2' TO ACCESOS-SOCIO-TURNOS-MA,
               'T3' TO ACCESOS-SOCIO-TURNOS-MI,
               'T4' TO ACCESOS-SOCIO-TURNOS-JU,
               'T5' TO ACCESOS-SOCIO-TURNOS-VI,
               'T6' TO ACCESOS-SOCIO-TURNOS-SA,
               'T7' TO ACCESOS-SOCIO-TURNOS-DO.
APPEND ACCESOS.
CLEAR ACCESOS.
MOVE: '45051' TO ACCESOS-SOCIO-NUMERO,
               'RUTH PEÑA' TO ACCESOS-SOCIO-NOMBRE,
               '0' TO ACCESOS-SOCIO-REPOSICION,
               'T1' TO ACCESOS-SOCIO-TURNOS-LU,
               'T2' TO ACCESOS-SOCIO-TURNOS-MA,
               'T3' TO ACCESOS-SOCIO-TURNOS-MI,
               'T4' TO ACCESOS-SOCIO-TURNOS-JU,
               'T5' TO ACCESOS-SOCIO-TURNOS-VI,
               'T6' TO ACCESOS-SOCIO-TURNOS-SA,
               'T7' TO ACCESOS-SOCIO-TURNOS-DO.
APPEND ACCESOS.
ENDFORM.
FORM LLENA_ACCESOS *
FORM DESCARGA_XML *
FORM DESCARGA_XML.
DATA: L_DOM TYPE REF TO IF_IXML_ELEMENT,
               M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
               G_IXML TYPE REF TO IF_IXML,
               W_STRING TYPE XSTRING,
               W_SIZE TYPE I,
               W_RESULT TYPE I,
               W_LINE TYPE STRING,
               IT_XML TYPE DCXMLLINES,
               S_XML LIKE LINE OF IT_XML,
               W_RC LIKE SY-SUBRC.
DATA: XML TYPE DCXMLLINES.
DATA: RC TYPE SY-SUBRC,
BEGIN OF XML_TAB OCCURS 0,
               D LIKE LINE OF XML,
END OF XML_TAB.
CLASS CL_IXML DEFINITION LOAD.
G_IXML = CL_IXML=>CREATE( ).
CHECK NOT G_IXML IS INITIAL.
M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
CHECK NOT M_DOCUMENT IS INITIAL.
WRITE: / 'Converting DATA TO DOM 1:'.
CALL FUNCTION 'SDIXML_DATA_TO_DOM'
EXPORTING
               NAME = 'ACCESOS'
               DATAOBJECT = ACCESOS[]
IMPORTING
               DATA_AS_DOM = L_DOM
CHANGING
               DOCUMENT = M_DOCUMENT
EXCEPTIONS
               ILLEGAL_NAME = 1
               OTHERS = 2.
IF SY-SUBRC = 0.
               WRITE 'Ok'.
ELSE.
               WRITE: 'Err =',
               SY-SUBRC.
ENDIF.
CHECK NOT L_DOM IS INITIAL.
W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
IF W_RC IS INITIAL.
               WRITE 'Ok'.
ELSE.
               WRITE: 'Err =',
               W_RC.
ENDIF.
CALL FUNCTION 'SDIXML_DOM_TO_XML'
EXPORTING
               DOCUMENT = M_DOCUMENT
IMPORTING
               XML_AS_STRING = W_STRING
               SIZE = W_SIZE
TABLES
               XML_AS_TABLE = IT_XML
EXCEPTIONS
               NO_DOCUMENT = 1
               OTHERS = 2.
IF SY-SUBRC = 0.
               WRITE 'Ok'.
ELSE.
               WRITE: 'Err =',
               SY-SUBRC.
ENDIF.
LOOP AT IT_XML INTO XML_TAB-D.
               APPEND XML_TAB.
ENDLOOP.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
               BIN_FILESIZE = W_SIZE
               FILENAME = GK_RUTA
               FILETYPE = 'BIN'
TABLES
               DATA_TAB = XML_TAB
EXCEPTIONS
               OTHERS = 10.
IF SY-SUBRC <> 0.
               MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
Message was edited by:
        Hymavathi Oruganti

November 30, -0001

How to convert ALV output into XML format.

Hi all, I just want to know how to convert an ALV output into a XML format, this is really urgent. regards, Ruchika sainiThis program exports an internal table to an XML file. *---- Report ZPRUEBA_MML_13 * Export an internal table to XML document * N

How to convert database table into xml file

Hi. How to convert database table into XML file in Oracle HTML DB. Please let me know. Thanks.This not really a specific APEX question... but I search the database forum and found this thread which I think will help Exporting Oracle table to XML If i

How to convert .stl file into .xml file. Subtitles to IMPORT INTO FCPro

I have a subtitles file which was created in dvd studio pro. I exported that file and made a .stl file (which can be opened with TextEdit). I need to import that file into FCP to then make a quicktime file w/subs to be exported. I'm trying to use Tit

How to convert Java string into XML one?

With SAX I can parse an xml file, but I should create xml file by hands. Ok, it's simple, but how to encode java string into XML constant like "Hello & goodby" into "Hello & goodby" ? Is there a standard method for such special

How to convert alv list into excel file?

Hi Experts,         i have created one report for Due Date Analysis. Now My output is displaying in ALV list. But I need to convert the data which in alv list into Excel File. then only i have to send the Excel File to the Customer Thro Email.      S

How should convert text file into XML file?

I do a project "WEB SERVER LOG ANALYZER" using JSP. For that i copy the content of log file into the other file . how i convert it into XML file . xplain with codingRead this [page.|http://www.devx.com/getHelpOn/10MinuteSolution/20356]Read other

How to convert DTD files into XML(template) by using Java ?

I am a beginner to java,and want to convert a random DTD file into a XML template(having no data). any guys can give me some suggestions ? thanks very muchDTD allow you to validate a XML file. To do so, you can use API such as dom or xalan. To transf

How to convert text file into xml file

Hi Folks, I am genarating list of data into text file, but i want to genarate xml file for this text file. How to achive this , please let me know. Thanks. regards Vishalhi Vishal,   Use<b> GUI_DOWNLOAD</b> FM and give the file name as <b&g

How to convert excel file into xml file

Friends Will you please help me out becz i am daily getting excel file from SAP which i have to translate into the xml file. Waiting for ur reply. HiteshDepends on how your excel document looks like and what you wish to accomplish. First, save the ex

How to convert VCD files into readable format on iDVD, iMovie, DVD player

I found a bunch of old VCDs that I want to convert so that I can use them on iDVD, iMovie. What is the best free converter and would appreciate any tips as to the best way to reduce any loss of resolution. I tried last year converting thru mpeg strea

Conveting a BO report into XML format

Post Author: Gunjan CA Forum: Integrated Solutions Hi, We have a requirement to convert BO Report into XML format. Could you please help if there is any tool available to directly convert BO report into an XML based on a predefind XSD. Thanks GunjanP

Converting SPool information into HTML Format

Hi Friends, How to Converting SPool information into HTML Format and send this HTML INFORMATION INTO MAIL.. can anyone send program for this issue pls. it is an urgent issue regards,Hi Rich, once again thanks for your kindly reply. but i am developin

How to  send ALV output data into Excel sheet format via Mail to the user?

Hi friends, I have a doubt ie, How to  send ALV output data into Excel sheet format via Mail to the user? regards MoosaHi, Provide the output internal table to the objbin in the below FM Send Message   CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'   

How to convert Abap output/excel output into pie charts

Hi....... I've managed to output my Hierarchial sequential report output into a excel file....converting the abap output to xml and then mailing it.....now how can i convert this to pie chart......and mail it.....is it possible to have a pie chart in

How to convert HL7 file into an XML

Hi All, I am new to HL7,can any one tell how to convert HL7 file into an XML.Give sample demo or related links. My sample HL7 file is as follows how can I convert. FHS|^~\&||Tax ID123^Lab Name123^L|||201110191435||HL7.txt||1234567|123|| PID|seqno|123

Converting a result of query into XML format

Hi, I am going to use DBXML,DBBOM and DBXSL ie PLSXML utilities to convert the records returned after querying the data into XML format.Is it possible to do this using these packages? Should i use Oracle SQL XML Utility? Which would be better?I've us

How to regenerate output in XML format after having assigned RTF Template

1. I created a concurrent request to get the output in XML data format 2. Having created RTF File and assigned Data Definition and Template through XML Administartor Responsibility 3. Now I want to make changes in Data Definition XML File, However I

Procedure/sample code to download alv output in HTM format & mail to user.

Hello Experts, I've a requirement to run the Alv report at background. But i need to download the alv output in HTM fomat because it has subtotal values & look wise downloaded HTM format will be same as that of ALV output. Then send the attachment th

HT204382 How to convert VOB files into MP4 ? Tks

Hi, anyone knows how to convert VOB files into MP4 ones ? Tkshttp://forums.macrumors.com/showthread.php?t=812985 The procedure is dated and I will assume that the DVD is not copy-protected since discussion of such things is verboten.Read other 3 answ

Tool or mechanism to put the Oracle metadata into XML format

Hi, Is there any tool or mechanism provided by Oracle to put the Oracle metadata into XML format?I mean metadata here represents Database objects like Tables, Columns, Schemas, stored procedures, Table spaces etc. Regards, DayakarFrom 9i and onwards,