Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: set(), del(), dropdownlist(),enter()
Purpose
The article details how to create a new customized dropdownlist on the SAP screen. Here, we will create a dropdownlist with required Order Type values in the VA01 transaction and execute a function automatically when a value is selected from the dropdownlist. To demonstrate this process we are considering the Create Sales Order: Initial screen as an example and we’ll guide you through the following actions:
- Delete the entry field.
- Add the dropdownlist to select the order type.
- Add a function to assign value to the input field.
Let's consider an organization that wants to create only the following types of Sales Orders:
- AEBO Order
- Promotional Order
- Standard Sales Order
User Interface
//Create the file SAPMV45A.E0101.sjs inside your scripts folder for customizing the Create Sales Order: Initial Screen.
//Now, add the Liquid UI script to the above file and save it.
Customization
- Log into SAP, navigate to the VA01 screen, and delete the entry field for the Order Type input field using the del().
//Deletes entry field for Order Type. del("F[Order Type]",{"value":true}); del("#[2,29]",{"text":true});
- Add the dropdownlist labeled Select Order Type with the required Order Type values, as shown below.
//Sets order type values to 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});
- Add the test_dropdown function to assign a selected dropdownlist value to the Order Type field.
//Function to assign dropdownlist value to Order Type field. function test_dropdown() { set("F[Order Type]", z_ordertypeselected); enter(); }
SAP Process
- Refresh the SAP screen, select an order type from the created dropdownlist, and click Enter. Then, you will be navigated 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 in the image below.
Hence, we can customize the Create Sales Order: Initial Screen (VA01) using a value selected from the dropdownlist.