Skip to Content

Issue with empty context in useOneAsMany SAP PI function

Hello.

I had no problems with even complex graphical mappings but now I faced one.

I have to create a target "u_user" element for each record. So I use function "useOneAsMany".

Everything works fine if every user has at least one role. But if there is a user without roles, function fails.

It says that there are different number of contexts in first and second queue. But in fact there are 3 context in each of these. Even though the second context in second queue is empty.

All queues are displayed on the screenshot.

Looks like a bug. Is there a fix or any idea why this happens?

Best regards,

Andrey

<?xml version="1.0" encoding="UTF-8"?>
<ns0:UserRoleByCodeResponse xmlns:ns0="urn:pgk:po:PA:SM:Core:User">
   <ResponseHeader>
      <QueryId>21</QueryId>
   </ResponseHeader>
   <UserCodesWithRoles>
      <UserCodeWithRoles>
         <UserCode>USER1</UserCode>
         <Roles>
            <Role>
               <LogicalSystemCode>CRPCLNT400</LogicalSystemCode>
               <RoleCode>Z001</RoleCode>
               <ValidityStartDate>2019-01-18</ValidityStartDate>
               <ValidityEndDate>9999-12-31</ValidityEndDate>
            </Role>
         </Roles>
      </UserCodeWithRoles>
      <UserCodeWithRoles>
         <UserCode>USER2</UserCode>
         <Roles/>
      </UserCodeWithRoles>
      <UserCodeWithRoles>
         <UserCode>USER3</UserCode>
         <Roles>
            <Role>
               <LogicalSystemCode>S4PCLNT400</LogicalSystemCode>
               <RoleCode>Z002</RoleCode>
               <ValidityStartDate>2019-01-18</ValidityStartDate>
               <ValidityEndDate>9999-12-31</ValidityEndDate>
            </Role>
            <Role>
               <LogicalSystemCode>BWPCLNT400</LogicalSystemCode>
               <RoleCode>Z003</RoleCode>
               <ValidityStartDate>2019-01-18</ValidityStartDate>
               <ValidityEndDate>9999-12-31</ValidityEndDate>
            </Role>
            <Role>
               <LogicalSystemCode>EMPCLNT400</LogicalSystemCode>
               <RoleCode>Z004</RoleCode>
               <ValidityStartDate>2019-01-18</ValidityStartDate>
               <ValidityEndDate>9999-12-31</ValidityEndDate>
            </Role>
         </Roles>
      </UserCodeWithRoles>
   </UserCodesWithRoles>
</ns0:UserRoleByCodeResponse>
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Posted on Jan 18, 2019 at 11:10 AM

    Hi Andrey,

    Try below and let us know:

    Note: Please check 2nd and 3rd parameters of UseOneAsMany. Please ignore the target field name.

    Thanks& Regards,

    Binod Kumar Mondal


    9bbqd.png (36.4 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Hello Binod.

      It doesn't give an error message but it works wrong.

      There should be no value "101" in the result because that user has no roles.

      In your example 4 records are produced instead of 3.

      There should be one record with 10 and two records with 102. And no records with 101.

      Best regards,

      Andrey

  • Posted on Jan 18, 2019 at 01:01 PM

    Hi Andrey,

    As per your comment. Please check below mapping.

    Thanks,

    Binod


    inyfz.png (40.3 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 17 at 06:20 AM

    Hi Andrey,

    Remember below thing while using 'use one as many'.

    As this function have 3 input:

    1) the first two input(i.e. 1st and 2nd) should have same number of context changes.

    2) the last two input(i.e. 2nd and 3rd) should have same number of values in both the queue.

    This will help you to check your mapping using display queue.

    Thanks,

    Aamir

    Add comment
    10|10000 characters needed characters exceeded