2006 Oct 18 8:00 AM
Hi,
Can anyone explain me for what the SLIS type pool is used for?
Please explain me the following sub-routines.
PERFORM get_fieldcat USING 'SGTXT' 'Cheque Details' 50.
PERFORM get_eventcat CHANGING eventcat.
PERFORM get_top_of_page CHANGING list_top_of_page.
PERFORM start_list_viewer.
FORM get_fieldcat USING b_alvfield b_text b_size.
ADD 1 TO fieldcat_ln-col_pos.
fieldcat_ln-fieldname = b_alvfield.
fieldcat_ln-seltext_l = b_text.
fieldcat_ln-outputlen = b_size.
APPEND fieldcat_ln TO fieldcat.
ENDFORM. " get_fieldcat
FORM get_eventcat CHANGING p_event_cat TYPE slis_t_event.
CONSTANTS:
formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
DATA : ln_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_event_cat
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
READ TABLE p_event_cat WITH KEY name = slis_ev_top_of_page
INTO ln_event.
IF sy-subrc = 0.
MOVE formname_top_of_page TO ln_event-form.
APPEND ln_event TO p_event_cat.
ENDIF.
ENDFORM. " get_eventcat
FORM get_top_of_page CHANGING p_list_top_of_page.
DATA: topline TYPE slis_listheader.
CLEAR topline.
topline-typ = 'H'.
CONCATENATE 'User : ' sy-uname
INTO topline-info.
APPEND topline TO list_top_of_page.
topline = ' '.
APPEND topline TO list_top_of_page.
topline-typ = 'S'.
topline-info = 'Last 4 months Average Sales'.
APPEND topline TO list_top_of_page.
ENDFORM. " get_top_of_page
FORM start_list_viewer.
DATA : pgm LIKE sy-repid, t1(30) TYPE c.
t1 = 'USER_COMMAND'.
pgm = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = pgm
i_callback_user_command = t1
is_layout = layout
it_fieldcat = fieldcat
i_save = 'A' "To save variants
it_events = eventcat[] "heading
is_print = printalv
TABLES
t_outtab = i_bsad
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " start_list_viewer
I am new to this type of programming. Please explain me this sub-routines. Good explaination will be rewarded.
Best Regards
Renjan
Hi,
Can anyone explain me for what the SLIS type pool is used for?
Please explain me the following sub-routines.
PERFORM get_fieldcat USING 'SGTXT' 'Cheque Details' 50.
PERFORM get_eventcat CHANGING eventcat.
PERFORM get_top_of_page CHANGING list_top_of_page.
PERFORM start_list_viewer.
FORM get_fieldcat USING b_alvfield b_text b_size.
ADD 1 TO fieldcat_ln-col_pos.
fieldcat_ln-fieldname = b_alvfield.
fieldcat_ln-seltext_l = b_text.
fieldcat_ln-outputlen = b_size.
APPEND fieldcat_ln TO fieldcat.
ENDFORM. " get_fieldcat
FORM get_eventcat CHANGING p_event_cat TYPE slis_t_event.
CONSTANTS:
formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
DATA : ln_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_event_cat
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
READ TABLE p_event_cat WITH KEY name = slis_ev_top_of_page
INTO ln_event.
IF sy-subrc = 0.
MOVE formname_top_of_page TO ln_event-form.
APPEND ln_event TO p_event_cat.
ENDIF.
ENDFORM. " get_eventcat
FORM get_top_of_page CHANGING p_list_top_of_page.
DATA: topline TYPE slis_listheader.
CLEAR topline.
topline-typ = 'H'.
CONCATENATE 'User : ' sy-uname
INTO topline-info.
APPEND topline TO list_top_of_page.
topline = ' '.
APPEND topline TO list_top_of_page.
topline-typ = 'S'.
topline-info = 'Last 4 months Average Sales'.
APPEND topline TO list_top_of_page.
ENDFORM. " get_top_of_page
FORM start_list_viewer.
DATA : pgm LIKE sy-repid, t1(30) TYPE c.
t1 = 'USER_COMMAND'.
pgm = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = pgm
i_callback_user_command = t1
is_layout = layout
it_fieldcat = fieldcat
i_save = 'A' "To save variants
it_events = eventcat[] "heading
is_print = printalv
TABLES
t_outtab = i_bsad
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " start_list_viewer
I am new to this type of programming. Please explain me this sub-routines. Good explaination will be rewarded.
Best Regards
Renjan
2006 Oct 18 8:53 AM
Hi,
Type pool SLIS contains all the declarations related to buliding of following -
Fieldcatalog
Layout
Events
Grid Heading, and more
related to display an ALV on the screen.
We have to include it call all the definition in the program for usage.
Its simply like using a Perform where you are passing the values to assign to variables.
Regards,
Amit
2006 Oct 18 9:06 AM
HI,
Its nothing but abap code,
where some bunch of
TYPES (data types) and some data declaration,
is already done.
(which we can use in other programs)
(as the name suggests,
it is a pool (bunch)
of TYPES.
It is type-pool (bunch of types)
required for ALV purpose.
(eg. variable for field catalogue, alv layout etc)
Advantage is that we have to use such types,
just by referring, them, (bcos they are already defined)
Types-Pool contains the TYPE declaration which is global and can be used across any program.Once we write
TYPE-POOL : <pool name>
It will include all declariuon in the program and we can refer those.
There are many standard types pool provided by SAP
like SLIS,ICON,ABAP etc.
However also,we can create our own Type-Pool using
SE11->Type Group.
Regards,
Laxmi.
2006 Oct 18 10:01 AM
Hi Laxmi,
Do you have any soft copy of the notes for field catalog?
Best Regards
Renjan
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |