on 09-05-2006 12:01 PM
Hi everybody,
I have a problem when I map an IDOC to a target structure.
The target structure is going to be converted by File content conversion.
I need that in the final flat file a tab occurs everytime a field is empty or full so I type
field.fielSeparator = '0x09'. Until here everything goes ok.
The problem cames when some field of the ZIDOC is empty and the xml tag is not generated.
Consequently, the tag in the target structre is not generated and finally a tab doesn't occur as there is no field.
Every field in the IDOC is 0..1.
I have tried to set the ocurrence in the target field to 1 with a default value but it doesn't work. It gives
a mapping error.
I have managed to solve the problem by implementing a graphical mapping functions (exists, if,...),
something like that:
ZIDOC/Target Structure
A -- Graphical mapping -
> B
Graphical mapping:
IF (EXISTS (A))
THEN A
ELSE CONSTANT=""
Just I need to generate the target field when the source field doesn`t exists.
HOW can I simulate this graphical mapping with a user function as I need to use this function in every field of the IDOC?
Maybe, is there any other way to solve this?
Thanks
Regardas
Carlos
Hi,
You can do this manyways in UDF.
in the UDF you can just check
if(input==null)
return = " ";
else
return input;
Thanks,
Prakash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use MAPWITHDEFAULT available I think under Node Functions and use it by providing the default value.
SOURCE FIELD -->MAPWITHDEFAULT --> TARGET FIELD
If the source field is not available in the source, then Target field is filled with the default value provided.
Should do the trick I guess.
Regards,
Bhavesh
Hi Prakash,
this solution gives the following error:
/usr/sap/DXI/DVEBMGS50/j2ee/cluster/server0/./temp/classpath_resolver/Map1cde3e403cd111dba6e9000f203c1245/source/com/sap/xi/tf/_MM_MAESTROS_DELEGACIONES_HH_.java:339: cannot resolve symbol symbol : variable input location: class com.sap.xi.tf._MM_MAESTROS_DELEGACIONES_HH_ if(input==null) ^ 1 error
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.