2007 Dec 28 10:49 AM
Hi friends,
can any one give a sample program using the function module REUSE_ALV_EVENTS_GET or provide any links.
points will be awarded..
Regards and Thanks
Vijaya
2007 Dec 28 10:57 AM
Hi,
Check out this code,
data: ist_fcat TYPE slis_t_fieldcat_alv, "fieldcat table
g_layout type slis_layout_alv, "layout work area
events type slis_t_event,
event type slis_alv_event,
heading type slis_t_listheader,
hline type slis_listheader,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = g_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = g_layout
it_fieldcat = ist_fcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
i_save = 'X'
is_variant = variant
it_events = events[]
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = ist_main[]
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.
fill the heading part in the top of page.
FORM build_comments .
DATA: text(50).
CLEAR hline.
hline-typ = 'H'.
hline-info = 'S&OP'.
APPEND hline TO heading.
CLEAR: hline,text.
hline-typ = 'S'.
WRITE: 'Date :' TO text.
WRITE: p_endda TO text+10.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_pernr-low IS NOT INITIAL.
WRITE: 'Sal Code:' TO text.
WRITE: s_pernr-low TO text+15.
ENDIF.
IF s_pernr-high IS NOT INITIAL.
WRITE: 'to' TO text+25.
WRITE: s_pernr-high TO text+28.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_bukrs-low IS NOT INITIAL.
WRITE: 'Company Code:' TO text.
WRITE: s_bukrs-low TO text+15.
ENDIF.
IF s_bukrs-high IS NOT INITIAL.
WRITE: 'to' TO text+23.
WRITE: s_bukrs-high TO text+26.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_werks-low IS NOT INITIAL.
WRITE: 'Personal area:' TO text.
WRITE: s_werks-low TO text+15.
ENDIF.
IF s_werks-high IS NOT INITIAL.
WRITE: 'to' TO text+23.
WRITE: s_werks-high TO text+26.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_ansvh-low IS NOT INITIAL.
WRITE: 'Work contract:' TO text.
WRITE: s_ansvh-low TO text+15.
ENDIF.
IF s_ansvh-high IS NOT INITIAL.
WRITE: 'to' TO text+23.
WRITE: s_ansvh-high TO text+26.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_btrtl-low IS NOT INITIAL.
WRITE: 'Personnel subarea:' TO text.
WRITE: s_btrtl-low TO text+20.
ENDIF.
IF s_btrtl-high IS NOT INITIAL.
WRITE: 'to' TO text+26.
WRITE: s_btrtl-high TO text+30.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_persg-low IS NOT INITIAL.
WRITE: 'Employee group:' TO text.
WRITE: s_persg-low TO text+17.
ENDIF.
IF s_persg-high IS NOT INITIAL.
WRITE: 'to' TO text+23.
WRITE: s_persg-high TO text+26.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_persk-low IS NOT INITIAL.
WRITE: 'Employee subgroup:' TO text.
WRITE: s_persk-low TO text+20.
ENDIF.
IF s_persk-high IS NOT INITIAL.
WRITE: 'to' TO text+26.
WRITE: s_persk-high TO text+30.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
Fill the event part.
FORM get_events .
CLEAR event.
event-name = slis_ev_top_of_page.
event-form = form_name "subroutine name ie . top_of_page.
APPEND event TO events.
ENDFORM. " get_events
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = heading[]
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
.
ENDFORM. "TOP_OF_PAGE
regards,
Santosh Thorat
2007 Dec 28 10:54 AM
Hi,
You can standard program BCALV_TEST_FULLSCREEN_EVENTS.
Thanks,
Sriram Ponna.
2007 Dec 28 10:57 AM
Hi
Check the sample program BCALV_TEST_LIST_EVENTS.
Thanks
Sharath.
2007 Dec 28 10:57 AM
Hi,
Check out this code,
data: ist_fcat TYPE slis_t_fieldcat_alv, "fieldcat table
g_layout type slis_layout_alv, "layout work area
events type slis_t_event,
event type slis_alv_event,
heading type slis_t_listheader,
hline type slis_listheader,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = g_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = g_layout
it_fieldcat = ist_fcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
i_save = 'X'
is_variant = variant
it_events = events[]
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = ist_main[]
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.
fill the heading part in the top of page.
FORM build_comments .
DATA: text(50).
CLEAR hline.
hline-typ = 'H'.
hline-info = 'S&OP'.
APPEND hline TO heading.
CLEAR: hline,text.
hline-typ = 'S'.
WRITE: 'Date :' TO text.
WRITE: p_endda TO text+10.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_pernr-low IS NOT INITIAL.
WRITE: 'Sal Code:' TO text.
WRITE: s_pernr-low TO text+15.
ENDIF.
IF s_pernr-high IS NOT INITIAL.
WRITE: 'to' TO text+25.
WRITE: s_pernr-high TO text+28.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_bukrs-low IS NOT INITIAL.
WRITE: 'Company Code:' TO text.
WRITE: s_bukrs-low TO text+15.
ENDIF.
IF s_bukrs-high IS NOT INITIAL.
WRITE: 'to' TO text+23.
WRITE: s_bukrs-high TO text+26.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_werks-low IS NOT INITIAL.
WRITE: 'Personal area:' TO text.
WRITE: s_werks-low TO text+15.
ENDIF.
IF s_werks-high IS NOT INITIAL.
WRITE: 'to' TO text+23.
WRITE: s_werks-high TO text+26.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_ansvh-low IS NOT INITIAL.
WRITE: 'Work contract:' TO text.
WRITE: s_ansvh-low TO text+15.
ENDIF.
IF s_ansvh-high IS NOT INITIAL.
WRITE: 'to' TO text+23.
WRITE: s_ansvh-high TO text+26.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_btrtl-low IS NOT INITIAL.
WRITE: 'Personnel subarea:' TO text.
WRITE: s_btrtl-low TO text+20.
ENDIF.
IF s_btrtl-high IS NOT INITIAL.
WRITE: 'to' TO text+26.
WRITE: s_btrtl-high TO text+30.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_persg-low IS NOT INITIAL.
WRITE: 'Employee group:' TO text.
WRITE: s_persg-low TO text+17.
ENDIF.
IF s_persg-high IS NOT INITIAL.
WRITE: 'to' TO text+23.
WRITE: s_persg-high TO text+26.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
CLEAR: hline,text.
IF s_persk-low IS NOT INITIAL.
WRITE: 'Employee subgroup:' TO text.
WRITE: s_persk-low TO text+20.
ENDIF.
IF s_persk-high IS NOT INITIAL.
WRITE: 'to' TO text+26.
WRITE: s_persk-high TO text+30.
ENDIF.
hline-typ = 'S'.
hline-info = text.
APPEND hline TO heading.
Fill the event part.
FORM get_events .
CLEAR event.
event-name = slis_ev_top_of_page.
event-form = form_name "subroutine name ie . top_of_page.
APPEND event TO events.
ENDFORM. " get_events
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = heading[]
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
.
ENDFORM. "TOP_OF_PAGE
regards,
Santosh Thorat
2007 Dec 28 10:58 AM
hi,
check this sample program.
REPORT zstemp_qty2_ NO STANDARD PAGE HEADING LINE-SIZE 650
MESSAGE-ID zmde .
TYPE-POOLS: slis.
*type declaration for values from ekko
TYPES: BEGIN OF i_ekko,
ebeln LIKE ekko-ebeln,
aedat LIKE ekko-aedat,
bukrs LIKE ekko-bukrs,
bsart LIKE ekko-bsart,
lifnr LIKE ekko-lifnr,
END OF i_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF i_ekko INITIAL SIZE 0,
wa_ekko TYPE i_ekko.
*type declaration for values from ekpo
TYPES: BEGIN OF i_ekpo,
ebeln LIKE ekpo-ebeln,
ebelp LIKE ekpo-ebelp,
matnr LIKE ekpo-matnr,
menge LIKE ekpo-menge,
meins LIKE ekpo-meins,
netpr LIKE ekpo-netpr,
END OF i_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF i_ekpo INITIAL SIZE 0,
wa_ekpo TYPE i_ekpo .
*variable for Report ID
DATA: v_repid LIKE sy-repid .
*declaration for fieldcatalog
DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA: it_listheader TYPE slis_t_listheader.
*declaration for events table where user comand or set PF status will
*be defined
DATA: v_events TYPE slis_t_event,
wa_event TYPE slis_alv_event.
*declartion for layout
DATA: alv_layout TYPE slis_layout_alv.
*declaration for variant(type of display we want)
DATA: i_variant TYPE disvariant,
i_variant1 TYPE disvariant,
i_save(1) TYPE c.
*PARAMETERS : p_var TYPE disvariant-variant.
*Title displayed when the alv list is displayed
DATA: i_title_ekko TYPE lvc_title VALUE 'FIRST LIST DISPLAYED'.
DATA: i_title_ekpo TYPE lvc_title VALUE 'SECONDRY LIST DISPLAYED'.
INITIALIZATION.
v_repid = sy-repid.
PERFORM build_fieldcatlog.
PERFORM event_call.
PERFORM populate_event.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_listheader USING it_listheader.
PERFORM display_alv_report.
*&----
*& Form BUILD_FIELDCATLOG
*&----
*Fieldcatalog has all the field details from ekko
*----
FORM build_fieldcatlog.
wa_fieldcat-tabname = 'IT_EKKO'.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-seltext_m = 'PO NO.'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_EKKO'.
wa_fieldcat-fieldname = 'AEDAT'.
wa_fieldcat-seltext_m = 'DATE.'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_EKKO'.
wa_fieldcat-fieldname = 'BUKRS'.
wa_fieldcat-seltext_m = 'COMPANY CODE'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_EKKO'.
wa_fieldcat-fieldname = 'BUKRS'.
wa_fieldcat-seltext_m = 'DOCMENT TYPE'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_EKKO'.
wa_fieldcat-fieldname = 'LIFNR'.
wa_fieldcat-no_out = 'X'.
wa_fieldcat-seltext_m = 'VENDOR CODE'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. "BUILD_FIELDCATLOG
*&----
**& Form EVENT_CALL
*&----
*
*
*we get all events - TOP OF PAGE or USER COMMAND in table v_events
*----
FORM event_call.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = v_events
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
IF sy-subrc EQ 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. "EVENT_CALL
*&----
**& Form POPULATE_EVENT
*&----
*
*Events populated for TOP OF PAGE & USER COMAND
*----
FORM populate_event.
READ TABLE v_events INTO wa_event WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc EQ 0.
wa_event-form = 'TOP_OF_PAGE'.
MODIFY v_events FROM wa_event TRANSPORTING form WHERE name =
wa_event-form.
ENDIF.
READ TABLE v_events INTO wa_event WITH KEY name = 'USER_COMMAND'.
IF sy-subrc EQ 0.
wa_event-form = 'USER_COMMAND'.
MODIFY v_events FROM wa_event TRANSPORTING form WHERE name =
wa_event-name.
ENDIF.
ENDFORM. "POPULATE_EVENT
*&----
**& Form data_retrieval
*
*retreiving values from the database table ekko
*----
FORM data_retrieval.
SELECT ebeln aedat bukrs bsart lifnr FROM ekko INTO TABLE it_ekko.
ENDFORM. "data_retrieval
*&----
**& Form bUild_listheader
*-->I_LISTHEADEtext
*----
FORM build_listheader USING i_listheader TYPE slis_t_listheader.
DATA hline TYPE slis_listheader.
hline-info = 'this is my first alv pgm'.
hline-typ = 'H'.
ENDFORM. "build_listheader
*&----
**& Form display_alv_report
*----
FORM display_alv_report.
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_pf_status_set = ' '
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_grid_title = i_title_ekko
*I_GRID_SETTINGS =
is_layout = alv_layout
it_fieldcat = i_fieldcat[]
*IT_EXCLUDING =
*IT_SPECIAL_GROUPS =
*IT_SORT =
*IT_FILTER =
*IS_SEL_HIDE =
i_default = 'ZLAY1'
i_save = 'A'
is_variant = i_variant
it_events = v_events
TABLES
t_outtab = it_ekko
EXCEPTIONS
program_error = 1
OTHERS = 2
.
IF sy-subrc EQ 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. "display_alv_report
*&----
**& Form TOP_OF_PAGE
*----
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader
*
*i_logo =
*I_END_OF_LIST_GRID =
.
ENDFORM. "TOP_OF_PAGE
*&----
**& Form USER_COMMAND
*----
*
*-->R_UCOMM text
*-->, text
*-->RS_SLEFIELDtext
*----
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
PERFORM build_fieldcatlog_ekpo.
PERFORM event_call_ekpo.
PERFORM populate_event_ekpo.
PERFORM data_retrieval_ekpo.
PERFORM build_listheader_ekpo USING it_listheader.
PERFORM display_alv_ekpo.
ENDCASE.
ENDFORM. "user_command
*&----
**& Form BUILD_FIELDCATLOG_EKPO
*----
FORM build_fieldcatlog_ekpo.
wa_fieldcat-tabname = 'IT_EKPO'.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-seltext_m = 'PO NO.'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_EKPO'.
wa_fieldcat-fieldname = 'EBELP'.
wa_fieldcat-seltext_m = 'LINE NO'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_EKPO'.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-seltext_m = 'MATERIAL NO.'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_EKPO'.
wa_fieldcat-fieldname = 'MENGE'.
wa_fieldcat-seltext_m = 'QUANTITY'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_EKPO'.
wa_fieldcat-fieldname = 'MEINS'.
wa_fieldcat-seltext_m = 'UOM'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_EKPO'.
wa_fieldcat-fieldname = 'NETPR'.
wa_fieldcat-seltext_m = 'PRICE'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. "BUILD_FIELDCATLOG_EKPO
*&----
**& Form event_call_ekpo
*&----
*we get all events - TOP OF PAGE or USER COMMAND in table v_events
*----
FORM event_call_ekpo.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = v_events
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
IF sy-subrc EQ 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. "event_call_ekpo
*&----
**& Form POPULATE_EVENT
*&----
*Events populated for TOP OF PAGE & USER COMAND
*----
FORM populate_event_ekpo.
READ TABLE v_events INTO wa_event WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc EQ 0.
wa_event-form = 'TOP_OF_PAGE'.
MODIFY v_events FROM wa_event TRANSPORTING form WHERE name =
wa_event-form.
ENDIF.
ENDFORM. "POPULATE_EVENT
*&----
**& Form TOP_OF_PAGE
*&----
FORM f_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader
*i_logo =
*I_END_OF_LIST_GRID =
.
ENDFORM. "TOP_OF_PAGE
*&----
**& Form USER_COMMAND
*-->R_UCOMM text
*-->, text
*-->RS_SLEFIELDtext
*----
*
*retreiving values from the database table ekko
FORM data_retrieval_ekpo.
SELECT ebeln ebelp matnr menge meins netpr FROM ekpo INTO TABLE it_ekpo.
ENDFORM.
----
FORM BUILD_LISTHEADER_EKPO *
----
........ *
----
--> I_LISTHEADER *
----
FORM build_listheader_ekpo USING i_listheader TYPE slis_t_listheader.
DATA: hline1 TYPE slis_listheader.
hline1-typ = 'H'.
hline1-info = 'CHECKING PGM'.
ENDFORM.
----
FORM DISPLAY_ALV_EKPO *
----
........ *
----
FORM display_alv_ekpo.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_interface_check = ' '
i_bypassing_buffer = ' '
i_buffer_active = ' '
i_callback_program = v_repid
i_callback_pf_status_set = ' '
i_callback_user_command = 'F_USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_callback_html_top_of_page = ' '
i_callback_html_end_of_list = ' '
*I_STRUCTURE_NAME =
i_background_id = ' '
i_grid_title = i_title_ekpo
*I_GRID_SETTINGS =
*IS_LAYOUT =
it_fieldcat = i_fieldcat[]
*
*IT_EXCLUDING =
*IT_SPECIAL_GROUPS =
*IT_SORT =
*IT_FILTER =
*IS_SEL_HIDE =
*I_DEFAULT =
i_save = 'A'
*IS_VARIANT =
it_events = v_events
TABLES
t_outtab = it_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2
.
IF sy-subrc EQ 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM.
Regds
Sivaparvathi
Please reward points if helpful..
2007 Dec 28 10:59 AM
Hi
check out the Perform PERFORM GET_EVENTS in the code below.
&----
*& Report ZALV_SALES *
*& *
&----
*& *
*& *
&----
REPORT ZALV_SALES NO STANDARD PAGE HEADING
MESSAGE-ID Z00.
*..Type Definitions for ALV Report
TYPE-POOLS SLIS.
----
Table Declarations. *
----
TABLES: VBAK, "Sales Document: Header Data
VBAP, "Sales Document: Item Data
VBUK, "Sales Document: Header Status and Administrative Data
KNA1, "Customer Master
KONV, "Conditions (Transaction Data)
VBKD, "Sales Document: Business Data
MARA, "Material Master
TVTA. "Organizational Unit: Sales Area(s)
----
----
*......................................................................
Internal table to store final data
*----
DATA: BEGIN OF IT_FINAL OCCURS 0,
KUNNR LIKE VBAk-KUNNR, "Sold-To Party
KNUMV LIKE VBAK-KNUMV, "Number of the document condition
VBELN LIKE VBAK-VBELN, "Sales Document
AUDAT LIKE VBAK-AUDAT, "Document Date
VKORG LIKE VBAK-VKORG, "Sales Organisation
NETWR LIKE VBAK-NETWR, "Net Value
VTWEG LIKE VBAK-VTWEG, "Distribution Channel
SPART LIKE VBAK-SPART, "Division
POSNR LIKE VBAP-POSNR, "Billing Item
MATNR LIKE VBAP-MATNR, "Material Number
ARKTX LIKE VBAP-ARKTX, "Short Txt For Sales Ord Item
KWMENG LIKE VBAP-KWMENG, "Cuml Order QTY In Sales Item
WERKS LIKE VBAP-WERKS, "Plant
LGORT LIKE VBAP-LGORT, "Storage Location
NETPR LIKE VBAP-NETPR, "Net Price
BSTDK LIKE VBKD-BSTDK, "Customer purchase order date
I_SHIPTO LIKE VBPA-KUNNR, "Customer Number
END OF IT_FINAL.
*......................................................................
Internal table to store data AT LINE SELECTION
*----
DATA: BEGIN OF IT_SEL OCCURS 0,
"VBELN LIKE VBAK-VBELN, "Sales Document
"KNUMV LIKE KONV-KNUMV, "Number of the document condition
KPOSN LIKE KONV-KPOSN, "Condition item number
KSCHL LIKE KONV-KSCHL, "Condition type
KBETR LIKE KONV-KBETR, "Rate
KWERT LIKE KONV-KWERT, "Condition value
I_VTEXT LIKE T685T-VTEXT, "Text
END OF IT_SEL.
----
ALV Type declaration *
----
*..Field Catalog for Basic List.
DATA:IT_FIELDCAT_HEADER TYPE SLIS_T_FIELDCAT_ALV ,
WA_FIELDCAT_HEADER TYPE SLIS_FIELDCAT_ALV. "work area for Header
*..Field Catalog for Secondary List.
DATA:IT_FIELDCAT_ITEM TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT_ITEM TYPE SLIS_FIELDCAT_ALV. "work area
*..Events For Basic List.
DATA:IT_EVENTS TYPE SLIS_T_EVENT,
WA_EVENTS TYPE SLIS_ALV_EVENT. "work area
*..FOR SECONDARY LIST :to Capture Events
DATA : IT_EVENTS_ITEM TYPE SLIS_T_EVENT,
WA_EVENTS_ITEM TYPE SLIS_ALV_EVENT.
*..Layout For Basic List
DATA : WA_LAYOUT_HEADER TYPE SLIS_LAYOUT_ALV.
*..Layout for Secondary list
DATA :WA_LAYOUT_ITEM TYPE SLIS_LAYOUT_ALV.
----
DATA DECLARATIONS *
----
DATA: SELKNUMV TYPE VBAK-KNUMV,
VINDEX TYPE SY-TABIX.
*..To Store Program Name
DATA: V_REPID TYPE SYREPID,
*..To know whether basic list contains any data
V_FLAG TYPE C.
----
Selection Screen. *
----
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-H01.
PARAMETERS: P_VKORG LIKE VBAK-VKORG ,
P_VTWEG LIKE VBAK-VTWEG,
P_SPART LIKE VBAK-SPART.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN,
S_AUDAT FOR VBAK-AUDAT,
S_KUNNR FOR KNA1-KUNNR,
S_MATNR FOR MARA-MATNR.
PARAMETERS: OPNORDER RADIOBUTTON GROUP RAD1,
ALLORDER RADIOBUTTON GROUP RAD1.
SELECTION-SCREEN END OF BLOCK B1.
----
Event:Initialization *
----
INITIALIZATION.
*Report Name
V_REPID = SY-REPID.
----
AT Selection Screen. *
----
AT SELECTION-SCREEN.
PERFORM VALIDATIONS.
----
Event: Start-of-Selection *
----
START-OF-SELECTION.
&----
To get data into final internal table IT_FINAL for ALL ORDERS
----
IF ALLORDER = 'X'.
PERFORM FETCH_FINAL_DATA.
&----
To get data into final internal table IT_FINAL for OPEN ORDERS
----
ELSE .
PERFORM FETCH_OPEN_DATA.
ENDIF.
----
Event: End-of-Selection *
----
END-OF-SELECTION.
IF V_FLAG = ''.
MESSAGE I010 WITH 'NO DATA TO BE DISPLAYED '.
EXIT.
ELSE.
PERFORM DISPLAY_REPORT.
PERFORM FILL_FIELD_CATALOG_HEADER.
PERFORM GET_LAYOUT.
PERFORM GET_EVENTS.
PERFORM DISPLAY_BASIC_LIST.
ENDIF.
//////////////////////////////////////////////////////////////////////
*
FORM DEFINITIONS *
*
*//////////////////////////////////////////////////////////////////////
&----
*& Form VALIDATIONS
&----
To validate data entered in selection screen
----
--> p1 text
<-- p2 text
----
FORM VALIDATIONS.
&----
To validate sales document
----
PERFORM VALIDATE_VBELN.
&----
To validate customer number
----
PERFORM VALIDATE_KUNNR.
&----
To validate material number
----
PERFORM VALIDATE_MATNR.
&----
To validate sales organisation
----
PERFORM VALIDATE_VKORG.
&----
To validate distribution channel
----
PERFORM VALIDATE_VTWEG.
&----
To validate division
----
PERFORM VALIDATE_SPART.
ENDFORM. " VALIDATIONS
&----
*& Form VALIDATE_VBELN
&----
To validate sales document
----
--> p1 text
<-- p2 text
----
FORM VALIDATE_VBELN.
IF NOT S_VBELN[] IS INITIAL.
SELECT VBELN
UP TO 1 ROWS
INTO (VBAK-VBELN)
FROM VBAK
WHERE VBELN IN S_VBELN.
ENDSELECT.
ENDIF.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH TEXT-002.
ENDIF.
ENDFORM. " VALIDATE_VBELN
&----
*& Form VALIDATE_KUNNR
&----
To validate customer number
----
--> p1 text
<-- p2 text
----
FORM VALIDATE_KUNNR.
IF NOT S_KUNNR[] IS INITIAL.
SELECT KUNNR
UP TO 1 ROWS
INTO (VBAK-KUNNR)
FROM KNA1
WHERE KUNNR IN S_KUNNR.
ENDSELECT.
ENDIF.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH TEXT-003.
ENDIF.
ENDFORM. " VALIDATE_KUNNR
&----
*& Form VALIDATE_MATNR
&----
To validate material number
----
--> p1 text
<-- p2 text
----
FORM VALIDATE_MATNR.
IF NOT S_MATNR[] IS INITIAL.
SELECT MATNR
UP TO 1 ROWS
INTO (VBAP-MATNR)
FROM MARA
WHERE MATNR IN S_MATNR.
ENDSELECT.
ENDIF.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH TEXT-004.
ENDIF.
ENDFORM. " VALIDATE_MATNR
&----
*& Form VALIDATE_VKORG
&----
To validate sales organisation
----
--> p1 text
<-- p2 text
----
FORM VALIDATE_VKORG.
IF NOT P_VKORG IS INITIAL.
SELECT SINGLE VKORG
INTO (VBAK-VKORG)
FROM TVKO
WHERE VKORG LIKE P_VKORG.
ENDIF.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH TEXT-005.
ENDIF.
ENDFORM. " VALIDATE_VKORG
&----
*& Form VALIDATE_VTWEG
&----
To validate distribution channel
----
--> p1 text
<-- p2 text
----
FORM VALIDATE_VTWEG.
IF NOT P_VTWEG IS INITIAL.
SELECT SINGLE VTWEG
INTO (VBAK-VTWEG)
FROM TVKOV
WHERE VTWEG LIKE P_VTWEG.
ENDIF.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH TEXT-006.
ENDIF.
ENDFORM. " VALIDATE_VTWEG
&----
*& Form VALIDATE_SPART
&----
To validate division
----
--> p1 text
<-- p2 text
----
FORM VALIDATE_SPART.
IF NOT P_SPART IS INITIAL.
SELECT SINGLE SPART
INTO (VBAK-SPART)
FROM TVTA
WHERE SPART LIKE P_SPART.
ENDIF.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH TEXT-007.
ENDIF.
ENDFORM. " VALIDATE_SPART
&----
*& Form FETCH_OPEN_DATA
&----
To get data into table IT_FINAL for open orders
----
--> p1 text
<-- p2 text
----
FORM FETCH_OPEN_DATA.
SELECT A~VBELN
A~VKORG
A~VTWEG
A~SPART
A~AUDAT
A~KUNNR
A~NETWR
A~KNUMV
B~POSNR
B~MATNR
B~ARKTX
B~KWMENG
B~WERKS
B~LGORT
B~NETPR
INTO CORRESPONDING FIELDS OF TABLE IT_FINAL
FROM VBAK AS A
INNER JOIN VBAP AS B
ON AVBELN = BVBELN
INNER JOIN VBUK
ON BVBELN = VBUKVBELN
WHERE A~VBELN IN S_VBELN
AND AUDAT IN S_AUDAT
AND KUNNR IN S_KUNNR
AND MATNR IN S_MATNR
AND VKORG = P_VKORG
AND VTWEG = P_VTWEG
AND A~SPART = P_SPART
AND VBUK~GBSTK <> 'C'.
PERFORM VALIDATE_ITEMLEVEL.
IF SY-SUBRC <> 0.
V_FLAG = SPACE.
MESSAGE E000 WITH 'No data found for the selection criteria'.
EXIT.
ELSE.
V_FLAG = 'X'.
ENDIF.
ENDFORM. " FETCH_OPEN_DATA
&----
*& Form FETCH_FINAL_DATA
&----
To get data into table IT_FINAL for all orders
----
--> p1 text
<-- p2 text
----
FORM FETCH_FINAL_DATA.
SELECT A~VBELN
A~VKORG
A~VTWEG
A~SPART
A~AUDAT
A~KUNNR
A~NETWR
A~KNUMV
B~POSNR
B~MATNR
B~ARKTX
B~KWMENG
B~WERKS
B~LGORT
B~NETPR
INTO CORRESPONDING FIELDS OF TABLE IT_FINAL
FROM VBAK AS A
INNER JOIN VBAP AS B
ON AVBELN = BVBELN
WHERE A~VBELN IN S_VBELN
AND AUDAT IN S_AUDAT
AND KUNNR IN S_KUNNR
AND MATNR IN S_MATNR
AND VKORG = P_VKORG
AND VTWEG = P_VTWEG
AND A~SPART = P_SPART.
PERFORM VALIDATE_ITEMLEVEL.
IF SY-SUBRC <> 0.
V_FLAG = SPACE.
MESSAGE E000 WITH 'No data found for the selection criteria'.
EXIT.
ELSE.
V_FLAG = 'X'.
ENDIF.
ENDFORM. " FETCH_FINAL_DATA
&----
*& Form VALIDATE_ITEMLEVEL
&----
To validate and get item level data
----
--> p1 text
<-- p2 text
----
FORM VALIDATE_ITEMLEVEL .
IF NOT IT_FINAL[] IS INITIAL.
LOOP AT IT_FINAL.
VINDEX = SY-TABIX.
SELECT SINGLE KUNNR
FROM VBPA
INTO IT_FINAL-I_SHIPTO
WHERE VBELN = IT_FINAL-VBELN
AND POSNR = IT_FINAL-POSNR
AND PARVW = 'WE'.
IF SY-SUBRC <> 0.
SELECT SINGLE KUNNR
FROM VBPA
INTO IT_FINAL-I_SHIPTO
WHERE VBELN = IT_FINAL-VBELN
AND POSNR = '000000'
AND PARVW = 'WE'.
ENDIF.
SELECT SINGLE BSTDK FROM
VBKD INTO
IT_FINAL-BSTDK
WHERE VBELN = IT_FINAL-VBELN AND
POSNR = IT_FINAL-POSNR.
IF SY-SUBRC <> 0.
SELECT SINGLE BSTDK FROM
VBKD INTO
IT_FINAL-BSTDK
WHERE VBELN = IT_FINAL-VBELN AND
POSNR = '000000'.
ENDIF.
MODIFY IT_FINAL INDEX VINDEX TRANSPORTING KUNNR BSTDK .
ENDLOOP.
ENDIF.
ENDFORM. " VALIDATE_ITEMLEVEL
&----
*& Form FILL_FIELD_CATALOG_HEADER
&----
text : TO FILL HEADER DETAILS OF VBRK .
----
--> p1 text
<-- p2 text
----
FORM FILL_FIELD_CATALOG_HEADER.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'IT_FINAL'
I_INCLNAME = V_REPID
CHANGING
CT_FIELDCAT = IT_FIELDCAT_HEADER
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT IT_FIELDCAT_HEADER INTO WA_FIELDCAT_HEADER.
CASE WA_FIELDCAT_HEADER-FIELDNAME.
WHEN 'VBELN'.
*
WA_FIELDCAT_HEADER-COL_POS = '1'.
WA_FIELDCAT_HEADER-JUST = 'C'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '15'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Bill Doc No'. " long key word
WA_FIELDCAT_HEADER-SELTEXT_M = 'Bill No'. " middle key word
WA_FIELDCAT_HEADER-SELTEXT_S = 'VBELN ' . " short text
WA_FIELDCAT_HEADER-HOTSPOT = 'X'.
WHEN 'VKORG'.
WA_FIELDCAT_HEADER-COL_POS = '2'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '10'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'SALES ORG'.
WHEN 'AUDAT'.
WA_FIELDCAT_HEADER-COL_POS = '3'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '15'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Docu Date'.
WHEN 'VTWEG'.
WA_FIELDCAT_HEADER-COL_POS = '4'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '10'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Dist Chnl'.
WHEN 'NETWR'.
WA_FIELDCAT_HEADER-COL_POS = '5'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '22'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Net Value'.
WA_FIELDCAT_HEADER-DO_SUM = 'X'.
WHEN 'SPART'.
WA_FIELDCAT_HEADER-COL_POS = '6'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '10'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Division'.
WHEN 'KUNNR'.
WA_FIELDCAT_HEADER-COL_POS = '7'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '12'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Sold party'.
WHEN 'POSNR'.
WA_FIELDCAT_HEADER-COL_POS = '8'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '10'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Bill Item'.
WHEN 'MATNR'.
WA_FIELDCAT_HEADER-COL_POS = '9'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '20'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Mat No'.
WHEN 'ARKTX'.
WA_FIELDCAT_HEADER-COL_POS = '10'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '42'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Text'.
WHEN 'KWMENG'.
WA_FIELDCAT_HEADER-COL_POS = '11'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '20'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Order Qty'.
WHEN 'NETPR'.
WA_FIELDCAT_HEADER-COL_POS = '12'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '22'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Net Price'.
WA_FIELDCAT_HEADER-DO_SUM = 'X'.
WHEN 'WERKS'.
WA_FIELDCAT_HEADER-COL_POS = '13'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '13'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Plant'.
WHEN 'LGORT'.
WA_FIELDCAT_HEADER-COL_POS = '14'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '10'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Str Loc'.
WHEN 'BSTDK'.
WA_FIELDCAT_HEADER-COL_POS = '15'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '14'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Pr Ord Dt'.
WHEN 'SHIPTO'.
WA_FIELDCAT_HEADER-COL_POS = '16'.
WA_FIELDCAT_HEADER-OUTPUTLEN = '10'.
WA_FIELDCAT_HEADER-SELTEXT_L = 'Ship To'.
ENDCASE.
*
MODIFY IT_FIELDCAT_HEADER FROM WA_FIELDCAT_HEADER INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " FILL_FIELD_CATALOG_HEADER
&----
*& Form DISPLAY_BASIC_LIST
&----
text
----
--> p1 text
<-- p2 text
----
FORM DISPLAY_BASIC_LIST.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME = ''
IS_LAYOUT = WA_LAYOUT_HEADER
IT_FIELDCAT = IT_FIELDCAT_HEADER
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = IT_EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_FINAL
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. " DISPLAY_BASIC_LIST
&----
*& Form get_events
&----
text:TO GET THE EVENTS IN THE BASIC LIST .
2 EVENTS ARE USED .
1. TOP_OF_PAGE.
2. USER_COMMAND.
----
--> p1 text
<-- p2 text
----
FORM GET_EVENTS.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = IT_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 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.
LOOP AT IT_EVENTS INTO WA_EVENTS.
CASE WA_EVENTS-NAME.
WHEN 'TOP_OF_PAGE'.
WA_EVENTS-FORM = 'FILL_LIST_HEADER'.
WHEN 'USER_COMMAND'.
WA_EVENTS-FORM = 'PROCESS_BASIC_LIST'.
ENDCASE.
MODIFY IT_EVENTS FROM WA_EVENTS INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " get_events
----
FORM FILL_LIST_HEADER *
----
........ *
----
FORM FILL_LIST_HEADER.
WRITE:2'Report :' , sy-repid,
: 98 ' company' CENTERED,
: 189 'Date :' ,sy-datum,
:/2'User :', sy-uname,
: 95 ' Hyderabad ' CENTERED ,
: 189 'Pg.No :' ,sy-pagno,
:/96 ' Sales Order Report ' CENTERED.
SKIP 2.
ENDFORM.
----
PROCESS_BASIC_LIST *
----
........ *
----
FORM PROCESS_BASIC_LIST USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'. "DOUBLE CLICK
READ TABLE IT_FINAL INDEX RS_SELFIELD-TABINDEX.
IF SY-LSIND = 1.
SELECT SINGLE KNUMV
INTO SELKNUMV
FROM VBAK
WHERE VBELN EQ IT_FINAL-VBELN.
" MOVE SELKNUMV TO IT_SEL-KNUMV.
SELECT
"KONV~KNUMV
KONV~KPOSN
KONV~KSCHL
KONV~KBETR
KONV~KWERT
INTO CORRESPONDING FIELDS OF TABLE IT_SEL
FROM KONV
WHERE KNUMV EQ SELKNUMV.
IF NOT IT_SEL[] IS INITIAL.
LOOP AT IT_SEL.
VINDEX = SY-TABIX.
SELECT SINGLE VTEXT
FROM T685T
INTO IT_SEL-I_VTEXT
WHERE KSCHL = IT_SEL-KSCHL AND
SPRAS = SY-LANGU AND
KVEWE = 'A' AND
KAPPL = 'V'.
MODIFY IT_SEL INDEX VINDEX TRANSPORTING I_VTEXT.
ENDLOOP.
ENDIF.
ENDIF.
PERFORM DISPLAY_SECONDARY_LIST.
ENDCASE.
ENDFORM.
&----
*& Form DISPLAY_SECONDARY_LIST
&----
text : to display the secondary list with Item Data.
1.filling the field catalog
2. calling the list_display function module
----
--> p1 text
<-- p2 text
----
FORM DISPLAY_SECONDARY_LIST.
*..filling the field catalog
PERFORM FILL_FIELDCAT_2NDARY_LIST.
*..fill the layout..
PERFORM FILL_LAYOUT_2NDARY_LIST.
*..Get Events for the 2ndary list.
PERFORM GET_EVENTS2.
*..display the output
PERFORM WRITE_2NDARY_LIST.
ENDFORM. " DISPLAY_SECONDARY_LIST
&----
*& Form FILL_FIELDCAT_2NDARY_LIST
&----
text
----
--> p1 text
<-- p2 text
----
FORM FILL_FIELDCAT_2NDARY_LIST.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'IT_SEL'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = V_REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FIELDCAT_ITEM
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT IT_FIELDCAT_ITEM INTO WA_FIELDCAT_ITEM.
CASE WA_FIELDCAT_ITEM-FIELDNAME.
WHEN 'VBELN'.
WA_FIELDCAT_ITEM-OUTPUTLEN = '23'.
WA_FIELDCAT_ITEM-NO_OUT = 'X'.
WHEN 'KPOSN'.
WA_FIELDCAT_ITEM-COL_POS = '1'.
WA_FIELDCAT_ITEM-OUTPUTLEN = '25'.
WA_FIELDCAT_ITEM-SELTEXT_L = 'COND.ITEM.NO.'.
WHEN 'KBETR'.
WA_FIELDCAT_ITEM-COL_POS = '2'.
WA_FIELDCAT_ITEM-OUTPUTLEN = '25'.
WA_FIELDCAT_ITEM-SELTEXT_L = 'RATE'.
WHEN 'KWERT'.
WA_FIELDCAT_ITEM-COL_POS = '3'.
WA_FIELDCAT_ITEM-OUTPUTLEN = '25'.
WA_FIELDCAT_ITEM-SELTEXT_L = 'COND.VAL'.
WHEN 'KSCHL'.
WA_FIELDCAT_ITEM-COL_POS = '4'.
WA_FIELDCAT_ITEM-OUTPUTLEN = '25'.
WA_FIELDCAT_ITEM-SELTEXT_L = 'Cond. Type'.
WHEN 'I_VTEXT'.
WA_FIELDCAT_ITEM-COL_POS = '5'.
WA_FIELDCAT_ITEM-OUTPUTLEN = '25'.
WA_FIELDCAT_ITEM-SELTEXT_L = 'Text'.
ENDCASE.
WA_FIELDCAT_ITEM-HOTSPOT = 'X'.
MODIFY IT_FIELDCAT_ITEM FROM WA_FIELDCAT_ITEM INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " FILL_FIELDCAT_2NDARY_LIST
&----
*& Form WRITE_2NDARY_LIST
&----
text
----
--> p1 text
<-- p2 text
----
FORM WRITE_2NDARY_LIST.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT = WA_LAYOUT_ITEM
IT_FIELDCAT = IT_FIELDCAT_ITEM
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = IT_EVENTS_ITEM
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_SEL
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. " WRITE_2NDARY_LIST
&----
*& Form FILL_LAYOUT_2NDARY_LIST
&----
text
----
--> p1 text
<-- p2 text
----
FORM FILL_LAYOUT_2NDARY_LIST.
WA_LAYOUT_ITEM-INFO_FIELDNAME = 'COLOR'.
WA_LAYOUT_ITEM-ZEBRA = 'X'.
WA_LAYOUT_ITEM-TOTALS_TEXT = 'GRAND TOTAL'.
ENDFORM. " FILL_LAYOUT_2NDARY_LIST
&----
*& Form GET_LAYOUT
&----
text
----
--> p1 text
<-- p2 text
----
FORM GET_LAYOUT.
WA_LAYOUT_HEADER-TOTALS_TEXT = 'TOTAL'.
WA_LAYOUT_HEADER-ZEBRA = 'X'.
ENDFORM. " GET_LAYOUT
&----
*& Form GET_EVENTS2
&----
text
----
--> p1 text
<-- p2 text
----
FORM GET_EVENTS2.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = IT_EVENTS_ITEM
EXCEPTIONS
LIST_TYPE_WRONG = 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.
READ TABLE IT_EVENTS_ITEM
INTO WA_EVENTS_ITEM WITH KEY
NAME = 'TOP_OF_PAGE'.
WA_EVENTS_ITEM-FORM = 'FILL_LIST_HEADER1'.
MODIFY IT_EVENTS_ITEM FROM WA_EVENTS_ITEM INDEX SY-TABIX.
ENDFORM. " GET_EVENTS2
----
FORM FILL_LIST_HEADER1 *
----
........ *
----
FORM FILL_LIST_HEADER1.
WRITE: 2 'Report :' , sy-repid ,
: 38 ' company' CENTERED,
:106 'Date :' , sy-datum,
: /2'User :' , sy-uname,
: 35 ' Hyderabad ' CENTERED ,
:106 'Pg.No :', sy-pagno,
:/36 ' Sales Orders Report ' CENTERED.
SKIP 2.
ENDFORM.
2007 Dec 28 11:02 AM
hi, here i am sending one code..
if u want u can declare selection screen in general manner.
here i have used tabs in the screen.
the FM returns an internal table I_EVENTS with the possible events, you can make use of the to write interactive reports.
The table structure contains the fields:
I_EVENTS-NAME: Name of the Callback event.
I_EVENTS-FORM: Name of the form routine that should be called in the calling program at the event.
This event table (I_EVENTS) is now checked with the desired constants. If the desired constant is found, then the corresponding field for the FORM NAME is populated with the name of the routine containing the corresponding event.
&----
*& Report ZUK_WIP02_SELSCREEN
*&
&----
*&
*&
&----
REPORT ZUK_WIP02_SELSCREEN NO STANDARD PAGE HEADING MESSAGE-ID ZMSG44 LINE-SIZE 110 LINE-COUNT 65(3).
To obtalin tabbed selection-screens ------------>
TABLES : VBAP,VBEP.
TYPE-POOLS : SLIS.
DATA : I_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA : W_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA : W_EVENTS TYPE SLIS_ALV_EVENT,
I_EVENTS TYPE SLIS_T_EVENT.
DATA : I_LISTHEADER TYPE SLIS_T_LISTHEADER,
HLINE TYPE SLIS_LISTHEADER.
DATA : GD_PRINTPARAMETERS TYPE SLIS_PRINT_ALV.
DATA : IT_SORT TYPE SLIS_T_SORTINFO_ALV ,
W_SORT TYPE SLIS_SORTINFO_ALV .
Internal table decl
TYPES : BEGIN OF S_VBAP,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
MATNR LIKE VBAP-MATNR,
MATKL LIKE VBAP-MATKL,
END OF S_VBAP.
DATA : I_VBAP TYPE STANDARD TABLE OF S_VBAP,
W_VBAP TYPE S_VBAP.
TYPES : BEGIN OF S_VBEP,
VBELN LIKE VBEP-VBELN,
POSNR LIKE VBEP-POSNR,
ETENR LIKE VBEP-ETENR,
WMENG(13),
MEINS(3),
WMENG LIKE VBEP-WMENG,
MEINS LIKE VBEP-MEINS,
END OF S_VBEP.
DATA : I_VBEP TYPE STANDARD TABLE OF S_VBEP,
W_VBEP TYPE S_VBEP.
DATA : BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
MATNR LIKE VBAP-MATNR,
MATKL LIKE VBAP-MATKL,
VBELN LIKE VBEP-VBELN,
POSNR LIKE VBEP-POSNR,
ETENR LIKE VBEP-ETENR,
WMENG LIKE VBEP-WMENG,
MEINS LIKE VBEP-MEINS,
END OF ITAB.
DATA : V_REPID LIKE SY-REPID,
V_TEMP TYPE I.
********************************************************************************************
selection-screens
********************************************************************************************
SELECTION-SCREEN 101----->
SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
skip.
SELECT-OPTIONS : S_VBELN FOR VBAP-VBELN OBLIGATORY.
skip.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN END OF SCREEN 101.
SELECTION-SCREEN 102----->
SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
skip.
SELECT-OPTIONS : S_POSNR FOR VBAP-POSNR OBLIGATORY.
skip.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN END OF SCREEN 102.
SELECTION-SCREEN 103----->
SELECTION-SCREEN BEGIN OF SCREEN 103 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-001.
skip.
SELECT-OPTIONS : S_MATNR FOR VBAP-MATNR. " OBLIGATORY.
skip.
SELECTION-SCREEN END OF BLOCK B3.
SELECTION-SCREEN END OF SCREEN 103.
selection-screen tabbed
SELECTION-SCREEN BEGIN OF TABBED BLOCK UK FOR 10 LINES .
SELECTION-SCREEN TAB (10) NAME_1 USER-COMMAND UCOMM1 DEFAULT SCREEN 101.
SELECTION-SCREEN TAB (20) NAME_2 USER-COMMAND UCOMM2 DEFAULT SCREEN 102.
SELECTION-SCREEN TAB (30) NAME_3 USER-COMMAND UCOMM3 DEFAULT SCREEN 103.
SELECTION-SCREEN END OF BLOCK UK.
**************************************************************************
initialization
************************************************************************
INITIALIZATION.
NAME_1 = TEXT-004.
NAME_2 = TEXT-005.
NAME_3 = TEXT-006.
V_REPID = SY-REPID.
PERFORM BUILD-LAYOUT.
PERFORM BUILD-FIELDCAT.
PERFORM EVENTS-BUILD.
PERFORM EVENTS-POPULATE.
*************************************************************************
Validations
*************************************************************************
AT SELECTION-SCREEN ON S_VBELN.
SELECT SINGLE *
FROM VBAP
INTO VBAP
WHERE VBELN IN S_VBELN.
IF SY-SUBRC NE 0.
MESSAGE I999 WITH 'Enter Valid PO Num !'.
SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
ENDIF.
AT SELECTION-SCREEN ON S_POSNR.
SELECT SINGLE *
FROM VBAP
INTO VBAP
WHERE VBELN IN S_VBELN.
IF SY-SUBRC NE 0.
MESSAGE I999 WITH 'Enter Valid Item Num !'.
SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
ENDIF.
AT SELECTION-SCREEN ON S_MATNR.
SELECT SINGLE *
FROM VBAP
INTO VBAP
WHERE VBELN IN S_VBELN.
IF SY-SUBRC NE 0.
MESSAGE I999 WITH 'Enter Valid MATRL Num !'.
SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
ENDIF.
*******************************************************************
* start of selection
*******************************************************************
START-OF-SELECTION.
PERFORM GET-DATA.
PERFORM DISPLAY.
******************************************************************************************************************
FORMS
******************************************************************************************************************
&----
*& Form BUILD-LAYOUT
&----
text
----
--> p1 text
<-- p2 text
----
FORM BUILD-LAYOUT .
I_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
I_LAYOUT-F2CODE = 'PICK'.
I_LAYOUT-ZEBRA = 'X'.
ENDFORM. " BUILD-LAYOUT
&----
*& Form BUILD-FIELDCAT
&----
text
----
--> p1 text
<-- p2 text
----
FORM BUILD-FIELDCAT .
W_FIELDCAT-SELTEXT_L = 'Sales-doc'.
W_FIELDCAT-DATATYPE = 'CHAR'.
W_FIELDCAT-OUTPUTLEN = 10.
W_FIELDCAT-FIELDNAME = 'VBELN'.
W_FIELDCAT-TABNAME = 'ITAB'.
W_FIELDCAT-KEY = 'X'.
W_FIELDCAT-HOTSPOT = 'X'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-SELTEXT_L = 'Sales-doc-Item'.
W_FIELDCAT-DATATYPE = 'CHAR'.
W_FIELDCAT-OUTPUTLEN = 14.
W_FIELDCAT-FIELDNAME = 'POSNR'.
W_FIELDCAT-TABNAME = 'ITAB'.
W_FIELDCAT-KEY = 'X'.
W_FIELDCAT-HOTSPOT = 'X'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-SELTEXT_L = 'Matrl No'.
W_FIELDCAT-DATATYPE = 'CHAR'.
W_FIELDCAT-OUTPUTLEN = 18.
W_FIELDCAT-FIELDNAME = 'MATNR'.
W_FIELDCAT-TABNAME = 'ITAB'.
W_FIELDCAT-HOTSPOT = 'X'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-SELTEXT_L = 'Sch lines'.
W_FIELDCAT-DATATYPE = 'CHAR'.
W_FIELDCAT-OUTPUTLEN = 10.
W_FIELDCAT-FIELDNAME = 'ETENR'.
W_FIELDCAT-TABNAME = 'ITAB'.
W_FIELDCAT-KEY = 'X'.
W_FIELDCAT-HOTSPOT = 'X'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-SELTEXT_L = 'Matrl Grp'.
W_FIELDCAT-DATATYPE = 'CHAR'.
W_FIELDCAT-OUTPUTLEN = 10.
W_FIELDCAT-FIELDNAME = 'MATKL'.
W_FIELDCAT-TABNAME = 'ITAB'.
W_FIELDCAT-HOTSPOT = 'X'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-SELTEXT_L = 'Ord-qty'.
W_FIELDCAT-DATATYPE = 'QUAN'.
W_FIELDCAT-OUTPUTLEN = 13.
W_FIELDCAT-FIELDNAME = 'WMENG'.
W_FIELDCAT-TABNAME = 'ITAB'.
W_FIELDCAT-HOTSPOT = 'X'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-SELTEXT_L = 'Base unit'.
W_FIELDCAT-DATATYPE = 'UNIT'.
W_FIELDCAT-OUTPUTLEN = 9.
W_FIELDCAT-FIELDNAME = 'MEINS'.
W_FIELDCAT-TABNAME = 'ITAB'.
W_FIELDCAT-HOTSPOT = 'X'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
ENDFORM. " BUILD-FIELDCAT
&----
*& Form EVENTS-BUILD
&----
text
----
--> p1 text
<-- p2 text
----
FORM EVENTS-BUILD .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = I_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 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. " EVENTS-BUILD
&----
*& Form EVENTS-POPULATE
&----
text
----
--> p1 text
<-- p2 text
----
FORM EVENTS-POPULATE .
READ TABLE I_EVENTS INTO W_EVENTS WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
W_EVENTS-FORM = 'TOP-OF-PAGE'.
MODIFY I_EVENTS FROM W_EVENTS TRANSPORTING FORM WHERE NAME = W_EVENTS-NAME.
ENDIF.
READ TABLE I_EVENTS INTO W_EVENTS WITH KEY NAME = 'END_OF_PAGE'.
IF SY-SUBRC EQ 0.
W_EVENTS-FORM = 'END-OF-PAGE'.
MODIFY I_EVENTS FROM W_EVENTS TRANSPORTING FORM WHERE NAME = W_EVENTS-NAME.
ENDIF.
READ TABLE I_EVENTS INTO W_EVENTS WITH KEY NAME = 'TOP_OF_LIST'.
IF SY-SUBRC EQ 0.
W_EVENTS-FORM = 'TOP-OF-LIST'.
MODIFY I_EVENTS FROM W_EVENTS TRANSPORTING FORM WHERE NAME = W_EVENTS-NAME.
ENDIF.
READ TABLE I_EVENTS INTO W_EVENTS WITH KEY NAME = 'END_OF_LIST'.
IF SY-SUBRC EQ 0.
W_EVENTS-FORM = 'END-OF-LIST'.
MODIFY I_EVENTS FROM W_EVENTS TRANSPORTING FORM WHERE NAME = W_EVENTS-NAME.
ENDIF.
ENDFORM. " EVENTS-POPULATE
&----
*& Form GET-DATA
&----
text
----
--> p1 text
<-- p2 text
----
FORM GET-DATA .
SELECT A~VBELN
A~POSNR
A~MATNR
A~MATKL
B~VBELN
B~POSNR
B~ETENR
B~WMENG
B~MEINS
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM VBAP AS A INNER JOIN VBEP AS B
ON AVBELN = BVBELN
AND APOSNR = BPOSNR
WHERE A~VBELN IN S_VBELN
AND A~POSNR IN S_POSNR.
IF SY-SUBRC NE 0.
MESSAGE I999 WITH 'QUERY FAILED-BOBBY'.
ENDIF.
ENDFORM. " GET-DATA
&----
*& Form DISPLAY
&----
text
----
--> p1 text
<-- p2 text
----
FORM DISPLAY .
PERFORM PRINT-PARAMS.
PERFORM SORT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ''
I_CALLBACK_HTML_END_OF_LIST = ''
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = I_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = IT_SORT
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'X'
IS_VARIANT =
IT_EVENTS = I_EVENTS[]
IT_EVENT_EXIT =
IS_PRINT = GD_PRINTPARAMETERS
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB
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. " DISPLAY
&----
*& Form TOP-OF-PAGE
&----
text
----
--> p1 text
<-- p2 text
----
FORM TOP-OF-PAGE .
*DATA : I_LISTHEADER TYPE SLIS_T_LISTHEADER,
HLINE TYPE SLIS_LISTHEADER.
HLINE-TYP = 'H'.
HLINE-INFO = 'Prepared by Umakanth:- sales order details'.
APPEND HLINE TO I_LISTHEADER.
CLEAR HLINE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_LISTHEADER
I_LOGO = 'ENJOYSAP_LOGO'
I_END_OF_LIST_GRID =
I_ALV_FORM =
.
REFRESH I_LISTHEADER.
ENDFORM. " TOP-OF-PAGE
&----
*& Form TOP-OF-LIST
&----
text
----
--> p1 text
<-- p2 text
----
FORM TOP-OF-LIST .
WRITE : / 'Prepared by', SY-UNAME, 'ON',SY-DATUM.
HLINE-TYP = 'H'.
HLINE-INFO = 'Prepared by JUMBLE-HEART:- sales order details'.
APPEND HLINE TO I_LISTHEADER.
CLEAR HLINE.
.
ENDFORM. " TOP-OF-LIST
&----
*& Form END-OF-PAGE
&----
text
----
--> p1 text
<-- p2 text
----
FORM END-OF-PAGE ."USING I_LISTHEADER.
DATA :LISTWIDTH TYPE I,
ID_PAGEPOS(10) TYPE C,
ID_PAGE(10) TYPE C.
SKIP.
WRITE : / 'PAGE NO IS:',SY-PAGNO.
ENDFORM. " END-OF-PAGE
&----
*& Form END-OF-LIST
&----
text
----
--> p1 text
<-- p2 text
----
FORM END-OF-LIST .
DATA :LISTWIDTH TYPE I,
ID_PAGEPOS(10) TYPE C,
ID_PAGE(10) TYPE C.
SKIP.
WRITE : / 'PAGE NO IS:',SY-PAGNO.
ENDFORM. " END-OF-LIST
&----
*& Form PRINT-PARAMS
&----
text
----
--> p1 text
<-- p2 text
----
FORM PRINT-PARAMS .
GD_PRINTPARAMETERS-RESERVE_LINES = '3'.
GD_PRINTPARAMETERS-NO_COVERPAGE = 'X'.
ENDFORM. " PRINT-PARAMS
&----
*& Form SORT
&----
text
----
--> p1 text
<-- p2 text
----
FORM SORT .
w_sort-spos = '2'.
W_SORT-FIELDNAME = 'POSNR'.
W_SORT-GROUP = '*'.
APPEND W_SORT TO IT_SORT.
CLEAR W_SORT.
ENDFORM. " SORT
reward points if helpful
rgds
Umakanth.P