cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with my first WebItem creation

Former Member
0 Kudos

Hello,

I'm trying to create a new webItem, but I have some problem. I have created one row in RSRRENDERER table :

REN NAME : ZCL_WWW_LAYOUT

REN CLASS : GRID

POSN : 0

blank for other fields of the row.

In the RSRRENDERERATR table :

REN NAME : ZCL_WWW_LAYOUT

ATR NAME : NAME

ATR TYP : RENDERER

CHR MAX LEN : 0

VALUE : ZCL_WWW_LAYOUT

POSN : 0

CAPTION : caption

DESCRIPTION : description

blank for other fields of the row.

I'm have created a new class ZCL_WWW_LAYOUT (super class: CL_RSR_WWW_ITEM_TEXT_ELEMENTS) and I have redefined public method RENDER with this code :

method RENDER.
CALL METHOD SUPER->RENDER
  EXPORTING
    I_R_PARAMETER        = i_r_parameter
    I_NO_SNIPPET_MARKERS = i_no_snippet_markers
  EXCEPTIONS
    X_MESSAGE            = 1
    NO_PROCESSING        = 2
    NO_SNIPPET_POSSIBLE  = 3
    others               = 4
        .

n_sx_output-string = '<h1>Hello World</h1>'.

endmethod.

In the WAD, i have created a webtemplate with this code :


...
<P><object>
         <param name="OWNER" value="SAP_BW"/>
         <param name="CMD" value="GET_ITEM"/>
         <param name="NAME" value="WEBITEM_1"/>
         <param name="ITEM_CLASS" value="ZCL_WWW_LAYOUT"/>
         <param name="CAPTION" value="test webitem"/>
         <param name="GENERATE_LINKS" value=""/>
         <param name="CLOSED" value="X"/>
         ITEM:            WEBITEM_1
</object></P>
...

And when I lunch my webtemplate I've got an error (not very explicit !) ...


Messages: 
 Error loading item WEBITEM_1. 

What is the step I have forgetten in the creation of my webitem ?

Thanks for your help,

GC.

Accepted Solutions (1)

Accepted Solutions (1)

former_member189638
Active Contributor
0 Kudos

have you included this Web Template as an object in another WAD???

Then I think you need to assign a dataprovider to the Web Item.

Once you do this then along with other code you can also see the following code.

<param name="DATA_PROVIDER" value="DP"/>

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

in general, if you inherit from an item of SAP you need to copy all Parameters of RSRRENDERERATR of that specific item to your item.

Because, when SAP creates the instance of your item it will call SET_ITEM method of you base class. When this class references Objects whoich could not be initialized due to missing parameters you will get this error. If you would like to create an item without relation to a dataprovider you should inherit from Class CL_RSR_WWW_ITEM and override methods Set_item and Render_data or Render.

Also make sure that you base class also needs no dataprovider binding.

best regards,

Kai

Former Member
0 Kudos

I think I don't need to assign a dataprovider, because in the table RSRRENDER, I haven't put true for the field 'WITH_DATABIND'. (Anyway I can't specified an infoprovider in webitem properties)

My webtemplate is very simple, I just have put (by drag and drop) my webitem in a new webtemplate.