pushbutton

The pushbutton command is used to create and modify pushbuttons in SAP.

Pushbuttons are some of the most useful and powerful screen elements in WS and SAP. the pushbutton command is used to create, modify and link pushbuttons to other actions in SAP. Pushbuttons can be tied to functions, SAP transaction codes, processes and menu options. The following table displays the syntaxes for using the pushbutton command in WS:

Syntax Description
pushbutton([TOOLBAR], "Label", "/n[tcode]", {"separator":true}); Specifies a toolbar pushbutton and assigns a transaction code that will be called when the button is pushed.
pushbutton([startRow, startCol], "Label", "/n[tcode]", {"process":process_name, "using":{"param1":"value"}}) Specifies a pushbutton that has a process attached. A parameter value will defined to be passed to the function.

Options

The pushbutton command takes the following options:

fcode / tcode

Places the pushbutton relative to the top left corner of the screen. The syntax is as follows:

{"offset":[rows, cols]}
process

Launches or executes a function when the pushbutton is clicked. The syntax is as follows:

{"process":process_name}
size

Specifies the size of the pushbutton in rows and columns. The syntax is as follows:

{"size":[rows,cols]}
[TOOLBAR]

Places the pushbutton on the toolbar of a given SAP screen. Neither the size nor the position needs to be specified for a toolbar pushbutton. The syntax is as follows:

pushbutton([TOOLBAR], "Label", {option":value…});
using

Passes values to processes called by pushbuttons. The syntax is as follows:

{"using":{"param1":"value", "param2":"value"…}}