Skip to Content
avatar image
Former Member

Displaying data in ALV for a Particular fields

Hi Team,

I Entered the sales order no as input and i am displaying the data in ALV table.

I am using SALV_WD_TABLE and in view i used view container but my node contains 4 fields like VBELN POSNR MATNR MATKL with using the table VBAP, but in output i am seeing all fileds in table VBAP but i want to see only 4 fields of my node fileds are VBELN POSNR MATNR MATKL

Can any one help this issue.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jan 21, 2013 at 09:25 AM

    there are two ways to do this:

    1. as sown by biabani afzal.

    2. you can hide additional column by configuring ALV in WDDOINIT hook method.

    example:-

       * alv component intantiation
      lo_cmp_usage =   wd_this->wd_cpuse_ALV( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
    * calling interfacecontroller get_model method
      lo_interfacecontroller =   wd_this->wd_cpifc_ALV( ).
      lv_value = lo_interfacecontroller->get_model(
      ).

       *Get all the columns to make row editable
      CALL METHOD lv_value->if_salv_wd_column_settings~get_columns
        RECEIVING
          value = lt_columns.

    *Now loop the columns table and change the cell editor of a column
      LOOP AT lt_columns INTO ls_columns.

           CASE ls_columns-id.
           WHEN  'COLUMN_NAME'.

        ls_columns-r_column->set_visible( if_wdl_core=>visibility_none ).

    ENDLOOP.

    <removed by moderator>

    Message was edited by: Oxana Noa Zubarev

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Jitendra Yadav wrote:

      there are two ways to do this:

      1. as sown by biabani afzal.

      2. you can hide additional column by configuring ALV in WDDOINIT hook method.

      example:-

         * alv component intantiation
        lo_cmp_usage =   wd_this->wd_cpuse_ALV( ).
        IF lo_cmp_usage->has_active_component( ) IS INITIAL.
          lo_cmp_usage->create_component( ).
        ENDIF.
      * calling interfacecontroller get_model method
        lo_interfacecontroller =   wd_this->wd_cpifc_ALV( ).
        lv_value = lo_interfacecontroller->get_model(
        ).

         *Get all the columns to make row editable
        CALL METHOD lv_value->if_salv_wd_column_settings~get_columns
          RECEIVING
            value = lt_columns.

      *Now loop the columns table and change the cell editor of a column
        LOOP AT lt_columns INTO ls_columns.

             CASE ls_columns-id.
             WHEN  'COLUMN_NAME'.

          ls_columns-r_column->set_visible( if_wdl_core=>visibility_none ).

      ENDLOOP.

      reward if helpful.

      Hi, you can also do this in an own method within your componentcontroller to keep your wddoint a bit more structured with less coding.

      regards,

      Mathias

  • avatar image
    Former Member
    Jan 19, 2013 at 04:35 PM

    Hello Venkatesh,

                           Go to the context where you have declared VBAP node, and remove the dictionary structure VBAP.

    see the below image.


    Add comment
    10|10000 characters needed characters exceeded

  • Jan 23, 2013 at 12:56 PM

    Hi Durga,

    If the context node which is mapped to the ALV DATA node is defined as having a dictionary structure, it will automatically display all fields of the structure even if only a subset of fields is selected for the context node. To make the ALV display only the context node fields, remove the dictionary structure from the context node definition.

    Cheers,

    Amy

    Add comment
    10|10000 characters needed characters exceeded