Posted: Fri Nov 23, 2007 1:15 pm Post subject: Эмуляция кнопок на тулбаре ALV
Опять я со своими вопросами по объектному гриду.
В репорте создан GUI статус с набором кнопок, почти полностью совпадающими с набором кнопок в тулбаре ALV. На самом ALV его тулбар скрыт. Нажатие кнопок на GUI status нормально ловится и попадает в обработчик
MODULE USER_COMMAND_0100 INPUT.
вот в нем нужно вызвать (сэмулировать) соотвествующие нажатия кнопок на тулбаре в ALV, включая настройки layout и т.д.
Возможно?
Зачем это надо? Для совместимости с прошлой разработкой, чтобы было "один в один".
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_))
Age: 175 Joined: 04 Oct 2007 Posts: 1218 Location: Санкт-Петербург
Posted: Fri Nov 23, 2007 2:39 pm Post subject:
Сорри, нужно использовать метод
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.
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.