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

  • Get RSS Feed

2 Answers

  • Jan 18 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

    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

  • Jan 18 at 01:01 PM

    Hi Andrey,

    As per your comment. Please check below mapping.

    Thanks,

    Binod

    Add comment
    10|10000 characters needed characters exceeded