cancel
Showing results for 
Search instead for 
Did you mean: 

Optional Recordset substructure in FCC

Former Member
0 Kudos

Hi Experts,

I am very new to SAP PI and need help to resolve issue related to  FCC in  sender file adapter.

We have requirement as below :

file structure will be like

NameA   A  1111 2222 33333

NameB   B  1111 2222 33333

NameC   C  1111 2222 33333

NameD   D  1111 2222 33333

NameA   A  1111 2222 33333

NameB   B  1111 2222 33333

NameD   D  1111 2222 33333

Substructure NameC is optional, if there is any value then we need to use it otherwise ignore it.

I have mentioned below values in parameters.

NameA.keyFieldValue

NameA.fieldFixedLengths

NameA.endSeparator

NameA.fieldNames

In Recordset Structure : NameA,1, NameB,1, NameC,*, NameD,1 

All is working fine when we have value  for substructure NameC but when it not there is file then getting error as below :

Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR consistency check in recordset structure validation (line no. 4: missing structure(s) before type 'NameA').


I have gone through multiple blogs but not got any resolution for this specific error.



Warm Regards,

Naveen K


Accepted Solutions (0)

Answers (1)

Answers (1)

sahithi_moparthi
Contributor
0 Kudos

Hi,

Can you please share your structure.Could you please let us know what is the field separtor between the fields.It seems field separator paramter is missing.As per the above ex:It looks like the separator is space.

Former Member
0 Kudos

Hi Sahithi,

We are not using field separator as we are using fieldFixedLengths parameter.

I have mentioned the structure of file.

we are facing issue when any of the substructure mentioned in Recordset structure is not coming in the file.

Warm Regards,

Naveen K

azharshaikh
Active Contributor
0 Kudos

Hi Naveen,

I believe you have set the Sequence of your Recordset as Ascending in your Channel FCC Config TAB due to which its trying to search for the Tags / Records in the sequence that you have mentioned in your FCC Structure.

Please change the Sequence from drop down to Variable and test.

Reference:

Converting Text Format in the Sender File/FTP Adapter to XML - Advanced Adapter Engine - SAP Library


You define the start and end of recordsets containing a variable number and arrangement of structures as follows:

    • Ascending :The sequence of the recordset structures is assumed to be unique. A new recordset is started as soon as an earlier structure occurs.
    • Variable :The sequence of the recordset structures is assumed not to be fixed. A new recordset is not started until another structure occurs that is defined with a fixed number. If all structures are defined as variable, the system interprets the entire document as a single recordset.

Hope it helps

Regards,

Azhar

Former Member
0 Kudos

Hi Azhar,

Thanks for your response.

I have made the changes you suggested but no luck.

I have already gone through the link you have shared but all the parameters talk about any field related to substructure like NameA.XYZ but no such parameter available if NameA itself is missing in the file structure.

Anything else that I can check for this issue.

Warm Regards,

Naveen K

azharshaikh
Active Contributor
0 Kudos

Hi Naveen,

Can you share your Channel FCC tab screenshot & error log as well.

Regards,

Azhar

Former Member
0 Kudos

Hi Azhar,

Please find the FCC settings below :

Recordset Name : Recordset

Recordset Structure : SHP_QM,1,L11_DL,*,NAM_02,1,LOC_PK,1

Recordset Instance : Variable

Key filed Name : RECORD_TAG

Parameters :

SHP_QM.keyFieldValue SHP_QM

SHP_QM.fieldFixedLengths 20,9,6,103,8,6

SHP_QM.endSeparator 'nl'

SHP_QM.fieldNames TP_EDI_ID,TRX_CONTROL_NBR,RECORD_TAG,HEADER_INFO,FILE_DATE,FILE_TIME

L11_DL.keyFieldValue L11_DL

L11_DL.fieldFixedLengths 20,9,10,30

L11_DL.endSeparator 'nl'

L11_DL.fieldNames TP_EDI_ID,TRX_CONTROL_NBR,RECORD_TAG,DELV_LOCATION

L11_DL.missingLastfields : add

NAM_02.keyFieldValue NAM_02

NAM_02.fieldFixedLengths 20,9,10,60

NAM_02.endSeparator 'nl'

NAM_02.fieldNames TP_EDI_ID,TRX_CONTROL_NBR,RECORD_TAG,DELV_RECIPIENT

LOC_PK.keyFieldValue LOC_PK

LOC_PK.fieldFixedLengths 20,9,10,30

LOC_PK.endSeparator 'nl'

LOC_PK.fieldNames TP_EDI_ID,TRX_CONTROL_NBR,RECORD_TAG,EXCEPTION_DESC

error :

Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR consistency check in recordset structure validation (line no. 4: missing structure(s) before type 'SHP_QM.').

sahithi_moparthi
Contributor
0 Kudos

Hi,

It seems you have mentioned the FCC parameters incorrectly.

Ex:

SHP_QM.fieldFixedLengths 20,9,6,103,8,6 is having 6 fields but in the field names you have mention only 5  as TP_EDI_ID,TRX_CONTROL_NBR,RECORD_TAG,HEADER_INFO,FILE_DATE

Please add Keyfield value in the fieldnames.

Former Member
0 Kudos

Hi Sahithi,

It is having 6 values , 6th Values is FILE_TIME. I think you have missed out due to scroll.

Moreover, I am not facing any issue if I send all the substructure , so it is rare chance that we are missing any necessary parameters.

Warm Regards,

Naveen K

maheswarareddykonda
Active Contributor
0 Kudos

Naveen,

since you are using fieldfixedlength, keep mapwithdefault for each filed in mapping.

this may solve ur issue.

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Naveen,

Can you try giving L11_DL.missingLastfields : ignore and check the outcome

maheswarareddykonda
Active Contributor
0 Kudos

sorry, ignore my comment, i did not check, ur case is sender

Former Member
0 Kudos

Hi Vishnu,

Thanks for your response.

I have tried out your option but it is not working.

Any other option I can try.

Warm Regards,

Naveen K

maheswarareddykonda
Active Contributor
0 Kudos

HI Naveen,

i guess u created structure like below

<MT_test>

  <Recordset>

        <SHP_QM>

             1

             2

        <L11_DL>

             1

             2

       <NAM_02>

             1

             2

     <LOC_PK>

if yes , try to remove that <<Recordset>> in structure.

i mean like this(direct under MT and make sure in channel remove that Record set name)

<MT_Test>

      <SHP_QM>

             1

             2

       <L11_DL>

             1

             2

      <NAM_02>

             1

             2

    <LOC_PK>

        

  

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Naveen,

In the channel level, in FCC the structure L11_DL occurrence mentioned a * which means variable number of times, can you check for the same structure, the occurrence maintained in the source structure, is it 0:unbounded or 1:unbounded.

If it is 0:unbounded, then it should not be the issue.

Check this out and let me know.

Former Member
0 Kudos

Hi Vishnu,

It is mentioned as  0 : unbounded.

We are just not able to make this L11_DL as optional structure.

Warm Regards,

Naveen K