Command: Focus

Previous  Next |  Direct link to this topic

Go to list of all Commands

Syntax: Focus(<target>|<modifier>);

 

Set focus on an item in current form

 

NB: The Focus command work exactly that same as Click command so same features. The reason the Command in the first place is that while click does the same in some scenarios reading the word Focus in a Macro feel more natural.

 

Command variants

Description

Focus($[$<item>.<col>.<type>]);

Sample: Focus($[$7.0.0])will (if placed on a Business Partner Form) focus the name of the Business Partner.

Tip: instead of specifying the column you can use keyword “RowHeader” to do a click/select the row-header (The gray block in front of the row)

 

Focus($[$<item>.<col>.<type>.<row>]);

As above but with a 4th .row argument that allow you to specify a specific row to work with.

 

In addition to a numbered row you can use the following keywords to refer to special rows:

 

Keyword

Description

.FIRST

Refer to the First row in the Matrix (does essentially the same a ".1")

.LAST

Refer to the Last row in the Matrix

LAST-1

Refer to the Second to Last row in the matrix (this is in many cases handy as SAP normally have an new empty line for new row entries)

.SELECTED

Refer to the Row that have a Selection (aka highlighted in Yellow). If no selection this will fall back to working with the first row

.FOCUSED

Refer to the Tow that have cell focus (the row where the "yellow" cell is). If no cell focus this will fall back to working with the first row

Sample: Focus($[$38.11.0.1]) will on a sales order focus in the Quantity cell on the 1st row.

Sample: Focus($[$38.1.0.LAST-1]) will on a sales order focus in the Item Code cell on the second to last row.

Video: Working with rows and keywords

Focus($[$<item>.<col>.<type>]|<Modifier>);

It is possible to use different modifiers with a focus. These modifiers (NONE / CTRL / ALT / SHIFT) can for example be used to make multi selects in a table.

image436

Sample: Focus($[$3.ROWSHEADER.0.7]|CTRL);

 

 


Similar/Related Commands:
- Click
- DoubleClick
- DoubleClickColumnHeader