<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to update XML file from the program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-xml-file-from-the-program/m-p/6634571#M1442433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is what i have done but i dont know how to do the rest. i will apprecite any help from u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: man700s on Feb 16, 2010 6:58 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  Z_XML_FILE_UPDATE.


TYPES: BEGIN OF ts_staff,
         REF_IND(10)  TYPE c,
         Staff_No(5)  TYPE c,
         Name(50)     TYPE c,
         Room(3)      Type n,
         Phone(7)     Type n,
         Mail(30)     Type c,
       END OF ts_staff.

DATA: t_staff TYPE TABLE OF ts_staff WITH HEADER LINE.
DATA: w_staff Type ts_staff.

DATA T_STRING TYPE TABLE OF STRING.
DATA W_STRING TYPE STRING.

call SCREEN 100.

PERFORM upload_xml_file.
PERFORM update_xml_tab.
*PERFORM download_xml_file.

MODULE USER_COMMAND_0100 INPUT.



 W_STRING = '&amp;lt;allstaff&amp;gt;'.
  APPEND w_string to t_string.

  loop at t_staff into w_staff.
  w_string ='&amp;lt;staff&amp;gt;'.
  APPEND w_string to t_string.

  if T_staff-Ref_Ind = 'X'.
  CONCATENATE '&amp;lt;Ref_Ind&amp;gt;' w_staff-Ref_Ind '&amp;lt;/Ref_Ind&amp;gt;' into w_string.
  APPEND w_string to t_string.
  ENDIF.


  if T_staff-staff_no = 'X'.
  CONCATENATE '&amp;lt;staff_no&amp;gt;' w_staff-staff_no '&amp;lt;/staff_no&amp;gt;' into w_string.
  APPEND w_string to t_string.
  ENDIF.

  if T_staff-name = 'X'.
  CONCATENATE '&amp;lt;name&amp;gt;' w_staff-name '&amp;lt;/name&amp;gt;' into w_string.
  APPEND w_string to t_string.
  ENDIF.

if T_staff-room = 'X'.
  CONCATENATE '&amp;lt;room&amp;gt;' w_staff-room '&amp;lt;/room&amp;gt;' into w_string.
  APPEND w_string to t_string.
  ENDIF.

  if T_staff-phone = 'X'.
  CONCATENATE '&amp;lt;phone&amp;gt;' w_staff-phone '&amp;lt;/phone&amp;gt;' into w_string.
  APPEND w_string to t_string.
  ENDIF.

  if T_staff-mail = 'X'.
  CONCATENATE '&amp;lt;mail&amp;gt;' w_staff-mail '&amp;lt;/mail&amp;gt;' into w_string.
  APPEND w_string to t_string.
  ENDIF.

  w_string = '&amp;lt;/staff&amp;gt;'.
  append w_string to t_string.

ENDLOOP.

  W_STRING = '&amp;lt;/allstaff&amp;gt;'.
  APPEND w_string to t_string.
    

ENDMODULE.                




&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: man700s on Feb 16, 2010 7:01 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Feb 2010 05:48:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-02-16T05:48:47Z</dc:date>
    <item>
      <title>how to update XML file from the program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-xml-file-from-the-program/m-p/6634570#M1442432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am new in abap , and i have the following issue,so plz anyone who knows how to do it &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Background :&lt;/P&gt;&lt;P&gt; An XML file is used as the datasource for a Flex Application. From time to time this requires updating with new staff details. &lt;/P&gt;&lt;P&gt;i have already saved the xml file in the c drive with the name C:\AdvAC\AC1\bin-debug\assets\staff&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Requirement :  Write a Dialog transaction with the following text input fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference Indicator.	(Char10)&lt;/P&gt;&lt;P&gt;Staff No		(NUMC, Length 5)&lt;/P&gt;&lt;P&gt;Name			(Char50)&lt;/P&gt;&lt;P&gt;Room			(Numc, length 3)&lt;/P&gt;&lt;P&gt;Phone			(Numc Length 7)&lt;/P&gt;&lt;P&gt;Mail			(char30)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in screen 100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The transaction should also have an u201CUpdate Fileu201D button, which when pressed :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Loads the file C:\AdvAC\AC1\bin-debug\assets \ into an ITAB.&lt;/P&gt;&lt;P&gt;2) Inserts the data into the ITAB using the following XML format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;staff&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;ref_ind&amp;gt; Reference Indicator.&amp;lt;/ref_ind&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;staff_no&amp;gt; Staff No &amp;lt;/staff_no&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;name&amp;gt; Name &amp;lt;/name&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;room&amp;gt; Room &amp;lt;/room&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;phone&amp;gt; Phone &amp;lt;/phone&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;mail&amp;gt; Mail &amp;lt;/mail&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/staff&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all should be inside  &amp;lt;allstaff&amp;gt; &amp;lt;/allstaff&amp;gt; tagsu2026.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Writes the ITAB back to the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2010 05:37:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-xml-file-from-the-program/m-p/6634570#M1442432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-16T05:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to update XML file from the program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-xml-file-from-the-program/m-p/6634571#M1442433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is what i have done but i dont know how to do the rest. i will apprecite any help from u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: man700s on Feb 16, 2010 6:58 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  Z_XML_FILE_UPDATE.


TYPES: BEGIN OF ts_staff,
         REF_IND(10)  TYPE c,
         Staff_No(5)  TYPE c,
         Name(50)     TYPE c,
         Room(3)      Type n,
         Phone(7)     Type n,
         Mail(30)     Type c,
       END OF ts_staff.

DATA: t_staff TYPE TABLE OF ts_staff WITH HEADER LINE.
DATA: w_staff Type ts_staff.

DATA T_STRING TYPE TABLE OF STRING.
DATA W_STRING TYPE STRING.

call SCREEN 100.

PERFORM upload_xml_file.
PERFORM update_xml_tab.
*PERFORM download_xml_file.

MODULE USER_COMMAND_0100 INPUT.



 W_STRING = '&amp;lt;allstaff&amp;gt;'.
  APPEND w_string to t_string.

  loop at t_staff into w_staff.
  w_string ='&amp;lt;staff&amp;gt;'.
  APPEND w_string to t_string.

  if T_staff-Ref_Ind = 'X'.
  CONCATENATE '&amp;lt;Ref_Ind&amp;gt;' w_staff-Ref_Ind '&amp;lt;/Ref_Ind&amp;gt;' into w_string.
  APPEND w_string to t_string.
  ENDIF.


  if T_staff-staff_no = 'X'.
  CONCATENATE '&amp;lt;staff_no&amp;gt;' w_staff-staff_no '&amp;lt;/staff_no&amp;gt;' into w_string.
  APPEND w_string to t_string.
  ENDIF.

  if T_staff-name = 'X'.
  CONCATENATE '&amp;lt;name&amp;gt;' w_staff-name '&amp;lt;/name&amp;gt;' into w_string.
  APPEND w_string to t_string.
  ENDIF.

if T_staff-room = 'X'.
  CONCATENATE '&amp;lt;room&amp;gt;' w_staff-room '&amp;lt;/room&amp;gt;' into w_string.
  APPEND w_string to t_string.
  ENDIF.

  if T_staff-phone = 'X'.
  CONCATENATE '&amp;lt;phone&amp;gt;' w_staff-phone '&amp;lt;/phone&amp;gt;' into w_string.
  APPEND w_string to t_string.
  ENDIF.

  if T_staff-mail = 'X'.
  CONCATENATE '&amp;lt;mail&amp;gt;' w_staff-mail '&amp;lt;/mail&amp;gt;' into w_string.
  APPEND w_string to t_string.
  ENDIF.

  w_string = '&amp;lt;/staff&amp;gt;'.
  append w_string to t_string.

ENDLOOP.

  W_STRING = '&amp;lt;/allstaff&amp;gt;'.
  APPEND w_string to t_string.
    

ENDMODULE.                




&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: man700s on Feb 16, 2010 7:01 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2010 05:48:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-xml-file-from-the-program/m-p/6634571#M1442433</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-16T05:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to update XML file from the program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-xml-file-from-the-program/m-p/6634572#M1442434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is the to upload the xml file &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM UPLOAD_XML_FILE .
CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;GUI_UPLOAD
  EXPORTING
    FILENAME                = 'C:\AdvAC\AC1\bin-debug\assets\staff'
    FILETYPE                = 'ASC'

  CHANGING
    DATA_TAB                = T_STRING
  EXCEPTIONS
    FILE_OPEN_ERROR         = 1
    FILE_READ_ERROR         = 2
    NO_BATCH                = 3
    GUI_REFUSE_FILETRANSFER = 4
    INVALID_TYPE            = 5
    NO_AUTHORITY            = 6
    UNKNOWN_ERROR           = 7
    BAD_DATA_FORMAT         = 8
    HEADER_NOT_ALLOWED      = 9
    SEPARATOR_NOT_ALLOWED   = 10
    HEADER_TOO_LONG         = 11
    UNKNOWN_DP_ERROR        = 12
    ACCESS_DENIED           = 13
    DP_OUT_OF_MEMORY        = 14
    DISK_FULL               = 15
    DP_TIMEOUT              = 16
    NOT_SUPPORTED_BY_GUI    = 17
    ERROR_NO_GUI            = 18
    others                  = 19
        .
ENDFORM.  

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2010 06:07:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-xml-file-from-the-program/m-p/6634572#M1442434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-16T06:07:43Z</dc:date>
    </item>
  </channel>
</rss>

