cancel
Showing results for 
Search instead for 
Did you mean: 

Need an error for no keyFieldValue during File Content Conversion

Former Member
0 Kudos

Hi Gurus,

I am working on a scenario where I have to convert a CSV file structure.

Each sender file is having "END" in the last so that the structure looks like as follows:

"

....

....

I,103468,-No Entry-,299103468002,0.010,50.000,1.000,-49.990,None,,0,Diab

S,3101,100.125,abc,abc

END

"

Now the requirement is, if file does not contain "END" in the last then PI should not pick this file.

This is only possible if I make "END" as a Key Field and for "keyFieldValue" I assign value "END" with either end separator or field fixed length functions.

But the default behaviour of PI is, even if I create key field value, if it is not available in the file, PI would ignore that record.

I tried all possible combination in the following link:

http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm

but for key field value it is clearly written that:

"Specify the value of the key field for the structure. This entry is mandatory if the key field name is set. Otherwise, the entry is ignored."

Is there any way by which I get error if "END" is not available?

One of the alternatives which I see is to create OS level scripts and read the content. If I don't get "END" in the last then put the same file in a different, temporary directory. And once processing is done I pull it back to original directory

Any suggestion on this would be highly appreciated.

Thanks in advance.

Vikash

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

using FCC you will not be able to handle this scenario.

either use a script or use a module to help you out.

Answers (3)

Answers (3)

Former Member
0 Kudos

Dear Mickael,

I tried putting "1" in the last and executed but it did not helped. File is executing successfully even if there is no END in the last.

so the current behaviour is: whatever written or even blank in the last, if it is not "END", it is ignored. If I mention "END" in the last, it is always picked by FCC and inserted in the XML.

Do you think some other way of proceeding?

Thanks in advance.

Regards,

Vikash

Former Member
0 Kudos

hi,

before to write a script, in FCC, have you something like that ?

Recordset structure = xxxxx, MyEnd,1 (with "1", so neither 0, nor * )

Key Field Name = MyKey

MyEnd.keyFieldValue = END

MyEnd.fieldNames=MyKey

regards.

Mickael

Former Member
0 Kudos

Hi.

I think is not posible to set parameters on FCC , I suggest to create OS level scripts.

http://wiki.sdn.sap.com/wiki/display/XI/SAPXIFileAdapterOSCommandLine+Feature

Regards.

Luis.