ToolBar Buttons Group Using CL_GUI_TOOLBAR


 

DATA lr_toolbar TYPE REF TO cl_gui_toolbar,
lr_cust_cont TYPE REF TO cl_gui_custom_container,
lt_btn TYPE ttb_button,
ls_btn TYPE stb_button.

CALL SCREEN 0001.
*&———————————————————————*
*&      Module  CREATE_PFSTATUS  OUTPUT
*&———————————————————————*

MODULE create_pfstatus OUTPUT.
SET PF-STATUS ‘STATUS’.
ENDMODULE.                 ” CREATE_PFSTATUS  OUTPUT
*&———————————————————————*
*&      Module  CREATE_TOOLBAR  OUTPUT
*&———————————————————————*
MODULE create_toolbar OUTPUT.
IF lr_cust_cont IS NOT BOUND.
CREATE OBJECT lr_cust_cont
EXPORTING
container_name ‘TOOLBAR’
repid          syrepid
dynnr          sydynnr.

ENDIF.

IF lr_toolbar IS NOT BOUND.
CREATE OBJECT lr_toolbar
EXPORTING
parent             lr_cust_cont
display_mode       cl_gui_toolbar=>m_mode_horizontal ” Display mode
name               ‘Demo Toolbar’
EXCEPTIONS
cntl_install_error 1
cntl_error         2
cntb_wrong_version 3
OTHERS             4.

ENDIF.

CLEAR ls_btn.
ls_btnbutn_type ‘0’.
ls_btnfunction ‘TSAVE’.
ls_btnicon ‘@2L@’.
ls_btntext ‘Save’.
APPEND ls_btn TO lt_btn.

CLEAR ls_btn.
ls_btnbutn_type ‘3’“Separator
APPEND ls_btn TO lt_btn.

CLEAR ls_btn.
ls_btnbutn_type ‘0’.
ls_btnfunction ‘EDIT’.
ls_btnicon ‘@TE@’.
ls_btntext ‘Edit’.
APPEND ls_btn TO lt_btn.

CLEAR ls_btn.
ls_btnbutn_type ‘3’” Separator
APPEND ls_btn TO lt_btn.

CLEAR ls_btn.
ls_btnbutn_type ‘0’.
ls_btnfunction ‘TCANCEL’.
ls_btnicon ‘@0W@’.
ls_btntext ‘Cancel’.
APPEND ls_btn TO lt_btn.

CALL METHOD lr_toolbar->add_button_group
EXPORTING
data_table       lt_btn
EXCEPTIONS
dp_error         1
cntb_error_fcode 2
OTHERS           3.

ENDMODULE.                 ” CREATE_TOOLBAR  OUTPUT
*&———————————————————————*
*&      Module  HANDLE_USERACTION  INPUT
*&———————————————————————*
MODULE handle_useraction INPUT.
CASE syucomm.
WHEN ‘BACK’ OR ‘EXIT’ OR ‘CANCEL’.
LEAVE TO SCREEN 0.
WHEN OTHERS.
ENDCASE.
ENDMODULE.                 ” HANDLE_USERACTION  INPUT


Screen flow logic.

 Screen layout with container.

Execute the program.


 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s