SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Эмуляция кнопок на тулбаре ALV



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
Сергей
Участник
Участник



Joined: 25 Oct 2007
Posts: 49

PostPosted: Fri Nov 23, 2007 1:15 pm    Post subject: Эмуляция кнопок на тулбаре ALV Reply with quote

Опять я со своими вопросами по объектному гриду.
В репорте создан GUI статус с набором кнопок, почти полностью совпадающими с набором кнопок в тулбаре ALV. На самом ALV его тулбар скрыт. Нажатие кнопок на GUI status нормально ловится и попадает в обработчик
MODULE USER_COMMAND_0100 INPUT.
вот в нем нужно вызвать (сэмулировать) соотвествующие нажатия кнопок на тулбаре в ALV, включая настройки layout и т.д.
Возможно?
Зачем это надо? Для совместимости с прошлой разработкой, чтобы было "один в один".
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 200
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Fri Nov 23, 2007 1:57 pm    Post subject: Reply with quote

Именно в том виде, как Вам нужно, не проверял, но в в документации по ALV
http://help.sap.com/saphelp_46c/helpdata/fr/0a/b55342d30911d2b467006094192fe3/content.htm

Quote:
set_user_command
Use
You can use this method to replace standard functions of the ALV Grid Control with self-defined functions. To do this, you must get the current function code in event before_user_command and change it using set_user_command.

Features
CALL METHOD <ref.var. to CL_GUI_ALV_GRID>->set_user_command
EXPORTING I_UCOMM = <var. of type SY-UCOMM>.
Parameter Meaning
I_UCOMM
Function code (function codes are defined as constant attributes of the class (and are prefixed with MC_FC_))
Back to top
View user's profile Send private message Blog Visit poster's website
vga
Мастер
Мастер


Age: 200
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Fri Nov 23, 2007 2:39 pm    Post subject: Reply with quote

Сорри, нужно использовать метод
set_function_code

Code:

MODULE user_command_0100 INPUT.
  MOVE sy-ucomm TO save_ok_code.
  CASE save_ok_code.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
    WHEN 'CANC'.
      LEAVE TO SCREEN 0.
    WHEN 'EXIT'.
      CALL METHOD g_custom_container->free.
      LEAVE PROGRAM.
    when others.
      call method grid_garn->set_function_code changing c_ucomm =
                                                          save_ok_code.
  ENDCASE.
ENDMODULE.
Back to top
View user's profile Send private message Blog Visit poster's website
Сергей
Участник
Участник



Joined: 25 Oct 2007
Posts: 49

PostPosted: Fri Nov 23, 2007 4:54 pm    Post subject: Reply with quote

Второй пример работает, спасибо! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.