Liquid UI - Documentation - 17.08 Create a new dropdownlist

17.08 Create a new dropdownlist


Prerequisites


Purpose

Learn how to create a new customized dropdownlist on the SAP screen. In this article, we will create a dropdownlist with required Order Type values in a VA01 transaction and execute a function automatically when a value is selected from the dropdownlist.

Let's, consider an organization that wants to create only the following types of Sales Orders:

  • AEBO Order
  • Promotional Order
  • Standard Sales Order
 

Learn how easy it is to add a dropdown list referring to the Order Type field on the VA01 transaction. We'll guide you through the following steps.

  • Delete unnecessary screen elements on the SAP screen using the del command.
  • Add screen elements
  • Add functionality to the screen element

 

User Interface

//Create this file inside your script folder for customizing the Create Sales Order: Initial Screen. SAPMV45A.E0101.sjs

//Now, let's add the Liquid UI script to the above file and save it.

 

Customization 

  1. Delete the entry and description field of the Order Type input field.
     
    //Deletes entry field of Order Type.
    del("F[Order Type]",{"value":true});
    del("#[2,29]",{"text":true});
    
     
     
  2. Add the dropdownlist with the required Order Type values, as shown below.
     
    //Sets order type values to mylist dropdownlist.
    set("V[mylist]","=--- Select Order Type---;AA=Promotion Order;CMR=Standard Order;AEBO=AEBO Order;");
    dropdownlist([2,17],"mylist",{"refer":"F[Order Type]","width":30,"process":test_dropdown});
    
     
     
  3. Add a function that assigns a selected dropdownlist value to an Order Type field. Save the script file and refresh the SAP screen
     
    //Adds function to assign dropdownlist value to Order Type field.
    function test_dropdown()
    {
    set("F[Order Type]", z_ordertypeselected);
    enter();
    }
    

 

SAP Process

  1. Now, refresh the SAP screen, select an order type from the created dropdownlist, and click Enter. You will navigate to the overview screen. Here, the screen name changes from Create Sales Order: Initial Screen to Create Promotion Order: Overview as we selected the order type as Promotion order, as shown below.
     
     
    Hence, we can customize the Create Sales Order: Initial Screen (VA01) using a value selected from the dropdownlist element. 

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