Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

ALV Reports

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

//alv list display// REPORT ZB2_SIMPLE_ALV_REPORT.

tables: ekpo. type-pools: slis. data: begin of it_ekpo OCCURS 0, ebeln type ekpo-ebeln, ebelp type ekpo-ebelp, matnr type ekpo-matnr, menge type ekpo-menge, netpr type ekpo-netpr, end of it_ekpo. data: it_fieldcat type slis_t_fieldcat_alv, wa_fieldcat type slis_fieldcat_alv . select-OPTIONS: s_ebeln for ekpo-ebeln. START-OF-SELECTION. wa_fieldcat-col_pos = '0'. wa_fieldcat-fieldname = 'EBELN'. wa_fieldcat-tabname = 'IT_EKPO'. wa_fieldcat-outputlen = '15'. wa_fieldcat-seltext_l = 'PO Number'. append wa_fieldcat to it_fieldcat. clear wa_fieldcat. wa_fieldcat-col_pos = '1'. wa_fieldcat-fieldname = 'EBELP'. wa_fieldcat-tabname = 'IT_EKPO'. wa_fieldcat-outputlen = '15'. wa_fieldcat-seltext_l = 'PO Item Number'. append wa_fieldcat to it_fieldcat. clear wa_fieldcat. wa_fieldcat-col_pos = '2'. wa_fieldcat-fieldname = 'MATNR'. wa_fieldcat-tabname = 'IT_EKPO'. wa_fieldcat-outputlen = '18'. wa_fieldcat-seltext_l = 'Material Number'. append wa_fieldcat to it_fieldcat. clear wa_fieldcat. wa_fieldcat-col_pos = '3'. wa_fieldcat-fieldname = 'MENGE'. wa_fieldcat-tabname = 'IT_EKPO'. wa_fieldcat-outputlen = '16'. wa_fieldcat-seltext_l = 'Quantity'.

append wa_fieldcat to it_fieldcat. clear wa_fieldcat. wa_fieldcat-col_pos = '4'. wa_fieldcat-fieldname = 'NETPR'. wa_fieldcat-tabname = 'IT_EKPO'. wa_fieldcat-outputlen = '16'. wa_fieldcat-seltext_l = 'Net Price'. append wa_fieldcat to it_fieldcat. clear wa_fieldcat. select ebeln ebelp matnr menge netpr from ekpo into table it_ekpo where ebeln in s_ebeln. end-of-selection. CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' EXPORTING I_INTERFACE_CHECK = ' ' I_BYPASSING_BUFFER = I_BUFFER_ACTIVE = ' ' I_CALLBACK_PROGRAM = sy-repid I_CALLBACK_PF_STATUS_SET = ' ' I_CALLBACK_USER_COMMAND = ' ' I_STRUCTURE_NAME = IS_LAYOUT = IT_FIELDCAT = it_fieldcat IT_EXCLUDING = IT_SPECIAL_GROUPS = IT_SORT = IT_FILTER = IS_SEL_HIDE = I_DEFAULT = 'X' I_SAVE = ' ' IS_VARIANT = 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 IR_SALV_LIST_ADAPTER = IT_EXCEPT_QINFO = I_SUPPRESS_EMPTY_DATA = ABAP_FALSE IMPORTING

* * * * * * * * * * * * * * * * * * * * * * * * * * *

* *

E_EXIT_CAUSED_BY_CALLER = ES_EXIT_CAUSED_BY_USER = TABLES T_OUTTAB = it_ekpo EXCEPTIONS PROGRAM_ERROR = 1 OTHERS = 2 . IF SY-SUBRC <> 0. * Implement suitable error handling here ENDIF.

REPORT

ZB2_SIMPLE_ALV_MACRO_DISPLAY.

tables: ekpo. type-pools: slis. data: begin of it_ekpo OCCURS 0, ebeln type ekpo-ebeln, ebelp type ekpo-ebelp, matnr type ekpo-matnr, menge type ekpo-menge, netpr type ekpo-netpr, end of it_ekpo. data: it_fieldcat type slis_t_fieldcat_alv, wa_fieldcat type slis_fieldcat_alv . define mac_field. wa_fieldcat-col_pos = &1. wa_fieldcat-fieldname = &2. wa_fieldcat-tabname = &3. wa_fieldcat-outputlen = &4. wa_fieldcat-seltext_l = &5. append wa_fieldcat to it_fieldcat. clear wa_fieldcat. end-of-DEFINITION. select-OPTIONS: s_ebeln for ekpo-ebeln. START-OF-SELECTION. mac_field mac_field mac_field mac_field mac_field '0' '1' '2' '3' '4' 'EBELN' 'EBELP' 'MATNR' 'MENGE' 'NETPR' 'IT_EKPO' 'IT_EKPO' 'IT_EKPO' 'IT_EKPO' 'IT_EKPO' '15' '15' '18' '16' '16' ' ' ' ' ' PO Number'. PO Item Number'. Material Number'. Quantity'. Net Price'.

select ebeln ebelp matnr

menge netpr from ekpo into table it_ekpo where ebeln in s_ebeln. end-of-selection. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING * I_INTERFACE_CHECK = ' ' * I_BYPASSING_BUFFER = ' ' * I_BUFFER_ACTIVE = ' ' I_CALLBACK_PROGRAM = sy-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 = IT_FIELDCAT = it_fieldcat * IT_EXCLUDING = * IT_SPECIAL_GROUPS = * IT_SORT = * IT_FILTER = * IS_SEL_HIDE = * I_DEFAULT = 'X' * I_SAVE = ' ' * IS_VARIANT = * 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 * 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 = it_ekpo EXCEPTIONS

PROGRAM_ERROR = 1 OTHERS = 2 . IF SY-SUBRC <> 0. * Implement suitable error handling here ENDIF.

REPORT

ZB2_SIMPLE_ALV_GRID_DISPLAY.

tables: ekpo. type-pools: slis. data: begin of it_ekpo OCCURS 0, ebeln type ekpo-ebeln, ebelp type ekpo-ebelp, matnr type ekpo-matnr, menge type ekpo-menge, netpr type ekpo-netpr, end of it_ekpo. data: it_fieldcat type slis_t_fieldcat_alv, wa_fieldcat type slis_fieldcat_alv . select-OPTIONS: s_ebeln for ekpo-ebeln. START-OF-SELECTION. wa_fieldcat-col_pos = '0'. wa_fieldcat-fieldname = 'EBELN'. wa_fieldcat-tabname = 'IT_EKPO'. wa_fieldcat-outputlen = '15'. wa_fieldcat-seltext_l = 'PO Number'. append wa_fieldcat to it_fieldcat. clear wa_fieldcat. wa_fieldcat-col_pos = '1'. wa_fieldcat-fieldname = 'EBELP'. wa_fieldcat-tabname = 'IT_EKPO'. wa_fieldcat-outputlen = '15'. wa_fieldcat-seltext_l = 'PO Item Number'. append wa_fieldcat to it_fieldcat. clear wa_fieldcat. wa_fieldcat-col_pos = '2'. wa_fieldcat-fieldname = 'MATNR'. wa_fieldcat-tabname = 'IT_EKPO'. wa_fieldcat-outputlen = '18'. wa_fieldcat-seltext_l = 'Material Number'. append wa_fieldcat to it_fieldcat. clear wa_fieldcat.

wa_fieldcat-col_pos = '3'. wa_fieldcat-fieldname = 'MENGE'. wa_fieldcat-tabname = 'IT_EKPO'. wa_fieldcat-outputlen = '16'. wa_fieldcat-seltext_l = 'Quantity'. append wa_fieldcat to it_fieldcat. clear wa_fieldcat. wa_fieldcat-col_pos = '4'. wa_fieldcat-fieldname = 'NETPR'. wa_fieldcat-tabname = 'IT_EKPO'. wa_fieldcat-outputlen = '16'. wa_fieldcat-seltext_l = 'Net Price'. append wa_fieldcat to it_fieldcat. clear wa_fieldcat. select ebeln ebelp matnr menge netpr from ekpo into table it_ekpo where ebeln in s_ebeln. end-of-selection. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING * I_INTERFACE_CHECK = ' ' * I_BYPASSING_BUFFER = ' ' * I_BUFFER_ACTIVE = ' ' I_CALLBACK_PROGRAM = sy-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 = IT_FIELDCAT = it_fieldcat * IT_EXCLUDING = * IT_SPECIAL_GROUPS = * IT_SORT = * IT_FILTER = * IS_SEL_HIDE = * I_DEFAULT = 'X' * I_SAVE = ' ' * IS_VARIANT = * 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 * 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 = it_ekpo EXCEPTIONS PROGRAM_ERROR = 1 OTHERS = 2 . IF SY-SUBRC <> 0. * Implement suitable error handling here ENDIF.

REPORT

ZB2_ALV_FIELDCAT_MERGE_FM.

tables: ekpo. type-pools: slis. data: it_ekpo type ekpo OCCURS 0 WITH HEADER LINE. data: it_fieldcat type slis_t_fieldcat_alv, wa_fieldcat type slis_fieldcat_alv . select-OPTIONS: s_ebeln for ekpo-ebeln. START-OF-SELECTION. CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' EXPORTING I_PROGRAM_NAME = sy-repid I_INTERNAL_TABNAME = 'IT_EKPO' I_STRUCTURE_NAME = 'EKPO' * I_CLIENT_NEVER_DISPLAY = 'X' * I_INCLNAME = * I_BYPASSING_BUFFER =

I_BUFFER_ACTIVE = CHANGING CT_FIELDCAT = it_fieldcat EXCEPTIONS INCONSISTENT_INTERFACE = 1 PROGRAM_ERROR = 2 OTHERS = 3 . IF SY-SUBRC <> 0. * Implement suitable error handling here ENDIF.

select * from ekpo into table it_ekpo where ebeln in s_ebeln. end-of-selection. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING * I_INTERFACE_CHECK = ' ' * I_BYPASSING_BUFFER = ' ' * I_BUFFER_ACTIVE = ' ' I_CALLBACK_PROGRAM = sy-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 = IT_FIELDCAT = it_fieldcat * IT_EXCLUDING = * IT_SPECIAL_GROUPS = * IT_SORT = * IT_FILTER = * IS_SEL_HIDE = * I_DEFAULT = 'X' * I_SAVE = ' ' * IS_VARIANT = * 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 * 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 = it_ekpo EXCEPTIONS PROGRAM_ERROR = 1 OTHERS = 2 . IF SY-SUBRC <> 0. * Implement suitable error handling here ENDIF.

You might also like