cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding enhancement for ALV usage Need Help!

Former Member
0 Kudos

Hi All,

I am trying to enhance my standard component in which i need to use alv uasge . i was able to create a node and and embed into the window but was very much surprised to see that since i has enhanced it i was not able to see the component usage option in my enhancement as we do generally in our normal ALVs. SO i made a try using the logic og dynamic context set_data method i instatiated the ALV and called the method of Get_model of interface controller but and i used the method set_data ( ) .

I got the dump as Data no longer available when SALV_WD_TABLE GET_MODEL.

Tried a lot with various options but unable to solve this ERROR! :(.

Can anyone please giv a solution for my problem .. and explain me clearly like how should or can i slove my issue ........

Awaiting for your valuable suggestions and answers.

Regards,

Sana.

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

Hi Misbah

I don't understand why you are getting a dump while using the get_model method. It works fine for me. Look at the code which I am using in one of my component and it works fine.



data: l_ref_cmp_usage type ref to if_wd_component_usage.
  l_ref_cmp_usage =   wd_this->wd_cpuse_alv_first( ).
  if l_ref_cmp_usage->has_active_component( ) is initial.
    l_ref_cmp_usage->create_component( ).
  endif.

  data l_salv_wd_table type ref to iwci_salv_wd_table.
  l_salv_wd_table = wd_this->wd_cpifc_alv_first( ).
  data l_table type ref to cl_salv_wd_config_table.
  l_table = l_salv_wd_table->get_model( ).
  data l_column type ref to cl_salv_wd_column.

 data linkview type ref to cl_salv_wd_uie_link_to_action.
  l_column = l_table->if_salv_wd_column_settings~get_column( 'CONNID' ).
  create object linkview.
  linkview->set_text_fieldname( 'CONNID' ).
  l_column->set_cell_editor( linkview ).

I hope it helps.

Regards

Arjun

Answers (1)

Answers (1)

former_member402443
Contributor
0 Kudos

Hi Misbah,

As per your question, you are getting dump as Data no longer available when SALV_WD_TABLE GET_MODEL. is called.

For resolving this issue, check this code.

You have to pass some dummy data in the internal table and bind that internal table to the node and after that pass that node to the set_data method of alv grid.

DATA : lo_nd_payment_table TYPE REF TO if_wd_context_node.

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

lo_nd_payment_table = wd_context->get_child_node( name = wd_this->wdctx_payment_table ).

*Inserting the blank rows in the grid*

DO 5 TIMES.

APPEND ls_payment_table TO lt_payment_table.

CLEAR ls_payment_table.

ENDDO.

  • Binding the table data to the context node

lo_nd_payment_table->bind_table(

new_items = lt_payment_table

set_initial_elements = abap_true ).

  • Data declaration for reference to the alv grid

DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table ,

lo_cmp_usage_ctr TYPE REF TO if_wd_component_usage.

  • create an instance of used ALV Component <PAYMENT_DETAILS>

lo_cmp_usage_ctr = wd_this->wd_cpuse_payment_detail( ).

IF lo_cmp_usage_ctr->has_active_component( ) IS INITIAL.

lo_cmp_usage_ctr->create_component( ).

ENDIF.

l_ref_interfacecontroller = wd_this->wd_cpifc_payment_detail( ).

l_ref_interfacecontroller->set_data( lo_nd_payment_table ).

DATA : lr_salv_wd_table_ctr TYPE REF TO iwci_salv_wd_table.

  • get ALV Component <CONTRACT_DETAILS>

lr_salv_wd_table_ctr = wd_this->wd_cpifc_payment_detail( ).

wd_this->alv_config_table = lr_salv_wd_table_ctr->get_model( ).

Hopes this will helps you.

Regard

Manoj Kumar