cancel
Showing results for 
Search instead for 
Did you mean: 

How to get required tags and name spaces in the output File?

Former Member
0 Kudos

Hello,

I am doing IDOC to File sceanrio and I am able to get the file but the problem is that I am unable to get the required tag names. Out put file is having ns0 ns1 and so on..

Eg:

ns2:MaterialDefinitionProperty><ns2:MaterialDefinitionProperty><ns2:ID>CU_NET_WEIGHT</ns2:ID></ns2:MaterialDefinitionProperty><ns2:MaterialDefinitionProperty><ns2:ID>EAN_SKU</ns2:ID></ns2:MaterialDefinitionProperty><ns2:MaterialDefinitionProperty><ns2:ID>CUPerCase</ns2:ID>

and so on..

Source structure is IDOC

Target structure is External Defination imported with references.

How can I get the output file with the exact namespaces and tags as imported through External Definations.

Thanks in Advace.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for your views Its really helped to solve the problem.

Former Member
0 Kudos

Perfect

And why did it work now?

Former Member
0 Kudos

Hi heinrich,

I was looking in to the payload in the Message monitoring all the time after making changes in the Module. Once I tried to check the output file and its working as needed.

Thanks for your information. I awarded points.

Former Member
0 Kudos

HI! Rajeev,

I have gone through this forum and we having 100% same to same requirement here in my project.

We want this at the top of the Output Payload..

<?xml version="1.0" encoding="UTF-8" ?> 
- <SyncMaterialDefinition xmlns="http://www.siemens.com/ad/mes/b2mt-1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bml="http://www.wbf.org/xml/b2mml-v02" xmlns:sit="http://www.siemens.com/ad/mes/b2mml-v02-SITExt-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oag="http://www.openapplications.org/oagis">
- <oag:ApplicationArea>

and also isome part of payload nstead of ns0: and ns1:

we want it as below for some part of same output payload

<oag:ApplicationArea>
- <oag:Sender>
  <oag:LogicalId>SAP</oag:LogicalId> 
  <oag:Component>PMConnector</oag:Component> 
  <oag:ReferenceId /> 
  <oag:Confirmation>Always</oag:Confirmation> 
  </oag:Sender>
  <oag:CreationDateTime>2009-06-14T22:23:29.42Z</oag:CreationDateTime>

</bml:MaterialDefinitionProperty>
- <bml:MaterialDefinitionProperty>
  <bml:ID>XXXXXXX</bml:ID> 
- <bml:Value>
  <bml:ValueString>0.0</bml:ValueString> 
  <bml:DataType>string</bml:DataType> 
  <bml:UnitOfMeasure>n/a</bml:UnitOfMeasure> 
  <bml:Any /> 
  *</bml:*Value>

Check the above code how we want but we are getting in normal way .

Could you please review this and guide me in detailed way how to do in a step by step manner if possible by taking my above payload condition.

Regards:

Amar Srinivas Eli

former_member181962
Active Contributor
0 Kudos

Hi Rajeev,

I think you are looking at the structure of the target and not the data.

In your test tab of the message mapping, give some input values and Run your Message mapping.

Then in the target side, press the SRC button, to see the actual XML Payload of the target file.

See if you still get the name spaces in your target payload.

Regards,

Ravi kanth Talagana

Former Member
0 Kudos

Hi Ravi,

I did the same and I see ns0 ns1

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

<ns0:MaterialDef xmlns:ns0="http://www.siemens.com/ad/abc/b2mt-1.0"><ns1:ApplicationArea xmlns:ns1="http://www.openapplications.org/oagis"><ns1:CreationDateTime>2009/04/07</ns1:CreationDateTime></ns1:ApplicationArea><ns0:DataArea>

and so on!...

I dont want to have default values ns0 ns1 and so on..

Thanks

Former Member
0 Kudos

Hi,

Please check in the Message Type and remove the namespace specified in XML Namespace field.

You are getting ns0 because of that.

Regards,

Shwetambari

former_member184619
Active Contributor
0 Kudos

Hi rajeev,

Have you checked this blog:

/people/sameer.shadab/blog/2005/12/05/how-to-remove-namespaces-in-mapping--xi

Sachin

Former Member
0 Kudos

Hi,

I am using external defination so there is no Message Type. H

ow can I remove these Default content ns0 and so on and instead I would like to have Target Message names spaces and tag names.

Thanks

former_member181962
Active Contributor
0 Kudos

Try to create a message type for the external definition(Use the external definition as data type) and see if you can remove the namespace as per the blog.

Regards,

Ravi

Former Member
0 Kudos

You could try the anonymizer bean.

http://help.sap.com/saphelp_nw70/helpdata/EN/45/d169186a29570ae10000000a114a6b/frameset.htm

Configure the module to allow just your ns2-namespace (anonymizer.acceptNamespaces=namespace ns2).

Former Member
0 Kudos

HI Heinrich,

I tried with your suggestion:

Enter the module name AF_Modules/XMLAnonymizerBean.

Select the Module Type Local Enterprise Bean

Module Key is 0 where as CallSAPAdaptor is 1

Module Key 0

Parameter Name anonymizer.acceptNamespaces

Parameter Value Namespace ns2

I send IDOC PI processed successfully but I didnt received ns2 is replaced wiht Namespace.

Do I miss some thing else?

Thanks

Former Member
0 Kudos

And your external definition contains the required namespace and ns2-tag?

Former Member
0 Kudos

Hi Heinrich,

I have the following namespace in the External Defination !...

bml="http://www.wbf3.org/xml/b2mmlv02"

in the output I want to have bml instaed of ns2.

I need to update module with http://www.wbf3.org/xml/b2mmlv02 with Namespace and ns2 with bml??

Thanks

Rajeev.

Former Member
0 Kudos

Yeah...

Module Key 0

Parameter Name anonymizer.acceptNamespaces

Parameter Value http://www.wbf3.org/xml/b2mmlv02 bml

Former Member
0 Kudos

Hi,

I made Adaptor configuration as mentioned but still I see ns2 in the payload:

<ns2:MaterialDefinition xmlns:ns2="http://www.wbf3.org/xml/b2mmlv02">

<ns2:ID>500</ns2:ID>

<ns2:Description>abc 1,5KG RICOTTA</

Am I missing some thing? I would like to have bml instaed of ns2.

This module is excuting before calling adaptor:

Module Key 0

Parameter Name anonymizer.acceptNamespaces

Parameter Value http://www.wbf3.org/xml/b2mmlv02 bml

Thanks

Rajeev.

Former Member
0 Kudos

Maybe just a caching problem now? Trigger a full cache refresh and try again? In my eyes the configuration should work.

The module is processed before the standard sap module CallSapAdapter?

Former Member
0 Kudos

Yeah this module is processed before the standard sap module CallSapAdapter and I see in Message Monitoring its processed successfully and called standard sap Module.

I did full cach refresh even, still the same output with ns2 tags.

Thanks

Rajeev

Former Member
0 Kudos

No idea...

Former Member
0 Kudos

Hello,

Before using this module payload is as follow:

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

- <ns0:SyncMaterialDefinition xmlns:ns0="http://www.siemens.com/ad/mes/b2mt-1.0">

- <ns1:ApplicationArea xmlns:ns1="http://www.openapplications.org/oagis">

<ns1:CreationDateTime>2009/04/07</ns1:CreationDateTime>

</ns1:ApplicationArea>

how can I get use of this module to get abc and def instead of ns0 and ns1 ?????

Any one can input there idea why the following XMLAnonymizerBean is not working:

Adaptor Configuration:

XMLAnonymizerBean XMLAnonymizerBean 0

after this module standard SAP callsap adaptor is called 1

anonymizer.acceptNamespaces -


Name

http://www.siemens.com/ad/mes/b2mt-1.0 abc http://www.openapplications.org/oagis def -


Value

still I am getting the same output as before, I mean there is no effect at all by using this module. I didnt got any error message and I see in Message monitoring this module got called and executed successfully.

Thanks

Rajeev.