This is part of a series of integration video how-to’s for SAP Cloud Applications Studio. The main blog post can be found here: Video How-To: Integration capabilities of SAP Cloud Applications Studio

I thought it might be good to create dedicated blog post so that I also can provide the code snippet here.

Goal:

– Invoke an external web service with ABSL coding

Again we use my Bonus Plan use case. What we have done so far:

– Business Object “Bonus Plan” is created

– Web Service in C4C is created for Bonus Plan: This allows external applications to create Bonus Plans

We want to consume our own web service in this example as this is the best way to learn it. So we want to create some ABSL coding that can create a bonus plan via web service request and this is basically what I show in the video.

Content:

– Use WSDL to create an External Webservice Integration

– Create your own “Communication Scenario”

– Configure a “Communciation System”

– Configure a “Communication Arrangement”

– Create ABSL coding to invoke a service

Video recommendation: watch in HD (720p) for best experience.

Summary of the relevant content types:

14-01-2014 23-31-02.png

These video tutorials are based on my use case “Bonus Plan” but can also be consumed apart from that. All my videos where I explain everything from the very beginning can be found here: SAP Cloud Applications Studio Video-How-To’s.

To report this post you need to login first.

10 Comments

You must be Logged on to comment or reply to a post.

  1. Srikantha Ballani

    Hi Jens,

    I need to pass a collection of records in a single call. If my Service Interface accepts “1 to N” records, how do I use ABSL script to populate the request parameters with multiple records ?

    Earlier I used to make multiple calls in a far loop, but there is a need to pass the whole collection in one go.

    Regards,

    Srikanth

    (0) 
    1. Jens Limbach Post author

      Hi Srikanth,

      please try to introduce a collection of your “node” of the service:

      var myServiceNode:collectionof

      Library::WebService.CreateAccount.Request.Customer.Address;

      Then you can fill the collection as it allows multiple values an this should generate as many node elements in the xml structure as you put instances there.

      Cheers,

      Jens

      (0) 
      1. Srikantha Ballani

        Hi Jens,

        The scenario is to replicate the contents of a Custom BO to CRM via PI.  The External Web Service Integration object is created using the WSDL downloaded from PI. When I do a CTRL+J after Library::WebService.<ServiceInterface>.MessageType. I do not get a collection option here nor an action like CreateAccount.

        When we generate the External Web Service from a Web Service exposed by Custom Object in Cloud as you have shown in the tutorial, we get such options, but I’m not getting such options for the WSDL provided by PI for Custom Object data replication.

        ExtWebServ.png

        Regards,

        Srikanth


        (0) 
  2. John Michael Izaguirre Cotrina

    Hi Jens,

    Great video, but I have a question, 7:58 minutes describing the inbound and outbound Custom service, in my case these nodes are empty. And when I save I get the message “you must select the services that you ‘want to include in the communication scenario”.

    The service is good, I’ve tested with soapUI.

    /wp-content/uploads/2014/12/2014_12_29_16_53_37_616279.png

    /wp-content/uploads/2014/12/2014_12_29_16_55_11_616280.png

    Regards,

    John Izaguirre

    (0) 
    1. Jens Limbach Post author

      Hi,

      this is a displaying issue. Please close the CSD window and save andactivate your external service file of the solution. Then after re-opening the CSD you will see the checkboxes.

      Cheers,

      Jens

      (0) 
        1. Navin Kandasamy

          Hi John,

          Are you able to resolve this issue.Am also facing the same error when I tried to Check the Connection.Please share your solution here.

          Regards,

          Arjun

          (0) 
  3. Daniel Su

    Hi Jens

    – Use WSDL to create an External Webservice Integration

    – Create your own “Communication Scenario”

    – Configure a “Communciation System”

    – Configure a “Communication Arrangement”

    – Create ABSL coding to invoke a service

    Can create a service consumer use ABAP coding to invoke the service on ECC??

    Similar links below:

    http://sapignite.com/consuming-a-web-service-in-abap/

    Best regards,

    Daniel Su

    (0) 
  4. Sabari Nathan Mariappan

    Great Video Jens.

    Hi All,

    I have one requirement to automate the remittance advice for the payment monitor in the Payment Management. ie., Whenever payment is done, remittance should be generated automatically.

    Approach followed as mentioned:

    1). Downloaded the ManageRemittanceAdviceIn WSDL to create an External Webservice Integration

    2). Create the own “Communication Scenario”

    3). Configured the “Communciation System”

    4). Configure the “Communication Arrangement”

    5). In the before Save Event of Payment BO, Created ABSL coding to invoke a service.


    When we trigger the webservice in the before save event of the Payment BO, instead of 1(one) remittance, thousands(1000) of remittance are created.

    In the before Save Event of the Payment BO, invoked the web service using the below ABSL code.. var

    // Declaration

    ZRequestRef : ZPaymentFileIntegration.MaintainBundle.Request;

    var ZResponseRef : ZPaymentFileIntegration.MaintainBundle.Response;

    var ZPaymentRef : ZPaymentFileIntegration.MaintainBundle.Request.RemittanceAdviceBundleMaintainRequest_sync.RemittanceAdvice;

    // Assigning value from XML to External Web Service Integration.         

    ZPaymentRef.AccountDebitIndicator = false;

    ZPaymentRef.BusinessPartnerInternalID = this.BusinessPartner.InternalID;

    ZPaymentRef.EffectivePaymentAmount.content = this.TransactionCurrencyAmount.content;

    ZPaymentRef.EffectivePaymentAmount.currencyCode = this.TransactionCurrencyAmount.currencyCode;

    ZPaymentRef.CompanyID = this.Company.ID;

    ZPaymentRef.ExternalAdviceID.content = this.ExternalID.content;

    ZPaymentRef.PaymentReference.ID.content = this.ExternalID.content;

    // Add the elements of the Remittance into the Remittance Advice Collection

    ZRequestRef.RemittanceAdviceBundleMaintainRequest_sync.RemittanceAdvice.Add(ZPaymentRef);

    // Execute the Webservice Call –The below response get executed for more than 3 mins and thousands of remittance are created for the single payment.

    ZResponseRef = ZPaymentFileIntegration.MaintainBundle(ZRequestRef, “”, “ZPaymentIntegration”);

    ZRequestRef.Clear();

    ZResponseRef.Clear();

    ZPaymentRef.Clear();

    The code line highlighted – response is taking too much time to come out of that and thousands of remittance are created. What is missing from side? Please help 🙂

    (0) 
  5. Omkar Uthale

    Hello, Jens,

    Thanks for nice blog. I am trying to consume REST service created in hybris. But it is a different scenario. Here when I put End Point details and communication arrangement, it is not providing me Outbound Services even after I restart Cloud Studio.

    Any pointers around consuming REST service?

    Regards,

    Omkar Uthale

    (0) 

Leave a Reply