Automate

 View Only
  • 1.  Cannot Post Data to a Web Service Call for VK15 Table 005 & Condition Type ZPR1

    Posted 08-29-2019 17:12

    Greetings:

    I am unable to post data for multiple rows to a web service from a repeating table in a Winshuttle form.   My Transaction Script is for posting and saving material pricing data to SAP Transaction Code VK15 to Table 005 for Condition Type ZPR1.

    We have created and imported a Transaction Script for calling VK15 to Table 005 for Condition Type ZPR1 with the following settings inside Winshuttle Composer Version 11.2.1:

    Transaction Script Field Mapping


    Note:
    Generating Repeating Section is checked or enabled to support the Repeating Table inside our Form Group, Sold_To_Pricing_Group, although the SAP Transaction Code VK15 to Table 005 and Condition Type ZPR1 is non-looping and does not repeat.

    The Sold_To_Pricing_Web_Service Advanced element properties for the Transaction Script's web service is set as follows:

    Sold_To_Pricing_Web_Service PropertiesThe Field Parameter Mapping values we are using to call the VK15_Table005_ZPR1_V2 Web Service are:

    Field Mapping Parameters
    The Execute button in the Winshuttle Form Group that calls the Sold_To_Pricing_Web_Service is set with the following attributes in Winshuttle Composer:

    Execute Button Properties
    The custom Execute action for the Rule that calls the JavaScript function that iterates through all the rows and calls the Sold_To_Pricing_Web_Service for each row is:

    Rules for Execute Button
    The implementation of the onExecuteSoldToPricingGroup() JavaScript function in one of our supporting Composer Solution JavaScript Code modules is as follows.  Note that the method call for $form.executeWebService() in this function matches the name with case sensitivity, for the solution's Transaction Script Web Service we're trying to use to post all of the Sold-To Material Pricing data in the repeating table in to SAP: "Sold_To_Pricing_Web_Service".
    JavaScript Method
    Sold-to Pricing Repeating Table

    When we click on the Execute button inside the Sold-To Pricing Form Group, the following actions occur as expected:

    • The Execute button does invoke and call the onExecuteSoldToPricingGroup() JavaScript function.

    • The number of Sold-To Pricing rows detected in the table are reflected correctly in the function call to set the maxSoldToPricingRow variable, count("[…]/my:Repeating_Content/my:RunParameter_12/my:Sold_To_Pricing_Group_allowRun"); (Note: Full XPath value for accessing the Sold-To Repeating Table truncated for clarity).

    • There are no additional errors and warnings inside the Google Chrome Debugger Console pane as the $form.executeWebService("Sold_To_Pricing_Web_Service"); is called in the for() loop for each row.

    Each of these conditions is reflected in the following screenshots from debugging the onExecuteSoldToPricingGroup() JavaScript function call:

    Chrome Debugging Console [1]
    Chrome Debugging Console [2]


    What doesn't happen that we expect is the display of the Logfield status message from calling the Sold_To_Pricing_Web_Service inside the repeating table for each row after the onExecuteSoldToPricingGroup() JavaScript function has finished; the Logfield remains empty for each of the rows in the Sold-To Pricing repeating table.

    There are no errors or issues when we run the same Transaction Script, VK15_TABLE005_ZPR1_V2.Txr, in Test or Debug mode using Winshuttle Studio.  Additionally, if we import, setup and run the VK15_TABLE005_ZPR1_V2.Txr Transaction Script for posting a single row in the form group without using a repeating table element, we can successfully call and post a single row of Sold-To Pricing data through the Winshuttle Composer solution.

    Based on these items, can you make any recommendations or suggestions to our solution that would allow the $form.executeWebService("Sold_To_Pricing_Web_Service"); function call to succeed for each row and return and display the Web Service call status message for each row posted?

    Thank you in advance for your time, help and patience in reviewing these questions.





    ------------------------------
    Bill Wonneberger
    bill.wonneberger@versummaterials.com
    ------------------------------


  • 2.  RE: Cannot Post Data to a Web Service Call for VK15 Table 005 & Condition Type ZPR1

    Employee
    Posted 08-30-2019 10:43
    Hi Bill

    Not a Javascript expert - I can read it, but I am wondering why you need it.  I have a solution that updates a bunch of pricing conditions, and I can get a count and run the web service without Javascript.

    Web service fields - all in the same repeating group

    I have a button with a rule run the post the price updates:

    I also have a group with number of rows and number of rows processed that display when I click to post the updates.  
    • Count number of rows uses a default value setting with the Count function passing in the field name: count('/my:myFields/my:PricingUpdates/my:PricingUpdates_Input/my:Repeating_Content/my:LogField')   
    • Count number of rows processed keys off of the Logfield - if it has Success (for validate) or Condition records saved (for post) it is counted in number processed:   count('/my:myFields/my:PricingUpdates/my:PricingUpdates_Input/my:Repeating_Content/my:LogField',"Condition records saved|Success")
    The allow_run field is checked.

    Did I miss something that the javascript is doing that can't be done without it in this use case?

    Best Regards,
    Sigrid



    ------------------------------
    Sigrid Kok
    pse | Winshuttle North America
    ------------------------------



  • 3.  RE: Cannot Post Data to a Web Service Call for VK15 Table 005 & Condition Type ZPR1

    Posted 08-30-2019 15:58

    Hi, Sigrid;

    Thank you very, very much for your reply and suggestions.  Your approach for posting the data to the web service and confirming the count of the number of pricing records posted displayed in a form group without any custom JavaScript seems to be much simpler and direct.  And with less code, far less error or bug prone.

    Before I try changing my approach to posting SAP data through the Web Service call, I do have a number of questions on how make the changes my Winshuttle Composer solution to follow your approach for calling and confirming what Pricing data is posted to the Web Service.

    1. There is a difference in Transaction Script Web Service Field Mapping values in your approach compared to what I have, namely the Single Upload and Bulk Upload radio buttons under the Group Name text box:
    Field Mapping Dialog Box         Your Transaction Script Field Mapping Dialog Box settings 

    Composer Ver. 11 Field Mapping Dialog Box            My Transaction Script Field Mapping Dialog Box settings

    Are the Single Upload and Bulk Upload radio buttons under the Group Name text box specific to your version of Winshuttle Composer?   The reason I ask is that we're running Winshuttle Composer Version 11.2.1, and I recall from your previous reply that you were using Version 12 of Winshuttle Composer, and these two radio buttons do not appear in my Transaction Script Field Mapping dialog box.

    1. I also was curious about how you configure and set up the Web Service for the Winshuttle Composer. When we create and save our Transaction Script for the Web Service inside Winshuttle Studio for importing it into Composer, are there any setting or changes that are required to allow the Transaction Script and Web Service to repeatedly call our Web Service?   For example, must we save and use the Web Service from an XML file, or have the .Txr set with a different option to make the web service call take place separately for each row in our Pricing Updates repeating table control.
    2. In place of our custom JavaScript event handler, onExecuteSoldToPricingGroup(), is the following correct to bind our Execute button to post the Pricing changes to our Web Service? Again, I am assuming what you shared in your reply for binding the button to call the Web Service is specific to Winshuttle Composer Version 12.  I am hoping that you can tell me if the same steps that follow would provide the same functionality in calling the Web Service in our Form Solution using Winshuttle Composer Version 11.

      First, I would create a New Rule using the Create Rule dialog box, and then have the Type value in its dropdown combo box set to Actions, then click on the Add button to set the custom action:

     Create Rule Dialog Box

    Then to complete the button binding to executing the Web Service to post the pricing data in our form's repeating table, I would then set the Action value in the dropdown list in the Add Rule Action dialog box to Execute Web Service, and then select the name of our Pricing update web service in the Web Service Control dropdown list:

    Add Rule Action Dialog Box

     

    Are there any other changes to bind the calling of the Web Service from the Pricing form's button in Winshuttle Composer 11 that I need to make or be aware of to match your implementation?


    Again, many, many thanks for your time, help and patience.

     

     

     

     

     



    ------------------------------
    Bill Wonneberger
    bill.wonneberger@versummaterials.com
    ------------------------------



  • 4.  RE: Cannot Post Data to a Web Service Call for VK15 Table 005 & Condition Type ZPR1

    Employee
    Posted 09-04-2019 13:48
    HI Bill

    Sorry for the delay in my reply.  

    The bulk option for repeating web services is new with version 12.1.   It will run all records on SAP a bit faster.  However the repeating web service you have in place should suffice for posting multiple condition records.

    That is all that would be different for previous versions in this scenario.  Everything else would apply for pretty much any version of Composer.

      There is no trick to running through multiple records, just:
    1. make the web service repeating when you import it, which you have
    2. make sure all of the fields in the repeating web service are in the same repeating group .  You would only worry about this if you are trying to re-use fields in your form. 
    3. make sure the allow run field is set to 'true' for the records you want to post, i.e. it's checked, as it is a checkbox
    4. make sure you have a web service control on your form view 
    5. either use a rule or choose a button to trigger the web service.  What you have outlined above should work
    6. my rule - you can ignore the show group step.  I have a group that shows the count of rows and the number of processed, and I only show it when I click the button that fires the post conditions button.  I also reset the number of processed rows.  I sent you the formulas to use for that previously.
    Hope that helps confirm the approach.  Best of luck!

    Best Regards,
    Sigrid


    ------------------------------
    Sigrid Kok
    pse | Winshuttle North America
    ------------------------------



  • 5.  RE: Cannot Post Data to a Web Service Call for VK15 Table 005 & Condition Type ZPR1

    Posted 09-04-2019 16:52

    Hi, SIgrid;

    Thank you very, very much for the reply, and the checklist in your most recent post on handling a repeating group of rows when posting to a Web Service.   As soon as I get a chance, I'll check my settings for the Transaction Script, including the Allow Run Field is set to true or checked.  Other than this one item, I think I have met all of the other items in the checklist accounted for.

    Again, my sincerest thanks for your time and help.



    ------------------------------
    Bill Wonneberger
    bill.wonneberger@versummaterials.com
    ------------------------------