cancel
Showing results for 
Search instead for 
Did you mean: 

Iterator Problem

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Can anyone explains why we should use fields symbols

Effect are the SAME ! fill tha table as parameters!!!!

I have been doin this to try but there is no changes!!!!

I did that Blog too ... Is it possible that maybe the SUPPORT PACKAGE is too low ? that it is a previous bug ?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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?

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi

I still have the error message

Business Server Page (BSP) Error

BSP exception: Structure component with name "ICON" does not exist

In the browser. For any reason I think it is trying to read the internal table with the column name ICON!!!

Former Member
0 Kudos

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

Former Member
0 Kudos

Hemendra,

Off course I did change that!

Thx

Former Member
0 Kudos

Hi Stefan,

Can you post the code that you are using in the methods of the iterator class so that we can help you.

Regards,

Ravikiran.

Former Member
0 Kudos

Hi Rav,

The code is in the thread start...

I've been using iterators previously but never got this error.

Regards,

--

stephan

Former Member
0 Kudos

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

Former Member
0 Kudos

Now I do have an field symbols not assigned.

What should I assign the field symbols within the method.

regards,

Former Member
0 Kudos

Hi,

I did try your solution without believing into it. Because the effect is the same and still get the error message.

Thanks for trying.

Steph