You are on page 1of 5

SRINIVASULU BANDI

* 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 .

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.

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

IS

H N

LO G

SRINIVASULU BANDI
LO_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_ALV( ).

DATA LV_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.


LV_VALUE = LO_INTERFACECONTROLLER->GET_MODEL( ).

*. 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.

*4. Set the color to the column using method SET_CELL_DESIGN_FIELDNAME


LR_COLUMN->SET_CELL_DESIGN_FIELDNAME( 'COLOR' ).

*Delete the COLOR Column From ALV Output

LV_VALUE->IF_SALV_WD_COLUMN_SETTINGS~DELETE_COLUMN( 'COLOR' ).

DATA LO_ND_VBAP TYPE REF TO IF_WD_CONTEXT_NODE. DATA LS_VBAP TYPE WD_THIS->ELEMENT_VBAP. DATA LT_VBAP TYPE WD_THIS->ELEMENTS_VBAP. * navigate from <CONTEXT> to <VBAP> via lead selection
LO_ND_VBAP = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_VBAP ).

* @TODO handle non existant child * IF lo_nd_vbap IS INITIAL. * ENDIF. * * @TODO compute values * * e.g. call a model function

N D

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

IS

H N

LO G

LR_COLUMN = LV_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'NETPR' ).

SRINIVASULU BANDI SELECT * FROM VBAP INTO CORRESPONDING FIELDS OF TABLE LT_VBAP UP TO 10 ROWS. IF SY-SUBRC IS INITIAL. LOOP AT LT_VBAP INTO LS_VBAP. IF LS_VBAP-NETPR GT '1500'.
LS_VBAP-COLOR = CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-NEGATIVE. LS_VBAP-TRAFFIC = ICON_RED_LIGHT. ELSE. LS_VBAP-COLOR = CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-POSITIVE. LS_VBAP-TRAFFIC = ICON_GREEN_LIGHT. ENDIF. MODIFY LT_VBAP FROM LS_VBAP TRANSPORTING COLOR TRAFFIC. ENDLOOP. ENDIF.

CREATE OBJECT LR_IMAGE. *4. Set the fieldname realted to the image using method SET_SOURCE_FIELDNAME
LR_IMAGE->SET_SOURCE_FIELDNAME( 'TRAFFIC' ).

*6. Set the CEll Editor as image

*Change the Column VBELN as Button * 1. First instantiate the class realted to button . DATA LR_BUTTON TYPE REF TO CL_SALV_WD_UIE_BUTTON.

LR_COLUMN->SET_CELL_EDITOR( LR_IMAGE ). DATA LR_HEADER TYPE REF TO CL_SALV_WD_COLUMN_HEADER. LR_HEADER = LR_COLUMN->CREATE_HEADER( ). LR_HEADER->SET_TEXT( 'Exception' ).

N D

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

IS

LR_COLUMN = LV_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'TRAFFIC' ).

*5. Get the column instance for which the cell editor should be changed *from TEXTVIEW to IMAGE

H N

*provinding images to a ALV Table Column DATA : LR_IMAGE TYPE REF TO CL_SALV_WD_UIE_IMAGE.

LO G

SRINIVASULU BANDI CREATE OBJECT LR_BUTTON. *2. Get the corresponding column instance
LR_COLUMN = LV_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'VBELN' ). LR_BUTTON->SET_TEXT_FIELDNAME( 'VBELN' ). LR_COLUMN->SET_CELL_EDITOR( LR_BUTTON ).

*aDD A dELETE BUTTON ON alv toolbar

LR_BUTTON1->SET_IMAGE_SOURCE( '@11@' ).

DATA LR_FUNCTION TYPE REF TO CL_SALV_WD_FUNCTION.

CREATE OBJECT LR_INPUT EXPORTING VALUE_FIELDNAME = 'MATNR'.

LR_INPUT->SET_READ_ONLY( ABAP_FALSE ).

LV_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'MATNR' )->SET_CELL_EDITOR( LR_INPUT ). LV_VALUE->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( ABAP_FALSE ).

N D

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

IS

LV_VALUE->IF_SALV_WD_FIELD_SETTINGS~GET_FIELD( 'VBELN' )->IF_SALV_WD_SORT~CREATE_SORT_RULE( GROUP_AGGREGATION = ABAP_TRUE ). DATA LR_INPUT TYPE REF TO CL_SALV_WD_UIE_INPUT_FIELD.

LV_VALUE->IF_SALV_WD_FIELD_SETTINGS~GET_FIELD( 'NETPR' )->IF_SALV_WD_AGGR~CREATE_AGGR_RULE( ).

*1. First get the instace of that field using method GET_FIELD *

H N

**************************************************************** *GRAND TOTAL

LO G

CREATE OBJECT LR_BUTTON1. * lr_button1->set_text( 'DELETE' ).

DATA LR_BUTTON1 TYPE REF TO CL_SALV_WD_FE_BUTTON.

SRINIVASULU BANDI
LR_FUNCTION = LV_VALUE>IF_SALV_WD_FUNCTION_SETTINGS~CREATE_FUNCTION( 'TOOLBAR' ). LR_FUNCTION->SET_EDITOR( LR_BUTTON1 ). LO_ND_VBAP>BIND_TABLE( NEW_ITEMS = LT_VBAP SET_INITIAL_ELEMENTS = ABAP_FALSE ).

ENDMETHOD.

N D

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

IS

H N

LO G