Answered by:
Namespace Issue

Question
-
Hi All,
I am trying to send an IDOC to SAP by appending some addtional node in my custom component. In the first IDOC given below it is working fine because I am adding in ns1 (1st Pic), however when I am using the same component for the other IDOC it is not working because the order of namespaces are getting rearranged after the mapping as shown in the second pic.
Anyone has any idea on how we can arrange the namespaces after the mapping or do I need to change the custom component ?
Thanks, Varun
Monday, December 22, 2014 3:56 PM
Answers
-
Varun,
you will have to pass the actual or required namespace to your component and not just presume what prefix will be used. Then, at runtime, parse enough of the "header" to work out what prefix you need to use and add your node as required.
I would try to do this in the map that generates the idoc, it would be a lot easier.
mark
mark
- Proposed as answer by Rachit SikroriaModerator Wednesday, December 24, 2014 9:52 PM
- Marked as answer by Angie Xu Monday, December 29, 2014 5:28 AM
Monday, December 22, 2014 8:55 PM -
Hi Varun,
You're confusing yourself.
The shown IDOC1 and IDOC2 are different not just the namespace rearrangement. IDOC1 seems have namespaces related to 711 where as IDOC2 relate to 731.
If in your custom component you just add/append a node nothing anything other than appending the node, then the output message (message passed in to you custom pipeline in send ) itself is different. First one is of 711 with different namespaces declaration and second one 731 with different namespace declarations.
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.
- Proposed as answer by Leonid GanelineModerator Monday, December 22, 2014 10:38 PM
- Marked as answer by Angie Xu Monday, December 29, 2014 5:28 AM
Monday, December 22, 2014 6:52 PM
All replies
-
Hi Varun,
Order of the namespace doesn't impact the output of the message created. It doesn't matter, so you don't need to change it.
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.
Monday, December 22, 2014 4:03 PM -
Hi Ashwin,
Yes it will not impact the output but the problem is in the custom component I am explicitly mentioning the namespace id like ns3 for adding a new node. The reason for the same is, I want the output to be like
<ns3:documentnode /> and ns3 has a different namespace in both the documents.
That is where I am getting the issue...
Hope you understood now.
Thanks,
Varun
Thanks, Varun
Monday, December 22, 2014 6:25 PM -
Hi Varun,
You're confusing yourself.
The shown IDOC1 and IDOC2 are different not just the namespace rearrangement. IDOC1 seems have namespaces related to 711 where as IDOC2 relate to 731.
If in your custom component you just add/append a node nothing anything other than appending the node, then the output message (message passed in to you custom pipeline in send ) itself is different. First one is of 711 with different namespaces declaration and second one 731 with different namespace declarations.
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.
- Proposed as answer by Leonid GanelineModerator Monday, December 22, 2014 10:38 PM
- Marked as answer by Angie Xu Monday, December 29, 2014 5:28 AM
Monday, December 22, 2014 6:52 PM -
Hi Varun,
Of what I have understood, I would suggest to create independent custom component for each IDOC type. Reading the namespaces and re-arranging them will be cumbersome task, you will not only have to rearrange the namespace alias but also rearrange qualified elements and attributes too.
Rachit
- Proposed as answer by Rachit SikroriaModerator Tuesday, December 23, 2014 4:42 AM
Monday, December 22, 2014 7:16 PMModerator -
Varun,
you will have to pass the actual or required namespace to your component and not just presume what prefix will be used. Then, at runtime, parse enough of the "header" to work out what prefix you need to use and add your node as required.
I would try to do this in the map that generates the idoc, it would be a lot easier.
mark
mark
- Proposed as answer by Rachit SikroriaModerator Wednesday, December 24, 2014 9:52 PM
- Marked as answer by Angie Xu Monday, December 29, 2014 5:28 AM
Monday, December 22, 2014 8:55 PM -
Hi Leonid,
I know they are different but both are of same type ZINVOICE. It is just the third system is older so we are using 711 version.
Both the IDOCs have same segments apart from namespaces which are rearragned after passing from the map.
I think I just have to add one more function for the other IDOC mentioning the addion of addtional node to the corrent namespace i.e ns1 instead of ns3.
Thanks,
Varun
Thanks, Varun
Tuesday, December 23, 2014 7:47 AM -
Hi Rachit/Mark,
Yes i think i have to do the same in my component only.
Thanks,
Varun
Thanks, Varun
- Proposed as answer by Rachit SikroriaModerator Sunday, December 28, 2014 6:43 PM
- Unproposed as answer by Rachit SikroriaModerator Sunday, December 28, 2014 6:43 PM
Tuesday, December 23, 2014 7:48 AM