cancel
Showing results for 
Search instead for 
Did you mean: 

Focus to a webdynpro alv grid column after report_element_t100_message

Former Member
0 Kudos

Hi All,

I have an alv grid on my view. When I click a button, I'm making some checks for editable cells and if necessary giving a message to the user by using report_element_t100_message method. After the message, I'm setting focus to the alv grid cell . If I don't give a message, my set_focus code works fine, but I must give a message , so how can I achive this? Isn't it possible setting to a cell after a message?

Followings are some parts from my source code .

Thanks in advance,

MERAL

-

-


-

-


THESE CODES ARE IN MY VIEW -

-


-

-


*-- GIVE MESSAGE

CALL METHOD wd_assist->mesaj_ver

EXPORTING

in_api_controller = lo_api_controller

in_el_context = lo_el_context

in_msgty = 'E'

in_msgno = wd_assist->msg_boskalamaz

in_msgv1 = cmsg

in_msgv2 = 'Geçerlilik Başlama Tarihi'.

strFocusColumn = 'GECERLIBASTARIH'.

.........................

*-- SET FOCUS

lr_salv_wd_table = wd_this->wd_cpifc_alv_molekul_selected( ).

lr_salv_wd_table->set_focus(

index = itabix

column = strFocusColumn ).

-

-


-

-


THIS METHOD IS IN MY ASSISTANCE CLASS -

-


-

-


method MESAJ_VER.

data lo_message_manager type ref to if_wd_message_manager.

data message type SYMSG.

*-- Get message manager

CALL METHOD in_api_controller->GET_MESSAGE_MANAGER

RECEIVING

MESSAGE_MANAGER = lo_message_manager.

message-MSGTY = IN_MSGTY.

message-MSGID = 'Z_BYY_CLS_AYYA_MSG'.

message-MSGNO = IN_MSGNO.

message-MSGV1 = IN_MSGV1.

message-MSGV2 = IN_MSGV2.

message-MSGV3 = IN_MSGV3.

message-MSGV4 = IN_MSGV4.

  • report message

CALL METHOD lo_message_manager->report_element_t100_message

EXPORTING

msg = message

element = in_el_context

cancel_navigation = in_cancel_navigation.

endmethod.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Check https://scn.sap.com/thread/3258741

Togheter with Karri we reached to a solution to a similar problem related to set_focus.

On short what you can do: create an action with a call of set_focus method.

Create a timedtrigger element to trigger your action. Delay of timedtrigger will be a context attribute and must be set to 1 second before you call this new action.

After set_focus reset to 0 the context attribute for delay.

My scenario was: in case of messages (displayed with if_wd_message_manager->report_t100_message

) the set_focus was not working.

It will be a bit annoying because of the 1 second delay but....

I'm not sure that this will work for you (because of particular message method that you use - which is referring to a particular node element) but you can try.

It's seems that set_focus is not working properly in a context like: message, popup...

Regards,

Catalin

Former Member
0 Kudos

Hi Catalin,

thanks for the answer I´ll try an report,

Regards,

Kai

Former Member
0 Kudos

Hi,

is there a solution for this problem?

Greetings

Former Member
0 Kudos

Sorry Vishal,

I have noticed your method's name after I send my previous message.

I changed my code to use the method report_ATTRIBUTE_t100_message..

But unfortunately it didn't solve my problem either

Former Member
0 Kudos

Thank you for your reply Vishal, but I already read context before I give message. Please have a look at my code below.

Do you say something different from this?

**************************************************************

DATA lo_el_context TYPE REF TO if_wd_context_element.

DATA lo_api_controller TYPE REF TO if_wd_controller.

DATA:

lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.

DATA:

lo_nd_tab_molekul_selected TYPE REF TO if_wd_context_node,

lt_tab_molekul_selected TYPE wd_this->elements_tab_molekul_selected,

lo_el_tab_molekul_selected TYPE REF TO if_wd_context_element,

wa_selected TYPE zbyys020,

strfocuscolumn TYPE string,

cmsg TYPE symsgv,

nsure(6) TYPE n ,

itabix TYPE sy-tabix .

DATA: itmp TYPE i,

isure TYPE i..

*----

-


CLEAR ret_ready .

lo_nd_tab_molekul_selected = wd_context->get_child_node(

name = wd_this->wdctx_tab_molekul_selected ).

lo_nd_tab_molekul_selected->get_static_attributes_table(

IMPORTING table = lt_tab_molekul_selected ).

lo_el_context = wd_context->get_element( ).

lo_api_controller ?= wd_this->wd_get_api( ).

CLEAR: strfocuscolumn, itabix.

LOOP AT lt_tab_molekul_selected INTO wa_selected

WHERE changed IS NOT INITIAL.

itabix = sy-tabix.

IF wa_selected-gecerlibastarih IS INITIAL.

CALL METHOD wd_assist->mesaj_ver

EXPORTING

in_api_controller = lo_api_controller

in_el_context = lo_el_context

in_msgty = 'E'

in_msgno = wd_assist->msg_boskalamaz

in_msgv1 = 'Geçerlilik Başlama Tarihi'.

strfocuscolumn = 'GECERLIBASTARIH'.

EXIT.

ENDIF.

lo_el_tab_molekul_selected =

lo_nd_tab_molekul_selected->get_element( index = sy-tabix ).

lo_el_tab_molekul_selected->set_attribute(

EXPORTING

value = ' '

name = 'CHANGED' ).

ENDLOOP.

IF strfocuscolumn IS NOT INITIAL.

lr_salv_wd_table = wd_this->wd_cpifc_alv_molekul_selected( ).

lr_salv_wd_table->set_focus(

index = itabix

column = strfocuscolumn ).

ELSE.

ret_ready = 'X'.

ENDIF.

Former Member
0 Kudos

Hi,

set the lead selection to the row which contains your cell.

Read the context node so it will give you a record as per the lead selection. then call the method

CALL METHOD lo_message_manager->report_attribute_t100_message

EXPORTING

msg = ls_msg " structure containing message from message class : type--> symsg

element = lo_el_alv " element as per the node containing alv data

attribute_name = 'REC1'. " contaxt attribute name

I hope this way it should work though i didnt try it

Regards

Vishal Kapoor