Fieldcatalog

my fieldcatalog has 5 fields . i have to dynamically display a few fields from these 5 fields.
say i want to display only F1 and F3 rest i want to show invisible.
which property should i choose from LVC_S_FCAT.
in oder to receive the output.

Hi,
Set the 'no_out' as 'X'.
means wa-no-out = 'X', for no output in the field.
Pooja

Similar Messages

  • OOPs ALV report Fieldcatalog Editing a currency field

    Hi all,
    I have created an OOP's ALV report. I have made one of the currency field editable. when I am changing the value in any cell and go out of the cell(or move to other cell using arrow keys or click some were in the grid) it is taking '.' after 2 digits from the right.
    for example if I take 10 it is converting to 0.10, if I take 100 it is becomnig 1.00, if I take 100.00 it is becoming 1.00. If I take 123.45 I am getting a pop up box with message "Too many decimal places"
    the fieldcatalog values are as follows
      WA_FIELDCAT-FIELDNAME   = 'ORD_VAL'.
      WA_FIELDCAT-SCRTEXT_M   = 'Ord Value'.
      WA_FIELDCAT-COL_POS     = 11.
    wa_fieldcat-no_zero     = 'X'.
      WA_FIELDCAT-OUTPUTLEN = 14.
       WA_FIELDCAT-CURRENCY  = 'INR'.
      wa_fieldcat-decimals_o = '2'.
      wa_fieldcat-no_zero = 'X'.
      WA_FIELDCAT-EDIT   = 'X'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR  WA_FIELDCAT.
    Can anybody please help me. As If I edit the field it should take the values what I input.
    Thanks in Advance.

    Hi ,
    The CURR field is the currency unit field in the table ITAB.
    I am just confused with your answer. in my case the final internal table is T_CHKQTY1 shall I take that or anything else. I have taken WA_FIELDCAT-CTABNAME = 'CURR'. but the system is thrownig an error as The data object has no component with CTABNAME but there is a component called TABNAME.
    Can you please currect me.

  • Changing FieldCatalog at runtime in an ALv

    Hi All,
    I have a requirement like : On selection-screen I have 2 input parameters and 2 pushbuttons namely. After input, if press one of these pushbuttons a pop up will come which is having 2 radio buttons. Based on the selection of the radiobutton, I need to make some of the fields editable in a fieldcatalog. But what my problem is .... whatever I select[Radio Button] the first time only that fieldcatalog is getting displayed. Hope I am clear in explaining my problem.
    -SatyaPriya

    hi
    good
    debug the program and check when first time the field catalogue is displaying  what are the process it is following before that,check where you r given the radio button action.
    Thanks
    mrutyun^

  • Creation of dynamic interal table and fieldcatalog for monat field

    Dear Experts,
    I am finding the average days of payments giving to our  vendors. for this i am passing company code, fiscal year , period and vendor in selection screen.
    Based on the period(monat)  i need to display the average days and finally i need to display total of the average days. suppose in selection screen if user enters 3 period then the output is like this.
    OutPut:
    column1    column2         column3                               column4                                  Column5                              column6
    Vendor No Vendor Name Avg days of paymentsPeriod 1  Avg days of paymentsperiod 2  Avg days of paymentsperiod total Averge days
    please advice me to get this output. thanks in advance.

    Hi,
    1.build your fieldcatalog by yourself.
    e.g. 4 columns , you will append 4 records in fieldcatalog internal table.
    2.use this fieldcatalog internal table to create dynamic internal table by method: cl_alv_table_create=>create_dynamic_table.
    3.edit content of  dynamic internal table.
    4.use alv to display it.
    That's all.

  • Create_dynamic_table does not work when fieldcatalog table contains LVC_S_S

    I'm getting short-dump when creating dynamic internal table via CALL METHOD cl_alv_table_create=>create_dynamic_table. The fieldcatalog contains a component named LVC_S_STYL which populates fine when after call function LVC_FIELDCATALOG_MERGE but when this is passed to cl_alv_table_create=>create_dynamic_table it short dumps!
    Is it possible to pass the style catalog in this case, how? Below is my code.
    Structure of 'ZZ_ALV_FCAT' is WERKS type werks_d, DATE type datum, CELLTAB type LVC_S_STYL.
       CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
         EXPORTING
           i_structure_name             = 'ZZ_ALV_FCAT'
          CHANGING
            ct_fieldcat                  = lt_fieldcat.
        CALL METHOD cl_alv_table_create=>create_dynamic_table
          EXPORTING
            it_fieldcatalog           = lt_fieldcat
            i_length_in_byte          = ''
          IMPORTING
            ep_table                  = dy_table
          EXCEPTIONS
            generate_subpool_dir_full = 1
            OTHERS                    = 2.
        IF sy-subrc EQ 0.
          ASSIGN dy_table->* TO <dyn_table>.
        ELSE.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    <b>I'll be generously giving away points for any help!</b>
    Any idea anyone? I was thinking may be convert the HEX data to CHAR before creating the dynamic table then again convert the CHAR data back to HEX before I call SET_TABLE_FOR_FIRST_DISPLAY? In that case, how to convert Hex of a structure to CHAR and vice versa?
    Message was edited by:
            Sougata Chatterjee

    Hi
    I worote this code in my system (4.6C) and I got any dump:
    DATA: CT_FIELDCAT TYPE  LVC_T_FCAT.
    DATA: DY_TABLE TYPE REF TO DATA.
    FIELD-SYMBOLS: <TABLE> TYPE TABLE.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
      EXPORTING
    *   I_BUFFER_ACTIVE              =
        I_STRUCTURE_NAME             = 'ZLVC_S_STYL'
    *   I_CLIENT_NEVER_DISPLAY       = 'X'
    *   I_BYPASSING_BUFFER           =
      CHANGING
        CT_FIELDCAT                  = CT_FIELDCAT
    EXCEPTIONS
       INCONSISTENT_INTERFACE       = 1
       PROGRAM_ERROR                = 2
       OTHERS                       = 3
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
          EXPORTING
            IT_FIELDCATALOG           = CT_FIELDCAT
    *       I_LENGTH_IN_BYTE          = ''
          IMPORTING
            EP_TABLE                  = DY_TABLE
          EXCEPTIONS
            GENERATE_SUBPOOL_DIR_FULL = 1
            OTHERS                    = 2.
    IF SY-SUBRC = 0.
      ASSIGN DY_TABLE->* TO <TABLE>.
      IF SY-SUBRC = 0.
      ENDIF.
    ENDIF.
    I've included the structure LVC_S_STYL in my structure ZLVC_S_STYL and then add some fields.
    But if I insert a field CELL like LVC_S_STYL, instead of to include it directly, I get the dump.
    So I believe it depends on how you've defined the structure in dictionary, because in the second case it seems the METHOD can't create the subroutine to create the dynamic table.
    It seems if it uses a complex structure where a field is a structure, the METHOD can't write a right defintion of an internal table based on the dictionary structure.
    In my system I saw the method try to create a subroutine where the interna table is defined in this way:
    DATA: STYLE TYPE ZLVC_S_STYL-STYLE. 
    instead of
    DATA: STYLE TYPE ZLVC_S_STYL-CELL-STYLE. 
    Max

  • Problem with coloring cells in dynamic fieldcatalog

    Hi All,
    I am trying to color cells based on the values in the cells. Here we are using dynamic fieldcatalog and internal table to build the ALV grid.I am getting problem in adding a field to the fieldcatlog which is of type lvc_t_scol. This Part of the code is used to build fieldcatlog dynamically.
    DEFINE add_cat.
        add 1 to lv_count1.
        lwa_fldcat-col_pos     = lv_count1.
        lwa_fldcat-fieldname = &1 .
        lwa_fldcat-reptext   = &2.
        lwa_fldcat-inttype   =  &3.
        lwa_fldcat-intlen    = &4.
        append lwa_fldcat to lt_fldcat .
      END-OF-DEFINITION.
    *Add Columns to the fieldcatalog
      add_cat c_proj 'Project' 'C' '30'.
      add_cat c_cust 'Customer' 'C' '30'.
      lwa_fldcat-col_pos     = 12.
        lwa_fldcat-fieldname = 'cellcolor' .
        lwa_fldcat-reptext   = 'cell color'.
    <b>    lwa_fldcat-inttype   =  'lvc_t_scol'.</b>
        append lwa_fldcat to lt_fldcat .
    Here i want to assign internal table(lvc_t_scol) to the fieldcatalog as a field.But  lwa_fldcat-inttype is of size 1 which will take one char. Is there any way that we can assign field of type internal table to the field catalog. Becoz of this i am unable to color cells in my ALV grid.
    Thanks

    It is not possible with the METHOD cl_alv_table_create=>create_dynamic_table to include another table inside that newly generated table.
    I have tried to do it with the code and I got the dynamic table created after at the end of the program.
    In the code,
    <DYN_TABLE> has same effect as your <table> variable
    <DYN_WA> has same effect as your <HEADER>
    REPORT  ZTEST_NP_DYNAMIC.
    DATA: DY_TABLE TYPE REF TO DATA,
          DY_LINE  TYPE REF TO DATA.
    FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE,
                   <DYN_WA>,
                   <DYN_FIELD>.
    FIELD-SYMBOLS: <FS> TYPE ANY.
    * To generate the Dyanmic table with the COLOR
    DATA: LS_SOURCE TYPE STRING.
    DATA: LT_SOURCE LIKE STANDARD TABLE OF LS_SOURCE WITH HEADER LINE.
    DATA: L_NAME LIKE SY-REPID.
    DATA: L_MESSAGE(240) TYPE C,
          L_LINE TYPE I,
          L_WORD(72) TYPE C.
    DATA: L_FORM(30) TYPE C VALUE 'TABLE_CREATE'.
    LT_SOURCE = 'REPORT ZTEST_SUBROUTINE_POOL.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'FORM  TABLE_CREATE USING I_FS TYPE ANY.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BEGIN OF LT_GENTAB OCCURS 0.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BUKRS TYPE BUKRS. '.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BKTXT TYPE BKTXT. '.
    APPEND LT_SOURCE.
    * you can add your fields here.....
    LT_SOURCE = 'DATA: COLOR TYPE lvc_t_scol. '.  " <<
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: END OF LT_GENTAB.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: POINTER TYPE REF TO DATA.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'CREATE DATA POINTER LIKE STANDARD TABLE OF LT_GENTAB.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'I_FS = POINTER.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'ENDFORM. '.
    APPEND LT_SOURCE.
    L_NAME = 'ZTEST_SUBROUTINE_POOL'.
    CATCH SYSTEM-EXCEPTIONS GENERATE_SUBPOOL_DIR_FULL = 9.
      GENERATE SUBROUTINE POOL LT_SOURCE NAME L_NAME
               MESSAGE L_MESSAGE LINE L_LINE WORD L_WORD.  "#EC CI_GENERATE
    ENDCATCH.
    IF NOT L_MESSAGE IS INITIAL.
      MESSAGE E000(0K) WITH L_MESSAGE L_LINE L_WORD.
    ENDIF.
    ASSIGN DY_TABLE TO <FS>.
    PERFORM (L_FORM) IN PROGRAM (L_NAME) USING <FS>.
    ASSIGN DY_TABLE->* TO <DYN_TABLE>.
    * Create dynamic work area and assign to FS
    CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>.
    ASSIGN DY_LINE->* TO <DYN_WA>.
    Write: 'bye'.
    Regards,
    Naimesh Patel

  • ALV Error: Fieldcatalog not found...

    Hello Experts,
    I am currently creating a new report that uses object oriented ALV with
    custom control. But when I run my program it always gives me that there is no fieldcatalog
    found. I will paste my code below so you can see. Hope you can help me out here guys.
    Thank you and take care!
    *=====================================================================
    * Program Name : ZSD_ORDERSTAGE
    * Author       : Aris Hidalgo
    * Date Created : May 4, 2007
    * Description  : Display sales orders for a given customer on a given
    *                date range
    *=====================================================================
    REPORT  zsd_orderstage
            NO STANDARD PAGE HEADING.
    * Data Dictionary Table/s                      *
    TABLES: vbak.
    * Global Structure/s                           *
    TYPES: BEGIN OF t_vbak,
              vbeln TYPE vbak-vbeln,
              posnr TYPE vbap-posnr,
              erdat TYPE vbak-erdat,
              ernam TYPE vbak-ernam,
              auart TYPE vbak-auart,
              kunnr TYPE vbak-kunnr,
              vkgrp TYPE vbak-vkgrp,
             END OF t_vbak.
    TYPES: BEGIN OF t_vbfa,
            vbelv   TYPE vbfa-vbelv,
            posnv   TYPE vbfa-posnv,
            vbtyp_n TYPE vbfa-vbtyp_n,
            vbtyp_v TYPE vbfa-vbtyp_v,
            vbeln   TYPE vbfa-vbeln,
           END OF t_vbfa.
    TYPES: BEGIN OF t_likp,
            vgbel TYPE lips-vgbel,
            vgpos TYPE lips-vgpos,
            vbeln TYPE likp-vbeln,
            posnr TYPE lips-posnr,
            kunnr TYPE likp-kunnr,
           END OF t_likp.
    TYPES: BEGIN OF t_vbrk,
            aubel TYPE vbrp-aubel,
            aupos TYPE vbrp-aupos,
            vbeln TYPE vbrk-vbeln,
           END OF t_vbrk.
    TYPES: BEGIN OF t_output,
            salesorder    TYPE vbak-vbeln,
            salesitem     TYPE vbap-posnr,
            salesgroup    TYPE vbak-vkgrp,
            custcode      TYPE vbak-kunnr,
            shipto        TYPE likp-kunnr,
            creation_date TYPE vbak-erdat,
            created_by    TYPE vbak-ernam,
            delorder      TYPE likp-vbeln,
            invnumber     TYPE vbrk-vbeln,
           END OF t_output.
    * Global Internal Table/s                      *
    DATA: gt_vbak   TYPE STANDARD TABLE OF t_vbak,
          gt_vbfa   TYPE STANDARD TABLE OF t_vbfa,
          gt_likp   TYPE STANDARD TABLE OF t_likp,
          gt_vbrk   TYPE STANDARD TABLE OF t_vbrk,
          gt_output TYPE STANDARD TABLE OF t_output.
    * SELECTION-SCREEN                             *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:     p_kunnr TYPE vbak-kunnr OBLIGATORY.
    SELECT-OPTIONS: s_vkgrp FOR vbak-vkgrp,
                    s_auart FOR vbak-auart,
                    s_erdat FOR vbak-erdat  OBLIGATORY,
                    s_ernam FOR vbak-ernam.
    SELECTION-SCREEN END OF BLOCK b1.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    * Data Declaration/s                           *
    DATA: ok_code             TYPE sy-ucomm,
          save_ok             TYPE sy-ucomm,
          g_max               TYPE i VALUE 100,
          g_repid             TYPE sy-repid,
          gs_layout           TYPE lvc_s_layo,
          cont_for_flights    TYPE scrfname VALUE 'BCALV_GRID_02_100',
          grid1               TYPE REF TO cl_gui_alv_grid,
          custom_container    TYPE REF TO cl_gui_custom_container,
          grid2               TYPE REF TO cl_gui_alv_grid,
    * reference to dialogbox container.
          dialogbox_container TYPE REF TO cl_gui_dialogbox_container,
          event_receiver      TYPE REF TO lcl_event_receiver.
    *       CLASS lcl_event_receiver DEFINITION
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_double_click
            FOR EVENT double_click OF cl_gui_alv_grid
                IMPORTING e_row e_column,
        handle_close
            FOR EVENT close OF cl_gui_dialogbox_container
                IMPORTING sender,
        create_detail_list.
      PRIVATE SECTION.
        DATA: dialogbox_status TYPE c.  "'X': does exist, SPACE: does not ex.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    *       CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
    * §3.At doubleclick(1): The event DOUBLE_CLICK provides
    *    parameters of the clicked row and column.
    *    Use row parameter to select a line of the
    *    corresponding internal table.
      METHOD handle_double_click.
    *    DATA: ls_sflight LIKE LINE OF gt_sflight.
    * read selected row from internal table gt_sflight
    *    READ TABLE gt_sflight INDEX e_row-index INTO ls_sflight.
    * §4.At Doubleclick(2): Select booking data
    *    PERFORM select_table_sbook USING ls_sflight
    *                               CHANGING gt_sbook.
    * §5.At doubleclick(3): Create dialogbox to show detail list
    *   (if not already existent)
        IF dialogbox_status IS INITIAL.
          dialogbox_status = 'X'.
    *      PERFORM create_detail_list.
          CALL METHOD me->create_detail_list.
        ELSE.
          CALL METHOD dialogbox_container->set_visible
            EXPORTING
              visible = 'X'.
          CALL METHOD grid2->refresh_table_display.
        ENDIF.
      ENDMETHOD.                    "handle_double_click
      METHOD handle_close.
    * §6.Handle the CLOSE-button of the dialogbox
    * set dialogbox invisible
    * (the dialogbox is destroyed outomatically when the user
    * switches to another dynpro).
        CALL METHOD sender->set_visible
          EXPORTING
            visible = space.
    * In this example closing the dialogbox leads
    * to make it invisible. It is also conceivable to destroy it
    * and recreate it if the user doubleclicks a line again.
    * Displaying a great amount of data has a greater impact on performance.
      ENDMETHOD.                    "handle_close
      METHOD create_detail_list.
    * create dialogbox container as dynpro-instance
    * When the user switches to another screen, it is
    * destroyed by lifetime mangagement of CFW
        CREATE OBJECT dialogbox_container
            EXPORTING
              top = 150
              left = 150
              lifetime = cntl_lifetime_dynpro
              caption = 'Sales Orders'(200)
              width = 800
              height = 200.
        CREATE OBJECT grid2
            EXPORTING i_parent = dialogbox_container.
    * Register ABAP OO event 'CLOSE'. It is not necessary to register this
    * event at the frontend (this is done during creation).
        SET HANDLER event_receiver->handle_close FOR dialogbox_container.
    * display data
        gs_layout-grid_title = space.
        CALL METHOD grid2->set_table_for_first_display
          EXPORTING
            i_structure_name = 'T_OUTPUT'
            is_layout        = gs_layout
          CHANGING
            it_outtab        = gt_output.
        CALL METHOD cl_gui_control=>set_focus
          EXPORTING
            control = grid2.
      ENDMETHOD.                    "create_detail_list
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    *       CLASS lcl_get_so DEFINITION
    CLASS lcl_get_so DEFINITION.
      PUBLIC SECTION.
        METHODS: get_sales_orders
                    EXPORTING
                       ex_vbak LIKE gt_vbak.
    ENDCLASS.                    "lcl_get_so DEFINITION
    *       CLASS lcl_get_so IMPLEMENTATION
    CLASS lcl_get_so IMPLEMENTATION.
      METHOD get_sales_orders.
        SELECT vbak~vbeln vbap~posnr vbak~erdat
               vbak~ernam vbak~auart vbak~kunnr
               vbak~vkgrp
          FROM vbak
          INNER JOIN vbap
          ON vbak~vbeln = vbap~vbeln
          INTO TABLE gt_vbak
         WHERE vbak~erdat IN s_erdat
           AND vbak~ernam IN s_ernam
           AND vbak~auart IN s_auart
           AND vbak~vkgrp IN s_vkgrp
           AND vbak~kunnr = p_kunnr.
        IF NOT gt_vbak[] IS INITIAL.
          ex_vbak[] = gt_vbak[].
        ENDIF.
      ENDMETHOD.                    "get_sales_orders
    ENDCLASS.                    "lcl_get_so IMPLEMENTATION
    *       CLASS lcl_get_do DEFINITION
    CLASS lcl_get_do DEFINITION.
      PUBLIC SECTION.
        METHODS: get_delivery_orders
                    IMPORTING
                       value(im_vbak) LIKE gt_vbak
                    EXPORTING
                       value(ex_likp) LIKE gt_likp.
    ENDCLASS.                    "lcl_get_do DEFINITION
    *       CLASS lcl_get_do IMPLEMENTATION
    CLASS lcl_get_do IMPLEMENTATION.
      METHOD get_delivery_orders.
        IF NOT im_vbak[] IS INITIAL.
          SELECT lips~vgbel lips~vgpos
                 likp~vbeln lips~posnr
                 likp~kunnr
            FROM likp
           INNER JOIN lips
              ON likp~vbeln = lips~vbeln
            INTO TABLE gt_likp
             FOR ALL ENTRIES IN im_vbak
           WHERE vgbel = im_vbak-vbeln
             AND vgpos = im_vbak-posnr.
        ENDIF.
        IF NOT gt_likp[] IS INITIAL.
          ex_likp[] = gt_likp[].
        ENDIF.
      ENDMETHOD.                    "get_delivery_orders
    ENDCLASS.                    "lcl_get_do IMPLEMENTATION
    *       CLASS lcl_get_bd DEFINITION
    CLASS lcl_get_bd DEFINITION.
      PUBLIC SECTION.
        METHODS: get_billing_documents
                   IMPORTING
                     value(im_vbak) LIKE gt_vbak
                   EXPORTING
                     value(ex_vbrk) LIKE gt_vbrk.
    ENDCLASS.                    "lcl_get_bd DEFINITION
    *       CLASS lcl_get_bd IMPLEMENTATION
    CLASS lcl_get_bd IMPLEMENTATION.
      METHOD get_billing_documents.
        IF NOT im_vbak[] IS INITIAL.
          SELECT vbrp~aubel vbrp~aupos vbrk~vbeln
            FROM vbrk
           INNER JOIN vbrp
              ON vbrk~vbeln = vbrp~vbeln
            INTO TABLE gt_vbrk
             FOR ALL ENTRIES IN im_vbak
           WHERE aubel = im_vbak-vbeln
             AND aupos = im_vbak-posnr.
        ENDIF.
        IF NOT gt_vbrk[] IS INITIAL.
          ex_vbrk[] = gt_vbrk[].
        ENDIF.
      ENDMETHOD.                    "get_billing_documents
    ENDCLASS.                    "lcl_get_bd IMPLEMENTATION
    *       CLASS lcl_combine_data DEFINITION
    CLASS lcl_combine_data DEFINITION.
      PUBLIC SECTION.
        METHODS: combine_data
                   IMPORTING
                     value(im_vbak) LIKE gt_vbak
                     value(im_likp) LIKE gt_likp
                     value(im_vbrk) LIKE gt_vbrk
                   EXPORTING
                     value(ex_output) LIKE gt_output.
    ENDCLASS.                    "lcl_combine_data DEFINITION
    *       CLASS lcl_combine_data IMPLEMENTATION
    CLASS lcl_combine_data IMPLEMENTATION.
      METHOD combine_data.
        FIELD-SYMBOLS: <fs_vbak> LIKE LINE OF im_vbak,
                       <fs_likp> LIKE LINE OF im_likp,
                       <fs_vbrk> LIKE LINE OF im_vbrk.
        DATA: wa_output LIKE LINE OF ex_output.
        SORT im_vbak ASCENDING BY: vbeln posnr.
        SORT im_likp ASCENDING BY: vgbel vgpos.
        SORT im_vbrk ASCENDING BY: aubel aupos.
        LOOP AT im_vbak ASSIGNING <fs_vbak>.
          READ TABLE im_likp ASSIGNING <fs_likp>
                             WITH KEY vgbel = <fs_vbak>-vbeln
                                      vgpos = <fs_vbak>-posnr
                                      BINARY SEARCH.
          IF sy-subrc = 0.
            MOVE: <fs_vbak>-vbeln TO wa_output-salesorder,
                  <fs_vbak>-posnr TO wa_output-salesitem,
                  <fs_vbak>-vkgrp TO wa_output-salesgroup,
                  <fs_vbak>-kunnr TO wa_output-custcode,
                  <fs_likp>-kunnr TO wa_output-shipto,
                  <fs_vbak>-erdat TO wa_output-creation_date,
                  <fs_vbak>-ernam TO wa_output-created_by,
                  <fs_likp>-vbeln TO wa_output-delorder.
          ENDIF.
          READ TABLE im_vbrk ASSIGNING <fs_vbrk>
                             WITH KEY aubel = <fs_vbak>-vbeln
                                      aupos = <fs_vbak>-posnr
                                      BINARY SEARCH.
          IF sy-subrc = 0.
            MOVE <fs_vbrk>-vbeln TO wa_output-invnumber.
          ENDIF.
          APPEND wa_output TO ex_output.
          CLEAR wa_output.
        ENDLOOP.
        DELETE ex_output WHERE salesorder IS INITIAL.
      ENDMETHOD.                    "combine_data
    ENDCLASS.                    "lcl_combine_data IMPLEMENTATION
    * START-OF-SELECTION                           *
    START-OF-SELECTION.
      DATA: lt_vbak_dum    LIKE gt_vbak,
            lt_likp_dum    LIKE gt_likp,
            lt_vbrk_dum    LIKE gt_vbrk.
      DATA: o_get_so         TYPE REF TO lcl_get_so,
            o_get_do         TYPE REF TO lcl_get_do,
            o_get_bd         TYPE REF TO lcl_get_bd,
            o_combine_data   TYPE REF TO lcl_combine_data.
      CREATE OBJECT: o_get_so,
                     o_get_do,
                     o_get_bd,
                     o_combine_data.
    END-OF-SELECTION.
      CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
    *  SET TITLEBAR 'xxx'.
      g_repid = sy-repid.
      IF custom_container IS INITIAL.
        CALL METHOD o_get_so->get_sales_orders
          IMPORTING
            ex_vbak = lt_vbak_dum.
        CALL METHOD o_get_do->get_delivery_orders
          EXPORTING
            im_vbak = lt_vbak_dum
          IMPORTING
            ex_likp = lt_likp_dum.
        CALL METHOD o_get_bd->get_billing_documents
          EXPORTING
            im_vbak = lt_vbak_dum
          IMPORTING
            ex_vbrk = lt_vbrk_dum.
        CALL METHOD o_combine_data->combine_data
          EXPORTING
            im_vbak   = lt_vbak_dum
            im_likp   = lt_likp_dum
            im_vbrk   = lt_vbrk_dum
          IMPORTING
            ex_output = gt_output.
    *Create a custom container control for our ALV Control
        CREATE OBJECT custom_container
            EXPORTING
                container_name = cont_for_flights
            EXCEPTIONS
                cntl_error = 1
                cntl_system_error = 2
                create_error = 3
                lifetime_error = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc NE 0.
    *Add your handling, for example
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = g_repid
              txt2  = sy-subrc
              txt1  = 'The control could not be created'(510).
        ENDIF.
    *Create an instance of alv control
        CREATE OBJECT grid1
             EXPORTING i_parent = custom_container.
    *Set a titlebar for the grid control
        gs_layout-grid_title = 'List of Sales Orders'(100).
        CALL METHOD grid1->set_table_for_first_display
          EXPORTING
    *        i_structure_name = 'T_OUTPUT'
            is_layout        = gs_layout
          CHANGING
            it_outtab        = gt_output.
    *Create Object to receive events and link them to handler methods.
    *When the ALV Control raises the event for the specified instance
    *the corresponding method is automatically called.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_double_click FOR grid1.
      ENDIF.
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = grid1.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CASE save_ok.
        WHEN 'BACK'.
          CALL METHOD custom_container->free.
          CALL METHOD cl_gui_cfw=>flush.
          IF sy-subrc <> 0.
    *Add your handling, for example
            CALL FUNCTION 'POPUP_TO_INFORM'
              EXPORTING
                titel = g_repid
                txt2  = sy-subrc
                txt1  = 'Error in FLush'(500).
          ENDIF.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          CALL METHOD custom_container->free.
          CALL METHOD cl_gui_cfw=>flush.
          IF sy-subrc <> 0.
    *Add your handling, for example
            CALL FUNCTION 'POPUP_TO_INFORM'
              EXPORTING
                titel = g_repid
                txt2  = sy-subrc
                txt1  = 'Error in FLush'(500).
          ENDIF.
          LEAVE PROGRAM.
        WHEN 'CANCEL'.
          CALL METHOD custom_container->free.
          CALL METHOD cl_gui_cfw=>flush.
          IF sy-subrc <> 0.
    *Add your handling, for example
            CALL FUNCTION 'POPUP_TO_INFORM'
              EXPORTING
                titel = g_repid
                txt2  = sy-subrc
                txt1  = 'Error in FLush'(500).
          ENDIF.
          LEAVE PROGRAM.
      ENDCASE.
      CLEAR save_ok.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT

    Hi Viraylab,
                       You need to craete a fieldcat to print data in ALV and pass this table to the method written below :
    CALL METHOD grid1->set_table_for_first_display
          EXPORTING
           i_structure_name = 'T_OUTPUT'
            is_layout        = gs_layout
          CHANGING
            it_outtab        = gt_output.
           i_fieldcat        = gt_fieldcat
    u can bulid afield catlog table like this :
    form FIELDCAT  using    p_i_fieldcat TYPE SLIS_T_FIELDCAT_ALV.
    DATA : L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    FOR MATERIAL NO
    CLEAR L_FIELDCAT.
    L_FIELDCAT-COL_POS = '1'.
    L_FIELDCAT-FIELDNAME = 'MATNR'.
    L_FIELDCAT-TABNAME = 'IT_MATSTOCK'.
    L_FIELDCAT-seltext_l   = 'MATERIAL NO'.                     " LONG TEXT FOR HEADER.
    L_FIELDCAT-seltext_m   = 'MAT NO'.                     " MEDIUM TEXT FOR HEADER.
    L_FIELDCAT-seltext_s   = 'MATNO'.                     " SHORT TEXT FOR HEADER.
    L_FIELDCAT-EMPHASIZE = 'C410'.                           " COLOR OF THIS COLUMN.
    L_FIELDCAT-OUTPUTLEN = '20'.
    APPEND L_FIELDCAT TO P_I_FIELDCAT.
    FOR MATERIAL TYPE
    CLEAR L_FIELDCAT.
    L_FIELDCAT-COL_POS = '2'.
    L_FIELDCAT-FIELDNAME = 'MTART'.
    L_FIELDCAT-TABNAME = 'IT_MATSTOCK'.
    L_FIELDCAT-seltext_l   = 'MATERIAL TYPE'.                     " LONG TEXT FOR HEADER.
    L_FIELDCAT-seltext_m   = 'MAT TYPE'.                     " MEDIUM TEXT FOR HEADER.
    L_FIELDCAT-seltext_s   = 'MAT TYP'.                     " SHORT TEXT FOR HEADER.
    L_FIELDCAT-EMPHASIZE = 'C510'.                           " COLOR OF THIS COLUMN.
    L_FIELDCAT-OUTPUTLEN = '6'.
    APPEND L_FIELDCAT TO P_I_FIELDCAT.
    FOR MATERIAL DESCRIPTION
    CLEAR L_FIELDCAT.
    L_FIELDCAT-COL_POS = '3'.
    L_FIELDCAT-FIELDNAME = 'MAKTX'.
    L_FIELDCAT-TABNAME = 'IT_MATSTOCK'.
    L_FIELDCAT-seltext_l   = 'MAT DESCRIP'.                     " LONG TEXT FOR HEADER.
    L_FIELDCAT-seltext_m   = 'M DESCRIP'.                     " MEDIUM TEXT FOR HEADER.
    L_FIELDCAT-seltext_s   = 'MDESCRIP'.                     " SHORT TEXT FOR HEADER.
    L_FIELDCAT-EMPHASIZE = 'C310'.                           " COLOR OF THIS COLUMN.
    L_FIELDCAT-OUTPUTLEN = '40'.
    APPEND L_FIELDCAT TO P_I_FIELDCAT.
    Reward points if helpful.
    Regards,
    Hemant

  • Create Fieldcatalog based on internal table (dynamic)

    Hi ,
    Is there a way to create Create Fieldcatalog based on internal table (dynamic).
    while creating fieldcat we usually many give the fields "fieldname" and "tabname".
    is there a way to get the fieldname from the main table ?
    Eg ..
    I have i_tab as the output table. It has 3 fields "a", "b" and "c"
    Now when i created fieldcat manually ( in case i cannot use fieldcat_merge FM) , i have to append 3 throws in fieldcat table.
    These rows would have "a", "b" and "c".
    Now i want to know if there is a way in which i can find "a" "b" and "c" fieldnames from the createdd internal tables.
    i can then append the same to fieldcat.

    Hi Anuj,
    I created a FORM routine for this 4 or 5 years ago and made a couple of refinements. Meanwhile it has prooved as very useful.
    The disadvantag is that it creates the oldfashioned field catalog for the function calls. But I already used it for OO fieldcatalog of LVC type - there is a function module for this but I do not have the name here.
    You need the two forms (second called in first) to build the field catalog from any internal table that can be used for ALV display.
    *&      Form  ALV_FIELDCAT_FOR_ITAB
    *       Feldkatalog from (arbitrary) internal Table (c) Clemens Li
    *       * build field catalog from        type description
    form alv_fieldcat_for_itab                                  "#EC *
      tables   pt_outtab                      type table        "#EC *
      changing pt_alv_fieldcat                type slis_t_fieldcat_alv."#EC *
      data:
        lv_desc                               type sydes_desc,
        ls_alv_fieldcat                       type slis_fieldcat_alv,
        lv_longfield                          type text80."CRM<=R/3 fname.
      field-symbols:
        <typeinfo>                            type sydes_typeinfo,
        <nameinfo>                            type sydes_nameinfo.
      describe field pt_outtab into lv_desc.                    "#EC *
      loop at lv_desc-types
          assigning <typeinfo>
          where not idx_name is initial
            and table_kind is initial "no entries for deep table like color
            and back                          = 1. "top-level-entries only.
        read table lv_desc-names index <typeinfo>-idx_name
          assigning <nameinfo>.
        check <nameinfo>-name                 <> 'INCLUDE'.
        ls_alv_fieldcat-fieldname             = <nameinfo>-name.
        while not <nameinfo>-continue is initial.
          add 1 to <typeinfo>-idx_name.
          read table lv_desc-names index <typeinfo>-idx_name
            assigning <nameinfo>.
          concatenate
            ls_alv_fieldcat-fieldname
            <nameinfo>-name
            into ls_alv_fieldcat-fieldname.
        endwhile." not <nameinfo>-continue IS INITIAL.
        read table lv_desc-names index <typeinfo>-idx_help_id
          assigning <nameinfo>.
        if sy-subrc                           = 0.
    * Caution: Help-ID may be Tablename-Fieldname and thus longer
    * than 30 Chars; ls_alv_fieldcat-rollname is 30 Chars only
          ls_alv_fieldcat-rollname            = <nameinfo>-name.
          lv_longfield                        = <nameinfo>-name.
          while not <nameinfo>-continue is initial.
            add 1 to <typeinfo>-idx_help_id.
            read table lv_desc-names index <typeinfo>-idx_help_id
              assigning <nameinfo>.
            concatenate
              lv_longfield
              <nameinfo>-name
              into lv_longfield.
          endwhile." not lv_desc-continue is initial.
    * help id may be data element or <table>-<field>
          if lv_longfield ca '-'.
    * get data                                type for table field
            perform get_rollname_4_tabfield
              using lv_longfield changing ls_alv_fieldcat.
          endif." lv_longfield ca '-'.
        else.
    * No Help-ID: Use Fieldname as text
          ls_alv_fieldcat-seltext_s           =
          ls_alv_fieldcat-seltext_m           =
          ls_alv_fieldcat-seltext_l           =
          ls_alv_fieldcat-reptext_ddic        =
          <nameinfo>-name.
        endif." sy-subrc                      = 0.
    * Starting 4.7: get edit mask
        if not <typeinfo>-idx_edit_mask is initial.
          read table lv_desc-names index <typeinfo>-idx_edit_mask
            assigning <nameinfo>.
          ls_alv_fieldcat-edit_mask           = <nameinfo>-name.
          if not <nameinfo>-continue is initial.
            add 1 to <typeinfo>-idx_edit_mask.
            read table lv_desc-names index <typeinfo>-idx_edit_mask
              assigning <nameinfo>.
            concatenate
              ls_alv_fieldcat-edit_mask
              <nameinfo>-name
              into ls_alv_fieldcat-edit_mask.
          endif." not <nameinfo>-continue IS INITIAL.
        endif." not <typeinfo>-IDX_EDIT_MASK is initial.
    * assign length, output length and decimals
        ls_alv_fieldcat-intlen                = <typeinfo>-length.
        ls_alv_fieldcat-outputlen             = <typeinfo>-output_length.
        ls_alv_fieldcat-decimals_out          = <typeinfo>-decimals.
        ls_alv_fieldcat-inttype               = <typeinfo>-type.
        append ls_alv_fieldcat to pt_alv_fieldcat.
        clear:  "prevent anything 2 B  taken for subsequent fields
          ls_alv_fieldcat.
      endloop." at lv_desc-types where not IDX_NAME is in initial.
    endform.                    " ALV_FIELDCAT_FOR_ITAB
    *&      Form  get_rollname_4_tabfield
    *       Get Data                          type for Table field
    form get_rollname_4_tabfield
      using    p_fname                        type text80 ""CRM<=R/3 fname
      changing p_alv_fieldcat                 type slis_fieldcat_alv.
      field-symbols:
        <dfies>                               type dfies.
      data:
        lv_tabname                            type tabname,
         lt_dfies                             type table of dfies,
        lv_fieldname                          type fieldname.
      split p_fname at '-'
        into lv_tabname lv_fieldname.
      clear p_alv_fieldcat-rollname.
      call function 'DDIF_FIELDINFO_GET'
        exporting
          tabname                             = lv_tabname
          fieldname                           = lv_fieldname
    *   LANGU                                 = SY-LANGU
    *   LFIELDNAME                            = ' '
    *   ALL_TYPES                             = ' '
    * IMPORTING
    *   X030L_WA                              =
    *   DDOBJTYPE                             =
    *   DFIES_WA                              =
    *   LINES_DESCR                           =
       tables
         dfies_tab                            =  lt_dfies
    *   FIXED_VALUES                          =
       exceptions
         not_found                            = 1
         internal_error                       = 2
         others                               = 3
      if sy-subrc                             <> 0.
        message id sy-msgid                   type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      else.
        read table   lt_dfies assigning <dfies> index 1.
        p_alv_fieldcat-rollname               = <dfies>-rollname.
    * Und wenn keinerlei Twexte gepflegt sind?
        if <dfies>-reptext is initial and
           <dfies>-scrtext_s is initial and
           <dfies>-scrtext_m is initial and
           <dfies>-scrtext_l is initial.
    * No Text: Use Fieldname as text
          p_alv_fieldcat-seltext_s            =
          p_alv_fieldcat-seltext_m            =
          p_alv_fieldcat-seltext_l            =
          p_alv_fieldcat-reptext_ddic         =
          p_alv_fieldcat-fieldname.
        endif." <dfies>-reptext IS INITIAL AND
      endif.
    endform.                    " get_rollname_4_tabfield
    Regards,
    Clemens

  • Regarding fieldcatalog to store a text field

    Hi friends,
    I want to store a text field in field catalog .so that it won't effect in field catalog . when if loop at fieldcatalog depending on that value i need to perform.
    regarding
    anil

    yu can use this  variable s_fieldcatalog-reptext_ddic = 'Sche qty'. for example to give your own text .Declare it in it_ekpo
    and use accordingly.
    s_fieldcatalog-col_pos = '9'.
    s_fieldcatalog-fieldname = 'MENGE'.
    s_fieldcatalog-reptext_ddic = 'Sche qty'.
    s_fieldcatalog-tabname = 'lT_EKPO'.
    s_fieldcatalog-rollname = 'MENGE'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.

  • How can I get the list of columns (fieldcatalog) for particular variant

    Hello,
    i have option chose variant on selection screen (REUSE_ALV_VARIANT_F4) and i need to get which fields (columns) are included in this variant - i need to get this restricted fieldcatalog according variant using FM. I need to save file only with columns included in particular variant.
    Thx.

    Hi Zdenek,
    You can get the list of user variant by FM
      call function 'LVC_VARIANT_F4'
    You can get the details of the selected variant using FM
       call function 'LVC_VARIANT_SELECT'
    Please check the SAP example BCALV_GRID_11 program for the code.
    Hope this helps.
    Franc

  • How to get DDIC information when building your fieldcatalog manually

    Hi guys!
    I try to build ma alv fieldcatalog manually. For each field i want to set a DDIC Dataelement.
    I tried this way.
    Data:
    lt_fcat type lvs_t_fcat,
    ls_fcat type lvs_s_fcat,
    ls_fcat-ref_field = 'ZZ_MY_DATAELEMENT'
    *... and some other information
    append ls_fcat to lt_fcat
    ...but it's not working the the column text is provided by the data_element.
    I know about the lvc_fieldcatalog_merge function, but i need to find a way to do this manually!
    thanks for your help

    hI
    There are field for the short, medium an long text too, are't there?
    SCRTEXT_L
    SCRTEXT_M
    SCRTEXT_S
    Max

  • Fieldcatalog in alv display

    hi experts,
    I  have a problem in alv report. actually output table consists of 150 fields. out of which i want to display 15 fields in alv grid and rest of the fields get displayed only when user wants to by using change layout tab.. now for this i need to make field catalog for each field separately which will increase the no of code lines to a great extent which i dont want..
    Is there any other alternative for that?
    Thanks

    hi
    u can use a function module for this.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       =
        CHANGING
          ct_fieldcat            = gt_fieldcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    "   then loop at fieldcatalog and make fieldcatalog for all
    the fields which u want to display.
    LOOP AT gt_fieldcat INTO ls_fcat.
        CASE ls_fcat-fieldname.
          WHEN c_fieldname.
            ls_fcat-col_pos    = 0.
            ls_fcat-row_pos    = 1.
            ls_fcat-outputlen  = 2.
            ls_fcat-tabname    = table_name.
    and when others will have all the fields which u dont want to display.
          WHEN OTHERS.
            ls_fcat-no_out      = 'X'.
            ls_fcat-outputlen  = 15.
            ls_fcat-just       = c_l.
            ls_fcat-tabname    = table_name .
        ENDCASE.
        MODIFY gt_fieldcat FROM ls_fcat.
        CLEAR ls_fcat.
      ENDLOOP.
    regards

  • How to read fieldcatalog of Data Entry View in CAT2

    Hi,
         I have a requirement wherein I need to validate the time data of 'Data Entry View' in TCode: CAT2. Here, there is a table control which uses dynamic field catalog (for days Eg: MO 11/07, TU 11/08.....SU 11/13).
           Whenever a user enters the 'Key Date' from CAT2, the system automatically gets the Data Entry Period of that Key date.
    For eg, let's say user enters Key date as '11/28/2011' then the Data entry period would be 11/28/2011 to 12/04/2011.
          Requirement: Now the system should allow the user to enter time for November month only i.e. 28, 29 and 30. It should not allow the user to enter time data for December. In short the system should allow the user to enter times of only one month.
          For this validation I'm using the User Exit: CATS0006 .  Please suggest me how to read the above fieldcatalog,
    And also let me know if this can be achieved by any other method.
    Thanks,
    Singh

    Thanks Raymond. The problem is solved.
    Below is some part of the logic...
    Work area declaration
    DATA: wa_check_table TYPE cats_comm.
    Variables
    DATA: w_cnt TYPE i.
    Get the no. of records
    DESCRIBE TABLE check_table LINES w_cnt.
    Read the last record
    READ TABLE check_table INTO wa_check_table INDEX w_cnt.   "We can loop also
    IF dateto4(2) GT datefrom4(2).
      IF wa_check_table-workdate4(2) GT datefrom4(2).
        MESSAGE e208(00) WITH text-001.  "Appropriate Error Message
      ENDIF.
    ENDIF.

  • Problem refreshing fieldcatalog in ALV grid classic

    Hi gurus,
    I´m really having problems with the column titles that are display in my ALV report and I cannot figure out why. I want to be able to print the text either in Spanish or in English, depending on the company code in the selection criteria screen. I refresh and populate the fieldcatalog with EN texts and I can see that changes are taken and pass to FM REUSE_ALV_GRID_DISPLAY but when I execute it they still show the Spanish text.
    Please help me with things. Points will be rewarded.
    I show here part of the code.
    FORM make_field_catalog.
      DATA: l_repid LIKE sy-repid.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
      DATA: pos         TYPE i VALUE 1.
      l_repid   = sy-repid.
      CLEAR ls_fieldcat.
      REFRESH i_fieldcat.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
          i_program_name     = l_repid
          i_internal_tabname = 'GT_OUTPUT'
          i_inclname         = l_repid
          i_bypassing_buffer = 'X'
       CHANGING
          ct_fieldcat        = i_fieldcat.
    Fields to output in the ALV.
    Show different languages, depending on the company code.
      IF is_es EQ 'X'.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'CUSTOMER'.
        ls_fieldcat-seltext_l      =  text-002.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   10.
        ls_fieldcat-key            =  'X'.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'DOC_NO'.
        ls_fieldcat-seltext_l      =  text-003.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   10.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'DOC_DATE'.
        ls_fieldcat-seltext_l      =  text-004.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   10.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'NET_AMOUNT'.
        ls_fieldcat-seltext_l      =  text-005.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   15.
        ls_fieldcat-do_sum         =  'X'.
        ls_fieldcat-datatype       =  'QUAN'.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
      ELSE.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'CUSTOMER'.
        ls_fieldcat-seltext_l      =  text-012.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   10.
        ls_fieldcat-key            =  ' '.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'DOC_NO'.
        ls_fieldcat-seltext_l      =  text-013.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   10.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'DOC_DATE'.
        ls_fieldcat-seltext_l      =  text-014.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   10.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'NET_AMOUNT'.
        ls_fieldcat-seltext_l      =  text-015.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   15.
        ls_fieldcat-do_sum         =  'X'.
        ls_fieldcat-datatype       =  'QUAN'.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
      ENDIF.
    ENDFORM.
    And later i make the call like follows:
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_buffer_active       = g_alv_buffer
                i_callback_program    = l_repid
               i_callback_top_of_page = 'TOP_OF_PAGE'
               i_callback_html_top_of_page = 'TOP_OF_PAGE'
                is_layout             = g_layout
                it_fieldcat           = i_fieldcat
                it_special_groups     = g_fieldgroups_tab[]
                it_sort               = g_sortfields_tab[]
                i_default             = c_n
                i_save                = c_a
                is_variant            = g_variant
                it_events             = g_events_tab[]
                it_event_exit         = g_event_exit_tab[]
                is_print              = g_print
                i_screen_start_column = g_screen_start_column
                i_screen_start_line   = g_screen_start_line
                i_screen_end_column   = g_screen_end_column
                i_screen_end_line     = g_screen_end_line
           TABLES
                t_outtab              = gt_output
           EXCEPTIONS
                program_error         = 1
                OTHERS                = 2.
    Does anybody knows what am I missing?
    Thanks! Elena

    hi ..
    Ensure Field catalog is Refreshed every time before it is buid.
    Code:
    <b>REFRESH i_fieldcat.</b>
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = l_repid
    i_internal_tabname = 'GT_OUTPUT'
    i_inclname = l_repid
    i_bypassing_buffer = 'X'
    CHANGING
    ct_fieldcat = i_fieldcat.
    <b>Reward if Helpful.</b>

  • Issuw with Fieldcatalog in ALV OOPS

    Hi All,
    I am displaying output using ALV OOPs. in output table ihave dropdown field called Manual Processing status.
    to get dropdown i used below logic.
      DATA: lt_dropdown TYPE lvc_t_drop,
            ls_dropdown TYPE lvc_s_drop.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = 'OPEN'(016).
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = 'CLOSED'(012).
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = 'CANCELLED'(014).
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = 'NO ACTION REQUIRED'(015).
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = ' '.
      APPEND ls_dropdown TO lt_dropdown.
      CALL METHOD grid->set_drop_down_table
        EXPORTING
          it_drop_down = lt_dropdown.
    when i a, displaying the output lenth of this field is '9'(i mentioned while building the fieldcatalog) but in output its size is more. I used the below field catalog for this field.
      ls_feildcat-fieldname = pv_field.
      ls_feildcat-outputlen =  pc_length.
      ls_feildcat-coltext = pv_header.
      ls_feildcat-just = pc_true.
      ls_feildcat-no_out = gc_space.
      ls_feildcat-drdn_hndl = '1'.
      ls_feildcat-fix_column = 'X'.
    when i comment   ls_feildcat-drdn_hndl = '1' then its working fine but i am not getting dropdown. ANybody can sugeest me how to approach in this case.
    Regards,
    Maheedhar

    Hi,
    Not sure to get your point...could this be in relation with your layout settings (e.g by passing is_layout-cwidth_opt = 'X' to method set_table_for_first_display) ?
    Kr,
    m.

  • Oops alv no_zero and 'word wrap' in fieldcatalog

    Hi All,
    I have 2 queations
    1)  Can I have word wrap option in alv, ie any option to display the same cell information in multiple lines and
    2) I am trying to use no_zero of fieldcatalog as shown in below code
        wa_billets_fcat-fieldname = 'ACTUAL_QTY'.
        wa_billets_fcat-inttype  = 'C'.
        wa_billets_fcat-outputlen = '13'.
        wa_billets_fcat-coltext   = 'Actual Qty'.
        wa_billets_fcat-seltext   = 'Actual Qty'.
        wa_billets_fcat-edit      = 'X'.
        wa_billets-no_zero         = 'X'.
        APPEND wa_billets_fcat TO billet_fcat.
        CLEAR wa_billets_fcat.
    but it is giving the error as bellow
    Field "WA_BILLETS-NO_ZERO" is unknow. it is neither is one of the specified tables nor defined by a 'DATA" statement.
    Please help me
    Thanks in advance.

    hi check this....
    wa_billets_fcat-fieldname = 'ACTUAL_QTY'.
    wa_billets_fcat-reptext_ddic = 'Actual quantity'.
    wa_billets_fcat-no_zero = 'X'.
    APPEND wa_billets_fcat TO billet_fcat.
    CLEAR wa_billets_fcat.
    hope this will help for the word wrap..
    http://www.sap-img.com/fu037.htm
    regards,
    venkat
    Edited by: venkat  appikonda on May 10, 2008 4:46 PM

Maybe you are looking for

  • 2.1 EA1 Bug No promt for substitution variables

    Didn't see a post for this yet. In this release, I am not being prompted for replacement variables when I use & in my query. SELECT &1 from dual; ORA-01008: not all variables bound 01008. 00000 -  "not all variables bound" *Cause:    *Action: SELECT

  • ASA5510 Clientless VPN SSO RDWEB OWA CIFS

    Hi! I´m trying to use single sign on in clientless vpn portal. I have my bookmarks in place (rdweb/web servers and cifs share). I would like to just enter user/pass just one time (at the portal loginpage of asa5510). I use radius for my auth (radius

  • Xslt in client memory

    Hello. I have some server components sending xml to a web browser client. There is a reference to an xslt stylesheet in the xml document, that results in html. I assume that every time the processor in the browser encounters that reference while pars

  • Where is the DLL file that exports these functions?

    I have been tasked with controlling a DAQCard E-series via program written in C. My development environment is MinGW on Windows 2000, with DAQ-MX and Traditional installed. I started by using the MX example code as a foundation. Everything goes well

  • Batch DNGing an Archive Request for Help

    I am updating thousands of images on a large drive containg folders and subfolders of nef, dng, tif and jpg images. Goal: To DNG only the nef images then delete the nef and related xmp files Problem 1: Adobe DNG Converter will dng the nefs but leaves