cancel
Showing results for 
Search instead for 
Did you mean: 

Showing dump due to attribute not found

vijy_mukunthan
Active Contributor
0 Kudos

Hi all

Am new to web dynpro. I create a node as ADOBE and attribute has pernr,endda,begda,sname and in the layout interactive form is designed and binded. In the meithod WDDOINIT i wrote my code to fetch the data and displys in the form. my code is below

DATA LO_ND_ADOBE TYPE REF TO IF_WD_CONTEXT_NODE.
  DATA LO_EL_ADOBE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
  DATA LS_ADOBE TYPE WD_THIS->ELEMENT_ADOBE.
  DATA LT_PA0001 TYPE TABLE OF PA0001.
* navigate from <CONTEXT> to <ADOBE> via lead selection
  LO_ND_ADOBE = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_ADOBE ).

* get element via lead selection
  LO_EL_ADOBE = LO_ND_ADOBE->GET_ELEMENT(  ).

* get all declared attributes
*  LO_EL_ADOBE->GET_STATIC_ATTRIBUTES(
*    IMPORTING
*      STATIC_ATTRIBUTES = LS_ADOBE ).



SELECT  * FROM PA0001 INTO CORRESPONDING FIELDS OF TABLE LT_PA0001 WHERE PERNR = '01234544'.

When i execute it nothing is displyed in the form.

But when i add the set_attribute

LO_EL_ADOBE->SET_ATTRIBUTE(
EXPORTING
  VALUE = LT_PA0001
  NAME  = 'ADOBE'
).

Its throw me a dump saying there is no attribute name as adobe. but in the context the name of the node is ADOBE only. where to rectify the error.

Regards

vijay

Accepted Solutions (0)

Answers (3)

Answers (3)

vijy_mukunthan
Active Contributor
0 Kudos

solved

Former Member
0 Kudos

Hi Vijay,

ADOBE is the name of the node not the attribute. The attributes are pernr,endda,begda,sname. So you can use set_attribute method to set any of these.

If you want to set values for the node ADOBE you can use bind_table method using lo_nd_adobe as the reference from interface if_wd_context_node.

Best Regards,

Pooja

vijy_mukunthan
Active Contributor
0 Kudos

HI

Now able to get the adobe form but am not able see any data getting filled. I debugged and checked the select statement LT_Pa0001 is getting filled. But no data get displays.

Here is my complete code

METHOD WDDOINIT .

  DATA LO_ND_ADOBE TYPE REF TO IF_WD_CONTEXT_NODE.
  DATA LO_EL_ADOBE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
  DATA LS_ADOBE TYPE WD_THIS->ELEMENT_ADOBE.
  DATA LT_PA0001 TYPE TABLE OF PA0001.
* navigate from <CONTEXT> to <ADOBE> via lead selection
  LO_ND_ADOBE = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_ADOBE ).

* get element via lead selection
  LO_EL_ADOBE = LO_ND_ADOBE->GET_ELEMENT(  ).

* get all declared attributes
*  LO_EL_ADOBE->GET_STATIC_ATTRIBUTES(
*    IMPORTING
*      STATIC_ATTRIBUTES = LS_ADOBE ).



SELECT  * FROM PA0001 INTO CORRESPONDING FIELDS OF TABLE LT_PA0001 WHERE PERNR = '01234544'.


  LO_EL_ADOBE->SET_STATIC_ATTRIBUTES(
    EXPORTING
      STATIC_ATTRIBUTES = LS_ADOBE ).

LO_ND_ADOBE->BIND_TABLE( LT_PA0001 ).

ENDMETHOD.

How do display the adobe form with data.

Regards

vijay

vijy_mukunthan
Active Contributor
0 Kudos

Hi

Now the dump error is rectified but am not getting the values filled in the adobe form. Only adobe form is displayed no data is populated. I have checked the internal table the data are filled but its not displayed. Here is my code.

DATA LO_ND_ADOBE TYPE REF TO IF_WD_CONTEXT_NODE.
  DATA LO_EL_ADOBE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
  DATA LS_ADOBE TYPE WD_THIS->ELEMENT_ADOBE.
  DATA LT_PA0001 TYPE TABLE OF PA0001.
* navigate from <CONTEXT> to <ADOBE> via lead selection
  LO_ND_ADOBE = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_ADOBE ).

* get element via lead selection
  LO_EL_ADOBE = LO_ND_ADOBE->GET_ELEMENT(  ).

* get all declared attributes
  LO_EL_ADOBE->GET_STATIC_ATTRIBUTES(
    IMPORTING
      STATIC_ATTRIBUTES = LS_ADOBE ).



SELECT  * FROM PA0001 INTO CORRESPONDING FIELDS OF TABLE LT_PA0001 WHERE PERNR = '01234544'.


  LO_EL_ADOBE->SET_STATIC_ATTRIBUTES(
    EXPORTING
      STATIC_ATTRIBUTES = LS_ADOBE ).

LO_ND_ADOBE->BIND_TABLE( LT_PA0001 ).

Kindly help me out.

Regards

vijay

Former Member
0 Kudos

Removed the wrong info

Thanks

Bala Duvvuri

Edited by: Bala Duvvuri on Jul 12, 2009 11:53 PM

Former Member
0 Kudos

Hi,

LO_EL_ADOBE->SET_STATIC_ATTRIBUTES(

EXPORTING

STATIC_ATTRIBUTES = LS_ADOBE ). "Why are you filling this again.

LO_ND_ADOBE->BIND_TABLE( LT_PA0001 ).

Check the names of the attributes and types of both the internal table and the node to which the ABOBE is bound.

Regards,

Lekha.

Former Member
0 Kudos

Hi,

Set_Attribute accepts the name of the 'ATTRIBUTE' not the 'NODE'. You will have to pass the name of the attribute within your node 'ADOBE' to set its value.

If you want to set node values, use set_static_attributes. If the cardinality is 0:n or 1:n use bind_table .

Can you tell me which value are you trying to set?

Radhika.