cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected text for XML-ABAP transformation

Pavan_Golesar
Active Participant

Hello Gurus,

    Facing error as 'Unexpected text for XML-ABAP transformation' and I googled it all but no helpful post..

can you help..???

Thanks,

Pavan G

Accepted Solutions (1)

Accepted Solutions (1)

Pavan_Golesar
Active Participant
0 Kudos

Hello,

I got it Resolved myself.. It was basically issue with my cache.. as said earlier I had already cleaned the cache..but I found that its not simple goin to tcode and firing the Cleanup activity..

I had already changed cardinality within my serive for the associations between entity sets.

but since I need to clear the cache and then activate the service.. so that new changes are reflected in cache when i run the service..I did clean up before the activation of service...

and the error is resolved..

- Pavan Golesar

Answers (1)

Answers (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Pavan,

What is the operation your performing ? Share the details.

Regards,

Ashwin

Pavan_Golesar
Active Participant
0 Kudos

Hello Ashwin,

      Yes, sure. attaching the snapshot for the same.

Hope to Hear more from you.

Best Regards,

Pavan Golesar.

AshwinDutt
Active Contributor
0 Kudos

Did you debug Pavan? i suspect response is not mapped back correctly to GW.

Check the Deep Structure which you have declared in back-end to fill all those details.

Please share the details how data is mapped back to GW as response and also the cardinality between the entities and their association.

Pavan_Golesar
Active Participant
0 Kudos

Hello Ashwin,

     Thanks for quick reponse !!

Please find the following are the details you asked for:

Source Code for Get_expanded_entity ( 😞


METHOD /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITY.

     DATA:

       LS_EXPANDED_CLAUSE1  LIKE LINE OF           ET_EXPANDED_TECH_CLAUSES,

       LV_VBELN             TYPE SALES_KEY,

       LT_VBELN             TYPE STANDARD TABLE OF SALES_KEY,

       LS_MARKER            TYPE ORDER_VIEW,

       LV_CONVERT_VBELN(10) TYPE N.

*-- POPULATING THE MARKER OF I_BAPI_VIEW IN FM

     LS_MARKER-HEADER = 'X'" cannot delete this as where condition....

     LS_MARKER-ITEM = 'X'.

     LS_MARKER-SDSCHEDULE = 'X'.

*-- item_>schline

     DATABEGIN OF T_ORDERITEMS.

             INCLUDE              TYPE  ZCL_ZSO_ALL_MPC=>TS_SALESORDERITEM.

     DATA: SCHLINES TYPE ZCL_ZSO_ALL_MPC=>TS_SCHLINE,

           END OF T_ORDERITEMS.

*  hdr > item > Schline

     DATABEGIN OF T_EXPAND_SO.

             INCLUDE       TYPE ZCL_ZSO_ALL_MPC=>TS_SALESORDER.

     DATA: SALESORDERITEMS LIKE TABLE OF T_ORDERITEMS,

           END OF T_EXPAND_SO.

     DATA: LS_EXPAND_SO LIKE T_EXPAND_SO,

           LS_ITEM      LIKE  T_ORDERITEMS,

           LT_ITEM      LIKE STANDARD TABLE OF T_ORDERITEMS.

*-- DATA OBJECTS

     DATA: LS_ITEM1      TYPE ZCL_ZSO_ALL_MPC=>TS_SALESORDERITEM, "TEMP WORK AREA

           LS_HEADER     TYPE ZCL_ZSO_ALL_MPC=>TS_SALESORDER,

           LS_SCH        TYPE ZCL_ZSO_ALL_MPC=>TS_SCHLINE,

           " *-- for bapi

           LS_EXPAND_HDR TYPE BAPISDHD,

           LS_EXPAND_ITM TYPE BAPISDIT,

           LS_EXPAND_SCH TYPE BAPISDHEDU,

           LT_EXPAND_HDR TYPE STANDARD TABLE OF BAPISDHD,

           LT_EXPAND_ITM TYPE STANDARD TABLE OF BAPISDIT,

           LT_EXPAND_SCH TYPE STANDARD TABLE OF BAPISDHEDU.

* * *-- GET FROM BRACKETS....

     DATALS_KEY_TAB   TYPE /IWBEP/S_MGW_NAME_VALUE_PAIR.

     CONSTANTS: LC_EXPAND_TECH_CLAUSE  TYPE STRING VALUE 'SALESORDERITEMS/SCHLINES'.

*Get the key property values and Read Sales Order and Item data

*-- FINDING THE ENTITY GETTING HIT

     CASE IV_ENTITY_SET_NAME.

       WHEN 'SalesOrders'.

         "extract the vbeln from brackets eg: SalesOrders('343')

         READ TABLE IT_KEY_TAB WITH KEY NAME = 'Vbeln' INTO LS_KEY_TAB.

         LV_VBELN = LS_KEY_TAB-VALUE.

         LV_CONVERT_VBELN = LV_VBELN.

         CLEAR LV_VBELN.

         LV_VBELN = LV_CONVERT_VBELN.

         APPEND LV_VBELN TO LT_VBELN." append to Table as its under 'TABLES'

*-- FM CALLING TO FILL SALES ORDER HEADER N ITEM TABLES

         CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'

           EXPORTING

             I_BAPI_VIEW         = LS_MARKER

           TABLES

             SALES_DOCUMENTS     = LT_VBELN

             ORDER_HEADERS_OUT   = LT_EXPAND_HDR

             ORDER_ITEMS_OUT     = LT_EXPAND_ITM

             ORDER_SCHEDULES_OUT = LT_EXPAND_SCH.

*------------------

         LOOP AT LT_EXPAND_HDR INTO LS_EXPAND_HDR.

           CLEAR LS_EXPAND_SO.

           LS_EXPAND_SO-VBELN      = LS_EXPAND_HDR-DOC_NUMBER.

           LS_EXPAND_SO-DOC_TYPE   = LS_EXPAND_HDR-DOC_TYPE.

           LS_EXPAND_SO-SALES_ORG  = LS_EXPAND_HDR-SALES_ORG.

           LS_EXPAND_SO-DISTR_CHAN = LS_EXPAND_HDR-DISTR_CHAN.

           LS_EXPAND_SO-DIVISION   = LS_EXPAND_HDR-DIVISION.

           LS_EXPAND_SO-CUSTOMER_NUMBER = LS_EXPAND_HDR-SOLD_TO.

           LS_EXPAND_SO-PURCH_NO_C = LS_EXPAND_HDR-PURCH_NO.

           LOOP AT LT_EXPAND_ITM INTO LS_EXPAND_ITM WHERE DOC_NUMBER = LS_EXPAND_HDR-DOC_NUMBER.

             LS_ITEM-ITMNUMBER  =      LS_EXPAND_ITM-ITM_NUMBER.

             LS_ITEM-DOCNUMBER  =      LS_EXPAND_ITM-DOC_NUMBER.

             LS_ITEM-MATERIAL   =      LS_EXPAND_ITM-MATERIAL.

             LS_ITEM-MATLGROUP  =      LS_EXPAND_ITM-MATL_GROUP.

             LS_ITEM-DIVISION   =      LS_EXPAND_ITM-DIVISION.

             LS_ITEM-REQQTY     =      LS_EXPAND_ITM-REQ_QTY.

             LS_ITEM-PLANT      =      LS_EXPAND_ITM-PLANT.

             LS_ITEM-STGELOC    =      LS_EXPAND_ITM-STGE_LOC.

             LS_ITEM-SHIPPOINT  =      LS_EXPAND_ITM-SHIP_POINT.

LOOP AT LT_EXPAND_SCH INTO LS_EXPAND_SCH.

             LS_SCH-ITM_NUMBER  =      LS_EXPAND_SCH-ITM_NUMBER.

             LS_SCH-DOC_NUMBER  =      LS_EXPAND_SCH-DOC_NUMBER.

             LS_SCH-REQ_DATE    =      LS_EXPAND_SCH-REQ_DATE.

             LS_SCH-REQ_QTY     =      LS_EXPAND_SCH-REQ_QTY.

             LS_ITEM-SCHLINES-ITM_NUMBER  =      LS_SCH-ITM_NUMBER.

             LS_ITEM-SCHLINES-DOC_NUMBER  =      LS_SCH-DOC_NUMBER.

             LS_ITEM-SCHLINES-REQ_DATE    =      LS_SCH-REQ_DATE.

             LS_ITEM-SCHLINES-REQ_QTY     =      LS_SCH-REQ_QTY.

             ENDLOOP." ENDLOOP OF SCHLINES

             APPEND LS_ITEM TO LS_EXPAND_SO-SALESORDERITEMS.

           ENDLOOP. " ENDLOOP OF ITMS

         ENDLOOP." ENDLOOP OF HDR

*-------------------------------------------------------------------------*

*             Assign the Navigation Proprties name to Expanded Tech clauses

*-------------------------------------------------------------------------*

         clear LS_EXPANDED_CLAUSE1.

          LS_EXPANDED_CLAUSE1  = 'SALESORDERITEMS'.

         APPEND LS_EXPANDED_CLAUSE1 TO ET_EXPANDED_TECH_CLAUSES.

          clear LS_EXPANDED_CLAUSE1.

          LS_EXPANDED_CLAUSE1  = 'SCHLINES'.

         APPEND LS_EXPANDED_CLAUSE1 TO ET_EXPANDED_TECH_CLAUSES.

*-------------------------------------------------------------------------*

*             Send back Response to Consumer

*-------------------------------------------------------------------------*

         COPY_DATA_TO_REF(

           EXPORTING

             IS_DATA = LS_EXPAND_SO

           CHANGING

             CR_DATA = ER_ENTITY ).

     ENDCASE.

   ENDMETHOD.






i am Trying to achieve HDR>ITEM>SCH Navigation

items data get correctly populated but when I try to append the sch lines data which i had got from bapi . its not appended...

Best Regards,

Pavan Golesar

AshwinDutt
Active Contributor
0 Kudos

Just one observation for Expand Entity ->


SalesOrder to Item cardinality is 1 to N and its fine.


I think Items to Schedule cardinality will be 1 to N ..


Based on this you need to declare the Deep structure correctly.


Cross check Deep Structure declaration again and you need to use Navigation Property Names as the Item table names during declaration. Check this again from your end.


However you need to have only one append and append it only once as below ->


LS_EXPANDED_CLAUSE1='SALESORDERITEMS/SCHLINES '

APPEND LS_EXPANDED_CLAUSE1 TO ET_EXPANDED_TECH_CLAUSES.

Pavan_Golesar
Active Participant
0 Kudos

Hello Ashwin,

                 Ya,I had change the cardinality as per your suggestion...!!

I am getting the data for schlines (Schedule Lines), Now issue is just in appending it to the sch lines table...

Note: I am Yet to use single append as you suggested...

Best Regards,

Pavan Golesar.

AshwinDutt
Active Contributor
0 Kudos

Please check the below and have a look how Deep Structure is declared and how finally data is appended to it.

You are doing the same way which has been written in the blog so this will help you describing end to end steps.

Pavan_Golesar
Active Participant
0 Kudos

Hello Ashwin,

    Thanks for reply.

i'll get back aftr implementing this document u hav shareed.......

Regards,

Pavan Golesar

Pavan_Golesar
Active Participant
0 Kudos

Hello Ashwin,

     I went through the document , now My deep struture has been populated by header > Item > Sch lines.. also its copied successfully...


* Fill ER_ENTITY

  copy_data_to_ref(

    EXPORTING

      is_data = ls_expand_so

    CHANGING

      cr_data = er_entity ).

after this above code.. we have same data in er_entity as well..

but once the  call leaves this

it gives error.. I later checked out going inside the abap flow.. then found the error occurs duin transaformation of lr_entity to cr_entity...

I guess this error arose after I changed the cardinality.. (Later I cleaned up the cache)

now kindly guide me where m i loosing ..?

Thanks,

Pavan

Message was edited by: Pavan Golesar