Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member186648
Active Contributor
6,797
Example scenario:
Creating Target Group and adding members to it via calling webservice "Manage Target Groups" via WSID in ABSL script.

  1. Download the .WSDL file of the service "Manage Target Groups"
    a. Log in to the Application UI, and navigate to the Administrator WoC
    b. Select "Communication Arrangements", and create/select the Communication arrangement on the communication scenario "Manage Target Groups"
    c. Select "Technical Data" tab:
    d. Select "Edit Advanced Settings" button to download the WSDL file into the local system

  2. Login to SAP Cloud Applications Studio(SDK)

  3. Create/Open a solution

  4. Create an External Webservice Integration(WSID) selecting Communication Scenario and upload the downloaded WSDL file

  5. In the Communication Scenario (CSD), select the outbound service:

  6. Create Communication Arrangement on the above Communication Scenario:
    Note: Make sure the Path is filled

  7. Create a custom BO:Ex:
    import AP.Common.GDT as apCommonGDT;businessobject TestTG1 { 

    [Label("Target Group Desc")] element TGDesc: MEDIUM_Description;

    node members [0,n]

    {

    [Label("Customer")] element CustID: ID;

    [Label("Contact")] element ContactID: ID;

    [Label("Employee")] element EmpID : ID;

    }

     

    }

  8. Create an ABSL script to call the Manage Target Groups webservice via WSID:Ex: BeforeSave on Root
    import ABSL;import AP.FO.BusinessPartner.Global;

    import AP.CRM.Global;

    import AP.Common.GDT;

     

    var tgSrvReq : TargetGroup1.MaintainBundle.Request;

    var tgSrvReqItem : TargetGroup1.MaintainBundle.Request.TargetGroupBundleMaintainRequest_sync.TargetGroup;

    var tgSrvReqMember: TargetGroup1.MaintainBundle.Request.TargetGroupBundleMaintainRequest_sync.TargetGroup.Member;

    tgSrvReqItem.Description = this.TGDesc.content;

    //This is for Target Group Create

    tgSrvReqItem.actionCode = "01";

    //...Handle Update case also

    foreach ( var itm in this.members)

    {

    var Cust = Customer.Retrieve(itm.CustID);

    tgSrvReqMember.CustomerUUID = Cust.UUID;

    tgSrvReqItem.Member.Add(tgSrvReqMember);

    //...

    //Handle Contact ID to UUID conversion also

    //Handle Employee ID to UUID conversion also

    }

    tgSrvReq.TargetGroupBundleMaintainRequest_sync.TargetGroup.Add(tgSrvReqItem);

    var response = Library::TargetGroup1.MaintainBundle(tgSrvReq,"","TargetGroup1");

  9. Create UI on the Custom BO to input valuesThanks, Pradeep.

4 Comments