cancel
Showing results for 
Search instead for 
Did you mean: 

Create product in SAP via B1iF

Former Member
0 Kudos

Hi,

i want to create or update products in SAP BO via the B1iF.

How is the best way to check if an product already exists in SAP BO?

Should i check it with an SQL Statement?

regards,

Frank

Accepted Solutions (1)

Accepted Solutions (1)

lars_jnsson
Active Participant
0 Kudos

Hi Frank!

The B1 outbound (Item object) takes care of this. If the item exists in B1 it will be an Update, if not it will be an Insert.

If you want to check other data for the item, the best way is to make a sql call via a sql call atom before the outbound.

Good luck!

Regards

Lars

Former Member
0 Kudos

Hi Lars,

thanks for the info.

regards

Frank

Former Member
0 Kudos

Hi,

i have tested a small example now:

I create this via IF:

<BOM xmlns="">

    <BO>

        <AdmInfo>

            <Object>4</Object>

            <Version>2</Version>

        </AdmInfo>

        <Items>

            <row>

                <ItemCode>4711</ItemCode>

                <ItemName>Test</ItemName>

            </row>

        </Items>

        <Items_Prices>

            <row>

                <PriceList>1</PriceList>

                <Price>999</Price>

                <Currency>EUR</Currency>

            </row>

        </Items_Prices>

    </BO>

</BOM>

For first time the product was created. If i send this a second time i got an error:

Exception : DI Error: (-10) Item code '4711' already exists

So what i am missing that an automatic update for the product works?

regards,

Frank

lars_jnsson
Active Participant
0 Kudos

Hi Frank!

You are not showing the B1out node in your question.

Are you using <B1out type="object"> which is default, then you must set the Method to "Synchronous Update with fallback to Insert" or "Synchronous Insert with fallback to Update". This is in the Details dialog in the outbound channel configuration.

If you are using <B1out type="object_full> then you have to set Update/Insert in the Control/method element.

Take a look in the documentation "out.B1.pdf" that you will find in Help->Documents.

Regards

Lars

Former Member
0 Kudos

Hi,

i have attached 2 screenshots that show my configuration.

i

As you see i have no outbound channel in my configuration. I create a call to B1 via DI object API.

That uses Synchronous Insert with fallback to Update.

But also with that i got the insert error.

Have you any ideas here?

Frank

lars_jnsson
Active Participant
0 Kudos

Hi Frank!

The key for items is not DocEntry. It is ItemCode.

If you still have problem, please post the complete payload for the B1 out.

Regards

Lars

Former Member
0 Kudos

Hi Lars,

i have changed Docentry to ItemCode but the problem still exists

I have attached the message log.

regards,

Frank

lars_jnsson
Active Participant
0 Kudos

Hi Frank!

Why do you use the BOM/BO mode? B1out is more common to use. Have you read the help document "out.B1.pdf"?

If you use the BOM/BO structure I think you have to insert QueryParams between AdmInfo and Items.

<BOM>

     <BO>

          <AdmInfo>

               <Object>4</Object>

               <Version>2</Version>

          </AdmInfo>

          <QueryParams>

               <ItemCode>100125</ItemCode>

          </QueryParams>

          <Items>

               <row>

                    <ItemCode>100125</ItemCode>

                    etc...

Regards

Lars

Former Member
0 Kudos

Hi,

great!

That does the trick.

If i set queryparams it works

Thanks a lot for this!

Frank

Answers (0)