cancel
Showing results for 
Search instead for 
Did you mean: 

Flat file to Idoc : Last line empty in payload

Former Member
0 Kudos

Hello everyone,

I'm trying to import Flat File from an external partner, and insert it in our SAP System as Idoc.

It works fine, after a small change in the flat file.

In the normal version, I have a last record with value 'OK'.

I have add the close record.lastFielsOptional in the FCC.

But after checking the payload, I have seen that I have at the end the following thing :

<ns:File xlmns:ns="http://world.com/file">

<record>

...

</record>

....

<record>

...

</record>

<record />

</ns:File>

Can someone explain me how to avoid to have this last <record/>, or checking it in mapping ?

Thanks a lot

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi,

Why don't you define a separate record type for this last line with "OK"? This will help you avoid all the complicated logic in mappings and so on. You can simply ignore this node in further processing.

Hope this helps,

Greg

Former Member
0 Kudos

Hello Greg,

The problem is that the key in the flat file is 3 digit numeric field, and OK is 2 char.

If I try to use the key, I have an error on the last record because we have only 2 char for the key, and when I put the parameter record.lastFiledsOptional : yes, i have no more error on the FCC, but the last record of the payload is empty.

Have you a possibility to avoid this error.

Thanks and regards

JC

former_member184681
Active Contributor
0 Kudos

Dear JC,

Actually, I meant to define an additional Recordset for the "OK" line. For instance, you could add "Confirmation, 1" to the Recordset Structure field contents, and then use this set of parameters:

Confirmation.keyFieldValue = OK

Confirmation.keepIncompleteFields = YES

Confirmation.keyFieldInStructure = ignore

Additionally, on the field names list for Confirmation, use only the key field, of the same name as for the Record structure.

Hope this helps,

Greg

Former Member
0 Kudos

Thanks a lot Greg, it works fine.

Answers (0)