Simple Transformation from ABAP to XML and back

Hi experts,
Can anyone provide me a simple example of a 'simple transformation' that will convert and internal table with more than one column into XML via a simple transformation.
I've spend days now reading SAP help and e-learning examples, but this just won't work and I am getting short dumps saying 'The goal was to access variable "ROOT". However, this access was notv possible.'
Here is my ABAP:
data: begin of struc,
           counter type i,
           aname type string,
           aname2 type string,
      end of struc.
data: cnt_c type c.
data: itab like table of struc with HEADER LINE,
      xml_string type xstring.
do 3 times.
     move sy-index to: itab-counter, cnt_c.
     concatenate 'nameA' cnt_c into itab-aname.
     concatenate 'nameB' cnt_c into itab-aname2.
     append itab.
enddo.
CALL TRANSFORMATION Z_ST_TEST5
       SOURCE  ROOT = itab
       RESULT XML xml_string.
CALL FUNCTION 'DISPLAY_XML_STRING'
  EXPORTING
    XML_STRING            = xml_string.
skip 1.
and here is my ST:
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
  <tt:root name="ROOT"/>
    <tt:template>
     <TABLE>
      <tt:loop ref=".ROOT" name="line">
        <ITEM>
          <counter>
            <tt:value ref="$line.aname" />
          </counter>
          <name>
            <tt:value ref="$line.aname" />
          </name>
          <name2>
            <tt:value ref="$line.aname2" />
          </name2>
        </ITEM>
      </tt:loop>
     </TABLE>
    </tt:template>
</tt:transform>

Figured it out. The interla tables used in teh call transformation statement can never have a header line.

Similar Messages

  • Simple Transformation from Adobe Form XML document to Dictionary structures

    I have an XML document that I am receiving via email (the XML document is generated from an Adobe Interactive form). I would like to write a simple transformation that will map that XML document to a structure and internal table in my ABAP program. I am new to Simple Transformations and I am having trouble working out how to write a simple transformation for this type of XML document. I would prefer to write a custom transformation rather than using the identity transformation (ID). I would appreciate any help you can provide.
    Please refer to the below for an example of the XML file.
    This maps directly to 2 dictionary structures that exist within our system containing all of the same components. PIM_REQUEST_HDR has a corresponding SAP dictionary structure Y_REQUEST_HDR and PIM_REQUEST_ITEMS has a corresponding SAP dictionary structure Y_REQUEST_ITEMS.
    Can anyone help with some instructions or examples of how to create the simple transformation?
    Thanks for your help! We are using ECC 6.0
    Sample XML to be transformed:
    <?xml version="1.0" encoding="UTF-8" ?>
    <data>
    <SFPSY>
      <DATE>2007-07-03</DATE>
      <TIME>07:25:21</TIME>
      <USERNAME>TLCITY</USERNAME>
      <SUBRC>0</SUBRC>
      </SFPSY>
    <PIM_REQUEST_HDR>
      <MANDT />
      <REQ_NUM />
      <REQ_DESC>blah blah blah</REQ_DESC>
      <PROC_AREA>CTC</PROC_AREA>
      <REQUESTED>2007-07-03</REQUESTED>
      <REQUIRED>2007-07-03</REQUIRED>
      <REQUESTOR>TLCITY</REQUESTOR>
      <MOD_TYPE>SAP Note manual changes</MOD_TYPE>
      <SAPNOTE_NUM>59549656</SAPNOTE_NUM>
      <SAPMSG_NUM>0000000000</SAPMSG_NUM>
      <TECH_SCRIPT />
      <REASON />
      <DEV_ENV>ECC6</DEV_ENV>
      <INSTALL_NO>2861655161</INSTALL_NO>
      <BASIS_REL>700</BASIS_REL>
      <REG_STATUS />
      <REJ_REASON />
      <APP_DATE />
      <REJ_DATE />
      <APPROVER />
      <REGISTRATOR />
      <REG_DATE />
      </PIM_REQUEST_HDR>
    <PIM_REQUEST_ITEMS>
    <DATA>
      <MANDT />
      <REQ_NUM />
      <PGMID>R3TR</PGMID>
      <OBJECT>PROG</OBJECT>
      <OBJ_NAME>RSDIJOIJSDOIF</OBJ_NAME>
      <ACCESSKEY />
      </DATA>
    <DATA>
      <MANDT />
      <REQ_NUM />
      <PGMID>R3TR</PGMID>
      <OBJECT>PROG</OBJECT>
      <OBJ_NAME>RRRSDIJOIJS03</OBJ_NAME>
      <ACCESSKEY />
      </DATA>
      </PIM_REQUEST_ITEMS>
      </data>

    I have solved this one with the help of another collegue.
    To simplify, we changed the XML to be as follows:
    [code]
    <?xml version="1.0" encoding="UTF-8" ?>
    <data>
    <PIM_REQUEST>
    <REQ_HDR>
      <MANDT />
      <REQ_NUM />
      <REQ_DESC>Key required for pricing routines</REQ_DESC>
      <PROC_AREA>SD</PROC_AREA>
      <REQUESTED>2007-07-30</REQUESTED>
      <REQUIRED>2007-08-02</REQUIRED>
      <REQUESTOR>TLCITY</REQUESTOR>
      <MOD_TYPE>SAP Note: Manual Changes</MOD_TYPE>
      <SAPNOTE_NUM>0000000000</SAPNOTE_NUM>
      <SAPMSG_NUM>0000000000</SAPMSG_NUM>
      <TECH_SCRIPT>TS-2498 Pricing Routines</TECH_SCRIPT>
      <REASON>New pricing routines required</REASON>
      <DEV_ENV>ECC6</DEV_ENV>
      <INSTALL_NO>029</INSTALL_NO>
      <BASIS_REL>700</BASIS_REL>
      <REG_STATUS />
      <REJ_REASON />
      <APP_DATE />
      <REJ_DATE />
      <APPROVER />
      <REGISTRATOR />
      <REG_DATE />
      </REQ_HDR>
    <KEY_DETAILS>
    <DATA>
      <MANDT />
      <REQ_NUM />
      <PGMID>R3TR</PGMID>
      <OBJECT>PROG</OBJECT>
      <OBJ_NAME>RVGHT902</OBJ_NAME>
      <ACCESSKEY />
      </DATA>
    <DATA>
      <MANDT />
      <REQ_NUM />
      <PGMID>R3TR</PGMID>
      <OBJECT>PROG</OBJECT>
      <OBJ_NAME>RVGHT901</OBJ_NAME>
      <ACCESSKEY />
      </DATA>
      </KEY_DETAILS>
      </PIM_REQUEST>
      </data>
    [/code]
    This maps directly to 1 dictionary structure that exists within our system containing all of the same components. PIM_REQUEST has a corresponding SAP dictionary structure Y_REQUEST_HDR which is a deep structure and has within it a structure REQ_HDR and a table KEY_DETAILS.
    The corresponding simple transformation we have then used is as follws:
    [code]
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="root"/>
      <tt:template>
        <data>
          <PIM_REQUEST>
            <tt:copy ref="root"/>
          </PIM_REQUEST>
        </data>
      </tt:template>
    </tt:transform>
    [/code]
    Alternatively the following 2 options also work:
    Option 2:
    [code]
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="root"/>
      <tt:template>
        <data>
          <PIM_REQUEST>
            <REQ_HDR>
              <tt:copy ref="root.REQ_HDR"/>
            </REQ_HDR>
            <KEY_DETAILS>
              <tt:loop name="KEY_DETAILS" ref="root.KEY_DETAILS">
                <DATA>
                  <tt:copy ref="$KEY_DETAILS"/>
                </DATA>
              </tt:loop>
            </KEY_DETAILS>
          </PIM_REQUEST>
        </data>
      </tt:template>
    </tt:transform>
    [/code]
    Option 3:
    [code]
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="root"/>
      <tt:template>
        <data>
          <PIM_REQUEST>
            <REQ_HDR>
              <MANDT tt:value-ref="root.REQ_HDR.MANDT"/>
              <REQ_NUM tt:value-ref="root.REQ_HDR.REQ_NUM"/>
              <REQ_DESC tt:value-ref="root.REQ_HDR.REQ_DESC"/>
              <PROC_AREA tt:value-ref="root.REQ_HDR.PROC_AREA"/>
              <REQUESTED tt:value-ref="root.REQ_HDR.REQUESTED"/>
              <REQUIRED tt:value-ref="root.REQ_HDR.REQUIRED"/>
              <REQUESTOR tt:value-ref="root.REQ_HDR.REQUESTOR"/>
              <MOD_TYPE tt:value-ref="root.REQ_HDR.MOD_TYPE"/>
              <SAPNOTE_NUM tt:value-ref="root.REQ_HDR.SAPNOTE_NUM"/>
              <SAPMSG_NUM tt:value-ref="root.REQ_HDR.SAPMSG_NUM"/>
              <TECH_SCRIPT tt:value-ref="root.REQ_HDR.TECH_SCRIPT"/>
              <REASON tt:value-ref="root.REQ_HDR.REASON"/>
              <DEV_ENV tt:value-ref="root.REQ_HDR.DEV_ENV"/>
              <INSTALL_NO tt:value-ref="root.REQ_HDR.INSTALL_NO"/>
              <BASIS_REL tt:value-ref="root.REQ_HDR.BASIS_REL"/>
              <REG_STATUS tt:value-ref="root.REQ_HDR.REG_STATUS"/>
              <REJ_REASON tt:value-ref="root.REQ_HDR.REJ_REASON"/>
              <APP_DATE tt:value-ref="root.REQ_HDR.APP_DATE"/>
              <REJ_DATE tt:value-ref="root.REQ_HDR.REJ_DATE"/>
              <APPROVER tt:value-ref="root.REQ_HDR.APPROVER"/>
              <REGISTRATOR tt:value-ref="root.REQ_HDR.REGISTRATOR"/>
              <REG_DATE tt:value-ref="root.REQ_HDR.REG_DATE"/>
            </REQ_HDR>
            <KEY_DETAILS>
              <tt:loop ref="root.KEY_DETAILS" name="KEY_DETAILS">
                <DATA>
                  <MANDT tt:value-ref="$KEY_DETAILS.MANDT"/>
                  <REQ_NUM tt:value-ref="$KEY_DETAILS.REQ_NUM"/>
                  <PGMID tt:value-ref="$KEY_DETAILS.PGMID"/>
                  <OBJECT tt:value-ref="$KEY_DETAILS.OBJECT"/>
                  <OBJ_NAME tt:value-ref="$KEY_DETAILS.OBJ_NAME"/>
                  <ACCESSKEY tt:value-ref="$KEY_DETAILS.ACCESSKEY"/>
                </DATA>
              </tt:loop>
            </KEY_DETAILS>
          </PIM_REQUEST>
        </data>
      </tt:template>
    </tt:transform>
    [/code]

  • Conversion of internal tables from ABAP to XML and Viceversa

    Hi ,
    I am writing a BAPI to pick the data from SAP system which gives its output to a .NET application. So, i designed XSD and i want the output of the BAPI according to that XSD rather than in the form of normal internal tables.
    Can any one please tell me what is the best way to do this ?
    I know very little about the simple transformations that are available in ABAP. Do we need to write our own transformation for the conversion of the internal tables to required XML format or do we already have transformations which take the internal tables and XSD to generate the XML required ?
    Also for again converting the XML document to ABAP do we need to write a new transformation ?
    Reward points are assured for all the replies.
    Regards,
    Srinivas.

    to convert internal table to xml format you could use CALL TRANSFORMATION key word
    data: xml_out type string .
    call transformation (`ID`)
                  source output = youritab
                  result xml xml_out.
    instead of ID (xslt program) you can desing your own xslt program to generate the xml in the desired format. ID is the standard delivered one

  • From IDML to XML, and back

    Hi,
    I'm trying to send my translators some simple XML files, they can translate with a text editor or CAT tool.
    What I do is export from InDesign CS5 to IDML. After replacing the .idml file extension with .zip, I can double-click to have the XML files in the Finder.
    When I get the translated XML files back, I use the right-click > Compress command of OSX to get a .zip file. Then I rename the .zip extension to .idml.
    While the file icon changes to an ID file, and opens in ID when double-clicking on it, ID refuses to recognize it as a valid file. What am I doing wrong?
    Best regards,
    Paolo

    Here is how I solved the problem. It is not the most elegant solution, but it works.
    First of all, I unzipped the .idml file generated by ID and renamed to .zip.
    Then, when I received the translated .xml files, I opened the original file with iZip. This program let me "see" inside the .zip archive, and manage the individual files it contains.
    So, I copied the translated .xml files to the original files inside the .zip file. When closing iZip, the .zip file was updated.
    At this point, I renamed it to .idml, and InDesign opened it perfectly.
    I guess this can also be done with anhy other Zip software that lets one see inside the .zip archive. Also, maybe it works with the Windows Explorer, that has this features as a native one.
    I'll also check if the scripts suggested by R-Bala will work. I'm downloading the InDesign CS5 Server SDK now.
    It would be great if Adobe could fix this issue as soon as possible, since it would make life of multilingual authors way easier.
    Paolo

  • Defining XSLT from Abap to XML and XML to Abap (Internal Table)

    Hi Experts, I need help with this XSLT for call transformation. I have defined an internal table and intend to use it as a source for Call Tranformation. But I have a Problem defining its XSLT and help would be greatly appreciated! I also wonder if this XSLT can be used for XML to internal table? Or do I have to define another XSLT again.... Hope to hear from any of u soon!
    CODES->>>
    TYPES: BEGIN OF CONTENT,
             CONTENT1(20),
             CONTENT2(20),
           END OF CONTENT.
    TYPES: T_CONTENT TYPE TABLE OF CONTENT.
    DATA: BEGIN OF I_DATA OCCURS 0,
            KEY1(10),
            KEY2(10),
            CONT TYPE T_CONTENT,
          END OF I_DATA.
    DATA: WA_TBL TYPE CONTENT.
    DATA: LI_TBL TYPE T_CONTENT.
    START-OF-SELECTION.
    populate data 1
      CLEAR I_DATA.
      I_DATA-KEY1 = 'AMI'.
      I_DATA-KEY2 = 'LEE'.
      CLEAR WA_TBL.
      REFRESH LI_TBL.
      WA_TBL-CONTENT1 = 'PENHAS ROAD'.
      WA_TBL-CONTENT2 = 'SG'.
      APPEND WA_TBL TO LI_TBL.
      WA_TBL-CONTENT1 = 'GILLMAN ROAD'.
      WA_TBL-CONTENT2 = 'SG'.
      APPEND WA_TBL TO LI_TBL.
      I_DATA-CONT = LI_TBL.
      APPEND I_DATA.
    populate data 1
      CLEAR I_DATA.
      I_DATA-KEY1 = 'KAI'.
      I_DATA-KEY2 = 'LEE'.
      CLEAR WA_TBL.
      REFRESH LI_TBL.
      WA_TBL-CONTENT1 = 'SUNSET WAY'.
      WA_TBL-CONTENT2 = 'SG'.
      APPEND WA_TBL TO LI_TBL.
      WA_TBL-CONTENT1 = 'BEDOK NORTH'.
      WA_TBL-CONTENT2 = 'SG'.
      APPEND WA_TBL TO LI_TBL.
      I_DATA-CONT = LI_TBL.
      APPEND I_DATA.
    call transformation (xslt)
        source i_data = i_data
        result xml xmlstr.

    here is the code sample using ixml library .
    just create a report program and copy paste the following code.
    if time permits, later on i will post the xslt program which you can use it call transformation.
    REPORT  y_test_xml.
    DATA: l_ixml                                 TYPE REF TO if_ixml,
            l_ixml_sf                              TYPE REF TO if_ixml_stream_factory,
            l_istream                              TYPE REF TO if_ixml_istream,
            l_ostream                              TYPE REF TO if_ixml_ostream,
            l_booklist                   TYPE REF TO if_ixml_element,
            l_document                             TYPE REF TO if_ixml_document,
            l_parser                               TYPE REF TO if_ixml_parser,
            l_root_element                         TYPE REF TO if_ixml_element,
            l_book_record                            TYPE REF TO if_ixml_element,
            l_date TYPE REF TO if_ixml_element ,
                    l_time TYPE REF TO if_ixml_element ,
            l_book_group                            TYPE REF TO if_ixml_element,
            l_book_cat                            TYPE REF TO if_ixml_element ,
            others                                  TYPE REF TO if_ixml_element ,
            link                                    TYPE REF TO if_ixml_element ,
            description                            TYPE REF TO if_ixml_element ,
            xml                                    TYPE xstring ,
            size TYPE  i ,
             l_xml  TYPE REF TO cl_xml_document  .
    DATA: xml_out TYPE string ,
          temp_string TYPE string .
    TYPES: BEGIN OF add_category,
    category_id(10),
    category_desc(40),
    END OF add_category,
    add_t_category TYPE add_category OCCURS 0 .
    TYPES: BEGIN OF add_book_grp,
    book_category TYPE add_t_category,
    END OF add_book_grp,
    add_t_book_grp TYPE add_book_grp OCCURS 0.
    TYPES: BEGIN OF add_book,
    book_num(10) TYPE c,
    short_desc(40) TYPE c,
    book_group TYPE add_t_book_grp,
    END OF add_book,
    add_t_book TYPE add_book OCCURS 0.
    TYPES: BEGIN OF type_data,
    date TYPE sy-datum,
    time TYPE sy-uzeit,
    book_record TYPE add_t_book,
    END OF type_data.
    DATA: i_data TYPE type_data OCCURS 0 WITH HEADER LINE.
    DATA: itab LIKE soli OCCURS 0 WITH HEADER LINE.
    DATA: cat_wa TYPE add_category ,
          bk_gp_wa TYPE add_book_grp ,
          bk_rec_wa TYPE add_book ,
          bk_wa LIKE LINE OF i_data .
    DATA: cat_tab TYPE STANDARD TABLE OF add_category ,
          bk_gp_tab TYPE STANDARD TABLE OF add_book_grp ,
          bk_rec_tab TYPE STANDARD TABLE OF add_book .
    MOVE: '03' TO cat_wa-category_id  ,
          ' BK GP 3' TO cat_wa-category_desc .
    APPEND cat_wa TO cat_tab .
    MOVE: '02' TO cat_wa-category_id  ,
          ' BK GP 2' TO cat_wa-category_desc .
    APPEND cat_wa TO cat_tab .
    bk_gp_wa-book_category  = cat_tab.
    APPEND bk_gp_wa TO bk_gp_tab .
    MOVE: '0012345678' TO bk_rec_wa-book_num ,
          'OMS book' TO bk_rec_wa-short_desc .
    bk_rec_wa-book_group = bk_gp_tab .
    APPEND bk_rec_wa TO bk_rec_tab .
    CLEAR:bk_gp_tab, cat_tab .
    REFRESH :bk_gp_tab, cat_tab .
    MOVE: '01' TO cat_wa-category_id  ,
          ' BK GP 1' TO cat_wa-category_desc .
    APPEND cat_wa TO cat_tab .
    MOVE: '09' TO cat_wa-category_id  ,
          ' BK GP 9' TO cat_wa-category_desc .
    APPEND cat_wa TO cat_tab .
    bk_gp_wa-book_category  = cat_tab.
    APPEND bk_gp_wa TO bk_gp_tab .
    MOVE: '00123456789' TO bk_rec_wa-book_num ,
          'SAP book' TO bk_rec_wa-short_desc .
    bk_rec_wa-book_group = bk_gp_tab .
    APPEND bk_rec_wa TO bk_rec_tab .
    MOVE: sy-datum TO bk_wa-date ,
          sy-uzeit TO bk_wa-time .
    bk_wa-book_record = bk_rec_tab .
    APPEND bk_wa TO i_data .
    CLEAR: cat_wa , bk_gp_wa ,bk_rec_wa , bk_wa .
    l_ixml = cl_ixml=>create( ).
    l_ixml_sf = l_ixml->create_stream_factory( ).
    l_document = l_ixml->create_document( ).
    l_root_element = l_document->create_element( name = 'asx:abap' ).
    l_root_element->set_attribute( name = 'xmlns:asx' value = 'http://www.sap.com/abapxml' ) .
    l_root_element->set_attribute( name = 'version' value = '1.0' ).
    l_document->append_child( new_child = l_root_element ).
    others = l_document->create_simple_element( parent = l_root_element name = 'asx:values' ).
    l_booklist = l_document->create_simple_element( parent = others name = 'BOOKLIST' ).
    LOOP AT i_data INTO bk_wa .
      CLEAR temp_string .
      MOVE: bk_wa-date TO temp_string .
      l_date = l_document->create_simple_element( parent = l_booklist name = 'DATE' value = temp_string  ).
      CLEAR temp_string .
      MOVE: bk_wa-time TO temp_string .
      l_time = l_document->create_simple_element( parent = l_booklist name = 'TIME' value = temp_string ).
      LOOP AT bk_wa-book_record INTO bk_rec_wa .
        l_book_record = l_document->create_simple_element( parent = l_booklist name = 'BOOK_RECORD' ) .
        CLEAR temp_string .
        MOVE: bk_rec_wa-book_num TO temp_string .
        l_date = l_document->create_simple_element( parent = l_book_record name = 'BOOK_NUM' value = temp_string ).
        CLEAR temp_string .
        MOVE: bk_rec_wa-short_desc TO temp_string .
        l_time = l_document->create_simple_element( parent = l_book_record name = 'SHORT_DESC' value = temp_string ).
        l_book_group = l_document->create_simple_element( parent = l_book_record name = 'BOOK_GROUP' ).
        LOOP AT bk_rec_wa-book_group INTO bk_gp_wa .
          LOOP AT bk_gp_wa-book_category INTO cat_wa .
            l_book_cat = l_document->create_simple_element( parent = l_book_group name = 'BOOK_CATEGORY' ).
            CLEAR temp_string .
            MOVE: cat_wa-category_id TO temp_string .
            l_date = l_document->create_simple_element( parent = l_book_cat name = 'CATEGORY_ID' value = temp_string ).
            CLEAR temp_string .
            MOVE: cat_wa-category_desc TO temp_string .
            l_time = l_document->create_simple_element( parent = l_book_cat name = 'CATEGORY_DESC' value = temp_string ).
          ENDLOOP .
        ENDLOOP .
      ENDLOOP .
    ENDLOOP .
    l_ostream = l_ixml_sf->create_ostream_xstring( xml ).
    l_document->render( ostream = l_ostream ).
    CREATE OBJECT l_xml.
    CALL METHOD l_xml->parse_xstring
      EXPORTING
        stream = xml.
    l_xml->render_2_string(
      EXPORTING
        pretty_print = 'X'
      IMPORTING
    *    RETCODE      = RETCODE
        stream       = xml_out
        size         = size
    CALL METHOD l_xml->display.
    Hope this is helpful.
    do let us know how it goes.
    Regards
    Raja

  • ABAP Simple Transformation - How to save XML to file with CL_FX_WRITER?

    Hello!
    When calling a Simple Transformation program for transformation from ABAP to XML, it is possible to specify RESULT XML rxml as a class reference variable of type CL_FX_WRITER, which points to an XML writer.
    How to handle CL_FX_WRITER in order to save XML to a file?
    Thanks and regards,
    Andrey

    Hallo Rainer!
    Many thanks. I have checked the profile parameter ztta/max_memreq_MB and it is set to 2048 MB in the development system. I hope, that won't be less on the client's machine. The only thing I did not clearly explained, is that I need to write XML data to the server. I am so sorry. Downloading to the local PC is very helpful for me also, but only for the test purposes.
    Regards,
    Andrey

  • Simple Transformation to deserialize an XML file into ABAP data structures?

    I'm attempting to write my first simple transformation to deserialize
    an XML file into ABAP data structures and I have a few questions.
    My simple transformation contains code like the following
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates"
                  xmlns:pp="http://www.sap.com/abapxml/types/defined" >
    <tt:type name="REPORT" line-type="?">
      <tt:node name="COMPANY_ID" type="C" length="10" />
      <tt:node name="JOB_ID" type="C" length="20" />
      <tt:node name="TYPE_CSV" type="C" length="1" />
      <tt:node name="TYPE_XLS" type="C" length="1" />
      <tt:node name="TYPE_PDF" type="C" length="1" />
      <tt:node name="IS_NEW" type="C" length="1" />
    </tt:type>
    <tt:root name="ROOT2" type="pp:REPORT" />
        <QueryResponse>
        <tt:loop ref="ROOT2" name="line">
          <QueryResponseRow>
            <CompanyID>
              <tt:value ref="$line.COMPANY_ID" />
            </CompanyID>
            <JobID>
              <tt:value ref="$line.JOB_ID" />
            </JobID>
            <ExportTypes>
              <tt:loop>
                <ExportType>
                   I don't know what to do here (see item 3, below)
                </ExportType>
              </tt:loop>
            </ExportTypes>
            <IsNew>
              <tt:value ref="$line.IS_NEW"
              map="val(' ') = xml('false'), val('X') = xml('true')" />
            </IsNew>
          </QueryResponseRow>
          </tt:loop>
        </QueryResponse>
        </tt:loop>
    1. In a DTD, an element can be designated as occurring zero or one
    time, zero or more times, or one or more times. How do I write the
    simple transformation to accommodate these possibilities?
    2. In trying to accommodate the "zero or more times" case, I am trying
    to use the <tt:loop> instruction. It occurs several layers deep in the
    XML hierarchy, but at the top level of the ABAP table. The internal
    table has a structure defined in the ABAP program, not in the data
    dictionary. In the simple transformation, I used <tt:type> and
    <tt:node> to define the structure of the internal table and then
    tried to use <tt:loop ref="ROOT2" name="line"> around the subtree that
    can occur zero or more times. But every variation I try seems to get
    different errors. Can anyone supply a working example of this?
    3. Among the fields in the internal table, I've defined three
    one-character fields named TYPE_CSV, TYPE_XLS, and TYPE_PDF. In the
    XML file, I expect zero to three elements of the form
    <ExportType exporttype='csv' />
    <ExportType exporttype='xls' />
    <ExportType exporttype='pdf' />
    I want to set field TYPE_CSV = 'X' if I find an ExportType element
    with its exporttype attribute set to 'csv'. I want to set field
    TYPE_XLS = 'X' if I find an ExportType element with its exporttype
    attribute set to 'xls'. I want to set field TYPE_PDF = 'X' if I find
    an ExportType element with its exporttype attribute set to 'pdf'. How
    can I do that?
    4. For an element that has a value like
    <ErrorCode>123</ErrorCode>
    in the simple transformation, the sequence
    <ErrorCode>  <tt:value ref="ROOT1.CODE" />  </ErrorCode>
    seems to work just fine.
    I have other situations where the XML reads
    <IsNew value='true' />
    I wanted to write
    <IsNew>
            <tt:value ref="$line.IS_NEW"
            map="val(' ') = xml('false'), val('X') = xml('true')" />
           </IsNew>
    but I'm afraid that the <tt:value> fails to deal with the fact that in
    the XML file the value is being passed as the value of an attribute
    (named "value"), rather than the value of the element itself. How do
    you handle this?

    Try this code below:
    data  l_xml_table2  type table of xml_line with header line.
    W_filename - This is a Path.
      if w_filename(02) = '
        open dataset w_filename for output in binary mode.
        if sy-subrc = 0.
          l_xml_table2[] = l_xml_table[].
          loop at l_xml_table2.
            transfer l_xml_table2 to w_filename.
          endloop.
        endif.
        close dataset w_filename.
      else.
        call method cl_gui_frontend_services=>gui_download
          exporting
            bin_filesize = l_xml_size
            filename     = w_filename
            filetype     = 'BIN'
          changing
            data_tab     = l_xml_table
          exceptions
            others       = 24.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
                     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.

  • Simple transformation error in converting XML to internal table

    Hi Team,
    I have an issue, its working in Dev, QA, and Prod in PI 7.0, once we upgrade it to PI 7.1 I'm getting the  below mention error,   
    Unknown Simple transformation error in converting XML to internal table
    Application error in mapping program ZF_INT006_FILE_TO_SAP_FILE, error code: , error text: Unknown Simple transformation error in converting XML to internal table An exception has occurred.
    Can any one suggest related notes are suggestion.
    appericate in advance for the solutions which you all provide me
    Thank you
    Venkat Anil

    Check the flag "use SAP XML toolkit" for the operation mapping and try, if that works then.
    Check the flag for all XSLT and Java mappings which is migrated from PI 7.0

  • Today, my iPhone calendar entries are changing from green to blue and back to green again. Anyone else having this issue?

    Today, my iPhone calendar entries are changing from green to blue and back to green again. Anyone else having this issue?

    No, never had the problem.

  • Porting data from Oracle8i to XML and from XML  to Oracle 10g

    Hai
    I have a client database (using oracle 8i) and a server database (oracle 10g).
    Due to lack of leased line connectivity i want to port these offline data from 8i to 10g
    using a modem(dial up connection).Is there is any way to port data from 8i to XML
    and from XML to 10g.
    thanks in advance
    dejies

    Thanks Nicolas,
    As per documentation, it seems to be difficult for export/import from Oracle8i to 10g. Is that any way to achieve this? I have to append the newly imported data with old or exisiting data into Oracle10g.
    Regards
    Nikhil

  • Convert image from RGB to CMYK and back to RGB

    Hey.
    I wonder if anyone has experience with converting image from RGB to CMYK and back to RGB?
    I had a TIF in RGB then converted to CMYK but I figured that it might be better to keep in RGB, so I converted back. I read that it supposed to cause some loss in the data, but I can't see anything on the image, it is still very huge and the 2 RGB files has the same size as well. Is there a way to compare the resolution of 2 images somehow, or how can I see what I lost through the 2 conversions?
    Thanks for help

    I had a TIF in RGB then converted to CMYK but I figured that it might be better to keep in RGB, so I converted back.
    The original RGB data is not being restored by converting from the CMYK version, so the term "keep" seems inappropriate.
    What are the actual Color Spaces (ICC profiles) involved?
    Is there a way to compare the resolution of 2 images somehow, or how can I see what I lost through the 2 conversions?
    How did resolution come into this?
    To determine how large a portion of the image has been changed you could
    • make a flattened copy of the original image
    • place a flattened copy of the RGB->CMYK->RGB image on top of that and set it to Blend Mode Difference
    • add an Adjustment Layer (Curves for example) to brighten the image

  • Simple Transformation with very long XML element names

    I am trying to write a program to deserialize XML documents using the Simple Transformation technique.  There are many optional elements in the XML document, so I need to have conditional statements statements to avoid trying to process elements that are not in the document.  The XML document, however, has several Element Names that are greater than 30 characters in length.  The Simple Transformation technique seems to require ABAP data dictionary structures that mirror the schema of the XML document.  But one cannot create structure component names that are greater than 30 characters in length.  We don't have any control over the XML schema as the XML documents come from the US government.  The ST fragment below shows the statement that I want to write, but since the ABAP Structure PlasticCardInformationGroup cannot have a component AuthorizationResponseInformation, the ST syntax checker yields an "Illegal Reference ADDITIONALPLASTICCARDINFORMATION" error message.
    Does anyone know a way to avoid this error?
    <tt:d-cond check="exist(TRS_TradingPartner_Agreement.TRS_FinancialTransaction.PlasticCardInformationGroup.AdditionalPlasticCardInformation)">
    <ns2:AdditionalPlasticCardInformation>
    <tt:attribute name="CardNetworkType" value-ref="TRS_TRADINGPARTNER_AGREEMENT.TRS_FINANCIALTRANSACTION.PLASTICCARDINFORMATIONGROUP.ADDITIONALPLASTICCARDINFORMATI.CARDNETWORKTYPE"/>
    <tt:attribute name="DraftLocatorNumber" value-ref="TRS_TRADINGPARTNER_AGREEMENT.TRS_FINANCIALTRANSACTION.PLASTICCARDINFORMATIONGROUP.ADDITIONALPLASTICCARDINFORMATI.DRAFTLOCATORNUMBER"/>
    </ns2:AdditionalPlasticCardInformation>

    could anyone help me?

  • Stopping iTunes from creating a .xml and .itf file on my desktop

    i am having difficulty with the iTunes library .xml and .itf files being created on my desktop every time i run iTunes.  All of my media files are on my external hard drive in the 'iTunes' folder.  can any one help?
    Computer is running Windows 7; iTunes version 10.2.2.12

    First, I would recommend repairing the hard drive with Disk Utility.
    If that doesn't fix the problem, there's a very dangerous command you can execute in the Terminal.  This is very hazardous, because a simple typo can result in very drastic consequences.  I have seen people erase their entire hard drive by putting a space in the wrong place!  So, please follow the directions I'm going to give you very carefully!
    Open the Terminal, which is found in the Utilities folder in the Applications folder.  In the Terminal, enter the following:
    sudo rm -f
    Make sure to put a space after the "-f"!  Then, drag the troublesome file from the Finder and drop it on the Terminal window.  That should insert the path to the file in the command.  Then go back to the Terminal and press return.  You will be asked for your password, and when you type it, nothing will be shown as a security measure.  Press return again after entering your password.  The file should be deleted.

  • AO amplitude transitions from 0 to 10V (and back to 0 again) within running VI

    Hi,
    I have a NI PCI-6225 multifunction DAQ that I am using for Geophysical measurements.  I am applying 10V from one AO channel and measuring voltage differences with 49 AI channels.  For the method I am using I must follow these steps:
    1.  Set voltage out = 0V
    2.  Take Self Potential measurements from all AI channels
    3.  Turn the AO channel ON with an applied voltage = 10V (1Hz square waveform)
    4.  Take measurements from all AI channels
    5.  Loop back to step # 1
    At the present, I have the VI set up to apply the AO of 10V and to take measurements over time.  The only thing missing is to take the Self Potential measurements while the applied voltage is at zero volts, run the VI in its current configuration, and then to start over again.
    I am using the Express VI DAQ Assistant to set up all of the electrodes in the array for the applied voltage and the measured voltage and am able to do everything needed except include the applied voltage to zero for the Self Potential measurement.
    I have attempted to use the DAQmx subVI's "Stop" and "Clear" (and any other combination of subVI's) to allow for the channel to be freed up within the VI, but the output channel then gives an error signal in the next cycle of the loop.
    I am not sure what else to do, so any suggestions will be greatly appreciated.
    Thanks,
    Dylan
    Note:  Attached is the VI in which the problem is occuring.  I have this VI as a subVI within a timed loop that will execute every 60 seconds.
    Attachments:
    Testing_Voltage_Measure.vi ‏339 KB

    Dylan,
    I think you may have posted twice.  I just wanted to make sure your question has been answered.  Let us know if you have any further questions.
    Link to other post:
    http://forums.ni.com/ni/board/message?board.id=250&message.id=24523
    Good luck with your application.
    Regards,
    Neil S.
    Applications Engineer
    National Instruments

  • Is there an easy way to switch iPhone microphone input from headphones to Bluetooth and back?

    When driving I plug my iPhone into the car stereo AUX jack with a cable to listen to music. To receive or make phone calls, or to use Siri, I use a Bluetooth (Jawbone) headset.
    If I'm playing music out the headphone jack and then answer a call, when the call ends the music starts playing again through the Bluetooth headset, so I have to switch it back to headphones. Theoretically no big deal, since there's the little airplay icon at bottom right in most music apps. Still, I really wish it would revert to playing through the headphone jacks and I didn't have to do anything. Is that possible?
    But it gets more annoying. Let's say I decide to use Siri and want to use the bluetooth. This is fine IF I plugged the headphones in before connecting Bluetooth, but for some reason it often seems to happen that it defaults to the headphone jack, especially if I've been messing with it a bit -- say I was listening to music, then received a call, then hung up, so now music plays through Bluetooth, so I hit the icon to switch music back to headphones, though sometimes this doesn't work and I have to unplug and replug in the headphones. But now usually if I want to use Siri, and I hold down the iPhone home button, or even if I hold down the jawbone button, it will often take input still from headphones.
    I can't go into all the variations of this that happen, but almost every car ride there's a pain about this -- someone calls but even though I answer through my headset, the input is still from the headphone jack, and i have to scramble to get the call going through Bluetooth again. Or I have to unplug then replug the headphones after Siri use. None of this even covers something other, like dictating text or making a voice memo, something else that need simply but DOESN'T have an AirPlay-style button on bottom right like the music apps do. Really a pain.
    Really wish there were some easy switch to toggle the input.
    And again, really wish the music would just go back to playing where to was playing from (headphones) instead of making me switch it either via a button or through unplugging/replugging headphones.
    Any solution to this?
    Thanks.

    Sometimes you turn off your Bluetooth and then back on and it doesn't reconnect with your phone unless you go into the menu. Either way doesn't help much if someone calls you while you're driving and you realize your iPhone is stuck on headphone input.

Maybe you are looking for

  • Can I programmatically change the printer paper size from ActionScript?

    Hi, I'm a newbie Flash/ActionSript developer and I have been searching for answers for a while with no luck. I wonder if I can get some pointers from this forum. I'm trying to programmatically print a movie clip to 8.5" x 11" plain paper regardless o

  • A question about the Tree Component

    I have try to use the tree component i a flash page, and it´s going allright until I´ll want to link the content to a page... WHY?? I have tried a lot of different codes here are those I tried: <tree> <folder label="Mine own"> <link label="My page" u

  • [Solved] ADFBC validation when your data isn't normalized

    Hello - I'm working on a ADFBC/JSF app (using JDev 10.1.3.3) where I am developing a JSF page to edit data for a table whose data is denormalized. I'll explain using the EMPLOYEES table in the HR sample schema. Change EMPLOYEES to... a. Add a column

  • Copy to DVD

    I am attempting to back up my photos so that I can remove the photos from the computer to regain the considerable HD space. I have backup them up to a Lacie external HD and would like to additionally backup to DVDs. I used SuperDuper to backup to the

  • Help needed to write algorithm to find Direction given lat/lon

    Hello, i need an algorithm to find out the direction being traveled given the starting and ending lat/lon decimal coordinates. Anybody have any clues how to do it? or where i can find one to just plug into my program? thanks for your help public Stri