cancel
Showing results for 
Search instead for 
Did you mean: 

IDoc to csv file with required fields

Former Member
0 Kudos

All,

I have a source IDoc going to XI. For example it contains source fields SF1 (required), SF2 (required), SF3(optional) and SF4(optional).

I want to produce a target file using file content conversion. I want to produce target fields TF1(required), TF2(required), TF3(optional), and TF4(optional). In my mapping SF1 maps to TF1, SF2 maps to TF2, etc...

I want to produce a comma separated file, I am using file content conversions and I am using NameA.fieldSeparator (using a comma) in my file content conversion parameters. I have no problem when all 4 source fields are populated. In this case if the value of my source fields are: ABC 123 XYZ and 789 then I get a flat file with the result:

ABC,123,XYZ,789

The problem is when my optional fields are blank I currently get the following in my csv file:

ABC,123

When instead I want:

ABC,123,,

I know I've seen threads relating to this issue but I haven't had any success locating them. Any insight is appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

prasannakrishna_mynam
Contributor
0 Kudos

Hi Shaun,

Source : SF1 (required), SF2 (required), SF3(optional) and SF4(optional).

Target: TF1(required), TF2(required), TF3(optional), and TF4(optional)

For Optional in mapping , If the source optional field is not there, then for target assign with blank constant. You will get the output as below, because at target side the element will be there with blank value and FCC will process that.

ABC,123,,

Otherwise Try with NameA.fieldFixedLengths in FCC.

Regards,

Prasanna

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Fcc parameters not populate the blank value.In mapping it self you should populate that. For optional fields map like below.

SF3(optional) map with default(function)-TF3(optional). etc..

Regards,

Prakasu.M

Former Member
0 Kudos

Use this


NameA.missingLastfields

If the inbound structure has less fields than specified in the configuration then the XML outbound structure is created as follows:

u25CB       ignore

Outbound structure only contains the fields in the inbound structure

u25CB       add

Outbound structure contains all fields from the configuration; the fields missing in the inbound structure are empty.

u25CB       error

Conversion is terminated due to the incomplete inbound structure. An error message is displayed.

former_member581827
Participant
0 Kudos

Hi,

Can you please try this option

NameA.lastFieldsOptional by specifying as YES.

Regards,

Chandra.

Former Member
0 Kudos

I don't think the file adapter has a parameter which automatically generates empty string for optional fields. You probably have to do it manually in your mapping.

Former Member
0 Kudos

Hi Shaun,

Can you please give the target structure you are using and the content conversion parameters you are using?

Also are you receiving any errors in receiver communication channel or you are having the file in the output without , in the output file.

Regards,

---Satish