Skip to Content

Graphical mapping requirement - Context handling

Hi Experts,

We have the below requirement.

1.Number of ADRMAS IDocs occurring depends on occurrence of BusinessPartner node

2.If both IsCustomer and IsSupplier are true then number of Idocs should be equal to the two times the number of occurences of BusinessPartner node

3.If either of IsCustomer or IsSupplier populated value is true then number of Idocs should be equal to the number of occurrences of BusinessPartner node

4.Occurrence of E1BPAD1VL segment under each Idoc for corresponding Businesspartner depends on occurrences of NationalVersion node which I will expain in detail below.

5.Address details like Street1,Street2, City, district etc. based on the role should populate to E1BPAD1VL segment correspondingly which I will expain in detail below.

Let us take example of attached XML where it has 1 BusinessPartner node and 3 NationalVersion occurrences under that node. Here both IsCustomer and IsSupplier are true so 2 ADRMAS IDocs one with OBJ_TYPE field as "NC" and other "NV" [these values are taken from AddressType in input file] & 6 E1BPAD1VL segments[3 E1BPAD1VL occurrences under each IDoc]. We might have multiple BusinessPartner nodes as well with multiple NationalVersion nodes in input file.

I could achieve till generating number of IDocs and segments correspondingly under IDoc. But challenge is to populate the address fields as explained below.

The below fields should occur under all 6 E1BPAD1VL segments since the source fields are present in input file.

Source field Target fields

NationalVersion/NationalName1 E1BPAD1VL - NAME

NationalVersion/NationalName2 E1BPAD1VL - NAME_2

NationalVersion/NationalName3 E1BPAD1VL - NAME_3

NationalVersion/NationalName4 E1BPAD1VL - NAME_4

But coming to address fields, if you observe the input file first occurrence has AddressType value equal to NC , NV & NG. In first IDoc with OBJ_TYPE field as NC it should be populated the address fields as below from 1st NationalVersion with AddressType NC to 1st occurrence of E1BPAD1VL in 1st IDoc occurrence. Similarly in 2nd IDoc with OBJ_TYPE value NV need to be populated with address details from 1st NationalVersion to 1st E1BPAD1VL segment in 2nd IDoc in this case as explained in below snippet.

1st IDoc occurrence with 3 segments:

2nd IDoc occurrence with 3 segments:

Address fields which should use above logic.

Source field Target fields

NationalVersion/Address/Street1 E1BPAD1VL STREET

NationalVersion/Address/Street2 E1BPAD1VL STR_SUPPL1 NationalVersion/Address/Street3 E1BPAD1VL STR_SUPPL2 NationalVersion/Address/HouseNumber E1BPAD1VL HOUSE_NO

Snippet showing that could generate the number of IDocs and segment E1BPAD1VL correctly under each IDoc but challenge is populate the address fields.

Kindly help me to populate the address details as explained above.

Please find the attached input file.

input.txt

Thanks,

Ramu.

source-target.jpg (106.7 kB)
occurrences.jpg (129.6 kB)
nc.jpg (100.8 kB)
nv.jpg (121.3 kB)
input.txt (5.9 kB)
input.txt (5.9 kB)
input.txt (5.9 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Nov 22, 2017 at 10:40 AM

    Hello Ram,

    Try using if the else I think 1-2 steps already we have given the solution.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Raghu,

      IDocs and segments are getting generated properly but challenge is with address data as explained in snippets.

      Thanks,

      Ramu.

  • Nov 22, 2017 at 09:21 AM

    Hi Experts,

    Can you please help here, is the requirement feasible in PI?

    Thanks,

    Ramu.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 25, 2017 at 09:58 AM

    Hi Raghu/Experts,

    Challenge is only with Address data that is of third level hierarchy and need to populate that data to proper E1BPAD1VL segment which is under proper IDoc. I could generate the number of IDocs and E1BPAD1VL segments under them properly.

    Other test case is like NationalVersion may occur one or more times based on that we need to generate E1BPAD1VL segments accordingly under proper IDoc occurrence.

    I can generate 2 IDocs with 3 E1BPAD1VL segments under each in case of 2nd test case below.

    Please refer the attached file where challenge is to create address data with AddressType NC under 2nd and 3rd occurrences of E1BPAD1VL segments of 1st IDoc.

    Similarly,to create address data with AddressType NV under 2nd and 3rd occurrences of E1BPAD1VL segments of 2nd IDoc.

    Here, I have given example of only one BusinessPartner node occurrence with multiple NationalVersion nodes but multiple occurrences of BusinessPartner node with no or one or many NationalVersion nodes will occur which should be handled correctly.

    I could handle only one test case of either of below by using graphical mapping:

    1) One BusinessPartner node occurrence with multiple NationalVersion nodes.

    2) Multiple occurrences of BusinessPartner node with no or one or many NationalVersion occurrences.

    Can you help me to handle both the test cases using graphical mapping.

    Please find the attached payloads.

    multiplebusinesspartner.txt

    multiplenatver.tx

    Thanks,

    Ramu.t

    Add comment
    10|10000 characters needed characters exceeded