cancel
Showing results for 
Search instead for 
Did you mean: 

Opening a System-Form with selected Data

MatLakaemper
Participant
0 Kudos

Hi,

i´m looking for a way to open a System-Form, e.g. Orders with

selected Data.

In the moment i do the following:

application.ActivateMenuItem("2050"); // orders

SAPbouiCOM.Form belegForm = application.Forms.ActiveForm;

belegForm.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE;

SAPbouiCOM.EditText edDocNum = (SAPbouiCOM.EditText)belegForm.Items.Item("8").Specific;

edDocNum.Value = "4711";

belegForm.Items.Item("1").Click(SAPbouiCOM.BoCellClickType.ct_Regular);

This works, but the screen is blinking, because first the form ist opened and shown with

empty values and then filled.

Is there a way to activate the form and do the search-Operation and afterwards show it ?

I think ist must be possible, because when clicking on the link-Button near CardCode, the Contacts-Form

is opened in this way.

regards Matthias

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Matthias,

You can try and freeze the form after it load so change your code:

application.ActivateMenuItem("2050"); // orders

SAPbouiCOM.Form belegForm = application.Forms.ActiveForm;

belegFrom.Freeze(True)

...

belefForm.Freeze(False)

Hope it helps,

Adele

MatLakaemper
Participant
0 Kudos

Hi Adele,

thank you for your answer.

The blinking-Problem is solved on this way, but

the empty screen is still shown before selecting the data.

regards Matthias

Former Member
0 Kudos

Hi Matthias,

I have no other solution for this. Maybe you can set the visible property of the form to false until you have finished, but I don't think it will work to get focus to the controls. You can try it out.

Hope it helps,

Adele

MatLakaemper
Participant
0 Kudos

Hi Adele,

The function

application.ActivateMenuItem("2050");

opens the Screen in Visible mode. If i set the visible-Property

of the screen to false the user will see the empty screen for

a short time.

Regards Matthias

Former Member
0 Kudos

Hi Matthias,

Try this:

Before the activate menu item, set a flag to true.

Then activate menu statement (Now the form load event should be raised)

If the form is freezed, unfreeze it.

On the form load event if the flag is true freeze the form.

Put the flag to false.

PS: Perhaps you could use the visible property instead of the freeze method for a better behavior

Hope helps,

Ibai Peñ

MatLakaemper
Participant
0 Kudos

Hi Ibai

thank you for your answer. But i think i don´t really

understand everything.

---Before the activate menu item, set a flag to true.

which flag do you mean ?

regards Matthias

Former Member
0 Kudos

The flag would be a global variable, used to identify when you must do what you need.

If you don´t use any flag, every form load would execute that code, and you don´t want that. You need that code to be executed only after you show the form manually.

Sorry for my bad explaining.

Ibai Peñ

MatLakaemper
Participant
0 Kudos

Hi Ibai,

i have tested both: freeze and form.visible = false in

the form_load-Event. It doesn´t work here.

Also neither the call

application.ActivateMenuItem("1281"); // find

nor the call

oForm.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE;

work in the form_load-Event.

After the form-Load-Event the et_FORM_ACTIVATE-Event is called.

Here the functions work, but here the screen is already visible.

regards Matthias

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Matthias,

in this case I always use the LinkedButton and storing the Docentry in a linked EditText-field.

Sometimes I add these two Items to an existing form and set the Visible property to false until I need to open the systemform (the LinkedButton must be visible to send the click-event). Maybe it's also possible to minimize the Items (e.g. Width = 0, Height = 0 ).

Kind Regards

Christian