cancel
Showing results for 
Search instead for 
Did you mean: 

Update Pick List through B1if

Former Member
0 Kudos

Hi experts,

We would like to update a Pick List, stored in SAP Business One, with the additional picked quantity.

We have created a web service through B1if for this purpose, but we cannot update the Pick list.

The method declared in the B1 Object is "Synchronous Insert with fallback to Update", so when we

run the step a new - empty Pick List is being created.

We use the following xml as inbound message:


<?xml version='1.0' encoding="UTF-8"?>

<TestPick xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms" xmlns="http://tempuri.org/">

  <PickLists>

  <row>

  <Absoluteentry>1</Absoluteentry>

  <Name>Jayson Butler</Name>

  <OwnerCode>1</OwnerCode>

  <PickDate>20140619</PickDate>

  <Remarks/>

  </row>

  </PickLists>

  <PickLists_Lines>

  <row>

  <AbsoluteEntry>1</AbsoluteEntry>

  <LineNumber>0</LineNumber>

  <OrderEntry>369</OrderEntry>

  <OrderRowID>0</OrderRowID>

  <PickedQuantity>1.000000</PickedQuantity>

  <ReleasedQuantity>3.000000</ReleasedQuantity>

  <BaseObjectType>17</BaseObjectType>

  </row>

  </PickLists_Lines>

    </TestPick>

In what checks shall we proceed in order to define why the update is not successful?

Thank you in advance

Kind regards,

Vassilis Korolis

Accepted Solutions (1)

Accepted Solutions (1)

bastian_schaefer
Active Contributor
0 Kudos

Hi Vassilis,

if you're using the B1 object atom to update a B1 pick list, please do the following:

  1. Define the B1 object for PickList:
    - Object Identifier = 156
    - Key Name = #Absoluteentry
    - Key Value = path to the key value you want to update (must not be empty for updates)
  2. Prepare the Payload atom (in my example atom2) with the following structure:

    please neither fill "Absoluteentry" on header level nor "AbsoluteEntry" and "LineNumber" on line level.
  3. The lines need to get updated by the visual order (line by line): The field LineNumber is no key for the XML interface.

In case you need to update the PickList via B1 OUTBOUND definition, please do the following:

  1. Define the B1 OUBOUND definition as follows:
  2. Prepare atom0 as follows:

This should solve your update problem.

Best regards

Bastian

Former Member
0 Kudos

Hi Bastian,

Thank you very much for your advice.

I changed the update scenario a little bit, by trying to Update only the Name field in the Header of the Pick List.

Following your instructions i changed the atom(2), by passing the xml code you can find in rows 24-28:


<?xml version='1.0' encoding="UTF-8"?>

<xsl:stylesheet xmlns:b1e="urn:com.sap.b1i.sim:b1event" xmlns:b1ie="urn:com.sap.b1i.sim:b1ievent" xmlns:b1im="urn:com.sap.b1i.sim:b1imessage" xmlns:b1mb="http://tempuri.org/" xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms" xmlns:jdbc="urn:com.sap.b1i.adapter:jdbcadapter" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:sim="urn:com.sap.b1i.sim:entity" xmlns:utils2="com.sap.b1i.bpc_tools.Utilities" xmlns:vpf="urn:com.sap.b1i.vplatform:entity" xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" bfa:force="" vpf:force="" jdbc:force="" rfc:force="" b1ie:force="" b1e:force="" xci:force="" sim:force="" utils2:force="" b1im:force="" b1mb:force="">

  <xsl:output method="xml" encoding="UTF-8" indent="yes"/>

  <xsl:param name="atom"/>

  <xsl:param name="sessionid"/>

  <xsl:variable name="msg" select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;S&apos;]"/>

  <xsl:variable name="vpSender" select="/vpf:Msg/vpf:Header/vpf:Sender/@Id"/>

  <xsl:variable name="vpObject" select="/vpf:Msg/vpf:Header/vpf:Sender/@ObjId"/>

  <xsl:variable name="vpReceiver" select="/vpf:Msg/vpf:Header/vpf:ReceiverList/vpf:Receiver[./@handover=&apos;P&apos;]/@Id"/>

  <xsl:variable name="vpAbsoluteentry" select="/vpf:Msg/vpf:Header/vpf:Variables/vpf:var[./@id=&apos;Absoluteentry&apos;]/@value"/>

  <xsl:template match="/">

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

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

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

  <Body>

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

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

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

  </Payload>

  </Body>

  </Msg>

  </xsl:template>

  <xsl:template name="transform">

  <PickLists xmlns="">

  <row>

  <Name>Test</Name>

  </row>

  </PickLists>

  </xsl:template>

  <xsl:template name="B1if.pltype_json">

  <!--option 1 - starting in the root with an object-->

  <io xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:com.sap.b1i.bizprocessor:bizatoms" pltype="json" xsi:schemaLocation="urn:com.sap.b1i.bizprocessor:bizatoms json_pltype.xsd">

  <object>

  <!--optional multiple of the following elements-->

  <string name="">value</string>

  <number name="">value</number>

  <object name="">...</object>

  <array>...</array>

  <bool name="">true/false</bool>

  <null name=""/>

  </object>

  </io>

  <!--option 2 - starting in the root with an array-->

  <io xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:com.sap.b1i.bizprocessor:bizatoms" pltype="jso" xsi:schemaLocation="urn:com.sap.b1i.bizprocessor:bizatoms json_pltype.xsd">

  <array>

  <!--optional multiple of the following elements-->

  <string name="">value</string>

  <number name="">value</number>

  <object name="">...</object>

  <array>...</array>

  <bool name="">true/false</bool>

  <null name=""/>

  </array>

  </io>

  </xsl:template>

</xsl:stylesheet>

I have proceeded with some further tests but unfortunately I am no longer able to create the Outbound XSD through B1if environment.

Can you please clarify how can I debug the Outbound XSD creation and find out why it is not being created?

Also, as one step further , what changes can I make in order to be able to give the value of the <Name> field, through a SOAP Request message?

Right now, in order to update the Pick List with a specific value, I have to pass the value manually in the atom(2).

Thank you in advance

Kind regards,

Vassilis Korolis

Answers (0)