admin Posted on 12:57 pm

SMART WAY

SMART WAY TO SHOW ADVANCED LIST PANE USING RUBY SCRIPTING

This blog introduces you to a smart way to show a dependent list view in C4C without creating any sub-nodes or writing any absl coding in SAP Cloud Application Studio. Using this method there will also be no user locking issue.

Use Case: Display ERP Sales Order IDs against each Opportunity as a separate tab in the Opportunity TI screen where the sales order does not exist in C4C. By using Confirm Opportunity Replication from the SAP Business Suite service, only ERP Sales Order IDs are getting replicated to C4C.

SDK Solution: This can be achieved by creating dedicated fields and using Ruby scripting in EC. Below are the steps to be performed.

Step 1: Create an Embedded Component in your solution.

Step 2: Open the newly created EC, drag and drop the AdvancedListPane from Toolbox onto the Designer screen and bind the corresponding fields in the Data Model as shown below.

 

Step 3: Once this is done, add a new AdvancedListPane in a similar way.

Step 4: Go to Data Model tab, make both fields of newly created Data List (renamed as SalesOrder) as dedicated fields:

 

Also, add a Data field at the Root level to bind with Opportunity ID and add an Inport structure (add Data field ID under it) as shown above. This would be used to add the embedded component in Opportunity TI screen.

Step 5: Once all the changes in the Data Model tab is done, let us move to the Controller tab to create event handlers.

Create two event handlers named as Read and Script respectively.

Step 6: Add the below-shown operations in Read event handler.

 

 

Step 7: To achieve the dependent list view visibility, add ruby script operations in Script event handler as shown below.

 

 

Step 8: Create Inport and assign Read as an OnFire event handler.

Step 9: Hide the first AdvancedListPane in embedded component. Finally, bind the embedded component to the

 

Leave a Reply

Your email address will not be published. Required fields are marked *