on 09-19-2011 1:59 PM
Hi Experts,
My scenario is ABAP proxy to File. ABAP program is sending data to PI with blank value. But in PI payload that field is not showing at all.
Suppose customer number value is blank in ABAP internal table, in PI payload customer number xml tag is not showing at all in source structure.
Have used one to one mapping and in content conversion we have used.
.addHeaderLine 0
.fieldSeparator ;
endSeparator 'nl'
and also I need - if any value in the source structure is coming empty we need to replace it with semi colon.it is not for a specific field, it might be any field of source structure.
please help on this.
Thanks,
Swapnashree
Make the source field mandatory then regenerate the proxy. Field will definitely come even with null as well.
Regards
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Before you call the message mapping in interface mapping, u need a java mapping code. This code will check if the required tag is absent. In case the required XML tag is missing, the java mapping code will insert the tag under proper parent node. This is best accomplished using DOM parser. If you need any further guidance from forum members on how to achieve this, then you need to publish following information
1. Version of PI you are working on.
2. Source XML structure.
3. Target XML structure.
You may refer to various java mapping blogs in SDN for further information on the topic.
Else try this mapping of the source field
Source field--------Exists ------> if ----------------- target field
if the condition evaluates true then map source field -------> target else constant (";") ------->target.
regards
Anupam
Edited by: anupamsap on Sep 20, 2011 2:42 PM
Hi
Thank you for the suggestion of regenerating the proxy. I had made the source fields mandatory, but then a new set of problems arose - The application failed because it was expecting some value for the mandatory fields (blank was not accepted). I forgot to regenerate the proxy, or left it for later once I established that the solution was working fine. I regenerated the proxy, after which it started working as desired - XML tags were generated even for empty fields
use MapWithDefault in message mapping and insert the default value in "MapWithDefault properties" (double click on function).
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>and also I need - if any value in the source structure is coming empty we need to replace it with semi colon.it is not for a specific field, it might be any field of source structure.
Another possible way is ...Check whether source structure gets value or not using if function and together using a constant function (storing semi colon in it) handle this issue. You might also try mapwithdefault standard function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you will have to use the standard function mapwithdefault to handle your case.
Refer: http://help.sap.com/saphelp_nwpi711/helpdata/en/2c/2d8c4024d26e1de10000000a1550b0/frameset.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.