Skip to Content
author's profile photo Former Member
Former Member

syntax error

Hi ,

I created one view having table which displays VBAK information.

for that

1) Create node( node_vbak) having table vbak under context of component controller

CONTEXT

NODE_VBAK (Node name)

vbeln

erdat

....

2) Created view (Main)

i) mapped component controller context to view controller context

II) Under Layout tab created table (Tableex )

III) Created context binding for table Tableex

iv) Under WDDOINIT Method

code written as

method wddoinit .

DATA lo_nd_node_vbak TYPE REF TO if_wd_context_node.

DATA lo_el_node_vbak TYPE REF TO if_wd_context_element.

DATA ls_node_vbak TYPE wd_this->element_node_vbak.

select * from vbak into corresponding fields of table ls_node_vbak.

  • navigate from <CONTEXT> to <NODE_VBAK> via lead selection

lo_nd_node_vbak = wd_context->get_child_node(

name = wd_this->wdctx_node_vbak ).

lo_nd_node_vbak->bind_table( ls_node_vbak ).

endmethod

I am getting error as

"LS_NODE_VBAK" is not an internal table "OCCURS n" specification is missing

if I change LS_node_vbak as

DATA ls_node_vbak TYPE standard table of vbak.

Then I am getting correct output.

Here my question.

DATA ls_node_vbak TYPE wd_this->element_node_vbak.

with this delclaration , I want to get the output

should I change any select statment.

Thanks,

Asha

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2009 at 09:18 AM

    hi

    you change

    DATA ls_node_vbak TYPE wd_this->element_node_vbak.

    DATA ls_node_vbak TYPE wd_this->elements_node_vbak.

    or

    select * from vbak into corresponding fields ls_node_vbak.

    endselect.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 17, 2009 at 09:50 AM

    Hi Asha,

    Refer to Alex Justin's reply in this [thread|bind-table-with-dynamic-data].

    I hope it helps.

    Regards

    Arjun

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 17, 2009 at 11:24 AM

    Hi Asha,

    I think problem is since your select statement is returning values which contains a mandt field as well and in yur node you dont have attribute for mandt field you are getting error.......

    regards

    Pranav

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 17, 2009 at 11:50 AM

    As a general rule of good programming technique you should never return data directly into data objects defined off of the generated Context structures. In your case wd_this->element_node_vbak. If the context definition changes, this can break your code. In your case you are using the structure element_node_vbak instead of the internal table elements_node_vbak - hence the error. Or you could have said DATA ls_node_vbak TYPE STANDARD TABLE OF wd_this->element_node_vbak.

    Actually another rule of structure for Web Dynpro is that you should never have SELECT statements in your coding. You are violating MVC. You should only have select statements in the assistance class, another free form class, a service object, or some other form of model.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.