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.



Add a comment
10|10000 characters needed characters exceeded

Related questions

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 a 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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.