cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to delete a column in Table in webdynpro

Former Member
0 Kudos

Hi All,

I am enhancing 'HRRCF_C_SEARCH_UI' dynpro of erec and want to hide country & reference code column in view VW_UNREG_HITLIST.

I tried using CALL METHOD LR_TABLE->REMOVE_COLUMN in wodomodifyview in post-exit, but it is not working.

Please help me.

Regards,

Rajan Jain


Accepted Solutions (0)

Answers (2)

Answers (2)

rajeshkothamasu
Active Participant
0 Kudos

Hi,

try with below coding

data : gs_table type ref to cl_wd_table,

         gs_abs_column type ref to cl_wd_abastr_table_column.

gs_table ?= view->get_element( id = 'TABLE' ). "Table ID

call method gs_table->remove_column

exporting

id = 'REF_CODE'

index = 1

importing

the_column = gs_abs_col.

former_member184578
Active Contributor
0 Kudos

Hi,

use remove_grouped_column() method to achieve this.

Code snippet:


DATA: lr_table    TYPE REF TO cl_wd_table,

       lr_abs_col TYPE REF TO cl_wd_abstr_table_column.

lr_table ?= view->get_element( id = 'TABLE ). " ID of Table UI

     CALL METHOD lr_table->remove_grouped_column

       EXPORTING

         id                = 'COL1' " column

         index             = 1      " index

       RECEIVING

        the_grouped_column = lr_abs_col.

hope this helps u,

Regards,

Kiran

Former Member
0 Kudos

Hi Kiran,

I tried the code mentioned by you, but it is giving error.

Runtime Errors         OBJECTS_OBJREF_NOT_ASSIGNED

Exception              CX_SY_REF_IS_INITIAL

Detail:

You attempted to use a 'NULL' object reference (points to 'nothing')

access a component (variable: "LR_TABLE").

An object reference must point to an object (an instance of a class)

before it can be used to access components.

Either the reference was never set or it was set to 'NULL' using the

CLEAR statement.

Regards,

Rajan Jain

former_member184578
Active Contributor
0 Kudos

Hi,

Please see in ST22 the error details. As mentioned in coments in the code, you need to replace the ID (TABLE) to your ID name of table in view layout. and the column name too..

I guess you didn't change those.!!

If not, please post the dump details of ST22

Regards,

Kiran

Former Member
0 Kudos

Hi Kiran,

Dump Analysis :

method _PST_4YWBYG6OI6AO3EJY7A2KK1NI4 . "Exit of WDDOMODIFYVIEW (in ZHR_EREC_UNREG_SRCH_ENH

    DATA lo_nd_job_hits TYPE REF TO if_wd_context_node.

  DATA lt_job_hits TYPE wd_this->elements_job_hits.

  data:lr_table type ref to cl_wd_table,
       lr_column type ref to CL_WD_TABLE_COLUMN,
       lr_abs_col TYPE REF TO cl_wd_abstr_table_column.

      lr_table ?= view->get_element( 'JOB_HITS' ).

      CALL METHOD lr_table->remove_grouped_column
       EXPORTING
         id                = 'COUNTRY_TXT' " column
         index             = 3      " index
       RECEIVING
        the_grouped_column = lr_abs_col.

Its showing error on Call method statement.

former_member184578
Active Contributor
0 Kudos

Hi,

Seems, lr_table is Initial here!! Please keep a break point at Call Method statement and check that lr_table has reference or not. And please make sure the table ID is JOB_HITS in the Layout

Edit: I see that the Id of the table is 'TABLE' in the view VW_UNREG_HITLIST, so please change it

Your code should be as below:


lr_table ?= view->get_element( 'TABLE' ).

CALL METHOD lr_table->remove_grouped_column

       EXPORTING

         id                = 'TABLE_COUNTRY_TXT' " column

         index             = 3      " index

       RECEIVING

        the_grouped_column = lr_abs_col.

hope this helps,

Regards,

Kiran

rajeshkothamasu
Active Participant
0 Kudos

Hi

Try with below coding

lr_table ?= view->get_element( 'TABLE' ).

CALL METHOD lr_table->remove_grouped_column

       EXPORTING

         id                = 'TABLE_COUNTRY_TXT' " column

         index             = 3      " index

       RECEIVING

        the_grouped_column = lr_abs_col.

if wrong correct me.

Former Member
0 Kudos

Hi Kiran,

I rectified the mistakes that you told, the method remove_grouped_column was not working but method REMOVE_COLUMN worked.

Thanks for your support.

Regards,

Rajan Jain