cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Adding comment line in XML message

Former Member
0 Likes
4,942

Hi,

Does anyone know how to add a comment line in outgoing XML message from XI? Using graphical mapping or java or adapter module?

Something like .....

<?xml version='1.0' encoding='UTF-8' ?>

<! this is a comment>

<record>

Thanks

Pushpinder

View Entire Topic
Former Member
0 Likes

Hi Pushpinder,

depends on the kind of mapping you process:

1) graphical mapping: not possible

2) xsl-mapping: use <xsl:comment>

3) JAVA-Mapping: Insert a comment-node to the target structure

3) ABAP-Mapping: Insert a comment-node to the target structure

Regards Mario

Former Member
0 Likes

Thanks to all who replied!!

I am very near to the solution. In the comment I need to pick up the first tag of the xml dynamically.

Say in place of <record> it could be specific to interface, then how to do it?

Please help

Thanks

Pushpinder

Former Member
0 Likes

Hi Pushpinder,

Can you explain exactly what you are looking for with one example. It can be very well done using Java Mapping.

Thanks

amit

Former Member
0 Likes

Hi,

I have to add a comment line in the target xml like:

<?xml version='1.0' encoding='UTF-8' ?>

<!DOCTYPE RMS_MODEL SYSTEM 'RMS_Model.dtd'>

<RMS_MODEL>

<DIVISION Value="2"/>

<RMS_RANGE Value="0801"/>

<WORKING_NO Value="S8153219"/>

<MODEL_NO/>

<MODEL_NAME/>

<CARRY_OVER/>

i am able to achieve the above.

But in my message mapping I am using multi mapping, so after the message mapping the target structure looks something like:

<?xml version='1.0' encoding='UTF-8' ?>

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"><ns0:Message1>

<!DOCTYPE RMS_MODEL SYSTEM 'RMS_Model.dtd'>

<RMS_MODEL>

<DIVISION Value="2"/>

<RMS_RANGE Value="0801"/>

<WORKING_NO Value="S8153219"/>

<MODEL_NO/>

<MODEL_NAME/>

<CARRY_OVER/>

now, is it possible to add a comment line as shown in this example?Or is it preferable to use an adapter module?

Thanks

Pushpinder

Former Member
0 Likes

Hey Pushpinder,

It should be possible without using a adapter module. Just give it a try and let me know. Don't worry about Messages and Message1.

amit

Former Member
0 Likes

Hi Amit,

But it will make a difference as the messages will be split after the message mapping. So how java mapping going to handle it?

I have tried deploying the java code but it is not inserting the comment line in the final message.

Thanks

Pushpinder