cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping requirement for file to IDOC scenario

swapna_patha
Explorer
0 Kudos

Source: we have file which contains many vehicle (C1 to C6, F1 contains fault code field) records C1 Is mandatory, for each occurrence of C1 we are creating one IDOC.

The issue is F1 (faultcode) record can repeat any number of times in each vehicle

The each occurrence of Fault code should be mapped to Err code1, Errcode2, Errcode3… at the target side(IDOC).

We have achieved it by using index (mapping)

But by using the above logic we could only generate the ERRCode only for the first vechicle in the First IDOC, no other IDOC are getting the values.

PFA input  structure:

The first IDOC is comming fine with containing error code feils :

2nd IDOC no err_code should come as the input file contain only record C1 not Record F1.

3rd IDOC Err_code is not populating though it contin Record F1 (faultcode field)

Accepted Solutions (0)

Answers (3)

Answers (3)

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Swapna,

I think it's not possible/difficult to handle this in mapping level, since there is no dependency between RecF1 and RecC1 in the structure(atleast like RecF1 as sub-segment of RecC1). Due to this, we can put logic using graphical mapping functions to group F1 relating to corresponding C1 segment and put the logic and map to target field.

Can you try out the possibility of Azhar suggestion.

azharshaikh
Active Contributor
0 Kudos

Hi Swapna,

Seems you are using FCC at Sender side? If so, you can use the property of FCC config to Control the number of Messages per Recordset.

Refer:

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

Under Recordsets per Message, specify the number of recordsets to be grouped together in a message.

This entry is optional. The default value is* . In the default setting, all recordsets are included in a message.

If the number of recordsets in a document is greater than the number specified, the adapter creates multiple messages from a document

With Recordsets per Message =1, it will generate separate XML Payload for Each occurrence of C1 (header)...with this payload you can map and handle context more efficiently

(Assuming there is no inter-dependency between Headers)


Regards,

Azhar

swapna_patha
Explorer
0 Kudos

Hi Azhar,


Please see my below configuration and assist if any changes required,

azharshaikh
Active Contributor
0 Kudos

Hi Swapna,

Thanks for sharing screenshots. In the First Screenshot, you have Defined Recordset Per Message as * ... Instead can you mention it as 1 and test it end to end

(with this option you should get only 1 Header in each of your recordset..So if the Input file has 2 Headers, it will split the file at runtime into 2 XML payload and pass it to mapping which will be helpful in Context handling. Each new Header will create 1 IDOC message)

Regards,
Azhar

swapna_patha
Explorer
0 Kudos

Hi Azhar, thanks for your time. The issue is not with IDOC's, i was able to create the IDOC as many times as RecC1 comes, the issue is with Feild RecF1, which i alway comming under different occurances of C1 but at the target end it comming only under 1st IDOC, PFabove screenshots in the intial queustion.

azharshaikh
Active Contributor
0 Kudos

Hi Swapna,

Yes I got the issue that you are referring. Inorder to handle this can you try & test with the config as suggested abv.

With the Screenshot you gave for FCC Config....its generating all the C1's in same RecordSet

Assuming C1 is Header Section, with Recordset = 1 you can split the message for each C1 (having its respective F1s) which will be easier for Context handling and correct mapping of F1s for related C1s.

Regards,

Azhar

swapna_patha
Explorer
0 Kudos

Hi Azhar, tried but didn't worked, can you help me with the UDF

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Swapna,

I agree with Azhar, you need to handle in channel level itself and split the records based on C1 field or something such that we would have definite pattern of F1 coming for C1 structure.

We can not handle in mapping level even if we go for udf since there is no definite pattern that we could assume for F1 structure comes for C1 structure.

Can you please share screenshots of the flat file and FCC which you maintained for record in recordset message configuration such that we could try and see if its possible.

swapna_patha
Explorer
0 Kudos

File

FCC screenshots i have shared already, do u want me to share the Recordfeildnames..?

maheswarareddykonda
Active Contributor
0 Kudos

Hi Swapna,

are you  thinking why that different Idocs not created?

i think you have mapped target root Idoc to source root note..that is the reason you are not getting diff idocs at target side...i think depents on source node(RecC1) that target idoc should be created. that means you suppose to map that REcC1 to DcEUR_ZVEHILICENSE02.

Please expalin little more

swapna_patha
Explorer
0 Kudos

hi, The issue is not with IDOC, I have mapped IDOC to Rec c1 and its getting created, the issue is with Fault code mapping with Error code for each occurance of C1(for each IDOC)