cancel
Showing results for 
Search instead for 
Did you mean: 

please provide solution

0 Kudos

hi everyone,

I'm new to SAP ,the task provided to me is to display the data in the display fields when the particular cell in table is selected

at the same time a button is provided make new entries into the table by clicking a button

but when iclick the new entry button the row which is already selected getting erased temporarily

but when i update the new record and save it it is also shown along with new record

the code i used is here below



method onactioncreate .
 DATA:
      node_expenseset                     TYPE REF TO if_wd_context_node,
      elem_expenseset                    TYPE REF TO if_wd_context_element,
      stru_expenseset                    TYPE if_exp_main=>element_expenseset .
*   navigate from <CONTEXT> to <EXPENSESET> via lead selection
    node_expenseset = wd_context->get_child_node( 'EXPENSESET' ).

*   @TODO handle not set lead selection
    IF ( node_expenseset IS INITIAL ).
    ENDIF.

*   get element via lead selection
    elem_expenseset = node_expenseset->get_element(  ).

*   @TODO handle not set lead selection
    IF ( elem_expenseset IS INITIAL ).
    ENDIF.

  clear stru_expenseset.
*   get all declared attributes
    elem_expenseset->set_static_attributes(
      exporting
        static_attributes = stru_expenseset ).


*  data:
*    node_expenseset1                    type ref to if_wd_context_node,
*    elem_expenseset1                    type ref to if_wd_context_element,
*    stru_expenseset1                    type if_exp_main=>element_expenseset1 .
** navigate from <CONTEXT> to <EXPENSESET1> via lead selection
*  node_expenseset1 = wd_context->get_child_node( name = if_exp_main=>wdctx_expenseset1 ).
*
** get element via lead selection
*  elem_expenseset1 = node_expenseset1->get_element(  ).
*
** alternative access  via index
** Elem_Expenseset1 = Node_Expenseset1->get_Element( Index = 1 ).
** @TODO handle non existant child
** if ( Elem_Expenseset1 is initial ).
** endif.
*clear stru_expenseset1.
** get all declared attributes
*  elem_expenseset1->get_static_attributes(
*    importing
*      static_attributes = stru_expenseset1   ).


endmethod.

here both table and drill down report are binded to same node

can any one send me the code to clear only drill down report contents

thanks & Regards

Madhu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi madhu,

Try the following code to add new entries in the table by clicking the button,paste the code on action of the add button

DATA:

node_expenseset TYPE REF TO if_wd_context_node,

elem_expenseset TYPE REF TO if_wd_context_element,

stru_expenseset TYPE if_exp_main=>element_expenseset .

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

node_expenseset = wd_context->get_child_node( 'EXPENSESET' ).

  • @TODO handle not set lead selection

IF ( node_expenseset IS INITIAL ).

ENDIF.

*create element

elem_expenseset = node_expenseset->create_element( ).

*Bind the element to the node

node_expenseset->bind_element(

new_item = elem_expenseset

set_initial_elements = abap_false

).

*set the newly created element to the lead selection

node_expenseset->set_lead_selection( element = elem_expenseset ).

Thanks,

krishna

0 Kudos

thanks

mr.Krishna

it was very hellpful

Answers (0)