on 10-07-2006 4:00 AM
Hi,
I'm trying to map an IDOC to a file of fixed length fields. I'm using the file content conversion parameters. The file is a one to one mapping of certain nodes in the IDOC. If a certain node in an IDOC does not have all its fields populated, the fixed length file does not get mapped correctly. For e.g. if the third field in the IDOC node is not present, all the fields in the file get shifted to the left.
Is there any way to fix this?
(As a work-around, I'm currently checking each field in the IDOC and creating an empty field even if the field does not exist in the source IDOC. This is very inconvenient especially if you have a lot of fields to map. We have about 1000 fields.)
Thanks,
Basant Gupta
Use the function "mapWithDefault". This function creates an empty node whenever the source is not available.
This function helps to get rid of if/then constructs.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In fixed length field content conversion, if there is no fields/value populated, you will get error in the content conversion.
To avoid this,in the mapping, you need to check for the existence of the source fields and then you need to proceed accordingly.
If field exists then map the same to Target field
Else map with that many spaces (as per the length) to the target fields. this logic you need to build in the mapping with built in functions like "If-Else" and "Exists" node functions.
I do agree that, it is lengthy process to do for huge number of fields. But it is required to do this way
Hope this helps
Regards,
Moorthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Basant,
You use Exists function and IF->then->else functions both at a time. First check if the field exists in the Idoc. If the field exists then you pass the value in then condition and if the field dont exists then you pass spaces in else condition. Since you are using content conversion you have to pass spaces in the else condition so that your content conversion will work fine.
field1 --> then
field1>exists>if -->target
spaces --> else
Hope this helps.........
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Basant,
Y dont you try mapping the fields to a constant without value and give the fieldSeparator as comma.Because even if some fields are missing in the idoc in ur flat file an empty field will be created.if the third field is missing then the output will be
x,y,,z.
Regards
jithesh
Message was edited by: jithesh balakrishnan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.