cancel
Showing results for 
Search instead for 
Did you mean: 

Xml conversion using graphical mapping

Former Member
0 Kudos

Hi All,

I am working on soap to RFC synchronous scenario.The RFC response structure is similar to the below structure

RFC Response structure

ContactDetails(0 to unbounded)

{

        --EmployeeID

        --contact

        --address

        etc

}  repeats for each Employee

ErrorDetails(0 to unbounded) 

{

        --EmployeeID

        --ErroMsg

} repeats for each Employee

FamilyDetails (0 to unbounded)

{

        --EmployeeID

        --familyType

        --familymemberName

        etc

}repeats for each Employee

But the third party requires the below format

XMLStructure

EmployeeDetails

{

        --EmployeeID

        --contactDetails

        --ErrorDetails

        --FamilyDetails repeat for each family member

} repeat for each Employee.

Is it possible to convert the above RFC response structure to the required format as mentioned above.Please help me in mapping the above two structures.

Thanks,

Ramya

Accepted Solutions (0)

Answers (7)

Answers (7)

PriyankaAnagani
Active Contributor
0 Kudos

Hi Swetha,

I felt this requirement as interesting and I can try helping out. If your issue is not resolved yet, please find the mapping in attached document.

Hope it will resolve your issue.

Regards,

Priyanka

PriyankaAnagani
Active Contributor
0 Kudos

PFA

Former Member
0 Kudos

Hi Priyanka,

Sorry I was held up with other issues and did not get time to check this.

Thanks for you help.Will check the above mappings and let you know the results.

Regards,

--Swetha.

Former Member
0 Kudos

Hi All,

None of the above solutions is working.Please guide me in mapping the target structures.I can't use sort/sort by Key because values are optional from the input.

Thanks,

Ramya

Former Member
0 Kudos

And Even if all the values exist getting the error details are getting wrongly populated.

For example consider employee IDs 1,2,0000,3 are coming in the input.0000 is not available and has error details.The error details of 0000 are getting populated in employee ID 1 in the target structure.Cant use sort by key as the error details exists only if the employee ID is not available.

Thanks,

Ramya

shivdutt
Explorer
0 Kudos

Hi Ramya,

Can you try using exist function to check if the employee ID exists, if yes then sort employee id and map to target else pass data as u want. Similarly sort other fields by sort by key,for other fields also you should use exists function to check if employee id is present.

Thanks

Shivdutt

Former Member
0 Kudos

hi Shivduttsinh,

Already tried with Exist function but of no use.

Please go though the link completely and suggest the solution

Regards,

Ramya

Former Member
0 Kudos

have you checked with the team if the system sending the response can structure this as it is easier for maintenance too

Former Member
0 Kudos


Hi Aravind ,

Checked with the ECC team.They could not change the structure.The data comes with thousands of employee ids.

Thanks,

Ramya

RaghuVamseedhar
Active Contributor
0 Kudos

Ramya,

Please follow grouping example in this blog

Former Member
0 Kudos

Hi Ramya,

For this specific case, you can make use of multi-mappings, i.e., 2 graphical mappings.

In the first one, map the Employee ID of contact details to contact_EMPID.

Similarly, Employee ID of Error details to Error_EMPID and Employee ID of Family Details to Family_EMPID.

In the second mapping, use the condition "IF contact_EMPID equalS Error_EMPID AND contact_EMPID equalS Family_EMPID" then map employee id to employee id of target, also map contact details, error details and family details to the respective target segments via remove context.

Regards,

Souvik

Former Member
0 Kudos

Hi Souvik,

If all the segments have same set of employee ids the above mapping works.But in my scenario if the employee ID does not exist in RFC then it will send only error details and if the Employee ID is available in RFC then it will send all the details except error details.All the employee ids are maintained in pdata(personal data).

Thanks,

--Swetha

Former Member
0 Kudos

Hi Ramya,

Then in that case, you can maintain in FCC set.structuretitle as lets say "Record" for the response structure. This will then maintain a title for every occurring structure. Maintain its occurrence as 0..unbounded. And within "Record" maintain the occurrence in each Employee ID as 1..1.

This should work then.

Regards,

Souvik

Former Member
0 Kudos

Hi souvik ,

Already structure is maintained as above.And I am using sort for employee id and sort by key for details.But for a few employee ids data is not maintained in RFC then error details  only will be coming from  RFC.

for example there are 1,2,3 employee ids...1 has all the data ,2 is not present in ECC hence only error data and 3 has all the data.Now the values corresponding to 3 are getting populated in 2.

Thanks,

--Ramya

Former Member
0 Kudos

Hi Ramya,

Ok, then in the first mapping out of the two which I had previously suggested you can map Employee ID of source to Employee ID of target via "map with Default" UDF. This will then not suppress any empty employee id field in the first mapping.

Next, in the second mapping you can pass the Employee ID field through a custom UDF which checks whether the Employee ID field is equal to constant [] or not. If yes the custom UDF will throw an error else it will simply display as required. For custom UDFs via JAVA mapping there are several threads which you can follow. In this case it will be a simple one.

Regards,

Souvik

Former Member
0 Kudos

Hi Souvik,

This will not work.As the pdata(personal data) will have all the employee IDs.Please go through the above logic again and suggest the solution.

Thanks,

--Ramya

HiHi souerhutierhgtiugfhhkjc
Former Member
0 Kudos

Then you can use a pre-check with the help of "count" UDF in all the structures for Employee ID field. If they do not match then you can throw an error.

Former Member
0 Kudos

Hi All,

Please let me know the udf to sort the values of EmployeeID.

The employeeID comes from

Contactdetails(0-unbounded)

FamilyDetails(0-unbounded)

ErrorDetails(0-unbounded).

Thanks in advance,

Ramya

sendhil_kumar
Active Participant
0 Kudos


Ramya,

Check this one. It talks about similar example.Look at the second example.

Also check Comment by Roberto Villadarez in the same blog.

--

Sendhil

Former Member
0 Kudos

 

Hi Sendhil,

Thanks for sharing the above link.But my requirement is bit complex.If my structure has only one type of details(like contact details) I can refer the above link.

But has Contact details,error details,....l(total of 9 structures).

So guide me in mapping the above strcuture.

Regards,

Ramya

shivdutt
Explorer
0 Kudos

Hi Ramya,

You can try using the sort function to sort the data as per the employee id and then using sort by key you can sort the other details. It would be helpful if you can share the mapping you have implemented.

Thanks

Shivdutt

Former Member
0 Kudos

Hi Shivduttsinh,

How the target structure will be developed based on the Employee ID.The rrequirement is as below

The employee details may come with Family details/Contact details/Error message details.since the occurence is 0 to unbounded.

For example

ContactDetails

Item

     1

     Contact1

Item

     3

     Contact3

ErrorDetails

Item

     2

     Errordetails of 2

Familydetails

     Item

     2FamilyDetails

     Item

     3FamilyDetails

The above structure needs to converted to

1Strucutre--Employeedetails

{

     Item

     1

     Contact1

}

2ndStructure--Employeedetails

{

     Item

     2

     Errordetails of 2

     2FamilyDetails
}

3rd Structure--Employeedetails

{

     Item

     3

     Contcat3

     3Familydetails

}

The structures must be generated besed on the employee ID and the corresponding data of Employee ID must be present in it.I am still developing the mapping.

Thanks,

--Ramya

Former Member
0 Kudos


Hi All ,

Please guide me in mapping the source struture to target structure.

Thanks,

Ramya