PDA

Ver la Versión Completa : Semaforo ALV


AntonioRamirez
07/04/10, 09:00:23
Buenas,

Tengo un ALV de pedidos y quiero añadirle una columna que tenga un semáforo, con tres estados y que al modificar su estado, el campo al que está asociado la columna se actualice en la base de datos.

Gracias.

caralbgro
07/04/10, 13:57:12
en la funcion de salida copmenta esto
* i_callback_top_of_page = 'TOP_OF_PAGE'
lo reemplazas por este
i_callback_html_top_of_page = p_heading

FORM REPORTE.

p_heading = 'HTML_TOP_OF_PAGE'.

PERFORM build_layout USING s_layout.
PERFORM build_comment USING heading[].
PERFORM build_eventtab USING events[].

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_interface_check = 'X'
i_callback_program = g_repit
it_fieldcat = LISTADO[]
* i_callback_top_of_page = 'TOP_OF_PAGE'
i_callback_html_top_of_page = p_heading
is_layout = s_layout
i_save = 'A'
it_events = events[]
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = T_LISTADO
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.

y agrega este codigo!!!

form html_top_of_page using document type ref to cl_dd_document.
data: text type sdydo_text_element,
R_AREA TYPE REF TO CL_DD_AREA.

CALL METHOD document->INITIALIZE_DOCUMENT.
CALL METHOD document->VERTICAL_SPLIT
EXPORTING SPLIT_AREA = document
SPLIT_WIDTH = '100%'
IMPORTING RIGHT_AREA = R_AREA.

CALL METHOD R_AREA->ADD_PICTURE
EXPORTING PICTURE_ID = 'ZLOGO'
WIDTH ='150'.

text = 'Listado de Notas de Pedidos Pendientes'.

call method document->add_text
exporting
text = text
sap_style = 'HEADING'
sap_color = space
sap_fontsize = cl_dd_document=>SANS_SERIF
sap_emphasis = cl_dd_document=>strong
style_class = space.

call method document->new_line.
call method document->new_line.

concatenate 'Usuario: ' sy-uname INTO text SEPARATED BY space.
call method document->add_text
exporting
text = text
sap_style = space
sap_color = space
sap_fontsize = cl_dd_document=>large
sap_emphasis = space
style_class = space.

call method document->add_gap
exporting
width = 10.
call method document->new_line.


concatenate 'Fecha: ' sy-datum INTO text SEPARATED BY space.
call method document->add_text
exporting
text = text
sap_style = space
sap_color = space
sap_fontsize = cl_dd_document=>large
sap_emphasis = space
style_class = space.

call method document->add_gap
exporting
width = 10.

call method document->new_line.
call method document->new_line.
call method document->new_line.

call method document->add_icon
exporting
sap_icon = 'ICON_RED_LIGHT'.
call method document->add_gap
exporting
width = 2.
text = 'No Autorizado'.

call method document->add_text
exporting
text = text
sap_style = space
sap_color = space
sap_fontsize = cl_dd_document=>large
sap_emphasis = cl_dd_document=>strong
style_class = space.

call method document->add_gap
exporting
width = 10.

call method document->add_icon
exporting
sap_icon = 'ICON_GREEN_LIGHT'.
call method document->add_gap
exporting
width = 2.
text = 'Autorizado'.
call method document->add_text
exporting
text = text
sap_style = space
sap_color = space
sap_fontsize = cl_dd_document=>large
sap_emphasis = cl_dd_document=>strong
style_class = space.


call method document->add_gap
exporting
width = 10.

call method document->add_icon
exporting
sap_icon = 'ICON_YELLOW_LIGHT'.
en la función de salida comenta esto

FORM REPORTE.

p_heading = 'HTML_TOP_OF_PAGE'.

PERFORM build_layout USING s_layout.
PERFORM build_comment USING heading[].
PERFORM build_eventtab USING events[].

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_interface_check = 'X'
i_callback_program = g_repit
it_fieldcat = LISTADO[]
* i_callback_top_of_page = 'TOP_OF_PAGE'
i_callback_html_top_of_page = p_heading
is_layout = s_layout
i_save = 'A'
it_events = events[]
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = T_LISTADO
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.
call method document->add_gap
exporting
width = 2.
text = 'Rechazado'.

call method document->add_text
exporting
text = text
sap_style = space
sap_color = space
sap_fontsize = cl_dd_document=>large
sap_emphasis = cl_dd_document=>strong
style_class = space.

endform. " Html_top_of_page