on 07-21-2015 3:42 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Pavan,
What is the operation your performing ? Share the details.
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
DATA: BEGIN 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
DATA: BEGIN 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....
DATA: LS_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
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.
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
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.