Skip to Content

How to create 13 - Invoices and 18 - PurchaseInvoices objects in single scenario setup with SAP B1IF

Hi Experts,

I want to import the A/R Invoice and A/P Invoice data from the XML file base on InvoiceType.

With using two different scenario setup's, we can able to import the A/R Invoice and A/P invoice data into SAP B1, But, in my case, I want to import the A/R & A/P Invoice's in single scenario.

So, can you please suggest me, How to create a scenario to import the A/R Invoice and A/P Invoice data using single scenario setup using SAP B1IF.

Thanks & Regards,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jul 17, 2018 at 11:32 AM

    Hi Chenna!

    If you need to specify object type depending on input you don't need to use the conditional processing. You can pass XPath expression to B1 Objects atom. Let's say you receive <InvoiceType>P (or) S </InvoiceType> tag. You need to convert it to 18 or 13 object type and pass it to your B1 Object atom. You can transform it in a regular xform atom using following xsl:

    <DocType>

    <xsl:choose>

    <xsl:when test="//vpf:Payload[@Role='S']//InvoiceType='S'">13</xsl:when>

    <xsl:otherwise>18</xsl:otherwise>

    </xsl:choose>

    </DocType>

    Then you can pass it using XPath: //vpf:Payload[@id='atom1']//DocType


    Please check the example below:

    If you have both of them (several AP Invoices and several AR Invoices in one input file) you can group them by type and use 2 B1 Object calls with hardcoded object types. Also you can use for-each process flow, but it's not recommended to use when you can avoid that.


    capture.png (56.9 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Jul 11, 2018 at 01:48 PM

    Hi,

    you can use a conditional processing atom to decide base on Invoice Type which object have to be created.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 17, 2018 at 10:12 AM

    Hi Dennis,

    How to pass XPath Expression condition in conditional processing atom's?

    in my 'xform(atom2)' we have <InvoiceType>P (or) S </InvoiceType> node tag.

    If InvoiceType='S' then data import into 'A/R(OINV)' table,

    If InvoiceType='P' then data import into 'A/P(OPCH)' table.

    Could you please find the below image for my 'XPath Expression' condition, by using this condition it's always executing otherwise atom only.

    Please correct me, if my 'XPath Expression' condition wrong.

    Thanks,


    xpathexp.png (59.0 kB)
    Add comment
    10|10000 characters needed characters exceeded