IFX transformation in ABAP

Hello.
Well, this message try to get any primary information about SAP ABAP Transformations. While I get some answers, I'll read about SAP Transformations with ABAP, but maybe my solution can be answer it by some of you, because is too easy than I'm thinking.
1. - I need to read a string with tags, and convert it to a itab, and
2. - i need to write a string with tags, from itab data.
The tags definition is:
<IFX>
  <SignonRq>
    <SignonPswd>
      <CustId>
        <SPName></SPName>
        <CustPermId></CustPermId>
        <CustLoginId></CustLoginId>
      </CustId>
    </SignonPswd>
    <ClientDt></ClientDt>
  </SignonRq>
  <PresSvcRq>
    <BillInqRq>
      <RqUID></RqUID>
      <MsgRqHdr>
        <NetworkTrnInfo>
          <NetworkOwner></NetworkOwner>
          <OriginatorName></OriginatorName>
          <TerminalId></TerminalId>
          <BankId></BankId>
        </NetworkTrnInfo>
      </MsgRqHdr>
      <CustId>
        <CustIdType></CustIdType>
        <CustIdNum></CustIdNum>
      </CustId>
      <BillerId>
        <SPName></SPName>
        <BillerNum></BillerNum>
      </BillerId>
      <BillId></BillId>
      <SelRangeDt>
        <StartDt></StartDt>
      </SelRangeDt>
    </BillInqRq>
  </PresSvcRq>
  <SignoffRq>
    <CustId>
      <SPName></SPName>
      <CustPermId></CustPermId>
      <CustLoginId></CustLoginId>
    </CustId>
  </SignoffRq>
</IFX>
Please, SAP Transformations can help me? How can I create the transformation file and ABAP code, according these definition?
Thanks in advance.

Hi,
my problem is modifying a standard dso from an internal table which contains  modified entries
from active table of dso.
Edit DSO Entries
I want to modify dso via a request (in order to modify all three tables automaticcaly)
i need to start a dtp.
as i have no transformation manually created in bi, my idea is to create dynamiccaly a dtp
which calls my coding in exper routine.
thanks

Similar Messages

  • 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.

  • Problem with "CALL Transformation" in ABAP

    Hello All,
           I am creating XML from ABAP program and using CALL TRANSFORMATION. Everything works fine but when my XML is created sometimes in some "element" values it is truncating space between the texts. For example, I have a field "description" with value "Bon Apetite" it changes to "BonApetite" (space truncated) after transformation! I did research everywhere but could not find why this would happen! Please give me any feedback if you have any information.
    Thanks.
    Mithun

    Hello Mithun,
    when you use the call transformation statement you have to specifiy the xslt transformation used. As a first step you usually use the transformation with the name ID. This is a special transformation for making the asXML representation of abap data. Unfortunately if you look into this transformation you find the following:
    <xsl:transform version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >
    <xsl:strip-space elements="*"/>
    <xsl:template match="/">
      <xsl:copy-of select="."/>
    </xsl:template>
    </xsl:transform>
    If I remember correctly when you use another transformation this will first call the ID transformation and after this the specified one. So it should not be possible to just copy ID transformation and remove the line. I'll have to think again how to avoid the behaviour.
    Best Regards
    Roman

  • Dynamic XSLT Transformation for ABAP

    Hi Team,
    I have a simple requirement, but could not get it to work. Tried different posts but need some help.
    I have an input XML file as follows:
    <ITEM>
       <ITEMQUALF>
       <MATERIAL>
       <UPC>
       <VENDORMATERIAL>
    <ITEM>
    I created my internal table with the exact fields as above and created a transformation which works fine. The problem is, there are scenario's where only one tag "MATERIAL", "UPC", OR "VENDORMATERIAL" is passed in the input XML. Empty tags are not passed. For E.G.
    <ITEM>
      <ITEMQUALF>
      <UPC>
    <ITEM>
    My transformation fails in this scenario because it does not finds the MATERIAL and VENDORMATERIAL tags. I tried using the <tt:cond/> tag, but no luck. I have some specific questions:
    1) How to take care of this scenario where empty tags are not passed? (I have the Superset of all the Tags available in an XSD). A quick Sample would help me a lot because I have spent weeks breaking my head with this.
    2) Is there any other method or Option to parse a very larger input file (~40 MB) as above? I have seen the iXML ABAP methods but don't know if we should use XSLT or iXML or is there any other method. We don't have XI in our landscape. Our system is ECC 6.0, ABAP 7.0 - SP 17, Enhancement Pack 3.
    Any pointers would help a lot. Thanks for your time.
    Regards
    Sanjay

    Hello Sanjay
    In such a scenario I usually make pre-transformation filling the missing elements before the main mapping.
    Input:
    <?xml version="1.0" encoding="utf-8"?>
    <List>
      <ITEM>
        <ITEMQUALF/>
        <MATERIAL/>
        <UPC/>
        <VENDORMATERIAL/>
      </ITEM>
      <ITEM>
        <ITEMQUALF/>
        <UPC/>
      </ITEM>
      <ITEM>
        <MATERIAL/>
      </ITEM>
    </List>
    XSLT Mapping (XML to XML):
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
        <xsl:template match="*">
            <List>
                <xsl:for-each select="ITEM">
                    <xsl:element name="ITEM">
                        <xsl:element name="ITEMQUALF">
                            <xsl:value-of select="ITEMQUALF"/>
                        </xsl:element>
                        <xsl:element name="MATERIAL">
                            <xsl:value-of select="MATERIAL"/>
                        </xsl:element>
                        <xsl:element name="UPC">
                            <xsl:value-of select="UPC"/>   
                        </xsl:element>
                        <xsl:element name="VENDORMATERIAL">
                            <xsl:value-of select="VENDORMATERIAL"/>   
                        </xsl:element>
                    </xsl:element>
                </xsl:for-each>
            </List>
        </xsl:template>
    </xsl:stylesheet>
    Resulting XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <List>
        <ITEM>
            <ITEMQUALF/>
            <MATERIAL/>
            <UPC/>
            <VENDORMATERIAL/>
        </ITEM>
        <ITEM>
            <ITEMQUALF/>
            <MATERIAL/>
            <UPC/>
            <VENDORMATERIAL/>
        </ITEM>
        <ITEM>
            <ITEMQUALF/>
            <MATERIAL/>
            <UPC/>
            <VENDORMATERIAL/>
        </ITEM>
    </List>
    Regards
      Uwe

  • Problem with CALL TRANSFORMATION xml - abap

    Hello!
    I got the following problems using call transformation to read a xml-file to local abap datatype!
    Simple xml file for testing:
    <BMECAT>
    <HEADER>
    asdf
    </HEADER>
    </BMECAT>
    XSLT file:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
      <xsl:template match="/">
        <xsl:value-of select="./BMECAT/HEADER"/>
      </xsl:template>
    </xsl:transform>
    The xslt transformation works with xslt-tester!
    My Source:
    DATA: xmlupl TYPE string,
    outputx TYPE XSTRING,
    lv_string TYPE string.
    * in xmlupl my xml import is stored
    CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    EXPORTING
    text = xmlupl " variable type string
    IMPORTING
    buffer = outputx. " variable type xstring
    TRY .
         CALL TRANSFORMATION path_to_xslt_file
           SOURCE XML outputx
         RESULT HEADER = lv_string.
    CATCH cx_xslt_exception INTO xslt_error.
         data: xslt_message type string .
         xslt_message = xslt_error->get_text( ).
    ENDTRY.
    After debugging in xslt_message is stored the following text:
    "The element abap was expected for the XML-ABAP transformation"
    Can anyone help me with this problem?
    Regards,
    Daniel

    hi
    good
    try this code
    Just look at this piece of code, I think it should help you.
      DATA : ITAB   TYPE TABLE OF SPFLI,
             L_XML  TYPE REF TO CL_XML_DOCUMENT.
      SELECT * FROM SPFLI INTO TABLE ITAB.
    CREATE THE XML OBJECT
      CREATE OBJECT L_XML.
    CONVERT THE DATA TO XML
      CALL METHOD L_XML->CREATE_WITH_DATA( DATAOBJECT = ITAB[] ).
    DATA IS CONVERTED TO XML; DISPLAY THE XML-DOCUMENT
      CALL METHOD L_XML->DISPLAY.
    thanks
    mrutyun^

  • Transformation XML - abap

    dear abap experts,
    i currently want to read an xml file and convert it to an internal table in abap program.
    in sap help, i find TRANSFORMATION, but the example there is convert from data in abap to xml format.
    i have tried to convert from xml file to data in abap program and i face a short dump with error message XML_FORMAT_ERROR. do i need to make a proper structure for keeping my xml format ?
    or is there something miss in my program ?
    beside using transformation, is there any way to convert string that content xml file content to an internal table ?
    please advice
    regards
    eddhie

    <i>XML_FORMAT_ERROR</i>
    this happens if the XML is not well formed. to make sure its well formed, just copy paste the xml in question into a notepad and save it as .xml. now double click it, it should open in Internet explorer and show the xml in tree format. if the xml is not well formed, browser wont render it and throw error message.
    if the xml is a small document, post it here we can see whats wrong.
    to convert XML to ABAP you can use CALL TRANSFORMATION key word which will require to you do develope XLST program to do the conversion.
    of you can use FM SMUM_XML_PARSE.
    (search this forum, i have already provided code sample for this FM)
    Regards
    Raja

  • XML Transformation error (ABAP -- XML)

    Hi,
    I'm getting the foll. error while doing a XML Transformation, Can anyone help me in this regard..
      <FIN_WT>56.0</FIN_WT>
      <FIN_WT_UNIT>KG</FIN_WT_UNIT>
      <ZZQMNUM />
      <ZZHOLD />
      <ZZDUMATNR
    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.
    The following tags were not closed: asx:abap, asx:values, OUTPUT, item. Error processing resource 'file:///C:/Documents and...
    > />
      <PSP_NR>U5/0626-HT-193-1-36-344</PSP_NR>
      <ZZCRTNAME>ALFI</ZZCRTNAME>
      <ZZAPPNAME>ALFI</ZZAPPNAME>
    Regards
    Jiku

    are you trying to transform XML to itab?
    is the xml well formed one - you can check this by running the xml file in webbrowser, if it doesnt display, then it means the xml is not well formed.
    Regards
    Raja

  • About single transformation in ABAP

    Hi gurus,
    We are trying to use single transformation to change an ABAP internal table to xml.
    Our structure of internal table is like below:
    DATA: BEGIN OF I_TOXML,
                      A TYPE CHAR10,
                      B TYPE CHAR10,
              END OF I_TOXML.
    The xml after transformation should be the following way:
      <?xml version="1.0" encoding="UTF-8" ?>
    <ufinterface billtype="bscubas" filename="test.xml">
         <basdoc id="A">
           <basdoc_head>
          </basdoc_head>
         </basdoc>
      </ufinterface>
    The node basdoc can be unbounded, while basdoc_head only occur once. The attribute "id" for basdoc is the value of varible A of internal table.
    Any help will be appreciated.
    Moderator message: there is plenty of documentation on "simple transformations" to XML, please read that before asking for basic how-to.
    Edited by: Thomas Zloch on Nov 4, 2010 9:32 AM

    hi
    use this links
    INNER JOIN  and OUTER JOINhttp://help.sap.com/erp2005_ehp_03/helpdata/EN/cf/21ec77446011d189700000e8322d00/frameset.htm
    JOINED TABLES
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/0f/49bd6a5d5049edba7b3afe6c7956e3/frameset.htm
    u will find all thins related to joins with example and how to use it
    Cheers
    Snehi
    Edited by: snehi chouhan on Jul 25, 2008 9:45 AM

  • Testing XML Transformation in ABAP

    Hi,
    I am trying to convert one XML file into ABAP structure.
    Once I enter into transformation editor, I am unable to test the transformation.
    Please let me know, how can I test the same.
    Thanks
    Nikhil

    Thanks for your response
    Here is the complete Scenario
    1)     we are receiving the XML file as the input to our RFC
    2)     we are populating the data from XML in to ABAP Structures using the ABAP Transformations.
    Bellow is my doubts
    I want to know how I can test the transformation passing the XML file as input in Transformation Editor.
    Is there any Standard routine or simple procedure in ABAP to convert the XML into ABAP? Simple documentation on transformations will be helpful me.
    Is there any direct Transaction code to test the Transformation if so please help me how I can test the Transformation passing the XML file.
    Regards
    Nikhil.B

  • Generate transformation in ABAP

    Hi,
    i need to create a transformation with an expert routine dynamicallyy in ABAP ?
    (expert routine contailns always the same coding)
    Any idea?
    regards
    rouzbeh
    Edited by: Roozbehan on May 26, 2010 9:50 AM

    Hi,
    my problem is modifying a standard dso from an internal table which contains  modified entries
    from active table of dso.
    Edit DSO Entries
    I want to modify dso via a request (in order to modify all three tables automaticcaly)
    i need to start a dtp.
    as i have no transformation manually created in bi, my idea is to create dynamiccaly a dtp
    which calls my coding in exper routine.
    thanks

  • Read current DTP filter value in Transformation via ABAP

    Hi guys!
    Here's the case.
    In DTP filter there is an OLAP variable, which value depends a lot on where the DTP was started from and what starting parameters are.
    We need to read the value of this variable in order to write some ABAP routines in Transformation.
    How can we read the current value of our OLAP variable?
    Thanks a lot for you help!

    Hi Vadim,
    I think this is what you are looking for...
    [/people/shlomi.weiss2/blog/2010/11/10/how-to-get-selection-criteria-in-transformations-routines|/people/shlomi.weiss2/blog/2010/11/10/how-to-get-selection-criteria-in-transformations-routines]
    Hope it helps...
    Regards, Federico

  • Objects transformation in abap  xmlns

    how I can know that the value of a variable xmlns?
    For example, the code then I need to know the value of P_PAIS
    <?sap.transform simple?>
    <?mso-application progid="Excel.Sheet"?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="ti_tabla"/>
      <tt:root name="ti_sumas"/>
      <tt:root name="ti_twew"/>
      <tt:root name="ti_prepa"/>
      <tt:root name="ti_sump"/>
      <tt:root name="p_pais"/>
    Thanks and Regards !.

    Hi,
    my problem is modifying a standard dso from an internal table which contains  modified entries
    from active table of dso.
    Edit DSO Entries
    I want to modify dso via a request (in order to modify all three tables automaticcaly)
    i need to start a dtp.
    as i have no transformation manually created in bi, my idea is to create dynamiccaly a dtp
    which calls my coding in exper routine.
    thanks

  • Call transformation for ABAP to XML

    guys I know say a guide to create a xml from a table.

    Hi,
    try searching in SDN. There are a lot of threads.
    regards, Dieter

  • Simple Transformation XML to ABAP Content of tag with subtrees to string field

    Hi,
    I have an  requirement in which I have to do a transformation from an XML file to an structure.
    I need get the value of a tag that have subtrees and move that to a field in my structure.
    Example:
    <TAG1>value1</TAG1>
    <TAG2>value2</TAG2>
    <TAG3>
         <TAG4>value4</TAG4>
         <TAG5>value5</TAG5>
    </TAG3>
    Result expected in ABAP Structure:
    field1 -> tag1
    field2 -> tag2
    field3 -> <TAG4>value4</TAG4><TAG5>value5</TAG5>
    The contents of the tag TAG3 is variable, so I want to store it as a string.
    Can I make this with Simple Transformation?
    In my tests I can move only the value of each child tag for the given field structure.
    This syntax dont work:
    <TAG3 tt:value-ref="STRUCTURE.FIELD3"/>
    Thanks and Regards,
    Miguel Motta

    Hi Miguel
    Have a look at below snippets. Here I have tried to escape the text inside TAG3 so that it gets treated as single node during transformation.
    ABAP code
    DATA: BEGIN OF result,
            col1 TYPE string,
            col2 TYPE string,
            col3 TYPE string,
          END OF result.
    DATA: xml_string TYPE string VALUE
    '<ROOT> <TAG1>value1</TAG1> <TAG2>value2</TAG2> <TAG3> <TAG4>value4</TAG4> <TAG5>value5</TAG5> </TAG3> </ROOT>',
          part1 TYPE string,
          part2 TYPE string,
          part3 TYPE string.
    *   Escape the text inside TAG3 tag
    FIND REGEX '(.*<TAG3>)(.*)(</TAG3>.*)' IN xml_string SUBMATCHES part1 part2 part3.
    IF sy-subrc EQ 0.
      part2 = escape( val = part2 format = cl_abap_format=>e_xml_text ).
    *      REPLACE ALL OCCURRENCES OF '<' IN part2 WITH '&lt;'.
    *      REPLACE ALL OCCURRENCES OF '>' IN part2 WITH '&gt;'.
      xml_string = part1 && part2 && part3.
    ENDIF.
    TRY.
    * Display xml
        cl_abap_browser=>show_xml( EXPORTING xml_string = xml_string ).
    * Deserialization
        CALL TRANSFORMATION zmtest
          SOURCE XML xml_string
          RESULT para = result.
    * Check result
        WRITE:/ 'COL1=', result-col1,
              / 'COL2=', result-col2,
              / 'COL3=', result-col3.
      CATCH cx_st_error.
    * Error handling
        MESSAGE 'Error in Simple Transformation'
                TYPE 'I' DISPLAY LIKE 'E'.
    ENDTRY.
    Transformation code
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates" template="temp" version="0.1">
       <tt:root name="PARA"/>
       <tt:template name="temp">
         <ROOT>
           <TAG1>
             <tt:value ref="PARA.COL1"/>
           </TAG1>
           <TAG2>
             <tt:value ref="PARA.COL2"/>
           </TAG2>
           <TAG3>
             <tt:value ref="PARA.COL3"/>
           </TAG3>
         </ROOT>
       </tt:template>
    </tt:transform>

  • 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

Maybe you are looking for

  • HT1048 Can I use a Gift Card to buy a iPhoto book?

    Can I use a Gift Card to buy a iPhoto book? Wether its a visa GC or a Apple GC, iTunes GC.

  • Select Query info req for ZMKPFMSEG: View of MSEG and MKPF table

    Hi I am fetching 7-8 records frm ZMKPFMSEG: View of MSEG and MKPF table,which based on matnr,werks & budut,which is taking a large time,there is no index in the table,so can nay one tell me how to fetch the data,to make code more effictient. SELECT 

  • Vantec PCIe SATA controller, Solaris x86

    I've searched all the online resources I can find, and don't see an answer to this. Is there a driver for this SATA controller for Sol. x86, and if so, where would I find it? Output of uname -X: System = SunOS Node = p810 Release = 5.10 KernelID = Ge

  • Failed to load Data base information

    after completeing the report in crystal when ever i want to see print preview it will say  Failed to load Data base information and whenever i will export the report to pdf it will say Failed to load Data base information please solve this issue

  • Camera app problem after updating to 8.0.2

    FFacing hanging up of the cameri app while opening through locked screen and even through normal way wwhat to do