is it possible to create shipments/deliveries via web services?

SUGGESTED

we are trying to create shipments/deliveries via web services. we are unsure at this time whether to go via the object, or via a sub program. there appears to be a built-in web service with an underlying subprogram named SDELIVERY however its usage is unclear.

  • 0
    I work with tmkgl, we're using v6.5 (Patch 35(?)).

    Thanks in advance for any info.
  • 0 in reply to JFrank

    Hi guys
    you can use web service for creating a delivery but you might get some problems. I just did that last month.
    as a rule it is always better to use a web service then writing program as the web service is doing exactly what the user do manually on screen (supposedly...)
    but , there are some exceptions:
    if the code has "if GWEBSERV" statement then some piece of code won't happen. and some other issues...

    I suggest the following:
    1. create a transaction for delivery in "Delivery" entry transactions and call it WS. don't forget to validate.
    (for performance uncheck all the things that you don't need for this object in the transactions.)
    2. create an object Web service and select SDH as object and WS at transaction.
    3. try it in the web service tester to see if it creates the delivery as you want.

    things that I needed to do to make this WS works:
    1. on the window of the WS transaction (WOSDHWS) you might need to change the sequence # of the screens and republish the web service.
    2. in the object SDH on environment tab you need to enter abbreviations for the screens (bottom right grid) so the web service will know which screens to refer as the "delivery address" and "billing address" uses the same screen: ADRBPC
    so enter ADB2, ADB3. find the other abbreviations for other screens on the grid.
    3. ALLFIL screen is not needed unless you allocate on the delivery and not on the sales order. you need to check this.
    4. for screen SCEE (if it in that grid) in field XFFWADD , changes the actions "execution" field to interactive so it won't affect WS.

    you need to validate the SDH object windows, entry transactions and the web service after all those changes,
    and see that it did not harm your process ...

    hope it will work for you

    just curious...
    why do you want to create a delivery using web service? X3 has functions to create a delivery from a sales order...

  • 0 in reply to Barak
    This is a great answer! Did this help you tmkgl / Jason? If so, would you be so kind as to mark Barak's post as the answer, or reply with what you'd like? Thanks!

    Bob
  • 0 in reply to Barak

    Hey Barak,

    Thanks! You got me a lot further than I was. I'm down to 2 final problems.

    1) Is there some way I can get the ADB2 and ADB3 screens to self populate like they do when someone is using the client directly? I see some actions being triggered that are Interactive but I am not given the option to change these to Always. This isn't a show stopper as I can pass in the data and it works, though redundant and non-elegant.

    2) When I pass in invoicing elements, they don't seem to work. The shipment takes these values from the customer. I want the values from the order. Alternatively, is there some way to switch this so that the shipment looks to the order for invoicing elements instead of looking to the customer?

    Thanks again, your response has been incredibly helpful!


    One last thing, we aren't using the functionality to create shipments off of the order because whenever I do that, the shipment has the creation date as it's shipment date. Our system sometimes is a little behind in generating shipments. We don't want the shipment date to always be the creation date.

  • 0 in reply to JFrank
    1. I dont understand what you want to do here...

    2. if you create a shipment not from a sales order then the invoice elements will come from customer as it does not know it is based on an order, so how it will know to take it from the order?
    if you create from sales order it will come from sales order (as far as I understand)

    3. creating a delivery is best from sales order, using FUNAUTDLV x3 function ,
    if you just need to modify the shipment date do it, it does not need to be the creation date.
    try to write code in SPESOH for VERIF_CRE, or CREATION actions and change the SHIDAT or DEMDLVDAT to what you want, see if that helps to achive what you want

    I think you are going on the wrong direction here...
  • 0 in reply to Barak
    Thanks Barak!

    I was actually looking into FUNAUTDLV before I read your post. I'm starting to understand what you are talking about. In fact, our future business process will involve us making shipments and then updating them before validation. This looks like the way to go.

    I'm having a small problem with FUNAUTDLV, however. Walking through the FUNAUTDLV code, it looks like stock must be allocated on the order or the shipment will not be generated. We don't want to allocate stock when orders are created; we want to allocate stock when the shipment is created. Do you know of any work arounds or other functions I could use?

    As for my other comments, when I was trying to use the object webservice like you previously mentioned, I had to pass in all of the ADB2 and ADB3 information, it was not being populated from the customer numbers. Also, as we discussed, the invoicing elements weren't being updated by the data I sent in. I'm starting to agree, however, that calling some function would be better than this approach.

    When I click on the Delivery button in X3, regardless of whether the order is allocated or not, I get a shipment. Is there some way to tap into that functionality?

    Thanks,
    Jason
  • 0 in reply to JFrank
    hi
    1. I think that you can allocate on the delivery/shipment level, but I don't know how. I think it is a setting in X3 that decide when and how to allocate , try to search the help on this.
    another idea - I think you can allocate just before the delivery i.e:
    1. create SO without allocation
    2. allocate stock - FUNAUTALL - look at this function.
    3. create delivery with FUNAUTDLV
    4. modify shipment as needed before validating

    2. when you click the Delivery button it call SDH object and create the delivery from that SO data, but I don't know how.
    you can start reading SUBSDH but that is a very big pain in the neck :)

    good luck
  • 0 in reply to Barak
    Ok,

    I'm running with the idea of allocating right before creating my delivery. Of course, I'm having some issues with the FUNAUTALL call. I'm also not having a ton of luck finding helpful documentation. Can you point me at any helpful 4GL snippets? I'm not getting any errors, just no order line items are being found. My order seems to comply with the filtering I see.

    Thanks for all the help so far!
  • 0 in reply to JFrank
    Eureka!

    Thanks so much Barak. I'm now allocating just before shipping which is working.

    Thanks again,
    Jason
  • 0 in reply to JFrank
    Hi Jason,

    Can you Mark this issue as answered please so we can give Barak some Sage City street cred?

    Thanks!
    Bob
  • 0 in reply to JFrank
    Thanks Barak, I actually have my shipment creation web service mostly working now. I added a tiny bit of script to move the invoicing elements from the order instead of the customer in the specific processing. It seems to be working great.

    The latest problem I've run into, however, is that my kits aren't unfolding on the shipments created by the web service. This leaves orders with kits only partially shipped. This is sort of weird because my shipment imports via the import template does unpack kits, so I feel like it's not the fault of something being set to interactive.

    Thanks again for all the help you've given me so far. I feel like I'm really close now.
  • 0

    Hi JFrank

    This is 2 years ago but I hope you remember this issue

    We are trying more or less the same and we are not sure if we can run the automatic allocation function from web services

    We need to do the allocation of concrete lines and quantities from orders through web services.

    Could you please guide us a little?

    Many thanks in advance

  • 0
    SUGGESTED

    Hello,

    Yes, Shipment can be created through web services using standard import template.

    The following are the steps to create sub-program type web service:

    a. create a script with sub program having input parameters whatever required for the template. (eg. SOHNUM as input)

    b. By passing Sales Order number as input parameter will get all the details required to pass shipment SDH import template.

    c. Now using sub program write the details to flat file and import file in X3 using SDH import template.

    d. If import is successful then you'll get Shipment number as output parameter.

    Hope this helps. Thank you.

  • 0 in reply to Ravi Teja

    Hi Ravi. Many thanks for your answer, much appreciated!!!! Just a small additional question :-) just in case you've been on same situation. It has been required to have the ability to overwrite some shipments quantity while they are not validated, as sometimes there are last minute modifications.  However the standard import process is not permitting me at the moment to update records and even adding the shipment number and the rest of the data identical but the quantity, is always creating a new shipment. Do you know if this a standard handicap or perhaps am I missing some parameter? Many thanks again. Laura

  • 0 in reply to LauraLerma

    Hello Laura,

    Please tick the check box "Update Allowed" for the respective import template and make a try.

    Even though not happened then one should write the specific sub program process replicating the standard modification process. 

    Implementing the above process will update the quantity.

    Hope this helps. Thank you.

  • 0 in reply to Ravi Teja

    I have flagged it and tried for all possible options I'm afraid but no way. That confirms that we need to go to the specific. Many thanks again Ravi.