on 10-05-2005 8:24 AM
I'm using BSP and creating a class iterator.
I'm tryin to add a column that does not exists in the table.
GET_COLUMN_DEFINITIONS:
method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS .
DATA : LW_COL LIKE LINE OF P_COLUMN_DEFINITIONS.
SELECT COLUMN
LW_COL-COLUMNNAME = 'SELECT'.
"this column does not exists in itab
APPEND LW_COL TO P_COLUMN_DEFINITIONS .
NAME
LW_COL-COLUMNNAME = 'NAME'.
APPEND LW_COL TO P_COLUMN_DEFINITIONS .
endmethod.
RENDER_CELL_START:
method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START .
FIELD-SYMBOLS <FS_BP> TYPE BAPIVENDOR_04.
DATA : LO_IMG TYPE REF TO CL_HTMLB_IMAGE.
IF P_COLUMN_KEY = 'SELECT'.
ASSIGN P_ROW_DATA_REF->* TO <FS_BP> .
DATA : L_ID TYPE STRING.
CREATE OBJECT LO_IMG.
MOVE <FS_BP>-VENDOR TO LO_IMG->ID .
LO_IMG->SRC =
CL_BSP_MIMES=>SAP_ICON( id = 'ICON_SELECT_DETAIL' ) .
LO_IMG->ONCLICK = 'VENDOR'.
P_REPLACEMENT_BEE = LO_IMG.
ENDIF.
endmethod.
And the following error message.
My bsp page does contain any ref to the SELECT but do have the following erro message
Business Server Page (BSP) Error
BSP exception: Structure component with name "SELECT" does not exist
Hi Stef,
Are you now using field symbol <LW_COL> in place of LW_COl ? The coding in get_column_definitions method should be this:
FIELD-SYMBOLS: <LW_COL> LIKE LINE OF p_column_definitions.
APPEND INITIAL LINE TO p_column_definitions ASSIGNING <LW_COL>.
<LW_COL>-columnname = 'SELECT'.
<LW_COL>-title = 'SELECT'.
APPEND INITIAL LINE TO p_column_definitions ASSIGNING <LW_COL>.
<LW_COL>-columnname = 'NAME'.
<LW_COL>-title = 'NAME'.
Is your code the same one? Try to follow steps as in Brian's weblog on HTMLB TableView Iterator.
/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator
Regards,
Ravikiran.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It doesn't matter if you use field-symbols or not (although they are a more efficient way to program). They certainly don't have anything to do with this solution.
Have you set a break-point in your RENDER_CELL_START? If you don't process the new column in this method, control will return to the default rendering of the tableView which of course will throw an error because the column doen't exist in the underlying table.
What Support Package are you on? That blog goes back fairly far and I know I was creating extra columns in some fairly old support packages. I doubt that the level is a problem (but it might be a bug in a particular release). Does the SAP application SBSPEXT_TABLE work OK?
hi,
in your IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS
-
FIELD-SYMBOLS: <LW_COL> LIKE LINE OF p_column_definitions.
APPEND INITIAL LINE TO p_column_definitions ASSIGNING <LW_COL>.
<LW_COL>-COLUMNNAME = 'SELECT'.
<LW_COL>-TITLE = 'SELECT'.
-
and your IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START
-
CASE p_column_key.
WHEN 'SELECT'.
<write your code for BEE here.>
endcase.
-
hope this helps you.
Regards,
Hemendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Now in the get_column_definitions method write this code..
APPEND INITIAL LINE TO p_column_definitions ASSIGNING <LW_COL>.
<LW_COL>-columnname = 'ICON'.
<LW_COL>-title = 'Status'.
..........
..........
Now in the RENDER_CELL_START method write this code to display icon:
CASE p_column_key.
WHEN 'ICON'.
p_replacement_bee = cl_htmlb_image=>factory( id = p_cell_id
src = '@08@' ).
END CASE.
Try this out and for pls further problems revert back.
Regards,
Ravikiran.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
if you have copied the code then look at this
instead of this:
FIELD-SYMBOLS:<LW_COL LIKE> LINE OF P_COLUMN_DEFINITIONS
use:
FIELD-SYMBOLS:<LW_COL> LIKE LINE OF P_COLUMN_DEFINITIONS
i think the problem is due to this only, or due to some syntax error inside ' ' since it is not checked during syntax check.
regards,
Hemendra
Hi Stephan,
LW_COL should be a Field Symbol. It should be like this:
<b>FIELD-SYMBOLS:<LW_COL LIKE> LINE OF P_COLUMN_DEFINITIONS</b>
and use this:
<LW_COL LIKE>-columnname = 'SELECT'.
Regards,
Ravikiran.
Message was edited by: Ravikiran C
Message was edited by: Ravikiran C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.