cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Header Line in CSV File - FCC Parameter Configuration

0 Kudos

Hi Experts,

Need an urgent help on the below issue.

Scenario: We have IDOC to CSV File scenario. The message structure at the receiver end is as follows,

Header Details

        Field 1

        Field 2

        Intermediate details

                Field 3

                Field 4

                Item Details

                        Field 5

                        Field 6

Requirement: We want the all the field headers of Header Details, Intermediate Details & Item Details, get populated in the CSV file at the first line.

FCC Parameter Configuration:

Recordset Structure: Header Details,Intermediate Details,Item Details

Header Details.addHeaderLine: 3

Header Details.headerLine: Field 1,Field 2

Header Details.fieldSeperator: |

Intermediate Details.addHeaderLine: 3

Intermediate Details.headerLine: Field 3,Field 4

Intermediate Details.fieldSeperator: |

Item Details.addHeaderLine: 3

Item Details.headerLine: Field 5,Field 6

Item Details.fieldSeperator: |

Item Details.endSeperator: 'nl'

Issue: Even after making these changes, the generated output CSV file doesn't contain any such header line.

Thanks in advance.

Regards,

Praloy

Accepted Solutions (0)

Answers (2)

Answers (2)

engswee
Active Contributor
0 Kudos

Hi Praloy

Not sure if you are providing the actual names or not. The segment names and field names cannot contain whitespaces in the configuration. Also, you have typo errors in the naming of the separator parameters: it should be Separator instead of Seperator.

Before even suggesting how to resolve your issue, perhaps you can provide more information on your set up.

i) What PI version are you on?

ii) Are you using FCC on the File adapter or MessageTransformBean on the SFTP adapter?

iii) Provide an example of how the actual XML looks like (instead of just the structure) as well as an example of how the corresponding CSV content should look like

iv) Provide screenshot of your current configuration

Rgds

Eng Swee

0 Kudos

Hi Eng Swee,

Thanks for your response.

The scenario that I posted is a sample format. It is correct that segment name should not contain any white spaces. It has been given to elaborate the requirement and its corresponding issue, that i am facing, in a simple way.

However please find the required information as follows,

i) What PI version are you on?

>> I am using PI 7.1.


ii) Are you using FCC on the File adapter or MessageTransformBean on the SFTP adapter?

>> I am using FCC on the File adapter.


iii) Provide an example of how the actual XML looks like (instead of just the structure) as well as an example of how the corresponding CSV content should look like

>> Below the XML data getting generated at the Receiver end,

Below is the sample expected output CSV file,

iv) Provide screenshot of your current configuration

>>Below is the snap-shot of the current configuration in FCC tab,

Please let me know for any further information regarding the same.

Regards,

Praloy

engswee
Active Contributor
0 Kudos

Hi Praloy

Thanks for providing more details of your requirement. It definitely helps us analyse the issue better.

First of all, the addHeaderLine option is only permitted if there is just one structure type - yours have three. Check the description mentioned in the online help.

Converting XML in the Receiver File/FTP Adapter to Text Format - Advanced Adapter Engine - SAP Libra...


This specification is only permitted if exactly one structure is defined.

Secondly, as Raghu has mentioned above, your structure has more levels of hierarchy than is supported by standard FCC. Raghu has suggested one approach of handling such structure with UDF. I will shamelessly suggest two other approaches of my own. It is up to you to assess and see which is most suitable for you.

Approach 1 - using XSLT

This will be quite easy to implement - just need to change the name of the root element in the XSLT code.

Approach 2 - using custom adapter module

This module is highly reconfigurable, which lets you can potentially reuse (without additional code development) if you have other similar requirements in the future. The drawback is that you are on PI 7.1, so if you want this, you will have to tweak the code for EJB2.1 and recompile in NWDS 7.1 before you can deploy.

Whichever approach you use will not solve your requirement to have a header line for each record type. The workaround for this is to enhance your target structure to have additional record types that holds the column/field names for each record type.

Rgds

Eng Swee

former_member182412
Active Contributor
0 Kudos

Hi Praloy,

Why dont you change your target structure to the way file adapter accept it, i think the above structure is source structure, if yes create the target structure like below and use your content conversion in the channel.

HeaderDetails

     Field1

     Field2

IntermediateDetails

     Field3

     Field4

ItemDetails

     Field5

     Field6

For HeaderLines you can do duplicate subtree on all three nodes (HeaderDetails, IntermediateDetails and ItemDetails) and map the constant field names to first subtree and you can do actual field to field mapping under second subtree.


Regards,

Praveen.

RaghuVamseedhar
Active Contributor
0 Kudos

Praloy,

Receiver FCC or StrictXml2PlainBean can handle 3 level deep XML.Above XML is more than 3 level deep. Please see below doc for more details.