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

simple Transformation Exception error

Former Member
0 Likes
2,619

Hi All,

I am working transformations (XTRANS) in sap and getting some exceptions. My Requirement is read XML data and pass it to RFC FM to execute in SAP.

XML is having same as RFC input parameters.

XML file Looks like below:

And Transformation code is like below and getting exception:

System expected element 'IT_P1_DATA'. Please suggest me how to avoid exceptions in SAP.

SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L1S33 {
color: #009300;
}

      <IT_P1_DATA>

        <tt:loop ref="ZRI_TTY_CHANGE.IT_P1_DATA">

          <ZT_P1_DAT>

            <MANDT tt:value-ref="MANDT"/>

            <VTGNR tt:value-ref="VTGNR"/>

            <BESTNR tt:value-ref="BESTNR"/>

            <VTGJJ tt:value-ref="VTGJJ"/>

            <PREM_REP_AS tt:value-ref="PREM_REP_AS"/>

            <ADJ_DUE_DATE tt:value-ref="ADJ_DUE_DATE"/>

            <PREMIUM_TEXT tt:value-ref="PREMIUM_TEXT"/>

          </ZT_P1_DAT>

        </tt:loop>

      </IT_P1_DATA>
5 REPLIES 5
Read only

Sandra_Rossi
Active Contributor
1,964

The issue is probably because PREMIUM_TEXT is missing in your XML. Optional elements must be conditioned (tt:cond).

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,964

Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.

If you do a comment under a question/answer and you want to target someone else than the question/answer' author, the only solution is to copy/paste their hyperlinked name so that the person receives a warning (NB: @ doesn't work)

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,964

I realize that the problem comes from something that you didn't provide. IT_P1_DATA is expected in the XML but is not found, so you should post the XML before IT_P1_DATA, not after, and also the corresponding transformation code.

Please post the code as text instead of image, so that one can easily answer by modifying portions of your code.

Read only

Former Member
0 Likes
1,964

code.txt

Rossi,

Thanks for your suggestion and attached the note pad with complete code.

Regards,

Sandeep K

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,964

The elements ZTRI_POLARIS_DAT and its children have a default namespace assigned. Check again without the namespace.