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

How to edit values in a node of cardinality 0...n at runtime.

Hi experts,

I am trying to reset value of an attribute of a node of cardinality 0...n at runtime. I am getting data in this node from a BAPI. I want to set one column's value to zero on display in the table created from this node. Please suggest what to do.

Thanks & Regards.

Vaibhav Tiwari.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2008 at 07:14 AM

    hi vaibhav........

    what you have to do is......

    read the node....

    loop the internal table and set the particular column to 0

    and again bind it back....

    if you want to erase an entire node...

    you can go for

    <node>->invalidate().

    ---regards,

    alex b justin

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Vaibhav Tiwari

      Try something like this:

      DATA lo_nd_sflight TYPE REF TO if_wd_context_node.

      DATA lt_sflight TYPE wd_this->elements_sflight.

      FIELD-SYMBOLS: <fs_sflight> TYPE wd_this->element_sflight.

      '* navigate from <CONTEXT> to <SFLIGHT> via lead selection

      lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ).

      '* get all declared attributes

      lo_nd_sflight->get_static_attributes_table(

      IMPORTING

      table = lt_sflight ).

      LOOP AT lt_sflight ASSIGNING <fs_sflight>.

      '* Here do something like <fs_sflight>-fldate = syst-datum.

      ENDLOOP.

      lo_nd_sflight->bind_table( lt_sflight ).

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2008 at 07:19 AM

    Hi Vaibhav Tiwari.

    There are a few possibilities, but i think the best one is to do this when you fill the node.

    When the BAPI returns the table simply loop over it and replace the values of that specific column.

    If you would like to do it before the table is displayed, you could do this in the WDDOMODIFYVIEW. Just retrieve the table from your context node and change the values.

    The disadvantage is that, if you don't check, whether it's the first time (FIRSTTIME = abap_true), then this check will be performed every time a roundtrip is triggered. In case your node contains a lot of data, this can become rather time-consuming.

    Regards,

    Jos

    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.