cancel
Showing results for 
Search instead for 
Did you mean: 

File Content Conversion for ignoring the entire line

Former Member
0 Kudos

Hi,

I'm getting a CSV file from that i want to skip some records based on some validation.. for example:

I'm getting the following data :

EmpNo EmpName EmpDept

E101 ABC ABAP

E102 XYZ BW

E103 GFC XI

E104 BVM ABAP

E105 ASD BW

E106 YFC XI

SO, here where ever i'm getting EmpDept = XI .. i want to skip those all the records( that entire line i want to skip).. .. this can be possible through Message Mapping.. but i wnat to do this in the File Content Conversion.. how can we do this..

any helpful answers will appriciated..

Thanks

babu

Accepted Solutions (1)

Accepted Solutions (1)

prateek
Active Contributor
0 Kudos

This couldn't be achieved directly using FCC. Better to handle it in mapping.

Regards,

Prateek

Answers (3)

Answers (3)

nisarkhan_n
Active Contributor
0 Kudos

Do the regaular deisgn for this and only at the root level node of the sorce to the target right the IF Then condition....

EMPDept != XI then pass the source node to the target root node...this will filter the records that have XI value in it,.

Former Member
0 Kudos

Babu,

You can't have conditions in FCC, you have to do the validataions in Mapping itself.

Regards,

Sarvesh

Former Member
0 Kudos

Hi,

FCC is used to generate the XML structure so that XI can understood properly. You can not do any kind of validations or Skip the records based on Element value condition in FCC.

There are scenarios where you want to skip the lines that time you can use the below option in FCC but this is again not based on condition.

Under Document Offset, specify the number of lines that are to be ignored at the beginning of the document.

This enables you to skip comment lines or column names during processing. If you do not make an entry, the default value is zero lines.

The best way to do is use the UDF:

Write an UDF on target root node.

take input in one context:

input a= Emp Dept:

for(i=o,i<a.length;i++)

{

if(a{i}.equals("X"))

{

result.addValue(SUPPRESS); this will supress the target root node if condition is equal to X

}

else

{

result.addValue("Constant"); this will generate the target root node.

}

}

Thnx

Chirag