on 12-05-2018 5:13 PM
Dear SAPiens,
My requirement is to change field name with prefix:fieldName...
Creating data type does not allow : character.
Please help in achieving this.
BR,
Rashmi
Hi Rashmi,
Just try this UDF
publicString setTargetFieldName(String newTargetFieldName, String Fieldvalue, Container container)
{
LeafStructureNode node =((LeafStructureNode) container.getParameter(“STRUCTURE_NODE”));
node.setQName(newTargetFieldName);
return Fieldvalue;
}
To add a prefix just pass data to UDF like this
constant("h:td")---------------\
setTargetFieldName----------------------><h:td>FIELD VALUE</h:td>
field------------------------------/
Please kindly note that all prefix has to be defined in xml before changing the target node name. Such as shown below, h and f are prefixes which has been defined at below at beginning of xml.
<root xmlns:h="http://www.w3.org/TR/html4/" xmlns:f="https://www.w3schools.com/furniture">
<h:table><h:tr><h:td>Apples</h:td><h:td>Bananas</h:td></h:tr></h:table><f:table><f:name>African Coffee Table</f:name><f:width>80</f:width><f:length>120</f:length></f:table>
</root>
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Anupam, I was able to achieve this using -
LeafStructureNode
I referred below blog -
https://blogs.sap.com/2012/11/05/message-mapping-play-around-with-target-structure/
BR,
Rashmi
Hi Rashmi,
I would suggest using XSLT/Java mapping to change the field name. I do not think it is possible in standard mapping.
regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.