SIH SOAP webservice x Stock issue lines creation

SUGGESTED

Hello,

When creating a Direct Sales invoice through SIH SOAP Webservice, the system returns the message below:

<message>Line Number 1 \ Product ITMMOB001 : The stock to issue has not been determined \ Document line quantity 1 Processed quantity 0</message>

How is possible to create an invoice and its stock line determination through SIH SOAP Webservice?

Based on some old posts and Sage KB's, there is a problem related to open another screen during a SOAP call, but in my case, when creating it manually there are no secondary screens in the process and the stock issue line is created automatically based on the settings. (Direct Invoice type, STK movement flags, Transaction with stock determination auto)

Sage X3 Version: V12.22

Parents
  • 0

    We have the same issue, did you find a solution for this?

  • 0 in reply to Sahem
    SUGGESTED

    Hello Sahem,

    I talked with Juliano directly suggesting a solution but my solution did not work for him. I am sharing the solution here with you because it worked for me and another person I know that had the issue.

    What happens: The "automatic stock issue" logic is done in an interactive field action that is not executed in webservice context.

    Here are the steps to bypass this problem:
    1. Add specific/custom field action for NBLIG in the screen SIH4. "After line" (the one that generates APRES_NBLIG). You can input it between DIVLINNUM and the STD action (order matters in field actions).

    2. Do not forget to validate the mask/screen, sales invoice transaction and republishing/restarting the webservice

    3. In the specific source/action compile the following code:

    Subprog APRES_NBLIG
    
    # [V]GWEBSERV       = 1 -> Webservice session
    # [V]GSLTSTKFLG     = 2 -> Automatic Stock issue
    # [M:SIH1]STOMVTFLG = 2 -> Stock movement for invoice enabled
    If GWEBSERV=1 & dim([V]GSLTSTKFLG)>0 and [V]GSLTSTKFLG=2 and [M:SIH1]STOMVTFLG = 2
        # Call standard action that is not executed in WS
        Gosub AAPRES_NBLIG From SUBSIH
    Endif
    
    End


    Regards,
    Roberto Nascimento

Reply
  • 0 in reply to Sahem
    SUGGESTED

    Hello Sahem,

    I talked with Juliano directly suggesting a solution but my solution did not work for him. I am sharing the solution here with you because it worked for me and another person I know that had the issue.

    What happens: The "automatic stock issue" logic is done in an interactive field action that is not executed in webservice context.

    Here are the steps to bypass this problem:
    1. Add specific/custom field action for NBLIG in the screen SIH4. "After line" (the one that generates APRES_NBLIG). You can input it between DIVLINNUM and the STD action (order matters in field actions).

    2. Do not forget to validate the mask/screen, sales invoice transaction and republishing/restarting the webservice

    3. In the specific source/action compile the following code:

    Subprog APRES_NBLIG
    
    # [V]GWEBSERV       = 1 -> Webservice session
    # [V]GSLTSTKFLG     = 2 -> Automatic Stock issue
    # [M:SIH1]STOMVTFLG = 2 -> Stock movement for invoice enabled
    If GWEBSERV=1 & dim([V]GSLTSTKFLG)>0 and [V]GSLTSTKFLG=2 and [M:SIH1]STOMVTFLG = 2
        # Call standard action that is not executed in WS
        Gosub AAPRES_NBLIG From SUBSIH
    Endif
    
    End


    Regards,
    Roberto Nascimento

Children