cancel
Showing results for 
Search instead for 
Did you mean: 

File content conversion: Always Insert ";" on 0..1 occurrence fields

Marçal_Oliveras
Active Contributor
0 Kudos

Hi,

My scenario is IDOC->File and the IDOC has some optional fields mapped to the file but the file is a CSV separated by ";".

I want to generate a ";;" on the file a field doesn't appear to the IDOC. The solution that I have to this is use the "EXIST" function in message mapping for source field and if it doesn't exist I map an empty constant to target message. But I want to know if there is a better solution because I've got a lot of fields to map in this way and my solution doesn't looks very "elegant"

Edited by: Marshal on Jul 16, 2009 3:08 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

As I know to get correct csv file you have to use empty fields in rows, so you will not avoid it. The only improvement i see may be using MapDefault function.

Regards,

Radek

Answers (2)

Answers (2)

Marçal_Oliveras
Active Contributor
0 Kudos

Just used mapWithdefault...

Former Member
0 Kudos

Hey

This needs to be handled in message mapping itself.

in past i have used mapWithDefault for all the fields which may or may not exist on sender side but can give issues in File content conversion on receiver side if they don't exist.

Thanks

Aamir

Marçal_Oliveras
Active Contributor
0 Kudos

Thank you both, so you think that my solution is the best?

What kind of problems can I have with "mapWithDefault" function? It seems a good choice for me.

Former Member
0 Kudos

>>What kind of problems can I have with "mapWithDefault" function? It seems a good choice for me.

Its just another function like EXIST.i personally prefer it since you don't need to use If-Else condition as you may have to use with EXIST.

Thanks

Aamir

Former Member
0 Kudos

Hi Marshall,

"mapWithDefault" function is the better solution for the requirement You have. It simplifies your graphical mapping and It must not give you any problem.

Regards

Ivan