2005 Oct 26 12:45 PM
Hi,
I am using the standard application log (SBAL) in a log view class in order to display the log entries. Since the standard application log is implemented in function modules, it is not that easy to get a connection between the log view class and the application log.
In order to be able to react on button clicks of the application log, I had to set a callback function module. This callback function module has to know the relation between application log and the reference of the log view object in order to be able to raise events (of the log view object). Therefore I register every application log/log view combination in the function group that also contains the callback modules. This works all right as long as a log entry is in the log. Then I get the message handle and I am able to identify the log and the log view reference.
When no log entry is available, I do not receive the message handle (that contains the log handle).
Do you know another possibility how to be able to raise an event of my log view class when an application log toolbar button has been clicked?
Kind regards,
Fabian
2005 Oct 26 1:19 PM
Hi Fabian,
You can get the current log handle by doing a global assign as follows in your callback handler routine,
FIELD-SYMBOLS: <fs_handle> TYPE BALLOGHNDL.
ASSIGN ('(SAPLSBAL_CNTL)<d>-handle') TO <fs_handle>.
By the way is this related to your earlier post?
Also are you calling log display as a popup?
Actually when user clicks on hotspot and it goes into your callback routine, by that time PAI is already called..
You can check that by putting a break-point in your callback routine.
May be I did not quite understand what PAI values you are trying to retrieve in your log viewer object handler method. Could you explain more?
Hope this helps..
Sri
Hi,
I am using the standard application log (SBAL) in a log view class in order to display the log entries. Since the standard application log is implemented in function modules, it is not that easy to get a connection between the log view class and the application log.
In order to be able to react on button clicks of the application log, I had to set a callback function module. This callback function module has to know the relation between application log and the reference of the log view object in order to be able to raise events (of the log view object). Therefore I register every application log/log view combination in the function group that also contains the callback modules. This works all right as long as a log entry is in the log. Then I get the message handle and I am able to identify the log and the log view reference.
When no log entry is available, I do not receive the message handle (that contains the log handle).
Do you know another possibility how to be able to raise an event of my log view class when an application log toolbar button has been clicked?
Kind regards,
Fabian
2005 Oct 26 1:19 PM
Hi Fabian,
You can get the current log handle by doing a global assign as follows in your callback handler routine,
FIELD-SYMBOLS: <fs_handle> TYPE BALLOGHNDL.
ASSIGN ('(SAPLSBAL_CNTL)<d>-handle') TO <fs_handle>.
By the way is this related to your earlier post?
Also are you calling log display as a popup?
Actually when user clicks on hotspot and it goes into your callback routine, by that time PAI is already called..
You can check that by putting a break-point in your callback routine.
May be I did not quite understand what PAI values you are trying to retrieve in your log viewer object handler method. Could you explain more?
Hope this helps..
Sri
2005 Oct 26 2:00 PM
Hi,
I tried to implement this. In fact I get a handle back but this is not the handle of the log that I am currently working with.
I searched through the structure SAPLSBAL_CNTL)<d> and found a table that contains the right log handle. But I do not understand, why this is a table and not a field. In fact it is possible on my side, that I open several logs in parallel. I tested this, but still only one log handle entry is in the table. That is ok and works fine for me but I do not know if it is the right way just to take the first entry of the table.
And I do not know what kind of handle the one is that you told me to use.
You had some questions concerning my last posting.
This posting is not that much related to my other problem. It is the same application but different issues.
Up to now, I do not call the log display as a popup. But I am thinking of doing it. Maybe in the future.
I tested my log but the PAI is not called, when I click on the hotspot link. The first thing that is called is the CALLBACK routine. I don't know why this is like that. Maybe it has something to do with the fact that I use this functionality to create a control for my logs:
*create control to display data
CALL FUNCTION 'BAL_CNTL_CREATE'
EXPORTING
i_container = ir_container
i_s_display_profile = is_display_profile
i_t_log_handle = it_log_handle
IMPORTING
e_control_handle = ev_control_handle
EXCEPTIONS
OTHERS = 1.
Concerning your last question: I only have to provide the log. Other developer have to use it and they always want to be sure, that all current values from their dynpros are available when an event comes from my log. That is the reason, why I can not give you a certain example. It just has to work for every possible case.
You helped me a lot up to now. It would be great if we could also solve this problem.
Regards,
Fabian
Message was edited by: Fabian Kegel
Hi,
I found out that the handle is in fact the CONTROL HANDLE and not the LOG HANDLE. But this should also work. I only have to use the control handle as registration entry.
2005 Oct 26 2:51 PM
Hi Fabian,
Yes, the handle is control handle and it will be different (unique) for each of your log views and I suggest that you use this for registration. Current one always you can find in SAPLSBAL_CNTL-<d>..
Also now I think I understand your Reusable Log view class functionality..
Yes, PAI is not called in your case as you are using BAL_CNTL_CREATE and displaying log in your own container.
And when you raise an event from your log view class and other developers using the class handle it, they have to do a CL_GUI_CFW=>SET_NEW_OK_CODE (with some OK_CODE) call in their handler method and then handle it in PAI in their User Command processing..
Its like if you are using ALV Grid and you want to trigger PAI on hotspot click, you have to call SET_NEW_OK_CODE method in your hotspot click handler method and then trigger PAI and handle the okcode in PAI.
I personally suggest this approach..
Your reusable component should not try and trigger PAI, what if other developers at some point of time do not want it to trigger PAI?
Sri
Message was edited by: Srikanth Pinnamaneni
2005 Oct 26 4:02 PM
Hi,
thank you for this information. We discussed this a few minutes ago and came to the same result. What I don't understand is, why the SBAL development did not allow to set the events as application events. Then the using application could decide how the log behaves.
When I create my own ALV, I am able to set up all events (also the hotspot click) as application events.
Regards,
Fabian
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |