Creation Of Active Icon

By : Kartikeya Bommuluri - kari_003@rediffmail.com

REPORT CREATION_OF_ACTIVE_ICON.
INITIALIZATION. 
IMPORT mytab-activetab FROM MEMORY ID 'TABSTRIP'. 
CASE mytab-activetab. 
WHEN 'UCOMM1'. mytab-dynnr = 100. 
WHEN 'UCOMM2'. mytab-dynnr = 200. 
WHEN 'UCOMM3'. mytab-dynnr = 300. 
WHEN OTHERS. 
tabb1-dynnr = 100. 
ENDCASE. 

START-OF-SELECTION. 
EXPORT: tabb1-activetab TO MEMORY ID 'TABSTRIP'. 

SHORT VERSION. 

INITIALIZATION. 
IMPORT mytab FROM MEMORY ID 'TABSTRIP'. 

START-OF-SELECTION. 
EXPORT: mytab TO MEMORY ID 'TABSTRIP'.


SYNTAX FOR CREATING THE EXISTING CONTEXT MENU.::

FORM on_ctmenu_text USING menu TYPE REF TO cl_ctmenu.
  CALL METHOD menu->load_gui_status
                      EXPORTING program = prog
                                status  = 'CON_MENU'
                                menu    = menu .
  CALL METHOD  menu->set_default_function
                      EXPORTING fcode = 'list'.
ENDFORM.


CREATING A NEW CONTEXT MENU::

FORM on_ctmenu_text USING menu TYPE REF TO cl_ctmenu.
  DATA new_menu TYPE REF TO cl_ctmenu.
  CREATE OBJECT new_menu.
  CALL METHOD new_menu->add_function
                      EXPORTING fcode = 'list'
                                text  = text-001.

  CALL METHOD  new_menu->add_function
                       EXPORTING fcode = 'add'
                                 text  = text-002.  CALL METHOD  
 new_menu->add_function
                       EXPORTING fcode = 'delete'
                                text  = text-003.

  CALL METHOD   new_menu->add_submenu
                       EXPORTING menu = new_menu
                                 text = text-005.
ENDFORM


SYNTAX FOR STATUS ICON:


CALL FUNCTION 'ICON_CREATE'
   EXPORTING
    NAME = 'icon name'
    TEXT   = 'text to be displayed'
    INFO   = 'tooltip text'•    

Get help for your ABAP problems
ABAP Forum - Do you have a ABAP Question?

ABAP Programming Books
ABAP Books - Certification, BAPI, Java, Web Programming, Smart Forms, Sapscripts Reference Books

More ABAP Functions Tips
ABAP Functions Examples

ABAP Tips
ABAP Forum for Discussion and Samples Program Codes for Abapers

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.