XML to Internal table using XSLT by CALL TRANSFORMATION error

Dear experts,
I have to fetch the data from an XML file using XSLT into internal tables. The XML file is very big as following:-
<?xml version="1.0" standalone="yes" ?>
- <Shipment>
  <shipmentID>25091203S000778</shipmentID>
  <manifestDateTime>2009-12-03T20:16:52.00</manifestDateTime>
  <shipmentFacilityNumber>025</shipmentFacilityNumber>
  <shipmentFacilityAbbreviation>CHI</shipmentFacilityAbbreviation>
  <shipmentFacilityAddress1>810 KIMBERLY DRIVE</shipmentFacilityAddress1>
  <shipmentFacilityAddress2 />
  <shipmentFacilityCity>CAROL STREAM</shipmentFacilityCity>
  <shipmentFacilityState>IL</shipmentFacilityState>
  <shipmentFacilityPostalCode>601880000</shipmentFacilityPostalCode>
  <shipmentTruckCarrierCode>X150</shipmentTruckCarrierCode>
  <shipmentSourceCode>T</shipmentSourceCode>
  <userID>CAMPOSG</userID>
- <Delivery>
  <primaryCustomerNumber>954371</primaryCustomerNumber>
  <primaryCustomerName>MIDWEST OFFICE SUPPLY</primaryCustomerName>
  <primaryCustomerAddress1 />
  <primaryCustomerAddress2>4765 INDUSTRIAL DR</primaryCustomerAddress2>
  <primaryCustomerCity>SPRINGFIELD</primaryCustomerCity>
  <primaryCustomerState>IL</primaryCustomerState>
  <primaryCustomerPostalCode>627030000</primaryCustomerPostalCode>
  <primaryCustomerPhoneNumber>2177535555</primaryCustomerPhoneNumber>
  <shuttleStopFacilityNumber />
  <billOfLadingNumber>25HZK99</billOfLadingNumber>
  <carrierProNumber />
  <shipmentTotalCartonCount>6</shipmentTotalCartonCount>
  <shipmentTotalWeight>266</shipmentTotalWeight>
- <order>
  <orderNumber>25HZK99</orderNumber>
  <subOrderNumber />
  <dateProcessed>2009-12-03</dateProcessed>
  <primaryOrderNumber />
  <shipTruckCode>X150</shipTruckCode>
  <shipTruckDescription>UDS - ADDISON</shipTruckDescription>
  <shipTruckPriorityCode>01</shipTruckPriorityCode>
  <shipTruckGroupCode>01</shipTruckGroupCode>
  <shipTruckDepartureTime>20.00.00</shipTruckDepartureTime>
  <shipTruckDockID>07</shipTruckDockID>
  <ldpFacilityAbbreviation />
  <shuttleAvailableIndicator>N</shuttleAvailableIndicator>
  <shuttleMessageText />
  <crossDockFacilityCode />
  <crossDockTruckCode />
  <crossDockID />
  <subsidizedFreightTruckID />
  <customerPurchaseOrderNumber>623559</customerPurchaseOrderNumber>
  <headerTypeCode>P</headerTypeCode>
  <orderTypeID>RG</orderTypeID>
  <deliveryTypeID>DS</deliveryTypeID>
  <deliveryMethodCode />
  <customerBarCode />
  <customerReferenceData>25HZK99</customerReferenceData>
  <customerReferenceText />
  <customerRouteData>ZNED UNTED</customerRouteData>
  <customerRouteText>ROUTE</customerRouteText>
  <endConsumerPurchaseOrderNumber />
  <endConsumerPurchaseOrderText />
  <endConsumerName>CHARLESTON TRANS. FACILITY</endConsumerName>
  <endConsumerAddress1>HOMEWOOD DT PROGRAM DEPT. 3</endConsumerAddress1>
  <endConsumerAddress2>17341 PALMER BLVD.</endConsumerAddress2>
  <endConsumerAddress3 />
  <endConsumerCity>HOMEWOOD</endConsumerCity>
  <endConsumerState>IL</endConsumerState>
  <endConsumerPostalCode>60430</endConsumerPostalCode>
  <endConsumerCountryCode />
  <fillFacilityNumber>025</fillFacilityNumber>
  <shpFacilityNumber>025</shpFacilityNumber>
  <homeFacilityAbbrCode>STL</homeFacilityAbbrCode>
  <homeFacilityNumber>015</homeFacilityNumber>
  <multiCartonIndicator>Y</multiCartonIndicator>
  <primaryCustomerIndicator>Y</primaryCustomerIndicator>
  <shipToCustomerNumber>954371001</shipToCustomerNumber>
  <customerCompanyID>01</customerCompanyID>
  <customerTruckID>U888</customerTruckID>
  <customerTruckDescription>UDS - ADDISON</customerTruckDescription>
  <customerTruckDockID>13</customerTruckDockID>
  <thirdPartyBillCarrier />
  <thirdPartyBillID />
  <thirdPartyBillType />
  <qualityCheckIndicator>N</qualityCheckIndicator>
  <warehouseLaydownID />
  <packListPosition>I</packListPosition>
  <preferredPackingType>CTN</preferredPackingType>
  <preferredPackingMaterial>PAPER</preferredPackingMaterial>
  <preferedPackingInstructions />
  <totalOrderCartonQty>6</totalOrderCartonQty>
  <convertAddressIndicator>N</convertAddressIndicator>
  <dealerInstructionIndicator>Y</dealerInstructionIndicator>
  <dealerinstructions1>CPO#: 623559</dealerinstructions1>
  <dealerinstructions2>ATTN: DANA GRIFFIN</dealerinstructions2>
  <dealerinstructions3>INFO: 612</dealerinstructions3>
  <dealerinstructions4>ROUTE: ZNED UNTED</dealerinstructions4>
  <dealerinstructions5 />
  <dealerinstructions6 />
  <shippingInstructionsIndicator>N</shippingInstructionsIndicator>
  <shippingInstructions1 />
  <shippingInstructions2 />
  <shippingInstructions3 />
  <shippingInstructions4 />
  <shippingInstructions5 />
  <shippingInstructions6 />
  <specialInstructionsIndicator>N</specialInstructionsIndicator>
  <specialInstructions1 />
  <specialInstructions2 />
  <customeContainerDesc />
- <carton>
  <deliveryCartonID>253370905995</deliveryCartonID>
  <shipIndicator>Y</shipIndicator>
  <deliveryPalletID>X150</deliveryPalletID>
  <consolidatedDeliveryCartonID />
  <scanDateTime>2009-12-03T19:36:12.00</scanDateTime>
  <cartonWeight>52</cartonWeight>
  <dropShipFlag>1</dropShipFlag>
  <carrierTrackingNumber />
  <carrierZoneID>0</carrierZoneID>
  <codAmount />
  <customerPackageAmount />
  <declaredValue />
  <residentialDeliveryIndicator />
  <serviceTypeCode>00</serviceTypeCode>
  <ssccCode>006860244400829393</ssccCode>
- <Item>
  <shipPrefix>UNV</shipPrefix>
  <shipStockNumber>21200</shipStockNumber>
  <itemDescription>PAPER XERO/DUP WE LTR 20#</itemDescription>
  <orderQuantity>1</orderQuantity>
  <originalShipQuantity>1</originalShipQuantity>
  <shipQuantity>1</shipQuantity>
  <inventoryUnitCode>CT</inventoryUnitCode>
  <inventoryWeightQuantity>52.000</inventoryWeightQuantity>
  <upcNumber>00000000000000</upcNumber>
  <upcRetailCode>087547212004</upcRetailCode>
  <hazmatIndicator>N</hazmatIndicator>
  <serialRequiredIndicator>N</serialRequiredIndicator>
  <dealerMemoPO>S</dealerMemoPO>
  <cartonLineNumber>1</cartonLineNumber>
  <orderLineNumber>11</orderLineNumber>
  <originalOrderPrefix>UNV</originalOrderPrefix>
  <originalOrderStockNumber>21200</originalOrderStockNumber>
  <reasonCode />
- <Item_Serial>
  <serialNumber />
  </Item_Serial>
    </Item>
  </carton>
   </order>
  </Delivery>
  </Shipment>
This is not the complete XML file as it exceeds the 15000 characters and then I cann't post here. So I have deleted much part of it.
The hierarchy is as following: Shipment->Delivery->Order->Carton->Item.
I have created a XSLT for it which is working fine.
But when I execute my report program it gives CX_SY_XSLT_FORMAT_ERROR saying that
Transformation error:  Non-canonical structure of element name XML_OUTPUT.

Dear experts,
My report program is as following:-
*& Report  Z_ASNTRNS
REPORT  Z_ASNTRNS.
*& Report  Z_ASNTRNS
TYPE-POOLS: abap, ixml.
TABLES: ZASN_SHIPMENT,ZASN_DELIVERY,ZASN_ORDER,ZASN_CARTON,ZASN_ITEM.
*CONSTANTS gs_file TYPE string VALUE 'C:Documents and SettingsC5134126DesktopRajesh_kandakatlaSampleASNFile.xml'.
This is the structure for the data from the XML file
TYPES: BEGIN OF ts_item,
      ZSHIPMENT LIKE ZASN_ITEM-ZSHIPMENT,
      VBELN LIKE ZASN_ITEM-VBELN,
      ORDER_NUMBER LIKE ZASN_ITEM-ORDER_NUMBER,
      CARTON_ID LIKE ZASN_ITEM-CARTON_ID,
       ITEM LIKE ZASN_ITEM-ITEM,
       CARTON_LINE_NUM LIKE ZASN_ITEM-CARTON_LINE_NUM,
       CARTON_LINE_NUMBER LIKE ZASN_ITEM-CARTON_LINE_NUM,
      AEDAT(8),
      AEZET(6),
       ITEM_DESCRIPTION LIKE ZASN_ITEM-ITEM_DESCRIPTION,
       ORD_QTY(16),
       ORIGINAL_SHIP(16),
       SHIP_QTY(16),
       UPC_NUMBER LIKE ZASN_ITEM-UPC_NUMBER,
       DEALER_MEMO_PO(5),
       ORDER_LINE_NUM LIKE ZASN_ITEM-ORDER_LINE_NUM,
      STATUS LIKE ZASN_ITEM-STATUS,
       END OF ts_item.
TYPES: BEGIN OF ts_carton,
      ZSHIPMENT LIKE ZASN_CARTON-ZSHIPMENT,
      VBELN LIKE ZASN_CARTON-VBELN,
      ORDER_NUMBER LIKE ZASN_CARTON-ORDER_NUMBER,
       CARTON_ID LIKE ZASN_CARTON-CARTON_ID,
      AEDAT(8),
      AEZET(6),
       SHIP_INDICATOR LIKE ZASN_CARTON-SHIP_INDICATOR,
       TRACKING_NUMBER LIKE ZASN_CARTON-TRACKING_NUMBER,
       ZZCARTON_WGT(18),
       Item type ts_item,
       END OF ts_carton.
TYPES: BEGIN OF ts_order,
      ZSHIPMENT LIKE ZASN_ORDER-ZSHIPMENT,
      VBELN LIKE ZASN_ORDER-VBELN,
       ORDER_NUMBER LIKE ZASN_ORDER-ORDER_NUMBER,
      AEDAT(8),
      AEZET(6),
       SUB_ORDER LIKE ZASN_ORDER-SUB_ORDER,
       ORDER_DATE(8),
       PRIMARY_ORDER LIKE ZASN_ORDER-PRIMARY_ORDER,
       CUSTOMER_PO LIKE ZASN_ORDER-CUSTOMER_PO,
       PRIMARY_ID LIKE ZASN_ORDER-PRIMARY_ID,
       SHIP_TO LIKE ZASN_ORDER-SHIP_TO,
      ANZPK(5),
       carton type ts_carton,
       END OF ts_order.
TYPES: BEGIN OF ts_delivery,
      ZSHIPMENT LIKE ZASN_DELIVERY-ZSHIPMENT,
      VBELN LIKE ZASN_DELIVERY-VBELN,
      AEDAT(8) TYPE C,
      AEZET(6) TYPE C,
       PRIMARY_CUSTOMER LIKE ZASN_DELIVERY-PRIMARY_CUSTOMER,
       BILL_OF_LADING LIKE ZASN_DELIVERY-BILL_OF_LADING,
       CARTON_COUNT(5),
       TOTAL_WEIGHT(18),
       order type ts_order,
       END OF ts_delivery.
TYPES: BEGIN OF ts_shipment,
       ZSHIPMENT LIKE ZASN_SHIPMENT-ZSHIPMENT,
       MANIFEST_DATE_TIME(25),
      AEDAT(8) TYPE C,
      AEZET(6) TYPE C,
      SDATE(8) TYPE C,
      STIME(6) TYPE C,
       SFACILITY_NUMBER LIKE ZASN_SHIPMENT-SFACILITY_NUMBER,
       ZZCARRIERCODE LIKE ZASN_SHIPMENT-ZZCARRIERCODE,
       Delivery type ts_delivery,
       END OF ts_shipment.
TYPES: BEGIN OF ts_shipment1,
       ZSHIPMENT LIKE ZASN_SHIPMENT-ZSHIPMENT,
       MANIFEST_DATE_TIME(25),
       SFACILITY_NUMBER LIKE ZASN_SHIPMENT-SFACILITY_NUMBER,
       ZZCARRIERCODE LIKE ZASN_SHIPMENT-ZZCARRIERCODE,
       PRIMARY_CUSTOMER LIKE ZASN_DELIVERY-PRIMARY_CUSTOMER,
       BILL_OF_LADING LIKE ZASN_DELIVERY-BILL_OF_LADING,
       CARTON_COUNT(5),
       TOTAL_WEIGHT(18),
       ORDER_NUMBER LIKE ZASN_ORDER-ORDER_NUMBER,
       SUB_ORDER LIKE ZASN_ORDER-SUB_ORDER,
       ORDER_DATE(8),
       PRIMARY_ORDER LIKE ZASN_ORDER-PRIMARY_ORDER,
       CUSTOMER_PO LIKE ZASN_ORDER-CUSTOMER_PO,
       PRIMARY_ID LIKE ZASN_ORDER-PRIMARY_ID,
       SHIP_TO LIKE ZASN_ORDER-SHIP_TO,
       CARTON_ID LIKE ZASN_CARTON-CARTON_ID,
       SHIP_INDICATOR LIKE ZASN_CARTON-SHIP_INDICATOR,
       TRACKING_NUMBER LIKE ZASN_CARTON-TRACKING_NUMBER,
       ZZCARTON_WGT(18),
       ITEM LIKE ZASN_ITEM-ITEM,
       CARTON_LINE_NUM LIKE ZASN_ITEM-CARTON_LINE_NUM,
       CARTON_LINE_NUMBER LIKE ZASN_ITEM-CARTON_LINE_NUM,
       ITEM_DESCRIPTION LIKE ZASN_ITEM-ITEM_DESCRIPTION,
       ORD_QTY(16),
       ORIGINAL_SHIP(16),
       SHIP_QTY(16),
       UPC_NUMBER LIKE ZASN_ITEM-UPC_NUMBER,
       DEALER_MEMO_PO(5),
       ORDER_LINE_NUM LIKE ZASN_ITEM-ORDER_LINE_NUM,
       END OF ts_shipment1.
TYPES: BEGIN OF t_xml_line,
             data(256) TYPE x,
           END OF t_xml_line.
*Typdefinition für Airplus
*READ THE DOCUMENTATION "LASG_XML_INVOICE_BTM"!!!
VARs beginning with "a_" are ATTRIBUTES
DATA: l_ixml            TYPE REF TO if_ixml,
      l_streamfactory   TYPE REF TO if_ixml_stream_factory,
      l_parser          TYPE REF TO if_ixml_parser,
      l_istream         TYPE REF TO if_ixml_istream,
      l_ostream         TYPE REF TO if_ixml_ostream,
      l_document        TYPE REF TO if_ixml_document,
      l_node            TYPE REF TO if_ixml_node,
      l_xml TYPE REF TO cl_xml_document,
      l_xmldata         TYPE string.
DATA: l_xml_table       TYPE TABLE OF t_xml_line,
         l_xml_line        TYPE t_xml_line,
         l_xml_table_size  TYPE i.
DATA: l_filename        TYPE string.
DATA: xml_out TYPE string ,
      size type i.
DATA: l_xml_x1   TYPE xstring.
DATA: l_len      TYPE i,
          l_len2     TYPE i,
          l_tab      TYPE tsfixml,
          l_content  TYPE string,
          l_str1     TYPE string,
          c_conv     TYPE REF TO cl_abap_conv_in_ce.
         l_itab     TYPE TABLE OF string.
DATA: BEGIN OF l_itab occurs 0,
      data(256) type c,
      end of l_itab.
TYPES : BEGIN OF TY_TEXT,
          data(255) type C,
        END OF TY_TEXT.
DATA: F_XML TYPE STRING.
DATA : LT_TEXT_OUT type table of TY_TEXT with header line.
tables
DATA: it_shipment    TYPE STANDARD TABLE OF ts_shipment,
      wa_shipment    TYPE  ts_shipment.
*Errorvariables
DATA: xslt_err   TYPE REF TO cx_xslt_exception,
      err_string TYPE string.
PARAMETERS: pa_file TYPE localfile OBLIGATORY
DEFAULT 'C:Documents and SettingsC5134126DesktopRajesh_kandakatlaSampleASNFile.xml'.
START-OF-SELECTION.
  Creating the main iXML factory
    l_ixml = cl_ixml=>create( ).
  Creating a stream factory
    l_streamfactory = l_ixml->create_stream_factory( ).
    PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.
here we use the CALL TRANSFORMATION method which calls
the XSLT program "z_asnfile"
TRY.
    CALL TRANSFORMATION ('Z_ASNFILE')
      SOURCE xml LT_TEXT_OUT[]
      RESULT xml_output = it_shipment
catch any error, very helpful if the XSLT isn't correct
    CATCH cx_xslt_exception INTO xslt_err.
    err_string = xslt_err->get_text( ).
    WRITE: / 'Transformation error: ', err_string.
    EXIT.
  ENDTRY." setting a breakpoint to watch the workarea
by the internal table "it_airplus"
       break-point.
  LOOP AT it_shipment INTO wa_shipment.
  ENDLOOP.
*&      Form  get_xml_table
  FORM get_xml_table CHANGING l_xml_table_size TYPE i
                              l_xml_table      TYPE STANDARD TABLE.
    l_filename = pa_file.
  upload a file from the client's workstation
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename   = l_filename
        filetype   = 'BIN'
      IMPORTING
        filelength = l_xml_table_size
      CHANGING
        data_tab   = l_xml_table
      EXCEPTIONS
        OTHERS     = 19.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
Convert binary to text.
CALL FUNCTION 'SCMS_BINARY_TO_TEXT'
  EXPORTING
    INPUT_LENGTH          = 70000
            FIRST_LINE            = 0
            LAST_LINE             = 0
            APPEND_TO_TABLE       = ' '
            MIMETYPE              = ' '
    WRAP_LINES            = 'X'
          IMPORTING
            OUTPUT_LENGTH         =
  TABLES
    BINARY_TAB            = l_xml_table
    TEXT_TAB              = LT_TEXT_OUT
          EXCEPTIONS
            FAILED                = 1
            OTHERS                = 2
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.                    "get_xml_table

Similar Messages

  • Xml to internal table using XSLT

    hello all,
    With the help of Mr. raja I have done with  the code but still i have some problem. could any one help me(raja you too).
    XLST program code (YSIMPLEXMLTOITAB)
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:strip-space elements="*"/>
      <xsl:output indent="yes"/>
      <xsl:template match="QfiData">
        <asx:abap xmlns:asx="http://www.sap.com/abapxml">
          <asx:values>
            <I_DATA>
              <xsl:for-each select="Materials">
                <I_DATA1>
                  <MATERIAL>
                    <xsl:value-of select="Material"/>
                  </MATERIAL>
                  <CONDITIONRATE>
                    <xsl:value-of select="ConditionRate"/>
                  </CONDITIONRATE>
                  <VALIDFROM>
                    <xsl:value-of select="ValidFrom"/>
                  </VALIDFROM>
                  <VALIDTO>
                    <xsl:value-of select="ValidTo"/>
                  </VALIDTO>
                  <REGIONID>
                    <xsl:value-of select="RegionID"/>
                  </REGIONID>
                  <MATERIALID>
                    <xsl:value-of select="MaterialID"/>
                  </MATERIALID>
                </I_DATA1>
              </xsl:for-each>
            </I_DATA>
          </asx:values>
        </asx:abap>
      </xsl:template>
    </xsl:stylesheet>
    Program to test it.
    REPORT  y_test_xml_tran.
    TYPES: BEGIN OF i_det,
    Material(10),
    ConditionRate(16) type p decimals 2 ,
    ValidFrom(10) ,
    ValidTo(10) ,
    RegionID(3) ,
    MaterialID(10) ,
    end of i_det .
    DATA: i_data TYPE TABLE OF i_det.
    data: wa like line of i_data .
    DATA: xml_string TYPE string .
    DATA: xslt_error     TYPE REF TO     cx_xslt_exception,
    xslt_message     TYPE     string .
    CLEAR xml_string .
    CONCATENATE
    `<?xml version="1.0" encoding="utf-8"?>`
    `<QfiData xmlns:xsl="http://www2.siemens.nl/qfiservice/QfiData.xsd">`
    `<Materials>`
    `<Material>463581</Material>`
    `<ConditionRate> 2.44</ConditionRate>`
    `<ValidFrom>20060208</ValidFrom>`
    `<ValidTo>99991231</ValidTo>`
    `<RegionID>48</RegionID>`
    `<MaterialID>36294</MaterialID>`
    `</Materials>`
    `<Materials>`
    `<Material>463582</Material>`
    `<ConditionRate> 2.44</ConditionRate>`
    `<ValidFrom>20060208</ValidFrom>`
    `<ValidTo>99991231</ValidTo>`
    `<RegionID>48</RegionID>`
    `<MaterialID>36295</MaterialID>`
    `</Materials>`
    `</QfiData>`
    INTO xml_string .
    TRY .
        CALL TRANSFORMATION (`YSIMPLEXMLTOITAB`)
        SOURCE XML  xml_string
        RESULT     i_data = i_data.
      CATCH cx_xslt_exception INTO xslt_error.
        xslt_message = xslt_error->get_text( ).
    ENDTRY.
    the error i am getting is:
    Error message : ABAP XML formatting error in XML node of type "element", name: "abap"

    Can you tell how did you solve ?

  • 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

  • Xml to Internal table : Issue

    Dear All,
    I have written a program to bring the data from xml to internal table  Below is the strucutre of my xml file .
    - <Data>
    - <MT Type="CR">
      <MatType>FERT</MatType>
      </MT>
    - <OP Type="CR">
      <MatNumber>9901040103-000115</MatNumber>
    - <Activities Element="AT">
    - <AT Type="CR">
      <MaterialNumber>115</MaterialNumber>
      <ActivityType>DEPR.</ActivityType>
      </AT>
    - <AT Type="CR">
      <MaterialNumber>117</MaterialNumber>
      <ActivityType>L.C.R</ActivityType>
      </AT>
      </Activities>
      </OP>
      </Data>
    .However I am not able to handle the multiple entries which comes together . ie
    - <AT Type="CR">
      <MaterialNumber>115</MaterialNumber>
      <ActivityType>DEPR.</ActivityType>
      </AT>
    - <AT Type="CR">
      <MaterialNumber>117</MaterialNumber>
      <ActivityType>L.C.R</ActivityType>
      </AT>
    Please let me know how to handle this . Thanks!
    Regards,
    Syed

    Hi ,
    To convert XML data into internal table u have to use FM "SMUM_XML_PARSE", this FM takes XString as input ,so first u have to
    convert  ur xml string into XString using FM "SCMS_STRING_TO_XSTRING".
    Thanks
    jitendra

  • How to check if internal table exists in dynamical called subroutine ?

    Hi,
    in a dynamically called subroutine i'm using a internal table, but in some calls this table is not exist.
    How can i check in the code whether the internal table exist or not ?
    regards,
    Hans

    In Horst Keller's blog /people/horst.keller/blog/2005/05/27/abap-geek-10--everything-functions-150-but-how my issue is talked about :
    All other parameters are handled in a way as they were declared as global data objects in the top include of the function group, that can be used only during the execution of the function module: They are visible throughout the function group but you can access them only while the function module is active. If you access such a parameter and the respective function module is not executed, you get the runtime error GETWA_NOT_ASSIGNED (Why? Well, technically thos guys are represented via field symbols which are valid only during the runtime of the function module).
    The code is in SD pricing. Sometimes the code is called from function module PRICING_BUILD_XKOMV or PRICING_SUBSCREEN_PBO where TKOMV is defined as globalized parameter.
    And sometimes it is called from function module PRCING_CHECK where TKOMV is NOT defined as parameter.
    In the call of last function the dump occures on the ASSIGN statement :
         data: ls_tkomv like line of tkomv,
                  lv_tablename(30) type c value 'TKOMV[]'.
        field-symbols: <lfs> type any table.
         assign (lv_tablename) to <lfs>.
         if <lfs> is assigned.
    Any suggestions to solve the issue ?
    regards,
    Hans

  • Reading data from XML to Internal table

    Hi Experts,
    I got a requirement to read the data fom xml to internal table.is it possible to store deep internel table data into flat internal tables?my internel table contains 4 internel table and these 4 internel table contains 2 internel tables each...can any one help me o this...
    points will be rewarded...
    Regards,
    Rakhi

    Hi Rakhi,
    * Structure to Get the Client Details as in XML format
      DATA: BEGIN OF client,
              BEGIN OF Personal_Details,
                kunnr like kna1-kunnr,
                name1 like kna1-name1,
                adrnr like kna1-adrnr,
              END OF Personal_Details,
              BEGIN OF Address,
                street like adrc-street,
                city1  like adrc-city1,
              END OF Address,
              BEGIN OF Communication,
                fax_number like adrc-fax_number,
                tel_number like adrc-tel_number,
              END OF Communication,
            END OF client.
      DATA: it_client TYPE TABLE OF client WITH HEADER LINES,
            result LIKE client.
      DATA: xml_string TYPE string.
    *  Get the Client Details into the structure to be made as an XML string
      TRY.
    *  Convert the Structure to XML string
          CALL TRANSFORMATION  ('ID')
            SOURCE para = it_client
            RESULT XML xml_string.
    *  Convert the XML string to structure - result
          CALL TRANSFORMATION  ('ID')
            SOURCE XML xml_string
            RESULT para = result.
      CATCH cx_st_error.
      ENDTRY.
    best regards,
    Thangesh

  • How to Upload Excel sheet in DB or internal table using SAP NetWeaver ABAP

    Dear All experts,
    Pls provide guidance  to Upload Excel sheet in DB or internal table using ABAP in  ( SAP NetWeaver stack  )
    Regards
    Machindra
    Edited by: Machindra Patade on Apr 8, 2010 3:07 PM

    Please search before posting.
    Thread locked.
    Thomas

  • How to extract data from info cube into an internal table using ABAP code

    HI
    Can Anyone plz suggest me
    How to extract data from info cube into an internal table using ABAP code like BAPI's or function modules.
    Thankx in advance
    regds
    AJAY

    HI Dinesh,
    Thankq for ur reply
    but i ahve already tried to use the function module.
    When I try to Use the function module RSDRI_INFOPOV_READ
    I get an information message "ERROR GENERATION TEST FRAME".
    can U plz tell me what could be the problem
    Bye
    AJAY

  • Delete row from internal table using field symbol.

    Hi friends,
      I created dynamic internal table using field symbol. I want to delete some data using where clause.
    for example. i want to use like,
        DELETE <FS> WHERE KUNNR = WA_KNA1-KUNNR.
    Like the above statment it won't work. How i can use delete with where clause in field symbols.
    Hope any one can help me.
    Thanks and regards
    Srikanth. S

    hi Srikanth,
    I think you have to LOOP through the whole internal table and check each line and decide to delete or not:
    LOOP at <itab> INTO <wa>.
    ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <wa> TO <field>.
    CHECK <field> IS ASSIGNED.
    IF <field> EQ WA_KNA1-KUNNR.
    DELETE ...
    ENDIF.
    UNASSIGN <field>.
    ENDLOOP.
    hope this helps
    ec

  • Internal table used by sap in a program

    Hi,
    I want to know the list of internal tables used in a program (including sap program).
    while debugging i want to view the data stored in it.
    I know the internal tables used by me. Before loading the program sap will load some information into internal table. How to know that.
    Advance Thanks.

    Internal tables, not transparent ones.
    In the old debugger, goto->system areas->internal information and look ITAB_HEADS.  This will show you the name of the tables in the system.  SYMBDATANM will show you all variables in memory.
    In the new debugger, it's even easier.  There's a global tab in the variables area, that tells you all variables in memory.  And you can see the variable type - i.e. if it is a table.
    matt

  • Final Internal Table used in MIGO Transaction

    Hi Experts,
              I need to know the final internal table used in the MIGO transaction. Why I want to know this is, I need all the records which are there in the table control (GODYNPRO) of the MIGO transaction. I have used the BADI BADI MB_MIGO_BADI to read the values. But since it is a table control the values are getting changed when the user scrolls down the table control. How can I get all the values shown in this table control. Is there any global internal table in the SAPLMIGO program?
    BR.

    Hi ABAP,
    Check the BADI MB_MIGO_BADI the example class CL_EXM_IM_MB_MIGO_BADI
    In attributes tab variable GT_EXTDATA contains all migo positions.
    Read the internal table to check items.
    in this method the internal table is filled.
    Therefore define your internal table in the class attributes.
    I hope you help.

  • How to join THREE different tables into internal table using one select statement .

    How to join THREE different tables into internal table using one select statement .
    Hi experts,
    I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
    Scenario:
    Database tables:
    SPFLI
    SFLIGHT
    SBOOK.
    Table Fields:
    SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
    SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
    SEATSOCC_C SEATSMAX_F SEATSOCC_F
    SBOOK - CARRID CONNID CLASS
    MY INTERNAL TABLE IS IT_XX.
    Your help much appreciated.
    Thanks in advance.
    Pawan.

    Hi Pawan,
    please check below codes. hope it can help you.
    TYPES: BEGIN OF ty_xx,
            carrid     TYPE spfli-carrid   ,
            connid     TYPE spfli-connid   ,
            countryfr  TYPE spfli-countryfr,
            cityfrom   TYPE spfli-cityfrom  ,
            countryto  TYPE spfli-countryto,
            cityto     TYPE spfli-cityto   ,
            fldate     TYPE sflight-fldate ,
            seatsmax   TYPE sflight-seatsmax ,
            seatsocc   TYPE sflight-seatsocc ,
            seatsmax_b TYPE sflight-seatsmax_b,
            seatsocc_b TYPE sflight-seatsocc_b,
            seatsmax_f TYPE sflight-seatsmax_f,
            seatsocc_f TYPE sflight-seatsocc_f,
            class      TYPE sbook-class,
          END OF ty_xx,
          t_xx TYPE STANDARD TABLE OF ty_xx.
    DATA: it_xx TYPE t_xx.
    SELECT spfli~carrid
           spfli~connid
           spfli~countryfr
           spfli~cityfrom
           spfli~countryto
           spfli~cityto
           sflight~fldate
           sflight~seatsmax
           sflight~seatsocc
           sflight~seatsmax_b
           sflight~seatsocc_b
           sflight~seatsmax_f
           sflight~seatsocc_f
           sbook~class
      INTO TABLE it_xx
      FROM spfli INNER JOIN sflight
      ON spfli~carrid = sflight~carrid
      AND spfli~connid = sflight~connid
      INNER JOIN sbook
      ON spfli~carrid = sbook~carrid
      AND spfli~connid = sbook~connid.
    Thanks,
    Yawa

  • XML file to Internal table through XSLT - Call Transformation

    Hi Friends,
    I am trying to work a scenario where i have a simple XML file and i need to convert the data in to an internal table. When i execute the XSLT seperately, it works fine. I get the output, but when it is invoked through a ABAP program, i am getting the error "The called method START_XSLT_DEBUGGER of the calss CL_WB_XSLT_DEBUGGER returned the exception CX_XSLT_FORMAT_ERROR"
    I feel my XSLT program is not correct, but i am unable to find out what the issue is. Any help is really apreciated. I have gone through the SDN forum replies. But could not figure out what is wrong with my program
    Below given are the details.
    My XML File:
    <?xml version="1.0" encoding="utf-8"?>
    <List>
      <ITEM>
        <ITEMQUALF>ITEM1</ITEMQUALF>
        <MATERIAL>MAT1</MATERIAL>
      </ITEM>
      <ITEM>
        <ITEMQUALF>ITEM2</ITEMQUALF>
        <MATERIAL>MAT2</MATERIAL>
      </ITEM>
      <ITEM>
        <ITEMQUALF>ITEM3</ITEMQUALF>
        <MATERIAL>MAT3</MATERIAL>
      </ITEM>
    </List>
    My XSLT program:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" xmlns:asx="http://www.sap.com/abapxml" exclude-result-prefixes="asx" version="1.0">
      <xsl:strip-space elements="*"/>
      <xsl:output encoding="utf-8" indent="yes" omit-xml-declaration="yes"/>
      <!--xsl:template match="/"-->
      <xsl:template match="List">
        <asx:abap version="1.0">
          <asx:values>
            <T_ACTUAL>
              <xsl:for-each select="*">
                <ITEMQUALF>
                  <xsl:value-of select="ITEMQUALF" />
                </ITEMQUALF>
                <MATERIAL>
                  <xsl:value-of select="MATERIAL" />
                </MATERIAL>
              </xsl:for-each>
            </T_ACTUAL>
          </asx:values>
        </asx:abap>
      </xsl:template>
    </xsl:transform>
    In my ABAP program:
    REPORT  z_xslt_abap_2.
    TYPES:
      BEGIN OF ty_actual,
        itemqualf   TYPE char50,
        material    TYPE char50,
      END OF ty_actual,
      line_t(4096)  TYPE x,
      table_t       TYPE STANDARD TABLE OF line_t,
      ty_t_actual   TYPE STANDARD TABLE OF ty_actual.
    DATA:
      t_actual    TYPE ty_t_actual,
      t_srctab    TYPE table_t,
      v_filename  TYPE string.
    DATA: gs_rif_ex     TYPE REF TO cx_root,
          gs_var_text   TYPE string.
    v_filename = 'D:\XML\xslt_test.xml'.
    * Function call
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename = v_filename
        filetype = 'BIN'
      TABLES
        data_tab = t_srctab
      EXCEPTIONS
        OTHERS   = 1.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    * Call Transformation
    TRY.
        CALL TRANSFORMATION (`ZXSLT_RAM`)
                SOURCE XML t_srctab
                RESULT     t_actual = t_actual.
      CATCH cx_root INTO gs_rif_ex.
        gs_var_text = gs_rif_ex->get_text( ).
        MESSAGE gs_var_text TYPE 'E'.
    ENDTRY .
    IF t_actual IS NOT INITIAL.
      WRITE: 'Success'.
    ENDIF.
    When i run the XSLT program seperately, this is the output that i get:
    <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
      <asx:values>
        <T_ACTUAL>
          <ITEMQUALF>ITEM1</ITEMQUALF>
          <MATERIAL>MAT1</MATERIAL>
          <ITEMQUALF>ITEM2</ITEMQUALF>
          <MATERIAL>MAT2</MATERIAL>
          <ITEMQUALF>ITEM3</ITEMQUALF>
          <MATERIAL>MAT3</MATERIAL>
        </T_ACTUAL>
      </asx:values>
    </asx:abap>
    I have been stuck with this for more than two days. If anyone can help me out with this, it would be really great. Please let me know, where i am going wrong.
    Thanks in advance.
    Best Regards,
    Ram.

    Hi,
    You can try this sample program, hopefully will help you.
    <a href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/readdatafromXMLfileviaXSLT+program&">Read Data From XML</a>.
    Regards,

  • Code to transfer xml file to abap internal table using transformation

    Hi friends
    Given the following xml file .the requirementis to  display and transfer the xml file to internal table usin transformation and gui_upload.If any onehaving simple code on this please send .
    Can any one sugest the steps to be followed to write source code using simple transformation.
    <?xml version="1.0" encoding="utf-8" ?>
    - <Negara>
    - <item>
    - <COUNTRY>
      <MANDT>600</MANDT>
      <ZCODE>500</ZCODE>
      <ZDESC>Pening Lalat</ZDESC>
      <ZSAPCD>T1</ZSAPCD>
      </COUNTRY>
      </item>
    - <item>
    - <COUNTRY>
      <MANDT>600</MANDT>
      <ZCODE>600</ZCODE>
      <ZDESC>Pening Lalat2</ZDESC>
      <ZSAPCD>T2</ZSAPCD>
      </COUNTRY>
      </item>
      </Negara>
    Thaking You

    hi..
    1. itab --- > xml
    xml ---> itab.
    2. This program will do both.
    (just copy paste in new program)
    3.
    REPORT abc.
    DATA
    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
    DATA : BEGIN OF itab OCCURS 0,
    a(100) TYPE c,
    END OF itab.
    DATA: xml_out TYPE string .
    DATA : BEGIN OF upl OCCURS 0,
    f(255) TYPE c,
    END OF upl.
    DATA: xmlupl TYPE string .
    FIRST PHASE
    FIRST PHASE
    FIRST PHASE
    Fetch Data
    SELECT * FROM t001 INTO TABLE t001.
    XML
    CALL TRANSFORMATION ('ID')
    SOURCE tab = t001[]
    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 = itab.
    Download
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filetype = 'BIN'
    filename = 'd:\xx.xml'
    TABLES
    data_tab = itab.
    SECOND PHASE
    SECOND PHASE
    SECOND PHASE
    REFRESH t001.
    CLEAR t001.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = 'D:\XX.XML'
    filetype = 'BIN'
    TABLES
    data_tab = upl.
    LOOP AT upl.
    CONCATENATE xmlupl upl-f INTO xmlupl.
    ENDLOOP.
    XML
    CALL TRANSFORMATION ('ID')
    SOURCE XML xmlupl
    RESULT tab = t001[].
    <b>Reward points if useful</b>
    Regards
    Ashu

  • Generate XML out of internal Table (via XSLT)

    Hi NG,
    is there an easy way to generate an XML document out of an internal ABAP Table? Maybe there is even a chnage to use XSLT as an template to define the structure of the XML file.
    Thanks
    Stefan

    check out following thread you will find more than one answer. I like CL_XML_DOCUMENT solution, that is so simple.
    Re: Convert to XML format
    -Sanjeev

Maybe you are looking for

  • Ipod Mini starts to sync then stops after a few songs and doesn't sync

    It has been about a year since I synced my iPod mini (Generation One) with my G3 PowerBook Pismo. I have been using it with no problems but I wanted to ad new songs. I went to sync it and it wanted to update. I am on the latest iTunes. After the iPod

  • How much can i get Final Cut Studio 2?

    Hi, *in fact, i love this program so so much and i will get it to make tutorials in my blog or website as well but i can't buy it because it is so expensive for me and i'm student too,now i have some questions:-* *1-is there discount for this program

  • Wireless outage (IP only) for 5 minutes, every 15 minutes

    Hey everyone, I recently moved to the UK from the US, and in the process gave up my Airport Base Station for the much less friendly BT Home Hub. Since doing so, I have been having some very annoying problems with the wireless connection that I did no

  • X1 issues fixed (I hope)

    Moved to existing thread.

  • Installing BB Desktop sw for PC (Win7)

    I tried to install the downloaded version of BB Desktop software for PC (Win7), posted on feb17,2012. When asked I provided a installation folder different than the default but with the same name (only the root was different, ie. F: a second HDD, not