‎2006 Aug 24 11:37 AM
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
‎2006 Aug 24 11:41 AM
‎2006 Aug 24 11:43 AM
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.
‎2006 Aug 24 12:21 PM
hi
good
go through these links
http://help.sap.com/saphelp_nw2004s/helpdata/en/e6/83a0375b5dd003e10000009b38f8cf/content.htm
thanks
mrutyun