Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

collaps / expand button - demo program

Former Member
0 Likes
768

Hi,

I know there is a example program in the SAP system to learn about hide ALV, tree-controls... -> e.g. ME21N -> there are collaps and expand buttons included.

Does anyone know the demo program to learn programing the buttons function? I cant find it.

thanks

mike

3 REPLIES 3
Read only

Former Member
0 Likes
582

Check the transaction

BIBS

Read only

Former Member
0 Likes
582

Check the below sample program:

REPORT ypra_sample36.

INCLUDE <icons>.

SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-003 NO

INTERVALS.

PARAMETERS: p_inst TYPE eanl-anlage MODIF ID new.

SELECTION-SCREEN: PUSHBUTTON 50(18) pbexco USER-COMMAND expcol

MODIF ID new.

PARAMETERS: p_status TYPE eanl-zzsptstatus MODIF ID exp.

SELECTION-SCREEN END OF BLOCK blk1.

AT SELECTION-SCREEN OUTPUT.

PERFORM set_expcol USING pbexco.

----


  • FORM set_expcol

----


FORM set_expcol USING button TYPE c.

IF button IS INITIAL OR button EQ '@K2\QHide@'.

CLEAR button.

CALL FUNCTION 'ICON_CREATE'

EXPORTING

name = icon_data_area_expand

info = text-001

IMPORTING

RESULT = button.

LOOP AT SCREEN.

IF screen-name = 'PBEXCO'.

screen-input = '1'.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'EXP'.

screen-input = '0'.

screen-invisible = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF button = '@K1\QShow@'.

CALL FUNCTION 'ICON_CREATE'

EXPORTING

name = icon_data_area_collapse

info = text-002

IMPORTING

RESULT = button.

LOOP AT SCREEN.

IF screen-group1 = 'EXP'.

screen-input = '1'.

screen-invisible = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

ENDFORM. "set_expcol

Text Elements:

001 Show

002 Hide

003 Installation data

Selection texts:

P_INST Installation No

P_STATUS Installation Status

This program is just a sample program with Expand and collapse button in selection screen.

Regards,

Prakash.

Regards,

Prakash.

Read only

Former Member