cancel
Showing results for 
Search instead for 
Did you mean: 

CSV file:Incoming field blank, how put 2 commas in file

Former Member
0 Kudos

Hi,

In my IDOC to FILE scenario, I am creating a CSV file from the incoming IDOC. I have a few optional fields in the incoming IDOC so if these fields have no value, then there are no XML tags in the incming XML file in Adapter engine for these fields.

In effect, when I create my CSV, these fields are missing. I want my CSV to have space/blank value between 2 commas for such fields.

Example:

So if idoc segment has 4 fields and field no 2 is optional(and blank in this case), I want my output file like

field1-value , , field3-value, field4-value.

I am sure this should be possible to do in FCC or field mapping, but I do not know the command. Appreciate your help.

Thanks

Shirin

Accepted Solutions (1)

Accepted Solutions (1)

former_member537867
Active Contributor
0 Kudos

Hi Shirin,

Yes u have to use that node function "EXISTS", ur absolutely right.

Check this blogs for use of exists Function:

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

Regards,

vinod.

Answers (3)

Answers (3)

GabrielSagaya
Active Contributor
0 Kudos

field2-value>exists()->ifthenelse->field2-value->Field2-Value

(true) (if-part)

field2-value>exists()->ifthenelse-> (Constant)->Field2-Value

(false) (else-part)

Former Member
0 Kudos

HI,

When you say does the field exist, I do not see any function in message mapping with the name EXIST(). ( there is one but its a node function).

So do I use the same node-function exist( though I need to checka field and not node).

Regards

Shirin

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

It is the node function exists()

Thanks

SaNv...

santhosh_kumarv
Active Contributor
0 Kudos

Hi Sharin,

In the mapping check if the optional field exist...

1. if so map the field itself

2. if not map a blank constant, this assures that the optionl field is always created in the target structure...

the same FCC can be used...

Thanks

SaNv...

Former Member
0 Kudos

Hi,

Use MappWithDefault Function to mapp the , , with the target field

Regards

Seshagiri