on 07-16-2011 6:00 AM
Hi Guys,
I have inserted image element as cell editor in alv column. But image is not coming. Check the below code and let me know where i did mistake.
DATA: LR_IMG3 TYPE REF TO CL_SALV_WD_UIE_IMAGE.
DATA: LO_COLUMN3 TYPE REF TO CL_SALV_WD_COLUMN.
LO_COLUMN3 = LO_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'PINFO' ).
CREATE OBJECT LR_IMG3.
LR_IMG3->SET_SOURCE_FIELDNAME( 'PINFO' ).
LR_IMG3->SET_HEIGHT_FIELDNAME( '20' ).
LO_COLUMN3->SET_CELL_EDITOR( LR_IMG3 ).
And what parameter i should pass to set_height_fieldname. ? I tried with 20px also, error saying 20px unknown.
Regards
Srinivas
Hi Srinivas,
Try this...
data lo_cmp_usage type ref to if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_alv( ).
if lo_cmp_usage->has_active_component( ) is initial.
lo_cmp_usage->create_component( ).
endif.
DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
lo_INTERFACECONTROLLER = wd_this->wd_cpifc_alv( ).
DATA lo_value TYPE ref to cl_salv_wd_config_table.
lo_value = lo_interfacecontroller->get_model( ).
data col type ref to CL_SALV_WD_COLUMN.
col = lo_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'IMAGE' ).
data image type ref to cl_salv_wd_uie_image.
CREATE OBJECT image.
image->SET_SOURCE_FIELDNAME( 'IMAGE' ).
COL->SET_CELL_EDITOR( image ).
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kris,
My code is also same as your code. am not getting images. i am getting cell as image cell but not displaying my images.
check this code.
IF WT_PR-PINFO = '2'.
LS_NPREQUESTS-PINFO = 'CORRECT.JPEG' .
ELSE.
LS_NPREQUESTS-PINFO = 'WRONG.JPEG' .
ENDIF.
in above code both correct and wrong images are stored in mimes folder. but its not taking images. instead of images it dispalying cross ( X) mark. ( it means no image )
And any idea about height which i asked?
Regards
Srinivas
Hello Srinivas,
you need to mention the full path for the mime object. because the ALV is a different component, and the mime object is in our component wont be available in the AL V component.
so maintain the source value as '/sap/bc/webdynpro/sap/Z_TEMP/image.jpg'
Z_TEMP - is your component name and image.jpg is your mime object name.
hope this solves your problem.
BR, Saravanan
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.