Liquid UI - Documentation - 13.12 Displaying pushbutton on the SAP table column

13.12 Displaying pushbutton on the SAP table column


Prerequisites


Purpose

Learn how to display a pushbutton on all the rows of a table column, and execute a process on click. We will walk you through the following steps.

  1. Delete the image container from the SAP Easy Access screen using the del command.
  2. Initialize a variable
  3. Add a table with two columns and name it as Create BOM
  4. Add a function with label RFCfunction to display the _nwrfcinuse system variable


User Interface

//Create this file inside your script folder for adding functionality to the SAP Easy Access screen: SAPLSMTR_NAVIGATION.E0100.sjs
//Now, let's start adding the Liquid UI script to the above file and save it.


Customization

  1. Logon to SAP and delete the image container using the del command on the SAP Easy Access screen, as shown below.
     
    // Deletes an image container on the easy access screen
    del("X[IMAGE_CONTAINER]");
     

     
  2. Initialize a variable labeled z_engr_bomtable to void (0) value, as shown below:
     
    z_engr_bomtable = void 0;
    
     
  3. Add a table labeled Create BOM on the SAP Easy Access screen with two columns Item and PushButton.
     
    // Creates a table with a title as Create BOM, technical name as z_engr_bomtable with 10 number of rows
    table([1,1], [10,25], {"name":"z_engr_bomtable", "title":"Create BOM", "rows":10});
    // Creates a column in the defined table with a title/header as Item, technical name as item_no at position 1 with 8 as size
    column("Item", {"table":"z_engr_bomtable", "name":"item_no", "position":1, "size":8});
    // Creates a column in the defined table with a title/header as PushButton, technical name as doc_push at position 2 with 10 as size, and pushbutton option as true with a label defined column("PushButton", {"table":"z_engr_bomtable", "name":"doc_push", "position":2, "size":10, "label":"@AA@", "pushbutton":true,"fcode":"?","process":RFCfunction});
     

     
  4. Add a function with the label RFCfunction to display the _nwrfcinuse system variable in the Cornelius window.
     
     
    Note: The _nwrfcinuse system variable displays whether the RFC library files are in use or not.
     
     
    // This function prints the value of _nwrfcinuse system variable value to know whether the RFCLibrarys are in use
     function RFCfunction(){
    	println("RFCLibrarys in use: "+_nwrfcinuse);
    }
    
     


SAP Process

  1. Now, refresh the SAP screen, and then click on any of the pushbuttons on the Pushbutton column in the Create BOM table. Then, the process RFCfunction will be executed, and displays whether the RFC library files are in use or not in the Cornelius window, as shown below. Here, true represents that the RFC library files are in use.
     
     

Can't find the answers you're looking for?