Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV - Column hiding error...

Former Member
0 Likes
719

Hi,

I m working on ALV. I have to show the few colums in first display, then the user will select the column from the list and then iwill display the other columns.

I m using 'no_output' for hiding the few columns, but when user selects from the list then the values in those column is incorrect. In some cases it is repeating the earlier values.

Field sequence and the internal field table sequence is correct.

Also in debugging I can see correct values in the all fields.

So is there any other way to hide and then display with correct content ?

Many thanks.

- Umesh.

Hi,

I m working on ALV. I have to show the few colums in first display, then the user will select the column from the list and then iwill display the other columns.

I m using 'no_output' for hiding the few columns, but when user selects from the list then the values in those column is incorrect. In some cases it is repeating the earlier values.

Field sequence and the internal field table sequence is correct.

Also in debugging I can see correct values in the all fields.

So is there any other way to hide and then display with correct content ?

Many thanks.

- Umesh.

5 REPLIES 5
Read only

Former Member
0 Likes
618

Hello Umesh,

The way u r doing to hide the fields is correct <b>NO_OUT = 'X'</b>.

Check the itab before u r passing to ALV FM whether u r filling data again to the table.

Otherwise u can make the option of using the Display Variant so that the user can change the layout as if he wants.

USe this code


DATA : g_r_disp_variant TYPE disvariant.





SELECTION-SCREEN BEGIN OF BLOCK variant WITH FRAME TITLE text-003.
PARAMETERS:  p_varian LIKE disvariant-variant DEFAULT '/STANDARD'.
SELECTION-SCREEN END OF BLOCK variant.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varian.
  PERFORM show_existing_display_variants.

*&---------------------------------------------------------------------
*
*&      Form  SHOW_EXISTING_DISPLAY_VARIANTS
*&---------------------------------------------------------------------
*
*       text
*----------------------------------------------------------------------
*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------
*
FORM show_existing_display_variants.

  g_r_disp_variant-report = sy-repid.

  CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
       EXPORTING
            is_variant    = g_r_disp_variant
            i_save        = 'A'
       IMPORTING
            es_variant    = g_r_disp_variant
       EXCEPTIONS
            not_found     = 1
            program_error = 2
            OTHERS        = 3.
  IF sy-subrc = 0.
    p_varian = g_r_disp_variant-variant.
  ENDIF.


ENDFORM.                               " SHOW_EXISTING_DISPLAY_VARIANTS





*form get_output


  g_repid = sy-repid.
*  display variant
  g_r_disp_variant-report = sy-repid.
  IF NOT p_varian IS INITIAL.
    g_r_disp_variant-variant = p_varian.
  ENDIF.




*get_output



  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            i_callback_program = g_repid
            i_grid_title       = 'PRICE COMPARISON REPORT:'
            is_layout          = it_layout
            it_fieldcat        = it_fldcat
            is_variant         = g_r_disp_variant
            i_default          = 'X'
            i_save             = 'A'
       TABLES
            t_outtab           = g_t_itab_alv
       EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.

Please reward if helps.

Thanks,

Vasanth

Read only

0 Likes
618

Hi...

Thanks for the quick replies.

I have already used the display layout variant.

But still it is not working.

Even in the internal table which is finally i m passing populated correctly.

Thanks...

Umesh

Read only

0 Likes
618

Hello Umesh,

Could u paste the ur code...

Regards,

Vasanth

Read only

0 Likes
618

Hello Umesh Lohar,

If you want to remove the field permanently, even user should not be able to see while changing layout

use tech field of fieldcatalog and it should be 'X' in order to not to display it to user even while changing layout.

Hope that helps.

Regards

Kapadia

***Assigning points is the way to say thanks in SDN.***