cancel
Showing results for 
Search instead for 
Did you mean: 

Generate new IDOC if any Header field value changed

kishore_thallapalem
Discoverer
0 Kudos

Hi Experts,

My scenario is File to IDOC. I will get a CSV file with header and line item data. I have to compare all values one by one in a Field, If any value changed, I have to generate new IDOC at target side with the corresponding Header data and line item data. In the same way I have to compare values for all fields in header.

My input XML will be like this.

<Record>

   <Header>

        <Field1>

        <Field2>

        <Field3>

        <Field4>

  </Header>

  <LineItem>

         <Field1>

         <Field2>

         <Field3>

         <Field4>

   </LineItem>

</Record>

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

sahithi_moparthi
Contributor
0 Kudos

Hi,

As Suggested by Mahesh use the logic.

You have to apply the above logic for all fields.Please let us know if you face any issues.

kishore_thallapalem
Discoverer
0 Kudos

Hi Sahithi, Maheswarareddy,

Thanks for your quick response.This logic is working in mapping currently, I have to test this end to end. But I have another logic. That is If line count in CSV file reaches 998, I have to generate a new IDOC. with other lines.

How to add this logic to the existing logic.

Thanks in advance,

Kishore. 

ridvan_polat
Participant
0 Kudos

Hi Kishore,

I think you can achieve it using Recordset per Message parameter.

Set the parameter to 998, then the channel will split messages every 998 lines.

Regards,

Ridvan Polat

sahithi_moparthi
Contributor
0 Kudos

Hi,

I echo with Ridvan.Set the parameter at the sender adapter side.

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Kishore,

If you want to handle this in mapping level itself, then use the logic as below:

Regards

Answers (1)

Answers (1)

maheswarareddykonda
Active Contributor
0 Kudos

Hi Kishore,

you can do mapping as below.

1.concat all fields in header

2.removecontext

3.sort

4.slitbyvalue(valuchange)

5.removecontext

6.map to target IDOC(root)

the above steps is only for avoid duplicate records. the complex thing is as per above condition you should be able to handle map target fields..i suggest to start build and if u stuck let us know. u may have to use formatebyexample function while map target fields

BR,

Maheswarareddy