Adding pushbuttons to the SAP toolbar

Pushbuttons can be placed on the SAP toolbar and separated from other toolbar elements. In the following example, we will add a previously created pushbutton to the toolbar.

  1. Go to the MM01 screen in SAP.
  2. Open the MM01 script file (SAPLMGMM.E0060.sjs) and enter the following code. Create the file if it does not already exist.
    				pushbutton( [TOOLBAR], "Process",{"separator":true, "process":setMatType});
    				
  3. Add the function code that the pushbutton will call. An example is shown below:
    				function setMatType() {
    	set("F[Industry Sector]", "C");
    	set("F[Material Type]", "FERT");
    	}
    				
  4. Save your changes and refresh the SAP screen.

    The MM01 screen now appears as follows:



  5. Click the Process toolbar button to initiate the function.

The Industry Sector and Material Type fields now have values set by the process.