*--[ Programa que limpia el buffer de los ALV antiguos
* BALVBUFDEL
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Descripcin : Plantilla para crear ALVs
* Autor : MGUTIERREZ
* Ultima Modif : 04.03.2005
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* P A S O S:
*
* ALV.1. Definir las variables y tablas para el ALV.
* ALV.1.1. Creamos pantalla de seleccin
* ALV.2. Creamos la estructura que aparecer en el ALV.
* ALV.3. Inicializamos el ALV:
* ALV.3.1. Creamos el catlogo de campos.
* ALV.3.1.1 Catlogo de campos esttico
* ALV.3.1.2 Catlogo de campos dinmico
* ALV.3.2. Redefinimos los eventos:
* ALV.3.2.1. Status.
* ALV.3.2.1.1. Preparamos el status.
* Se puede copiar del grupo de funciones
* SLVC_FULLSCREEN status STANDARD_FULLSCREEN
* ALV.3.2.2. Top of page.
* ALV.3.2.3. User command.
* ALV.3.2.3.1. Preparamos el User-Command.
* ALV.3.3. Ordenamos la tabla por estos criterios.
* ALV.4. Rellena la tabla interna con los datos.
* ALV.4.1. Colores de lnea/columna/registro.
* ALV.5. Sacamos el listado:
* ALV.5.1. Creamos la cabecera del listado.
* ALV.5.2. Definimos el layout. (colores)
* ALV.5.3. Llamamos a la funcin que saca al ALV.
* ALV.6. Coloreamos las diferentes lineas/celdas en la carga de datos.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Buscar y reemplazar
* 1.- QQQQQ : Nombre de la estructura que aparecer en el ALV
* 2.- TTTTT : Ttulo del GRID si fuese necesario
* 3.- KKKK1 : Campo de ordenacin #1
* 3.- KKKK2 : Campo de ordenacin #2
* 4.- LLLLL : Imagen de logotipo
* 5.- SSSSS : Nombre de tu status
* 6.- XMARK : Nombre del campo para marcar en la tabla
*
* º`ºø,,øº`ºø,,øº`ºø,,øº`ºø,,øº`ºø,,øº *
REPORT z NO STANDARD PAGE HEADING LINE-SIZE 255 LINE-COUNT 65.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.1. Definir las variables y tablas para el ALV
TYPE-POOLS: slis.
DATA: ALV_layout TYPE slis_layout_alv,
ALV_fieldcat TYPE slis_t_fieldcat_alv,
ALV_top_of_page TYPE slis_t_listheader,
alv_sort TYPE slis_t_sortinfo_alv,
ALV_event TYPE slis_t_event,
g_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE',
g_user_command TYPE slis_formname VALUE 'USER_COMMAND',
g_pf_status TYPE slis_formname VALUE 'PF_STATUS_SET',
g_slis_fieldname-marca TYPE slis_fieldname,
g_slis_fieldname-tabla TYPE slis_tabname,
g_repid LIKE sy-repid,
g_variant LIKE disvariant,
g_variante LIKE g_variant-variant,
cg_activo VALUE 'X',
cg_checkbox LIKE g_slis_fieldname-marca VALUE 'XMARK'.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.2. Creamos la estructura que aparecera en el ALV
* XMARK --> marca para seleccionar registros
* INCLUDE STRUCTURE --> nombre de la tabla base del ALV
* COLOR / TABCOLOR --> para modificar los colores tanto de las celdas
* como de las filas o columnas del ALV
DATA: BEGIN OF i_datos OCCURS 0.
DATA: xmark(01) TYPE c.
* INCLUDE STRUCTURE QQQQQ.
DATA: color(4) TYPE c,
tabcolor TYPE lvc_t_scol.
DATA: END OF i_datos.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.1.1. Creamos pantalla de seleccin
SELECTION-SCREEN BEGIN OF BLOCK bloque WITH FRAME TITLE text-001.
parameters: test as checkbox.
SELECTION-SCREEN END OF BLOCK bloque.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3. Inicializamos el ALV.
INITIALIZATION.
PERFORM ALV_3.
START-OF-SELECTION.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.4. Rellena la tabla interna con los datos.
PERFORM ALV_4.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.4.1. Colores de lnea/columna/registro.
PERFORM ALV_4_1.
END-OF-SELECTION.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.5. Sacamos el listado
PERFORM ALV_5.
* º`ºø,,øº`ºø,,øº`ºø,,øº`ºø,,øº`ºø,,øº
* R U T I N A S A L V
* º`ºø,,øº`ºø,,øº`ºø,,øº`ºø,,øº`ºø,,øº
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3. Inicializamos el ALV:
FORM ALV_3.
g_repid = sy-repid.
g_variant-report = g_repid.
g_variant-variant = g_variante.
g_slis_fieldname-marca = cg_checkbox.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.1. Creamos el catlogo de campos
PERFORM ALV_3_1 USING ALV_fieldcat[].
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.2. Redefinimos los eventos
PERFORM ALV_3_2 USING ALV_event[].
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.3 Ordenamos la tabla por estos criterios
PERFORM ALV_3_3 CHANGING alv_sort.
ENDFORM.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.1. Creamos el catlogo de campos
FORM ALV_3_1 USING p_t_fieldcat_alv TYPE slis_t_fieldcat_alv.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.1.1 Creamos el catlogo de campos esttico
perform ALV_3_1_1 using p_t_fieldcat_alv.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.1.2 Creamos el catlogo de campos dinmico
perform ALV_3_1_2 using p_t_fieldcat_alv.
endform.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.1.1 Creamos el catlogo de campos esttico
FORM ALV_3_1_1 USING
p_t_fieldcat_alv TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
CLEAR ls_fieldcat.
* Esta funcin crea el catlogo automticamente.
* ponemos el nombre de la estructura que hemos creado, I_datos
* y de la tabla a la que hace referencia.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING i_program_name = g_repid
i_internal_tabname = 'i_datos'
i_structure_name = 'QQQQQ'
i_client_never_display = cg_activo
CHANGING ct_fieldcat = p_t_fieldcat_alv[].
LOOP AT p_t_fieldcat_alv INTO ls_fieldcat.
CASE ls_fieldcat-fieldname.
* WHEN 'XMARK'.
* ls_fieldcat-fix_column = 'X'.
WHEN 'KKKKK1'.
* ls_fieldcat-hotspot = 'X'.
* ls_fieldcat-key = 'X'.
* ls_fieldcat-fix_column = 'X'.
* ls_fieldcat-outputlen = '000008'.
* ls_fieldcat-qfieldname = space.
* ls_fieldcat-do_sum = 'X'.
** Columna de color: VALORES --> space, 'X', 'Cxyz':
** x: Color number --> x:'1'-'9'
** y: Intensified --> '0'= off '1'= on
** z: Inverse --> '0'= off '1'= on
* ls_fieldcat-emphasize = 'C600'.
* ls_fieldcat-no_out = 'X'.
* ls_fieldcat-checkbox = 'X'.
ENDCASE.
MODIFY p_t_fieldcat_alv INDEX sy-tabix FROM ls_fieldcat.
ENDLOOP.
ENDFORM.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.1.2 Creamos el catlogo de campos dinmico o mejor dicho a mano
FORM ALV_3_1_2 USING p_t_fieldcat_alv TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
CLEAR ls_fieldcat.
clear p_t_fieldcat_alv. refresh p_t_fieldcat_alv.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = 'KKKK1'.
ls_fieldcat-tabname = 'I_DATOS'.
ls_fieldcat-ddictxt = 'S'. " (S)hort (M)iddle (L)ong
ls_fieldcat-seltext_s = 'Campo #1'. " short key word
* ls_fieldcat-cfieldname type slis_fieldname, " Campo Moneda
* ls_fieldcat-key(1) type c, " column with key-color
* ls_fieldcat-icon(1) type c, " as icon
* ls_fieldcat-symbol(1) type c, " as symbol
* ls_fieldcat-checkbox(1) type c, " as checkbox
* ls_fieldcat-just(1) type c, " (R)ight (L)eft (C)ent.
* ls_fieldcat-lzero(1) type c, " leading zero
* ls_fieldcat-no_sign(1) type c, " write no-sign
* ls_fieldcat-no_zero(1) type c, " write no-zero
* ls_fieldcat-no_convext(1) type c,
* ls_fieldcat-edit_mask type slis_edit_mask,
* ls_fieldcat-emphasize(4) type c, " emphasize
* ls_fieldcat-fix_column(1) type c, " Spalte fixieren
* ls_fieldcat-do_sum(1) type c, " sum up
* ls_fieldcat-no_out(1) type c, " (O)blig.(X)no out
* ls_fieldcat-tech(1) type c, " technical field
* ls_fieldcat-outputlen like dd03p-outputlen,
* ls_fieldcat-offset type dd03p-outputlen, " offset
* ls_fieldcat-ctabname type slis_tabname," Tabla del campo Moneda
* ls_fieldcat-seltext_l like dd03p-scrtext_l, " long key word
* ls_fieldcat-seltext_m like dd03p-scrtext_m, " middle key word
* ls_fieldcat-rollname like dd03p-rollname,
* ls_fieldcat-datatype like dd03p-datatype,
* ls_fieldcat-inttype like dd03p-inttype,
* ls_fieldcat-intlen like dd03p-intlen,
* ls_fieldcat-lowercase like dd03p-lowercase,
append ls_fieldcat to p_t_fieldcat_alv.
endform.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.2. Redefinimos los eventos:
FORM ALV_3_2 USING e03_lt_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
* Aqu leemos los eventos predefinidos!
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING i_list_type = 0
IMPORTING et_events = e03_lt_events.
LOOP AT e03_lt_events INTO ls_event WHERE name EQ g_pf_status.
case ls_event-name.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.2.1. Status.
when g_pf_status. ls_event-form = 'ALV_3_2_1_1'.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.2.2. Top of page.
when g_top_of_page. ls_event-form = 'ALV_3_2_2'.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.2.3. User command.
when g_user_command. ls_event-form = 'ALV_3_2_3_1'.
endcase.
MODIFY e03_lt_events FROM ls_event.
ENDLOOP.
ENDFORM.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.2.3.1. Preparamos el User-Comand.
FORM ALV_3_2_3_1 USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
* CASE r_ucomm.
* WHEN 'SAVE'. PERFORM guardar_modificaciones.
* WHEN '&IC1'. perform double_click. "Doble click
* ENDCASE.
ENDFORM.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.2.1.1. Preparamos el status.
FORM ALV_3_2_1_1 USING extab TYPE slis_t_extab.
DATA: ls_extab TYPE slis_extab.
* CLEAR ls_extab.
* ls_extab-fcode = '&VEXCEL'.
* APPEND ls_extab TO extab.
* Otros ejemplos: &AQW %SL &ABC &INFO
SET PF-STATUS 'SSSSS' EXCLUDING extab.
ENDFORM.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.3 Ordenamos la tabla por estos criterios
FORM ALV_3_3 CHANGING ct_sort TYPE slis_t_sortinfo_alv.
DATA: ls_sort TYPE slis_sortinfo_alv.
* Primer criterio de ordenacin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ls_sort-spos = 1.
ls_sort-fieldname = 'KKKK1'. "nombre del campo de la estruc
ls_sort-up =
ls_sort-group =
ls_sort-subtot = 'X'. "debe aparecer o no sumatorio
ls_sort-tabname =
ls_sort-down =
ls_sort-comp =
ls_sort-expa =
ls_sort-obligatory = space.
APPEND ls_sort TO ct_sort.
* Segundo criterio de ordenacin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ls_sort-spos = 2.
ls_sort-fieldname = 'KKKK2'.
ls_sort-group =
ls_sort-subtot =
ls_sort-up = 'X'.
ls_sort-comp =
ls_sort-expa =
ls_sort-tabname =
ls_sort-down =
ls_sort-obligatory = space.
APPEND ls_sort TO ct_sort.
ENDFORM.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.3.2.2. Top of page.
FORM ALV_3_2_2.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING it_list_commentary = ALV_top_of_page
i_logo = 'LLLLL'.
ENDFORM.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.4. Rellena la tabla interna con los datos.
FORM ALV_4.
DATA: ls_outtab LIKE i_datos.
DATA: ls_tabcolor TYPE lvc_s_scol.
ENDFORM.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.4.1. Colores de lnea/columna/registro.
form ALV_4_1.
DATA: ls_outtab LIKE i_datos.
DATA: ls_tabcolor TYPE lvc_s_scol.
* Ejemplo para toda la lnea
* LOOP AT i_datos.
* CASE i_datos-texto(1).
* WHEN 'A'. i_datos-color = 'C600'.
* MODIFY i_datos.
* ENDCASE.
* ENDLOOP.
* Ejemplo para solo una celda
* LOOP AT i_datos INTO ls_outtab.
* IF ls_outtab-s_curso IS INITIAL.
* ls_tabcolor-fname = 'KKKK1'.
* ls_tabcolor-color-col = 6.
* ls_tabcolor-color-int = 0.
* ls_tabcolor-color-inv = 1.
* INSERT ls_tabcolor INTO TABLE ls_outtab-tabcolor.
* MODIFY i_datos INDEX sy-tabix FROM ls_outtab
* TRANSPORTING tabcolor.
* ENDIF.
* ENDLOOP.
ENDFORM.
FORM ALV_5.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.5.1. Creamos la cabecera del listado.
PERFORM ALV_5_1 USING ALV_top_of_page[].
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.5.2. Definimos el layout
PERFORM ALV_5_2.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.5.3. Llamamos a la funcin que saca al ALV
PERFORM ALV_5_3.
ENDFORM.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.5.2. Definimos el layout
FORM ALV_5_2.
* BLOQUE 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ALV_layout-no_colhead = ' '. "Sin cabeceras
ALV_layout-no_hotspot = 'X'. "Cabeceras sin hotspot
ALV_layout-zebra = 'X'. "Sale a rayas blancas /azules
ALV_layout-no_vline = ' '. "Separacin columnas por spacio
ALV_layout-no_keyfix = ' '. "Columnas fijas o no!
ALV_layout-expand_all = 'X'. "Expandir todas las filas
ALV_layout-edit = ' '. "Modificar contenido celdas
*ALV_layout-cell_merge = 'X'. "not suppress field Replication
*ALV_layout-edit_mode = 'X'. "for grid only
*ALV_layout-numc_sum = 'X'. "totals for NUMC-Fields possib
*ALV_layout-no_input = 'X'. "only display fields
*ALV_layout-f2code like sy-ucomm,
*ALV_layout-reprep = 'X'. "report report interface active
*ALV_layout-no_author = 'X'. "No standard authority check
*ALV_layout-def_status = ' '. "default status space or 'A'
*ALV_layout-item_text(20) type c, "Text for item button
* Display options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ALV_layout-colwidth_optimize = 'X'. "Optimizar columnas
ALV_layout-min_linesize = 255. "Tamaño minimo de linea
ALV_layout-max_linesize = 250. "Default 250
ALV_layout-window_titlebar = sy-title. "Titulo ALV
ALV_layout-no_uline_hs = ' '. "Sin cabeceras
*ALV_layout-no_min_linesize = ' '. "line size = width eLIST
* Exceptions (semaforos) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*ALV_layout-lights_fieldname type slis_fieldname,
*ALV_layout-lights_tabname type slis_tabname,
*ALV_layout-lights_rollname like dfies-rollname,
*ALV_layout-lights_condense(1) type c,
* Sums ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ALV_layout-totals_before_items = ' '. "Total: X:arriba|'':abajo
*ALV_layout-no_sumchoice = ' '. "no choice for summing up
*ALV_layout-no_totalline = ' '. "no total line
*ALV_layout-no_subchoice = ' '. "no choice for subtotals
*ALV_layout-no_subtotals = ' '. "no subtotals possible
*ALV_layout-no_unit_splitting = ' '. "no sep.tot.lines by units
*ALV_layout-totals_only = 'X' "show only totals
*ALV_layout-totals_text(60), "text for 1st col.in total line
*ALV_layout-subtotals_text(60), "text for 1st col. in subtotals
* Interaction ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ALV_layout-box_fieldname = g_slis_fieldname-marca. "checkbox
ALV_layout-box_tabname = g_slis_fieldname-tabla. "checkbox
ALV_layout-confirmation_prompt = 'X'. "Desea salir?
ALV_layout-key_hotspot = ' '. "Campos claves como hotspot
*ALV_layout-box_rollname , "rollname for CB
*ALV_layout-expand_fieldname = 'X' "fieldname flag 'expand'
*ALV_layout-hotspot_fieldname = 'X'. "fieldname flag hotspot
*ALV_layout-flexible_key = 'X'. "key columns movable
*ALV_layout-group_buttons = 'X'. "buttons for COL1 - COL5
*ALV_layout-get_selinfos = 'X'. "read selection screen
*ALV_layout-group_change_edit = 'X'. "Sett. by user for new grp
*ALV_layout-no_scrolling = 'X'. "no scrolling
* Detailed screen ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*ALV_layout-detail_popup = 'X'. "show detail in popup
*ALV_layout-detail_initial_lines = 'X'. "show also initial lines
*ALV_layout-detail_titlebar = sy-title. "Titlebar for detail
* Display variants ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ALV_layout-info_fieldname = 'COLOR'. "Colores
ALV_layout-coltab_fieldname = 'TABCOLOR'. "Colores
*ALV_layout-header_text(20) type c, "Text for header button
*ALV_layout-default_item = ' '. "Items as default
* Others ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*ALV_layout-list_append = ' '. "no call screen
*ALV_layout-xifunckey type aqs_xikey, "eXtended interaction
*ALV_layout-xidirect type flag, "eXtended INTeraction
*ALV_layout-dtc_layout type dtc_s_layo, "Layout config.Tabstip
ENDFORM.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.5.3. Llamamos a la funcin que saca al ALV
FORM ALV_5_3.
DATA: accion TYPE slis_exit_by_user,
d_respuesta(1).
* CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING i_callback_program = g_repid
* Eliminar esta linea si se desea PF-STATUS standard
i_callback_pf_status_set = g_pf_status
i_callback_user_command = g_user_command
i_background_id = 'ALV_BACKGROUND'
is_layout = ALV_layout
* I_GRID_TITLE = 'TTTTT'
i_save = cg_activo
is_variant = g_variant
it_sort = alv_sort
it_events = ALV_event[]
it_fieldcat = ALV_fieldcat[]
IMPORTING es_exit_caused_by_user = accion
TABLES t_outtab = i_datos
EXCEPTIONS program_error = 1
OTHERS = 2.
case 'X'.
when accion-back or accion-exit or accion-cancel. EXIT.
endcase.
ENDFORM.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ALV.5.1. Creamos la cabecera del listado.
FORM ALV_5_1 USING e04_lt_top_of_page TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader.
CLEAR ls_line.
ls_line-typ = 'H'. " H = Header, S = Selection, A = Action
ls_line-info+20 = 'TTTTT'.
APPEND ls_line TO e04_lt_top_of_page.
ENDFORM.