101588046 WEBDYNPRO Alv Traffic Light Color Function

SRINIVASULU BANDI

B

* Call the interface controller method GET_MODEL *to get the ALV configuration model CL_SALV_WD_CONFIG_TABLE DATA LO_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .

A

LO_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ). IF LO_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL. LO_CMP_USAGE->CREATE_COMPONENT( ). ENDIF.

N D

METHOD WDDOINIT . *Instnatiate the SALV component DATA LO_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.

1

WEBDYNPRO ABAP/FPM/WEBDYNPRO CHIPS / BRF+ WITH OOPS & ADVANCED OOPS BANDIS TECHNOLOGY :040-64608866 , 9030098866

IS

T

E

C

H N

O

LO G

Y

SRINIVASULU BANDI LO_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_ALV( ). *4. Y . 9030098866 IS T E C H N O LO G LR_COLUMN = LV_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'NETPR' ). * * @TODO compute values * * e. *.g. DATA LV_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE. DATA LO_ND_VBAP TYPE REF TO IF_WD_CONTEXT_NODE. * navigate from <CONTEXT> to <VBAP> via lead selection LO_ND_VBAP = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_VBAP ). * ENDIF. DATA LS_VBAP TYPE WD_THIS->ELEMENT_VBAP. Get the corresponding colomn settings by using method *GET_COLUMN of IF_SALV_WD_COLUMN_SETTINGS DATA LR_COLUMN TYPE REF TO CL_SALV_WD_COLUMN. LV_VALUE = LO_INTERFACECONTROLLER->GET_MODEL( ). *Delete the COLOR Column From ALV Output LV_VALUE->IF_SALV_WD_COLUMN_SETTINGS~DELETE_COLUMN( 'COLOR' ). call a model function B A N D 2 WEBDYNPRO ABAP/FPM/WEBDYNPRO CHIPS / BRF+ WITH OOPS & ADVANCED OOPS BANDIS TECHNOLOGY :040-64608866 . Set the color to the column using method SET_CELL_DESIGN_FIELDNAME LR_COLUMN->SET_CELL_DESIGN_FIELDNAME( 'COLOR' ). * @TODO handle non existant child * IF lo_nd_vbap IS INITIAL. DATA LT_VBAP TYPE WD_THIS->ELEMENTS_VBAP.

Set the fieldname realted to the image using method SET_SOURCE_FIELDNAME LR_IMAGE->SET_SOURCE_FIELDNAME( 'TRAFFIC' ). Get the column instance for which the cell editor should be changed *from TEXTVIEW to IMAGE E C H N O *provinding images to a ALV Table Column DATA : LR_IMAGE TYPE REF TO CL_SALV_WD_UIE_IMAGE. LS_VBAP-COLOR = CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-NEGATIVE. IF SY-SUBRC IS INITIAL. CREATE OBJECT LR_IMAGE. LS_VBAP-COLOR = CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-POSITIVE. *6. LR_HEADER->SET_TEXT( 'Exception' ). T *5. LS_VBAP-TRAFFIC = ICON_RED_LIGHT. ELSE. ENDIF. ENDIF. MODIFY LT_VBAP FROM LS_VBAP TRANSPORTING COLOR TRAFFIC. DATA LR_BUTTON TYPE REF TO CL_SALV_WD_UIE_BUTTON. IF LS_VBAP-NETPR GT '1500'.SRINIVASULU BANDI SELECT * FROM VBAP INTO CORRESPONDING FIELDS OF TABLE LT_VBAP UP TO 10 ROWS. LO G Y . B A LR_COLUMN->SET_CELL_EDITOR( LR_IMAGE ). *4. N D 3 WEBDYNPRO ABAP/FPM/WEBDYNPRO CHIPS / BRF+ WITH OOPS & ADVANCED OOPS BANDIS TECHNOLOGY :040-64608866 . Set the CEll Editor as image *Change the Column VBELN as Button * 1. ENDLOOP. LR_HEADER = LR_COLUMN->CREATE_HEADER( ). LOOP AT LT_VBAP INTO LS_VBAP. DATA LR_HEADER TYPE REF TO CL_SALV_WD_COLUMN_HEADER. First instantiate the class realted to button . LS_VBAP-TRAFFIC = ICON_GREEN_LIGHT. 9030098866 IS LR_COLUMN = LV_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'TRAFFIC' ).

Get the corresponding column instance LR_COLUMN = LV_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'VBELN' ). * lr_button1->set_text( 'DELETE' ). LV_VALUE->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( ABAP_FALSE ). C *1. *2.SRINIVASULU BANDI CREATE OBJECT LR_BUTTON. CREATE OBJECT LR_INPUT EXPORTING VALUE_FIELDNAME = 'MATNR'. First get the instace of that field using method GET_FIELD * H N **************************************************************** *GRAND TOTAL O LO G CREATE OBJECT LR_BUTTON1. DATA LR_INPUT TYPE REF TO CL_SALV_WD_UIE_INPUT_FIELD. LV_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'MATNR' )->SET_CELL_EDITOR( LR_INPUT ). T E LV_VALUE->IF_SALV_WD_FIELD_SETTINGS~GET_FIELD( 'NETPR' )->IF_SALV_WD_AGGR~CREATE_AGGR_RULE( ). Y DATA LR_BUTTON1 TYPE REF TO CL_SALV_WD_FE_BUTTON. B A LR_INPUT->SET_READ_ONLY( ABAP_FALSE ). LR_BUTTON->SET_TEXT_FIELDNAME( 'VBELN' ). LR_COLUMN->SET_CELL_EDITOR( LR_BUTTON ). 9030098866 IS LV_VALUE->IF_SALV_WD_FIELD_SETTINGS~GET_FIELD( 'VBELN' )->IF_SALV_WD_SORT~CREATE_SORT_RULE( GROUP_AGGREGATION = ABAP_TRUE ). N D 4 WEBDYNPRO ABAP/FPM/WEBDYNPRO CHIPS / BRF+ WITH OOPS & ADVANCED OOPS BANDIS TECHNOLOGY :040-64608866 . DATA LR_FUNCTION TYPE REF TO CL_SALV_WD_FUNCTION. . *aDD A dELETE BUTTON ON alv toolbar LR_BUTTON1->SET_IMAGE_SOURCE( '@11@' ).

SRINIVASULU BANDI LR_FUNCTION = LV_VALUE>IF_SALV_WD_FUNCTION_SETTINGS~CREATE_FUNCTION( 'TOOLBAR' ). LR_FUNCTION->SET_EDITOR( LR_BUTTON1 ). 9030098866 IS T E C H N O LO G Y . LO_ND_VBAP>BIND_TABLE( NEW_ITEMS = LT_VBAP SET_INITIAL_ELEMENTS = ABAP_FALSE ). B A N D 5 WEBDYNPRO ABAP/FPM/WEBDYNPRO CHIPS / BRF+ WITH OOPS & ADVANCED OOPS BANDIS TECHNOLOGY :040-64608866 . ENDMETHOD.

Sign up to vote on this title
UsefulNot useful