Skip to Content
author's profile photo Former Member
Former Member

Setting focus to a field after form load

Hi all,

SBO 6.50.097 SP:01 EF:07

Just a small query, is there a way to set focus to a field as soon as a form has loaded?

For example: when the Stock Transfer screen (FormType = 940) loads, it sets the focus to the From Warehouse field (ItemUID = "18"). Is there a way to set the focus to the Customer field (ItemUID = "3") after the form is loaded?

I can use the following code to select an EditText type item object:

'Customer field.

Set oItem = oForm.Items.Item("3")

oItem.Click ct_Regular

but this does not work with et_Form_Load etc.

Any help is much appreciated.

Regards,

Andrew.

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 06, 2004 at 01:41 PM

    You might be able to use the form load event for this.

    Simulate a user click "after" the action has taken place.

    if pval.eventtype= et_FORM_LOAD

    _ and pval.beforeaction = false then

    end if

    This should give you a sort of "form loaded -event". If SAP generates before and after action in this case.

    HTH Lutz Morrien

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Andrew,

      within the working code , the event does translate to "after form_load".

      (Form_load Event + before_action=false)

      But that obviously does not help you since your code still does not work. Maybe using another event would (like form_activate).

      HTH Lutz Morrien