cancel
Showing results for 
Search instead for 
Did you mean: 

Change Bin Allocations Picking List via DI Server and DI API

Former Member
0 Kudos

Hi,

SBO1 9.0 Pl08

I have this scenario

I want change the bin location to line 3

The result is :

This is correct and SAP change the bin location, and the row of table PKL2

How i change this bin locations via SOAP (di server) and via DI API?

It's posible?

Thanks

Regards,

Iñaki

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I created a SAP Note. The answer from support is that is a bug. They will solve the problem with PL 10.

I wait for new version to try it

Thanks a lot!

Former Member
0 Kudos

Hello Iñaki,

Im having the exact same issue using DI API, do you know if this bug has been corrected? were you able to solve it?

maik_delly
Active Contributor
0 Kudos

Hi Javier,

this issue is fixed for DI Server in recent Patchlevels. Altthough DI Server itself is not working anymore reliable ( at least in german localization ).

In DI API it is/was working in general but there are/were still some minor stumbling blocks.Which PL are you using ?

regards,

Maik

Former Member
0 Kudos

Hello Maik, Im using SBO 9.0 PL08

this is my exact issue:

im developing an Addon that updates picklists using DI API, its goal its to update the picked quantity. In SAP I have this picklist:

the tables PKL1 and PKL2 look like this:

This is the  code:

    Private Sub BtnGuardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click

        Dim oDocument As SAPbobsCOM.PickLists

        Dim DocEntry As Integer

        DocEntry = G_PickList

        oDocument = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPickLists)

        Try

            If oDocument.GetByKey(DocEntry) Then

                oDocument.Lines.SetCurrentLine(G_PickListLinea)

                oDocument.Lines.BaseObjectType = G_origen

                oDocument.Lines.OrderEntry = G_NumOrigen

                oDocument.Lines.OrderRowID = G_linea

                oDocument.Lines.PickedQuantity = TxtPickedTab2.Text

                oDocument.Lines.BinAllocations.BinAbsEntry = G_BinAbs

                oDocument.Lines.BinAllocations.Quantity = TxtPickedTab2.Text

                If oDocument.Update <> 0 Then

                    oCompany.GetLastError(lErrCode, sErrMsg)

                    MessageBox.Show(sErrMsg.ToString)

                Else

                    E_barcodeitem = ""

                    E_barcodeubicacion = ""

                    TxtBin.Text = Nothing

                    TxtItem.Text = Nothing

                    For i As Integer = 0 To GridPicking.RowCount - 1

                        If GridPicking.Rows.Item(i).Selected = True Then

                            If Me.TxtPickedTab2.Text.ToString = G_liberado Then

                                GridPicking.Rows(i).DefaultCellStyle.BackColor = Color.LightGreen

                                GridPicking.Rows.Item(i).Selected = False

                                GridPicking.ClearSelection()

                            End If

                        End If

                    Next

                    Me.TabControl1.SelectedTab = TabPage1

                End If

            End If

        Catch ex As Exception

            MessageBox.Show(ex.ToString)

        End Try

       

    End Sub


This is the result after I update the picked quantity of the line 0 (Its allocated to a single bin location)



this is working fine.

This is the result after I update the next item (It is allocated to 2 different bins)



Note that I succesfully updated the 2nd line of the PKL2 table. The result is what I expected so far. But when I update the last picked quantity, this happens:


the previously allocated bin and picked quantity dissapeared. And finally the corresponding record in PKL2 has dissapeared aswell:

I dont know if its a Bug or if I'm Doing something wrong.

best regards!


maik_delly
Active Contributor
0 Kudos

Hi Javier,

you are doing something wrong :-).

You have 2 PickLines, where the second is having 2 PickBinAllocations but you are only addressing the first BinAllocation line of it:

oDocument.Lines.BinAllocations.BinAbsEntry = G_BinAbs                oDocument.Lines.BinAllocations.Quantity = TxtPickedTab2.Text

The BinAllocations are lines to the PickLines, so you also have to SetCurrentline for them.

If your warehouse is always picking the right amounts only from the suggested bin location it is quite easy : Loop through the BinAllocations lines and find the right one.

In praxis this is not always the case - so you have to code a more complex logic.

regards,

Maik

Former Member
0 Kudos

Hello Maik.

Thanks a lot for your time, I tried to loop through the bin allocations, but the method "Dim Lines As Integer = oDocument.Lines.BinAllocations.Count()" returns 1 for that particular troublesome line, which it's weird because PKL2 has 2 rows for that particular line.

and When i tried using SetCurrentline(0) it worked for the 1st bin allocation, then when I tried 

oDocument.Lines.BinAllocations.SetCurrentLine(i)

"i" being the stored value of PKL2.Pkl2LinNum

I get an "Invalid row" error when it reaches the 2nd bin.

Could you please give me an example of how the code should look like? I'm really out of ideas.

maik_delly
Active Contributor
0 Kudos

Hi Javier,

you are right and I was not aware. BinAllocation Lines are not present in the object when they were not picked yet.

I wrote a little C# example - I think it is self explained :


int PickLine = 1;

double PickQuantity = 1;

int PickBinAbsEntry = 1;

SAPbobsCOM.PickLists oPickList = SBO_Company.GetBusinessObject(BoObjectTypes.oPickLists);

oPickList.GetByKey(7);

oPickList.Lines.SetCurrentLine(0);//You just need to set the line

oPickList.Lines.PickedQuantity += PickQuantity; // ! add the picked quantity to the already picked

bool foundbin = false;

for (int i = 0; i < oPickList.Lines.BinAllocations.Count; i++)

{

    oPickList.Lines.BinAllocations.SetCurrentLine(i);

    if (oPickList.Lines.BinAllocations.BinAbsEntry == PickBinAbsEntry)//Check if bin was picked from

    {

        oPickList.Lines.BinAllocations.Quantity += PickQuantity;

        foundbin = true;

        break;

    }

}

if (!foundbin)

{

    oPickList.Lines.BinAllocations.Add();

    oPickList.Lines.BinAllocations.BinAbsEntry = PickBinAbsEntry;

    oPickList.Lines.BinAllocations.Quantity = PickQuantity;

}

if (oPickList.Update() != 0)

{

    SBO_Application.MessageBox("Error : " + SBO_Company.GetLastErrorDescription());

}

Hope it helps,

Maik

Former Member
0 Kudos

Oh Maik, that's awesome it solves my problem, thanks a lot!!

maik_delly
Active Contributor
0 Kudos

Hi Inaki,

in DI API you dont select a line but you set the AbsEntry of bin location.

A simple example would be :

SAPbobsCOM.PickLists oPickList = SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPickLists);

oPickList.GetByKey(pickloistno);

oPickList.Lines.PickedQuantity = quantity;

oPickList.Lines.BinAllocations.BinAbsEntry = binabsentry;

oPickList.Lines.BinAllocations.Quantity = quantity;

if (oPickList.Update() != 0)

    MessageBox.Show(SBO_Company.GetLastErrorDescription());

else

    MessageBox.Show("success");

   

For DI SERVER (B1WS):

svcPickList.PickListsService myPickListSvc = new svcPickList.PickListsService();

svcPickList.MsgHeader oPLHeader = new svcPickList.MsgHeader();

svcPickList.PickListParams oPLParams = new svcPickList.PickListParams();

oPLHeader.SessionID = SessionID;

oPLHeader.ServiceName = svcPickList.MsgHeaderServiceName.PickListsService;

oPLHeader.ServiceNameSpecified = true;

myPickListSvc.MsgHeaderValue = oPLHeader;

oPLParams.Absoluteentry = picklistno;

oPLParams.AbsoluteentrySpecified = true;

svcPickList.PickList myPickList = myPickListSvc.GetByParams(oPLParams);

svcPickList.PickListPickListsLine[] myPickListLine = myPickList.PickListsLines;   

myPickListLine[0].PickedQuantity = quantity;

myPickListLine[0].PickedQuantitySpecified = true;

myPickListLine[0].PickStatus = svcPickList.PickListPickListsLinePickStatus.ps_Picked;

myPickListLine[0].PickStatusSpecified = true;

svcPickList.PickListPickListsLineDocumentLinesBinAllocation[] bins = new svcPickList.PickListPickListsLineDocumentLinesBinAllocation[1];

bins[0] = new svcPickList.PickListPickListsLineDocumentLinesBinAllocation();

bins[0].BinAbsEntry = binabsentry;

bins[0].BinAbsEntrySpecified = true;

bins[0].Quantity = quantity;

bins[0].QuantitySpecified = true;

myPickListLine[0].DocumentLinesBinAllocations = bins;

myPickList.PickListsLines = myPickListLine;

myPickListSvc.Update(myPickList);

regards,

Maik

Former Member
0 Kudos

Hi,

I don't understand how you make for via di server

What is svcPickList?I don't know which  in SDK

i have this code for body SOAP

The code for body SOAP:

<dis:UpdateObject xmlns:dis="http://www.sap.com/SBO/DIS">

<BO>

    <AdmInfo>

      <Object>oPickLists</Object>

    </AdmInfo>

    <QueryParams>

      <Absoluteentry>15</Absoluteentry>

    </QueryParams>

    <PickLists />

    <PickLists_Lines>

      <row>

        <OrderEntry>306</OrderEntry>

        <OrderRowID>1</OrderRowID>

        <PickedQuantity>25</PickedQuantity>

        <BaseObjectType>17</BaseObjectType>

      </row>

    </PickLists_Lines>

    <DocumentLinesBinAllocations>

      <row>

        <BinAbsEntry>2</BinAbsEntry>

        <Quantity>0</Quantity>

      </row>

      <row>

        <BinAbsEntry>166</BinAbsEntry>

        <Quantity>25</Quantity>

      </row>

    </DocumentLinesBinAllocations>

  </BO>

</dis:UpdateObject>

i call this method oDIServerNode.Interact(sSOAP)

Thanks

maik_delly
Active Contributor
0 Kudos

Hi,

svcPickList is my name for a web reference to the WSDL of B1WS for DI Server. Put simply B1WS enables you to use managed code to create SOAP messages :

In your SOAP message thie BOM child is missing.

The plain SOAP message I succeded with :

<?xml version="1.0" encoding="UTF-16"?>

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">

    <env:Header>

        <SessionID>38525C1F-EA6A-4E64-A865-2B170A70D859</SessionID>

    </env:Header>

    <env:Body>

        <dis:UpdateObject xmlns:dis="http://www.sap.com/SBO/DIS">

            <BOM>

                <BO>

                    <AdmInfo>

                        <Object>oPickLists</Object>

                    </AdmInfo>

                    <QueryParams>

                        <Absoluteentry>4</Absoluteentry>

                    </QueryParams>

                    <PickLists />

                    <PickLists_Lines>

                        <row>

                            <PickedQuantity>25</PickedQuantity>

                        </row>

                    </PickLists_Lines>

                    <DocumentLinesBinAllocations>

                        <row>

                            <BinAbsEntry>26</BinAbsEntry>

                            <Quantity>25</Quantity>

                        </row>

                    </DocumentLinesBinAllocations>

                </BO>

            </BOM>

        </dis:UpdateObject>

    </env:Body>

</env:Envelope>

regards,

Maik

Former Member
0 Kudos

Hi,

Ok, this works fine with the first one line, but how can I do it with the second one or more lines?

How you define diferents lines in xml ?

This is my scenario:

Table PKL1

Table PKL2

Thanks

maik_delly
Active Contributor
0 Kudos

Hi,

I also had no success with the Update Document Interface - in DI API there is a property BaseLineNumber which doesn't exist in DI Server...

But the Picklists Interface works :

<?xml version="1.0" ?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <soap:Header>

        <MsgHeader xmlns="http://www.sap.com/SBO/DIS">

            <SessionID>33DE3748-2134-4107-BB3A-1887462D0615</SessionID>

            <ServiceName>PickListsService</ServiceName>

        </MsgHeader>

    </soap:Header>

    <soap:Body>

        <Update xmlns="PickListsService">

            <PickList xmlns="http://www.sap.com/SBO/DIS">

                <Absoluteentry>6</Absoluteentry>

                <Name>Robert Leitner</Name>

                <OwnerCode>1</OwnerCode>

                <PickDate>2013-07-11</PickDate>

                <Remarks />

                <Status>ps_Released</Status>

                <ObjectType>156</ObjectType>

                <PickListsLines>

                    <PickListsLine>

                        <AbsoluteEntry>6</AbsoluteEntry>

                        <LineNumber>0</LineNumber>

                        <OrderEntry>378</OrderEntry>

                        <OrderRowID>0</OrderRowID>

                        <PickedQuantity>10</PickedQuantity>

                        <PickStatus>ps_Picked</PickStatus>

                        <ReleasedQuantity>10</ReleasedQuantity>

                        <PreviouslyReleasedQuantity>10</PreviouslyReleasedQuantity>

                        <BaseObjectType>17</BaseObjectType>

                        <SerialNumbers />

                        <BatchNumbers />

                        <DocumentLinesBinAllocations>

                            <DocumentLinesBinAllocation>

                                <BinAbsEntry>26</BinAbsEntry>

                                <Quantity>10</Quantity>

                            </DocumentLinesBinAllocation>

                        </DocumentLinesBinAllocations>

                    </PickListsLine>

                    <PickListsLine>

                        <AbsoluteEntry>6</AbsoluteEntry>

                        <LineNumber>1</LineNumber>

                        <OrderEntry>378</OrderEntry>

                        <OrderRowID>1</OrderRowID>

                        <PickedQuantity>10</PickedQuantity>

                        <PickStatus>ps_Picked</PickStatus>

                        <ReleasedQuantity>10</ReleasedQuantity>

                        <PreviouslyReleasedQuantity>10</PreviouslyReleasedQuantity>

                        <BaseObjectType>17</BaseObjectType>

                        <SerialNumbers />

                        <BatchNumbers />

                        <DocumentLinesBinAllocations>

                            <DocumentLinesBinAllocation>

                                <BinAbsEntry>2</BinAbsEntry>

                                <Quantity>5</Quantity>

                            </DocumentLinesBinAllocation>

                            <DocumentLinesBinAllocation>

                                <BinAbsEntry>26</BinAbsEntry>

                                <Quantity>5</Quantity>

                            </DocumentLinesBinAllocation>

                        </DocumentLinesBinAllocations>

                    </PickListsLine>

                </PickListsLines>

            </PickList>

        </Update>

    </soap:Body>

</soap:Envelope>

regards,

Maik

Former Member
0 Kudos

Hi,

I understand more or less how works, but how i do it via SOAP(di server)?

This structure is that i must send? I call with oDIServerNode.Interact(sSOAP)

Thanks a lot!

maik_delly
Active Contributor
0 Kudos

Hi,

yes this is what you have to send ( in your case : content of sSOAP ). But of course you have to change data ( and remove unneeded  )  for your scenario.

BTW : I just realised, that 2 binallocations for 1 pickline lead to 2 picklines , apparently only one bin location can be assigned per pickline. That said it means that also the previous example would work : you just have to split picklines per binallocation.

20 x A00001 -> 2 lines

     15 x A00001 from BinAbsEntry a

     5 x A00001 from BinAbsEntry b

I cant tell how it will behave when you have 10 picklines and the first line has 2 binallocations ...

Former Member
0 Kudos

Hi,

I tried with this structure and does not work, i try to update only the first line with 1 bin location

sSOAP=

<?xml version="1.0"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<soap:Header><MsgHeader xmlns="http://www.sap.com/SBO/DIS">

<SessionID>4E41B79A-201B-49F4-829B-A723B5D464F8</SessionID>  

</soap:Header> <soap:Body>

<Update xmlns="PickListsService">

<PickList xmlns="http://www.sap.com/SBO/DIS">

<ServiceName>PickListsService</ServiceName> </MsgHeader>

<Absoluteentry>24</Absoluteentry>

   <PickListsLines>

<PickListsLine>

<AbsoluteEntry>24</AbsoluteEntry>

<LineNumber>0</LineNumber>

<OrderEntry>307</OrderEntry>

<OrderRowID>0</OrderRowID>

<PickedQuantity>10</PickedQuantity>

<DocumentLinesBinAllocations>

<DocumentLinesBinAllocation>

<BinAbsEntry>2</BinAbsEntry>

<Quantity>10</Quantity>

</DocumentLinesBinAllocation>

</DocumentLinesBinAllocations>

</PickListsLine>

</PickListsLines>

</PickList>

</Update>

</soap:Body></soap:Envelope>

I call oDIServerNode.Interact(sSOAP) and I get the following error:

<?xml version="1.0"?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value><env:Subcode><env:Value>-2007</env:Value></env:Subcode></env:Code><env:Reason><env:Text xml:lang="en">Se produjo un error interno (-2007)</env:Text></env:Reason><env:Detail><Service>PickListsService</Service><Command>Update</Command><SessionID>B529E115-E621-446E-9B00-EDAC8B3C899D</SessionID></env:Detail></env:Fault></env:Body></env:Envelope>

I don't understand the last message

"I just realised, that 2 binallocations for 1 pickline lead to 2 picklines , apparently only one bin location can be assigned per pickline. That said it means that also the previous example would work : you just have to split picklines per binallocation."

I have this scenario for test:

20 x A00001 -> 1 lines

20 x A00001 from BinAbsEntry a

15x A00002 -> 2 lines

     10 x A00002 from BinAbsEntry a

     5 x A00002 from BinAbsEntry b

How i can make the structure for SOAP? Can you help me?

Thanks a lot!

maik_delly
Active Contributor
0 Kudos

Hi, I dont have a DI Server to test, but your XML is wrong ( MsgHeader tag ) . It should be  :

<?xml version="1.0"?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <soap:Header>

        <MsgHeader xmlns="http://www.sap.com/SBO/DIS">

            <SessionID>4E41B79A-201B-49F4-829B-A723B5D464F8</SessionID> 

        </MsgHeader>

    </soap:Header>

    <soap:Body>

        <Update xmlns="PickListsService">

            <PickList xmlns="http://www.sap.com/SBO/DIS">

                <ServiceName>PickListsService</ServiceName>

                <Absoluteentry>24</Absoluteentry>

                <PickListsLines>

                    <PickListsLine>

                        <AbsoluteEntry>24</AbsoluteEntry>

                        <LineNumber>0</LineNumber>

                        <OrderEntry>307</OrderEntry>

                        <OrderRowID>0</OrderRowID>

                        <PickedQuantity>10</PickedQuantity>

                        <DocumentLinesBinAllocations>

                            <DocumentLinesBinAllocation>

                                <BinAbsEntry>2</BinAbsEntry>

                                <Quantity>10</Quantity>

                            </DocumentLinesBinAllocation>

                        </DocumentLinesBinAllocations>

                    </PickListsLine>

                </PickListsLines>

            </PickList>

        </Update>

    </soap:Body>

regards, Maik

Former Member
0 Kudos

Sorry Maik, I'm wrong in copy and paste, i deleted the tag.

I tried now and the mistake is the same.

How you know this structure? What structure is the correct?

And i another problem with this scenario: I use the structure that you showed me(message of

Response

<?xml version="1.0"?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value><env:Subcode><env:Value>-5002</env:Value></env:Subcode></env:Code><env:Reason><env:Text xml:lang="en">1470000341 - El artículo "A00101" no está completamente asignado a la ubicación "01"</env:Text></env:Reason><env:Detail><Object>156</Object><ObjectIndex>1</ObjectIndex><Command>UpdateObject</Command><SessionID>710B8626-ED80-4D27-AFF0-7670392004A5</SessionID></env:Detail></env:Fault></env:Body></env:Envelope>

---> The article "A00101" is not fully allocated to the location "01


Thanks a lot!


Regards

maik_delly
Active Contributor
0 Kudos

Hi,

the 2nd problem occurs because you have a released quantity of 25 in line 0 but you didnt allocate bin locations ( completely ).

When I have a running DIS, I ll reproduce your scenario...

The correct SOAP syntax I learned from many hours debugging DIS, forum posts and also B1WS was a big helper - allthough it is a little bit tricky to get it run from scratch in 9.0.

But it is really worth it, because you can make a lot of simple mistakes in pure SOAP.

For your problem I guess you really need the right picklistservice structure - since my example from Dec 20 1:20 PM was working here, you should try to use the exact same one( it was produced by B1WS ).

regards,

Maik

Former Member
0 Kudos

Hi,

In the 2 problem I assign  completly the quantity, and I indicated the bin location (the itemcode has only 1)

I use this structure:

<?xml version="1.0" encoding="UTF-16"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">    <env:Header> <SessionID>E7436914-0D05-4E94-B431-4A5D0AF0D21D</SessionID>    </env:Header>    <env:Body> <dis:UpdateObject xmlns:dis="http://www.sap.com/SBO/DIS"><BOM>

  <BO>

    <AdmInfo>

      <Object>oPickLists</Object>

    </AdmInfo>

    <QueryParams>

<Absoluteentry>24</Absoluteentry>

    </QueryParams>

    <PickLists />

    <PickLists_Lines>

      <row>

<PickedQuantity>25</PickedQuantity>

      </row>

    </PickLists_Lines>

    <DocumentLinesBinAllocations>

      <row>

<BinAbsEntry>2</BinAbsEntry>

        <Quantity>25</Quantity>

      </row>

    </DocumentLinesBinAllocations>

  </BO>

</BOM> </dis:UpdateObject> </env:Body></env:Envelope>

Response SOAP

The article "A00101" is not fully allocated to the location "01


But I can't assign partially?


The 2 structure that you showed me with picklistSservice don't works. I do not know why

--An internal error occurred (-2007)


Thanks a lot!


Regards