Skip to Content
author's profile photo Former Member
Former Member

B1if - #sender system in for each processing loop

Hi all,

I am creating a scenario where I use the for each processing loop.

Everything works fine but when I want to use the #Sender system in various steps (call B1 atom eg), I get an error saying the #Sender system is empty.

Do I need to do something to get it populated inside the for each loop?

Kind regards,

Joeri

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jan 05, 2012 at 03:14 PM

    Hi Joeri,

    I have done a test and I have the same problem you are having the system is empty when I use the #Sender System in a B1 call inside a for each. If I use a fix system id then it works fine.

    <?xml version="1.0" encoding="utf-8" ?> 
    <Msg xmlns="urn:com.sap.b1i.vplatform:entity">
      <Body>
        <Payload Role="C" id="atom3" system="empty">
          <B1CallResult status="failure" b1login="Technical User" method="Synchronous Retrieval" objectid="4" payload="" keyname="ItemCode" keyvalue="A00001" /> 
        </Payload>
      </Body>
    </Msg>

    Please open a message for support asking for it and share the information with us.

    Hope it helps

    Trinidad.

    Edited by: Maria Trinidad MARTINEZ GEA on Jan 6, 2012 11:00 AM

    My previous answer was not related to your question...

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 07, 2012 at 03:13 PM

    Dear Joeri,

    I thought further about this issue - and I would like to update you that the best-practice for this issue in case you hit it is this:

    1) Add a transformation after the "Unbranch".

    2) In the transformation atom press on button "Generate" - then choose "Correct after Branch".

    How to deal with potential XPath issues after "Unbranch" was maybe not documented clear enough so far.

    Please make sure not to miss latest documentation - B1if 1.11.0 will provide a major update - and more is going to come

    Please have a check.

    Thx,

    Frank

    Edited by: Frank Moebius on Feb 7, 2012 4:13 PM

    Simple sample also attached here...

    Edited by: Frank Moebius on Feb 13, 2012 4:00 PM

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Joeri, I do something different then this path for what I believe you are trying to accomplish.

      This may be a waste of your time but it may be useful in the future.

      Instead of creating multiple systems, I use a single 'in' folder for multiple venders and identify in my atom the BP so there is no need to switch systems in the xml. If you would like a sample of an atom xml that accomplishes this just let me know.

      Also, I believe the B1i architecture was designed with this in mind.

      I am more then happy to share,

      Mike

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2012 at 11:16 AM

    Hi Joeri,

    were you ever able to solve this problem?

    I'm having the same issue on 8.82PL8 (B1IF 1.13.6):

    <Msg xmlns="urn:com.sap.b1i.vplatform:entity">

    <Body>

    <Payload Role="C" id="atom4" system="empty">

    <B1CallResult status="failure" b1login="Technical User" method="Synchronous Retrieval" objectid="4" payload="atom0" keyname="ItemCode" keyvalue="0260103560"/>

    </Payload>

    </Body>

    </Msg>

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 07, 2016 at 10:52 AM

    Hi Joeri,

    It has been a while since you posted this question and i was wondering if you have found a general solution for this issue or not!? If so, please let me know..

    Since i could not find an answer myself either, i made a workaround for myself...

    Lets say your inbound is "Database" and your Query is: SELECT TOP 3 DocEntry FROM ORDR

    Then add a "XSL Transformation"atom with the following code:

    <xsl:template name="transform">

    <xsl:attribute name="pltype">xml</xsl:attribute>

    <RootNode xmlns="">

    <xsl:for-each select="$msg/jdbc:SqlResult/jdbc:ResultSet/jdbc:Row">

    <DataNode>

    <Msg xmlns="urn:com.sap.b1i.vplatform:entity">

    <xsl:copy-of select="/vpf:Msg/@*"></xsl:copy-of>

    <xsl:copy-of select="/vpf:Msg/vpf:Header"></xsl:copy-of>

    </Msg>

    <DocEntry>

    <xsl:value-of select="$msg/jdbc:SqlResult/jdbc:ResultSet/jdbc:Row/jdbc:DocEntry"></xsl:value-of>

    </DocEntry>

    </DataNode>

    </xsl:for-each>

    </RootNode>

    </xsl:template>

    So basicallly you added the /vpf:Msg/vpf:Header to your Inbound data.

    Then add a "For-each Processing (branch, split - join, xform)" atom and add the following to your "for-each" atom ("XPath Expression") field:

    /vpf:Msg/vpf:Body/vpf:Payload[./@Role='X']/RootNode/DataNode

    Within the "for-each" add another "XSL Transformation"atom with the following code (so replace the existing "<xsl:template match="/">" entry):

    <xsl:template match="/">

    <Msg xmlns="urn:com.sap.b1i.vplatform:entity">

    <xsl:copy-of select="/DataNode/vpf:Msg/@*"></xsl:copy-of>

    <xsl:copy-of select="/DataNode/vpf:Msg/vpf:Header"></xsl:copy-of>

    <Body>

    <Payload Role="X" id="{$atom}">

    <xsl:call-template name="transform"></xsl:call-template>

    </Payload>

    </Body>

    </Msg>

    </xsl:template>

    <xsl:template name="transform">

    <DataNode xmlns="">

    <DocEntry>

    <xsl:value-of select="DataNode/DocEntry"></xsl:value-of>

    </DocEntry>

    </DataNode>

    </xsl:template>

    Then add a "Call B1 Object" WITH pre "XSL Transformation".

    In your "XSL Transformation" add the following:

    <xsl:template name="transform">

    <Key xmlns="">

    <xsl:value-of select="vpf:Msg/vpf:Body/vpf:Payload[./@id=&apos;atom7&apos;]/DataNode/DocEntry"></xsl:value-of>

    </Key>

    </xsl:template>

    Then for your "B1 Object" set the "SysId*" to "Sender System" and for your "Key Value*" add the following (use the correct atom id ofcourse):

    /vpf:Msg/vpf:Body/vpf:Payload[./@id='atom2']/Key

    And for the rest make it a "Synchronous Retrieval" of Object "17".

    With kind regards,

    Ruben

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.