cancel
Showing results for 
Search instead for 
Did you mean: 

How to access programatically "System messages log" below the sap b1 window ?

Former Member
0 Kudos

Hi everyone,

If I use option "System Information" that allows me to see what form I currently hover with mouse I may observe that the "System messages log" have form uid = 683 (as at the picture attached).


Then I would like to know what height it has. For this I am using the code as below:

Form messageLogForm = Core.Connection.ConnectionHolder.Application.Forms.Item("683") as Form;
var height = messageLogForm.Height;

or

var height = Core.Connection.ConnectionHolder.Application.Forms.Item("10000020L").Height;

Core.Connection.ConnectoinHolder is my own class which is representing connection of my addon written in C# and SAP B1, current instance. Suppose "Core.Connection.ConnectionHolder.Application " is normal Application Object in SAP UI API.

The problem which I have is the error I am receiving whenever I would like to access this form object. Is that some special way to do so or somewhere is my mistake involved ? My main aim is to get to know how height is this system messages log tab at below the form.

Accepted Solutions (1)

Accepted Solutions (1)

former_member185682
Active Contributor

Hi Dariusz,

For use the Forms.Item method you need know the formUID of form the message log form. Then I suggest you to use the Forms.GetForm method when supplying a type and instance count.

Dim messageLogForm As Form = Core.Connection.ConnectionHolder.Application.Forms.GetForm("683", 0)
Dim height = messageLogForm.Height

For the second parameter I believe that is not possible to open more than one message log form, so you can use 0. But if the message log form is closed, when you execute the line above, you will receive an exception.

Kind Regards,

Diego Lother

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Diego,

works well.
Thank you for your suggestion.

former_member185682
Active Contributor
0 Kudos

Hi Dariusz,

Great.

Don't forget to click on the accept button below my answer.

Kind Regards,

Diego Lother