Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CALL TRANSFORMATION

Former Member
0 Likes
847

Hi all,

I have a class method where in am using the CALL TRANSFORMATION abap element to perform the transformation from XML to ABAP internal table.

call transformation (l_xslt->xml2abap_name)

source xml p_body

result (l_send_bindings).

l_xslt->xml2abap_name - /1SAI/XS00000000000000000009

p_body -

6D6D5F726B615F7661745F746F743E38372E33353C2F65636F6D6D5F726B615F7661745F746F743E

09093C65636F6D6D5F7661745F737465726C3E3C2F65636F6D6D5F7661745F737465726C3E09093C

65636F6D6D5F726B615F726174653E3C2F65636F6D6D5F726B615F726174653E09093C65636F6D6D

5F63757272656E63795F63643E4348463C2F65636F6D6D5F63757272656E63795F63643E09093C65

636F6D6D5F726B615F72746F74616C3E313233362E34303C2F65636F6D6D5F726B615F72746F7461

6C3E09093C65636F6D6D5F7461785F63645F7661745F7063743E3C2F65636F6D6D5F7461785F6364

5F7661745F7063743E09093C45434F4D4D5F5641545F42415349535F414D543E3030303030303030

3030303030303031323C2F45434F4D4D5F5641545F42415349535F414D543E09093C45434F4D4D5F

5641545F414D543E30303030303030303030303030303031333C2F45434F4D4D5F5641545F414D54

3E09093C45434F4D4D5F435552525F434F44453E4742503C2F45434F4D4D5F435552525F434F4445

3E093C2F544F544C5F494E464F3E3C2F44545F494E564F4943453E3C2F4D545F496E766F6963653E

(Internally the string representation for the above hexadecimal is -

<ecomm_net_value>1149.05</ecomm_net_value>

<ecomm_rka_freight>0.00</ecomm_rka_freight>

<ecomm_rka_sum>1149.05</ecomm_rka_sum>

<ecomm_rka_rtax>7.6</ecomm_rka_rtax>

<ecomm_rka_vat_tot>87.35</ecomm_rka_vat_tot>

<ecomm_vat_sterl></ecomm_vat_sterl>

<ecomm_rka_rate></ecomm_rka_rate>

<ecomm_currency_cd>CHF</ecomm_currency_cd>

<ecomm_rka_rtotal>1236.40</ecomm_rka_rtotal>

<ecomm_tax_cd_vat_pct></ecomm_tax_cd_vat_pct>

<ECOMM_VAT_BASIS_AMT>00000000000000012</ECOMM_VAT_BASIS_AMT>

<ECOMM_VAT_AMT>00000000000000013</ECOMM_VAT_AMT>

<ECOMM_CURR_CODE>GBP</ECOMM_CURR_CODE>

l_send_bindings-Is a structure having the field and their values accordingly .

TOTL_INFO-ECOMM_VAT_BASIS_AMT -


value is blank in resulting structure

TOTL_INFO-ECOMM_VAT_AMT-----value is blank in resulting structure

TOTL_INFO-ECOMM_CURR_CODE-----value is blank in resulting structure

My problem-Eventhough there are values for <ECOMM_VAT_BASIS_AMT> ,<ECOMM_VAT_AMT> and <ECOMM_CURR_CODE> fields in the xml mesage they are not appearing in the resulting structure of the CALL TRANSFORMATION statement.Why so? .

In fact,fields are appearing but not their values ...why?.

kindly help me out to resolve this issue...

Regards,

Karthik

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
769

Hello,

Why don't you try using Identical transformation? it is simple to use and transformation template is also not required.

Thanks,

Augustin.

Hi all,

I have a class method where in am using the CALL TRANSFORMATION abap element to perform the transformation from XML to ABAP internal table.

call transformation (l_xslt->xml2abap_name)

source xml p_body

result (l_send_bindings).

l_xslt->xml2abap_name - /1SAI/XS00000000000000000009

p_body -

6D6D5F726B615F7661745F746F743E38372E33353C2F65636F6D6D5F726B615F7661745F746F743E

09093C65636F6D6D5F7661745F737465726C3E3C2F65636F6D6D5F7661745F737465726C3E09093C

65636F6D6D5F726B615F726174653E3C2F65636F6D6D5F726B615F726174653E09093C65636F6D6D

5F63757272656E63795F63643E4348463C2F65636F6D6D5F63757272656E63795F63643E09093C65

636F6D6D5F726B615F72746F74616C3E313233362E34303C2F65636F6D6D5F726B615F72746F7461

6C3E09093C65636F6D6D5F7461785F63645F7661745F7063743E3C2F65636F6D6D5F7461785F6364

5F7661745F7063743E09093C45434F4D4D5F5641545F42415349535F414D543E3030303030303030

3030303030303031323C2F45434F4D4D5F5641545F42415349535F414D543E09093C45434F4D4D5F

5641545F414D543E30303030303030303030303030303031333C2F45434F4D4D5F5641545F414D54

3E09093C45434F4D4D5F435552525F434F44453E4742503C2F45434F4D4D5F435552525F434F4445

3E093C2F544F544C5F494E464F3E3C2F44545F494E564F4943453E3C2F4D545F496E766F6963653E

(Internally the string representation for the above hexadecimal is -

<ecomm_net_value>1149.05</ecomm_net_value>

<ecomm_rka_freight>0.00</ecomm_rka_freight>

<ecomm_rka_sum>1149.05</ecomm_rka_sum>

<ecomm_rka_rtax>7.6</ecomm_rka_rtax>

<ecomm_rka_vat_tot>87.35</ecomm_rka_vat_tot>

<ecomm_vat_sterl></ecomm_vat_sterl>

<ecomm_rka_rate></ecomm_rka_rate>

<ecomm_currency_cd>CHF</ecomm_currency_cd>

<ecomm_rka_rtotal>1236.40</ecomm_rka_rtotal>

<ecomm_tax_cd_vat_pct></ecomm_tax_cd_vat_pct>

<ECOMM_VAT_BASIS_AMT>00000000000000012</ECOMM_VAT_BASIS_AMT>

<ECOMM_VAT_AMT>00000000000000013</ECOMM_VAT_AMT>

<ECOMM_CURR_CODE>GBP</ECOMM_CURR_CODE>

l_send_bindings-Is a structure having the field and their values accordingly .

TOTL_INFO-ECOMM_VAT_BASIS_AMT -


value is blank in resulting structure

TOTL_INFO-ECOMM_VAT_AMT-----value is blank in resulting structure

TOTL_INFO-ECOMM_CURR_CODE-----value is blank in resulting structure

My problem-Eventhough there are values for <ECOMM_VAT_BASIS_AMT> ,<ECOMM_VAT_AMT> and <ECOMM_CURR_CODE> fields in the xml mesage they are not appearing in the resulting structure of the CALL TRANSFORMATION statement.Why so? .

In fact,fields are appearing but not their values ...why?.

kindly help me out to resolve this issue...

Regards,

Karthik

4 REPLIES 4
Read only

Former Member
0 Likes
770

Hello,

Why don't you try using Identical transformation? it is simple to use and transformation template is also not required.

Thanks,

Augustin.

Read only

0 Likes
769

Hello Augustin,

I am talking about the CALL TRANSFORMATION present in standard SAP class method i.e, CL_PROXY_XMS_PLSRV~DESERIALIZE_PAYLOAD.I do not know why it is not displaying values only for last three fields.For rest of the fields they are being displayed.

Regards,

Karthik.

Read only

0 Likes
769

Hi Refer this code.

REPORT  ZTESTXML                                .

TABLES: KNA1.

************************************************************************
* DATA DECLARATION
************************************************************************

DATA : IT_DATA_XML TYPE STANDARD TABLE OF KNA1 WITH HEADER LINE.
DATA : XML_RESULT TYPE STRING.
************************************************************************
* SELECT OPTIONS
************************************************************************
selection-screen begin of block abc with frame title text-001.
selection-screen skip.
SELECT-OPTIONS: SO_KUNNR FOR KNA1-KUNNR.
selection-screen skip.
selection-screen end of block abc.

************************************************************************
*START OF SELECTION
************************************************************************
START-OF-SELECTION.

  PERFORM GET_DATA.
  PERFORM GET_INTO_XML_FORMAT.


************************************************************************
* FORM GET_DATA
************************************************************************
FORM GET_DATA.

  SELECT * FROM KNA1 INTO TABLE IT_DATA_XML
  WHERE KUNNR IN SO_KUNNR.

  IF SY-SUBRC <> 0.
    MESSAGE 'RECORDS NOT FOUND.' TYPE 'E'.
  ENDIF.

ENDFORM.                    "GET_DATA

************************************************************************
* FORM GET_INTO_XML_FORMAT
************************************************************************
FORM GET_INTO_XML_FORMAT.


call transformation id
  source SOURCE = IT_DATA_XML[]
  result xml XML_RESULT.


refresh IT_DATA_XML.

  CALL TRANSFORMATION id
    SOURCE XML XML_RESULT
    RESULT SOURCE = IT_DATA_XML[].

write: 'this is test'.

ENDFORM.                    "GET_INTO_XML_FORMAT

Read only

0 Likes
769

Hello,

Check with the data type for last 3 columns are XSLT compatible.

Also you debug the standard transformation template to get the more idea.

Thanks,

Augustin.