cancel
Showing results for 
Search instead for 
Did you mean: 

comma inside quotes in FCC

former_member440449
Participant
0 Kudos

Hi Gurus,

In a File Content Convertion scenario, I am having an issue as next:

the sender CC will pick the file and put all data between comas in different fields. Example:

file:

data1, data2, data3

File mapped:

<field1>data1<field1>
<field2>data2<field2>
<field3>data3<field3>

But, there are some fields inside the file that are like this:

data1, "data2 (1, 2)", data3

So, what I need to do is remove comma in between double quotes.

Is this possible? How can I handle this?

Thanks!!

Accepted Solutions (1)

Accepted Solutions (1)

sunilchandra007
Active Contributor
0 Kudos

> So, what I need to do is remove comma in between double quotes.

Why do you want to remove the comma? You can just ignore it using enclosureSign parameter.

For more details pls check http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm .

Regards,

Sunil Chandra

Answers (5)

Answers (5)

former_member440449
Participant
0 Kudos

Finally, the enclosure sign solved this issue.

Thanks all for your help

Shabarish_Nair
Active Contributor
0 Kudos

there is already a standard solution available (enclosureSign) so use it - http://wiki.sdn.sap.com/wiki/display/XI/FileContentConversion

anupam_ghosh2
Active Contributor
0 Kudos

Hi ,

Unless you are very sure about which field and how many times comma may come,I do not think you can resolve this problem at UDF level, after reading the file using FCC. The FCC you are using is separating the fields using comma. Thus for a data like this

data1, "data2 (1, 2)", data3

you will receive

<field1>data1<field1>

<field2>"data2 (1<field2>

<field3>2)"<field3>

<field4>data3<field4>

Now I would rather suggest you to try to change the FCC parameters in such a way that record separator is 'nl' or newline. Thus if you receive a file like this

data1, "data2 (1, 2)", data3

data1, data2, data3

After FCC you will receive data like this

<mt_record>

<row>data1, "data2 (1, 2)", data3</row>

<row>data1, data2, data3</row>

</mt_record>

Now you need to follow java mapping to get the required target structure. If you are new to java mapping follow these blogs, for PI 7.1

http://wiki.sdn.sap.com/wiki/display/XI/UsingPI7.1APIforJavamapping

If you are working in PI 7.0 you can follow

http://wiki.sdn.sap.com/wiki/display/XI/BeginnersguidetoJavamappingusingDOMparserinSAPXI

After following the FCC specified here, try doing java mapping.

regards

Anupam

Edited by: anupamsap on Jul 8, 2011 6:48 AM

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>So, what I need to do is remove comma in between double quotes.

Yes it is possible. DO as follows.....

Use Standard text function replaceString to achieve this. It requires three input.

Example;  field2   ----> 1
          constant  , ----> 2
         constant (empty - no value)---->3

Map field2 --> replaceString --> target field

former_member181962
Active Contributor
0 Kudos

Hi Chapa,

Handle that particular field in the mapping. Use string functions (UDF) to remove the double quotes.

Best regards,

Ravi