ALV fieldcatalog

Hi all,
        I have a internal tables with 56 fields i want to display it in a ALV .I want to have the fieldcatalog for it.I dont to generate it manually.I tried to use function module 'LVC_FIELDCATALOG_MERGE' in that i passed my internal table and tried to get the field catalog.But i am not getting it.But if i pass 'SFLIGHT'.I am getting the fieldcat.Is it necessary to have a structure to be created in SE11 to get get the fieldcat using the function module.Does any know ???
regards
Ahasan

Hi,
By creating a structure it becomes easy for you modify the catalog in case you have to modify your report at a later point of time.
The changes to the strcuture will automatically reflect in the field catalog as well as the internal table as you can use the same structure for creating the internal table as well.
Are you going to ALV Controls / REUSE functions?
1. If you are using REUSE functions, you can try creating the field catalog using the REUSE_ALV_FIELDCATALOG_MERGE with the internal table, but it is having some problems.
2. If you are using controls, you cannot use the field catalog used by the REUSE function as the TYPE of the field catalog is different.
Given all that, even if you are successful, its recommended to go for a structure in SE11 and use that, else create it manually - but then again doesn't make sense as the no. of fields is on the higher side.
Regards,
Ravi
Note : Please mark the helpful answers

Similar Messages

  • ALV fieldcatalog change

    Hello,
    I have a colored ALV grid using the emphasize field from fieldcatalog table. When I change to edit mode I want to change the color of the row, so I change the color code from the fieldcatalog, and then call refresh_table_display, but the color of the grid is not changed. Does refresh_table_display take into account fieldcatalog changes?

    hi
    Coloring Rows
    You can change the color of rows in the grid control to highlight data in the list.
    The column color can be set using field EMPHASIZE of the field catalog (see: Output Options of Columns).
    Process Flow
    Define the layout structure of type LVC_S_LAYO .
    Add a four-digit character field to your output table, as shown in the example below:
    DATA: BEGIN OF GT_OUTTAB OCCURS 0.
            INCLUDE STRUCTURE <DDIC-Struktur>.
    DATA:   linecolor(4) type c. "Color for corresponding line
    DATA: END OF GT_OUTTAB.
    Select your data and copy it into the output table.
    Read one row of the output table at a time in a loop. To change the color of a row, assign a four-digit color code to the character field.
    For more information on color codes, see field EMPHASIZE of the field catalog (see Output Options of Columns).
    Assign the name of the internal table to field INFO_FNAME of the layout structure (in our case 'LINECOLOR' , see step 2).
    Pass the layout structure and the output table with method set_table_for_first_display.
    If you do not want to color the cells for the first display, postpone step 4 and refresh the output table with method refresh_table_display.
    just go thro this process flow also hopen it helps
    Process Flow
    Define the layout structure of type LVC_S_LAYO .
    Add a color table of type LVC_T_SCOL to your output table, as shown in the example below:
    DATA: BEGIN OF GT_OUTTAB OCCURS 0.
            INCLUDE STRUCTURE <DDIC-Struktur>.
    DATA:   CT TYPE LVC_T_SCOL. "Table for colors
    DATA: END OF GT_OUTTAB.
    Select your data and copy it into the output table.
    Read one row of the output table at a time in the loop. One row of the color table has three fields. If field NOKEYCOL is set, you can change the color of key fields. Assign values to the remaining fields as follows:
    If you want to color the entire row, assign the corresponding values to the fields of structure COLOR . Field fname does not receive a value in this case.
    If you want to color specific columns of the row only, you must append one row for each column to the color table. Assign the name of the desired column to field fname , and the corresponding values to the fields of structure COLOR .
    For information on the meaning of the color settings, see F1 help on the format command. Class CL_GUI_RESOURCES contains constant attributes for fields INT and INV of structure COLOR .
    Assign the name of the internal table to field CTAB_FNAME of the layout structure (in our case 'CT', see step 2).
    Pass the layout structure and the output table with method set_table_for_first_display.
    If you do not want to color the cells for the first display, postpone step 4 and refresh your output table with method refresh_table_display.
    regards
    navjot
    reward accordingly
    Message was edited by:
            navjot sharma

  • Report on ALV fieldcatalog

    Hi all,
    Is it possible to display mulitple rows from the same table using the ALV field catalog?
    Senerio:
    if there are 10 columns in the table , first  5 are new values and another 5 are old values. all are in the same table. i would like to display first 5 columns in the first row of the report and then another 5 columns in the second row below that.
    please help me if any body having sample senerio for the above or suggest me how can i  gain this.....
    thanks in advance.
    kP

    hi,
    iwith classical alv you can separate your 10 fields into 3 rows (with change layout)
    A.

  • Conversion Exit on ALV fieldcatalog ?

    Hi all,
    I have an editable ALV grid and one of the column displays a field which is of the floating type.
    Now instead of the regular 1.2870001E+00, can I make it display 1.28 ( Decimal rounded to 2 decimal places).
    I am trying to modify the fieldcat. I am able to get rid of the E+00 by having wa_fieldcat-exponent = 0.How can I get it to round to 2 decimal places ? Do I have to use any wa_fieldcat-convexit = .... ? or wa_fieldcat-round = ... ?
          when 'TEST_API_GRAVITY'.
            wa_fieldcat-edit = 'X'.
            wa_fieldcat-NO_ZERO = 'X'.
            wa_fieldcat-exponent = 0.
            wa_fieldcat-ROUNDFIELD = 'TEST_API_GRAVITY'.
          wa_fieldcat-round = 2.
          wa_fieldcat-DECIMALS = 2.
          wa_fieldcat-CONVEXIT = 'P'.
    MODIFY gi_fieldcat FROM wa_fieldcat.
    Thanks.
    SHK

    Hi,
    I tried it. It works...
    Try decimals_out of the fiedcatalog.
    wa_fieldcat-edit = 'X'.
    wa_fieldcat-NO_ZERO = 'X'.
    wa_fieldcat-exponent = 0.
    wa_fieldcat-ROUNDFIELD = 'TEST_API_GRAVITY'.
    <b>wa_fieldcat-DECIMALS_OUT = '2'.</b>
    MODIFY gi_fieldcat FROM wa_fieldcat.

  • Field EDIT_MASK in ALV fieldcatalog

    Hi,
    How can I use edit_mask of ALV field catalog in order to
    format the currency value sign to be on the left of the value instead of on the right?
    Example: - 100.00 instead of:  100.00  -
    My field to be displayed in the ALV column is of type CURR 13.
    Is there any conversion routine or mask format?
    Thanks,
    Eyal.

    Hi,
    If you set a conversion exit (for example,
    conv = ' ==ALPHA ' for function module CONVERSION_EXIT_ALPHA_OUTPUT ), you enforce output conversion for the associated output field.
    WRITE amount TO output USING EDIT MASK 'RRV_____,___'.
    Have a look at keyword documentation;
    - RR = right justified
    - V = sign
    - _ = place holder for number
    - , = decimal separator
    - _ = place holder for decimals
    Refer this link to get idea.
    Re: Curreny $ display in ALV Grid
    Or you can even solve this problem by moving it into char fields and then concatenating minus sign with it.
    Hope it helps.
    Rgds,
    J.Jayanthi

  • Alv fieldcatalog problem

    <b>fieldcat_ln-subtot = 'X'. its not accepting is it right way of declartion</b>
    ADD 1 TO col_pos.
      CLEAR fieldcat_ln.
      fieldcat_ln-ref_tabname        = 'LIKP'.
      fieldcat_ln-fieldname          = 'BTGEW'.
      fieldcat_ln-col_pos            = col_pos.
    fieldcat_ln-subtot             = 'X'.
      fieldcat_ln-do_sum             = 'X'.
      fieldcat_ln-hotspot            = 'X'.
      fieldcat_ln-emphasize = 'C41'.
      APPEND fieldcat_ln TO fieldcat.
    <b></b>

    hi,
    chk this example for totals and subtotlas.
    its working fine.
    report  zkeerthi_alv2                           .
    tables: vbak.
    type-pools : slis.
    data: begin of it_vbak occurs 0,
          icon type icon-id,
          vbeln like vbak-vbeln,
          audat like vbak-audat,
          vbtyp like vbak-vbtyp,
          auart like vbak-auart,
          augru like vbak-augru,
          netwr like vbak-netwr,
          waerk like vbak-waerk,
          end of it_vbak.
    data: g_repid like sy-repid,
          wa_sort type slis_sortinfo_alv,
          it_sort type slis_t_sortinfo_alv,
          wa_layout type slis_layout_alv,
          it_fieldtab type slis_t_fieldcat_alv,
          wa_fieldcat type slis_fieldcat_alv.
    selection-screen begin of block b1 with frame.
    select-options:s_vbeln for vbak-vbeln,
                   s_vbtyp for vbak-vbtyp default 'C'.
    selection-screen end of block b1 .
    selection-screen begin of block b2 with frame.
    parameters: list radiobutton group rad1,
                grid radiobutton group rad1.
    selection-screen end of block b2.
    initialization.
      g_repid = sy-repid.
    start-of-selection.
      select vbeln
             audat
             vbtyp
             auart
             augru
             netwr
             waerk into corresponding fields of table it_vbak
             from vbak where audat > '01/01/2004' and
             netwr > 0 and
             vbeln in s_vbeln and
             vbtyp in s_vbtyp.
      loop at it_vbak.
        if it_vbak-netwr < 10000.
          it_vbak-icon = '@08@'.
        elseif it_vbak-netwr > 10000 and it_vbak-netwr < 100000.
          it_vbak-icon = '@09@'.
        elseif it_vbak-netwr > 100000.
          it_vbak-icon = '@0A@'.
        endif.
        modify it_vbak index sy-tabix.
      endloop.
    end-of-selection.
      perform sort_list.
      perform modify_fieldcat.
      perform layout_list.
    *&      Form  sort_list
          text
    -->  p1        text
    <--  p2        text
    form sort_list .
      clear wa_sort.
      wa_sort-fieldname = 'AUART'.
      wa_sort-spos = '1'.
      wa_sort-up = 'X'.
      append wa_sort to it_sort.
      clear wa_sort.
      wa_sort-fieldname = 'VBTYP'.
      wa_sort-spos = '2'.
      wa_sort-up = 'X'.
      append wa_sort to it_sort.
      clear wa_sort.
      wa_sort-fieldname = 'WAERK'.
      wa_sort-spos = '3'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      append wa_sort to it_sort.
    endform.                    " sort_list
    *&      Form  layout_list
          text
    -->  p1        text
    <--  p2        text
    form layout_list .
      clear wa_layout.
      if list = 'X'.
        wa_layout-zebra = 'X'.
        wa_layout-window_titlebar = 'LIST DISPLAY'.
        wa_layout-subtotals_text = 'SUBTOTAL'.
        wa_layout-totals_text = 'TOTAL'.
        call function 'REUSE_ALV_LIST_DISPLAY'
         exporting
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
           i_callback_program             = g_repid
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      I_STRUCTURE_NAME               =
           is_layout                      = wa_layout
           it_fieldcat                    = it_fieldtab[]
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
           it_sort                        = it_sort[]
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
          tables
            t_outtab                       = it_vbak
    EXCEPTIONS
      PROGRAM_ERROR                  = 1
      OTHERS                         = 2
        if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
      elseif grid = 'X'.
        wa_layout-zebra = 'X'.
        wa_layout-window_titlebar = 'GRID DISPLAY'.
        wa_layout-subtotals_text = 'SUBTOTAL'.
        wa_layout-totals_text = 'TOTAL'.
        call function 'REUSE_ALV_GRID_DISPLAY'
         exporting
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
           i_callback_program                =  g_repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
           is_layout                         = wa_layout
           it_fieldcat                       = it_fieldtab
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
           it_sort                           = it_sort
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
          tables
            t_outtab                          = it_vbak
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
        if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
      endif.
    endform.                    " layout_list
    *&      Form  modify_fieldcat
          text
    -->  p1        text
    <--  p2        text
    form modify_fieldcat .
      clear wa_fieldcat.
      wa_fieldcat-tabname   = 'IT_VBAK'.
      wa_fieldcat-fieldname = 'ICON'.
      wa_fieldcat-seltext_l  = 'LIGHTS'.
      wa_fieldcat-icon = 'X'.
    WA_FIELDCAT-ddictxt = 'l'.
      wa_fieldcat-col_pos = 1.
      wa_fieldcat-outputlen = 10.
      append wa_fieldcat to it_fieldtab.
      clear wa_fieldcat .
      wa_fieldcat-tabname   = 'IT_VBAK'.
      wa_fieldcat-fieldname = 'VBELN'.
      wa_fieldcat-seltext_l  = 'SALES DOCUMENT'.
    WA_FIELDCAT-ddictxt = 'l'.
      wa_fieldcat-col_pos = 2.
      wa_fieldcat-outputlen = 10.
      append wa_fieldcat to it_fieldtab.
      clear wa_fieldcat .
    when 'maktx'.
      wa_fieldcat-tabname   = 'IT_VBAK'.
      wa_fieldcat-fieldname = 'AUDAT'.
      wa_fieldcat-seltext_l  = 'DATE'.
    WA_FIELDCAT-ddictxt = 'l'.
      wa_fieldcat-col_pos = 3.
      wa_fieldcat-outputlen = 15.
      append wa_fieldcat to it_fieldtab.
      clear wa_fieldcat .
      wa_fieldcat-tabname   = 'IT_VBAK'.
      wa_fieldcat-fieldname = 'VBTYP'.
      wa_fieldcat-seltext_l  = 'SALES CATEGORY'.
      wa_fieldcat-col_pos = 4.
      wa_fieldcat-outputlen = 10.
      append wa_fieldcat to it_fieldtab.
      clear wa_fieldcat .
      wa_fieldcat-tabname   = 'IT_VBAK'.
      wa_fieldcat-fieldname = 'AUART'.
      wa_fieldcat-seltext_l  = 'SALES DOCUMENT TYPE'.
      wa_fieldcat-col_pos = 5.
      wa_fieldcat-outputlen = 10.
      append wa_fieldcat to it_fieldtab.
      clear wa_fieldcat .
      wa_fieldcat-tabname   = 'IT_VBAK'.
      wa_fieldcat-fieldname = 'AUGRU'.
      wa_fieldcat-seltext_l  = 'ORDER REASON'.
    WA_FIELDCAT-ddictxt = 'l'.
      wa_fieldcat-col_pos = 6.
      wa_fieldcat-outputlen = 10.
      append wa_fieldcat to it_fieldtab.
      clear wa_fieldcat .
      wa_fieldcat-tabname   = 'IT_VBAK'.
      wa_fieldcat-fieldname = 'NETWR'.
      wa_fieldcat-seltext_l  = 'QUANTITY'.
      wa_fieldcat-do_sum = 'X'.
    WA_FIELDCAT-ddictxt = 'l'.
      wa_fieldcat-col_pos = 7.
      wa_fieldcat-outputlen = 25.
      append wa_fieldcat to it_fieldtab.
      clear wa_fieldcat .
      wa_fieldcat-tabname   = 'IT_VBAK'.
      wa_fieldcat-fieldname = 'WAERK'.
      wa_fieldcat-seltext_l  = 'CURRENCY'.
    WA_FIELDCAT-ddictxt = 'l'.
      wa_fieldcat-col_pos = 8.
      wa_fieldcat-outputlen = 10.
      append wa_fieldcat to it_fieldtab.
      clear wa_fieldcat .
    endform.                    " modify_fieldcat
    regards,
    keerthi

  • SUB TOTALS  IN ALV

    The below code is  giving the wrong result...how can i get   SUBTOTALS LIFNR WISE AND  THEN SUBTOTALS  BUKRS WISE....................................
    SELECT BUKRS LIFNR GJAHR BELNR BUDAT BLDAT WAERS DMBTR WRBTR SGTXT SHKZG BLART XBLNR HKONT PRCTR
    FROM BSIK INTO TABLE GT_BSIK
    WHERE  BUDAT IN SO_BUDAT AND  PRCTR IN SO_PRCTR.
    SORT  GT_BSIK BY PRCTR BUKRS LIFNR.
    LOOP AT GT_BSIK INTO GS_BSIK.
    AT END OF LIFNR.
            sum .
    MODIFY GT_BSIK FROM GS_BSIK.
    AT END OF bukrs.
             sum .
    MODIFY GT_BSIK FROM GS_BSIK.
    ENDAT.
    ENDAT.
    ENDLOOP.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                 = SY-CPROG
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = T_FCAT
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = GT_BSIK
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    REPORT zf14 NO STANDARD PAGE HEADING LINE-SIZE 138. .
    TABLES: bkpf,bseg,lfa1,t001,rbkp.
    TYPE-POOLS:slis.
    TYPES : BEGIN OF x_bkpf,
    bukrs TYPE bkpf-bukrs, " Company Code
    belnr TYPE bkpf-belnr, " Document Number
    gjahr TYPE bkpf-gjahr, " Fiscal year
    awkey TYPE bkpf-awkey, " Object Key
    bldat TYPE bkpf-bldat,
    budat TYPE bkpf-budat,
    END OF x_bkpf.
    TYPES : BEGIN OF x_final,
    lifnr TYPE lfa1-lifnr,
    sl_no TYPE sy-tabix,
    bukrs TYPE bkpf-bukrs, " Company Code
    belnr TYPE bkpf-belnr, " Document Number
    gjahr TYPE bkpf-gjahr, " Fiscal year
    blart TYPE bkpf-blart, " Document Type
    awkey TYPE bkpf-awkey, " Object Key
    awkey1 TYPE bkpf-awkey,
    bldat TYPE rbkp-bldat,
    budat TYPE bkpf-budat,
    witht TYPE with_item-witht,
    wt_qsshh TYPE with_item-wt_qsshh,
    wt_qbshh TYPE with_item-wt_qbshh,
    wt_acco TYPE with_item-wt_acco,
    name1 TYPE lfa1-name1, "vendor Name
    ort01 TYPE lfa1-ort01, "City
    j_1icstno TYPE j_1imovend-j_1icstno, "CST
    j_1ilstno TYPE j_1imovend-j_1ilstno ,"LST
    *Start of changes by Kiran.K dated 17072007.
    j_1ipanno TYPE j_1imovend-j_1ipanno, "PAN No.
    *End of changes by Kiran.K dated 17072007.
    END OF x_final.
    DATA : itbkpf TYPE x_bkpf OCCURS 0 WITH HEADER LINE.
    DATA : itfinal TYPE x_final OCCURS 0 WITH HEADER LINE.
    DATA : month_names LIKE t247 OCCURS 0 WITH HEADER LINE.
    DATA :i(2), "month
    y TYPE int4, "year
    c(4),
    v_bill LIKE bseg-dmbtr. " bill value
    DATA : pos TYPE sy-tabix,
    month(99),
    month1(99).
    DATA:sl_no(3) VALUE 0.
    DATA:string1(100),
    date1(10),
    date2(10),
    title(65).
    *Declarations for ALV
    DATA:itfieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA:itrepid TYPE sy-repid.
    itrepid = sy-repid.
    DATA:itevent TYPE slis_t_event.
    DATA:itlistheader TYPE slis_t_listheader.
    DATA:walistheader LIKE LINE OF itlistheader.
    DATA:itlayout TYPE slis_layout_alv.
    DATA:top TYPE slis_formname.
    DATA:itsort TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    DATA:itprintparams TYPE slis_print_alv.
    DATA:itvariant TYPE disvariant.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_bukrs LIKE t001-bukrs OBLIGATORY. "Company code
    SELECT-OPTIONS : s_lifnr FOR lfa1-lifnr, "Vendor name
    s_budat FOR sy-datum OBLIGATORY,
    s_gjahr FOR bseg-gjahr NO-DISPLAY.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: r1 RADIOBUTTON GROUP g1,
    r2 RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK b2.
    WRITE:S_BUDAT-LOW TO DATE1,
    S_BUDAT-HIGH TO DATE2.
    AT SELECTION-SCREEN.
    SELECT SINGLE bukrs
    INTO t001-bukrs
    FROM t001
    WHERE bukrs = p_bukrs.
    IF sy-subrc <> 0.
    MESSAGE e000(z_ma) WITH 'Invalid Company Code'.
    ENDIF.
    IF NOT s_lifnr[] IS INITIAL.
    SELECT SINGLE lifnr
    INTO lfa1-lifnr
    FROM lfa1
    WHERE lifnr IN s_lifnr.
    IF sy-subrc <> 0.
    MESSAGE e000(z_ma) WITH 'Invalid Vendor'.
    ENDIF.
    ENDIF.
    START-OF-SELECTION.
    IF s_budat IS NOT INITIAL.
    IF s_budat-high IS NOT INITIAL.
    WHILE s_budat-low LE s_budat-high.
    i = s_budat+7(2).
    IF i > 3.
    s_gjahr = s_budat+3(4).
    APPEND s_gjahr.
    ELSE.
    c = s_budat+3(4).
    s_gjahr = c - 1.
    APPEND s_gjahr.
    ENDIF.
    s_budat-low = s_budat-low + 1.
    ENDWHILE.
    ELSE.
    i = s_budat+7(2).
    IF i > 3.
    s_gjahr = s_budat+3(4).
    APPEND s_gjahr.
    ELSE.
    c = s_budat+3(4).
    s_gjahr = c - 1.
    APPEND s_gjahr.
    ENDIF.
    ENDIF.
    ENDIF.
    IF r1 = 'X'.
    PERFORM getdata.
    PERFORM alv.
    ELSE.
    PERFORM getdata.
    PERFORM classical.
    ENDIF.
    *& Form getdata
    text
    FORM getdata.
    SELECT bukrs
    belnr
    awkey
    budat
    gjahr
    blart
    FROM bkpf INTO CORRESPONDING FIELDS OF TABLE itbkpf
    WHERE bukrs = p_bukrs
    AND budat IN s_budat
    AND bstat = space
    AND gjahr = s_gjahr.
    IF sy-subrc NE 0.
    MESSAGE 'No Values exist for the Selection.' TYPE 'S'.
    ENDIF.
    *Tax details.
    LOOP AT itbkpf.
    MOVE-CORRESPONDING itbkpf TO itfinal.
    SELECT SINGLE belnr
    gjahr
    witht
    wt_qsshh
    wt_qbshh
    wt_acco "vendor
    FROM with_item INTO CORRESPONDING FIELDS OF itfinal
    WHERE bukrs = p_bukrs
    AND gjahr = itbkpf-gjahr
    AND belnr = itbkpf-belnr
    AND witht = 'T1'.
    APPEND itfinal.
    CLEAR itfinal.
    CLEAR itbkpf.
    ENDLOOP.
    LOOP AT itbkpf.
    MOVE-CORRESPONDING itbkpf TO itfinal.
    SELECT SINGLE belnr
    gjahr
    witht
    wt_qsshh
    wt_qbshh
    wt_acco "vendor
    FROM with_item INTO CORRESPONDING FIELDS OF itfinal
    WHERE bukrs = p_bukrs
    AND gjahr = itbkpf-gjahr
    AND belnr = itbkpf-belnr
    AND witht = 'T2'.
    APPEND itfinal.
    CLEAR itfinal.
    CLEAR itbkpf.
    ENDLOOP.
    LOOP AT itfinal.
    IF NOT ( itfinal-witht = 'T1' OR itfinal-witht = 'T2' ) OR ( itfinal-wt_qsshh = '0.00' ).
    DELETE itfinal.
    ENDIF.
    ENDLOOP.
    LOOP AT itfinal.
    itfinal-awkey1 = itfinal-awkey+0(10).
    SELECT SINGLE lifnr
    name1
    ort01
    FROM lfa1 INTO CORRESPONDING FIELDS OF itfinal
    WHERE lifnr = itfinal-wt_acco.
    SELECT SINGLE j_1icstno
    j_1ilstno
    *Start of changes by Kiran.K dated 17072007.
    j_1ipanno
    *End of changes by Kiran.K dated 17072007.
    FROM j_1imovend INTO CORRESPONDING FIELDS OF itfinal
    WHERE lifnr = itfinal-wt_acco.
    SELECT SINGLE bldat
    from rbkp INTO CORRESPONDING FIELDS of itfinal
    where belnr = itfinal-awkey1
    and gjahr = itfinal-gjahr.
    MODIFY itfinal.
    ENDLOOP.
    ENDFORM. "getdata
    *& Form alv
    Fieldcatalog for ALV Report
    FORM alv.
    DATA:NO_SUBTOTAL(1) TYPE C.
    SORT ITFINAL BY LIFNR.
    LOOP AT itfinal.
    itfinal-awkey1 = itfinal-awkey+0(10).
    itfinal-sl_no = sy-tabix.
    MODIFY itfinal.
    ENDLOOP.
    IF itfinal[] IS INITIAL.
    MESSAGE 'No Values exist for the Selection.' TYPE 'S'.
    STOP.
    ENDIF.
    DEFINE m_fieldcat.
    itfieldcat-fieldname = &1.
    itfieldcat-col_pos = &2.
    itfieldcat-seltext_l = &3.
    itfieldcat-do_sum = &4.
    itfieldcat-outputlen = &5.
    append itfieldcat to itfieldcat.
    clear itfieldcat.
    END-OF-DEFINITION.
    m_fieldcat 'SL_NO' '' 'SL. NO' '' 03 .
    m_fieldcat 'BUKRS' '' 'COMPANY CODE' '' 12 .
    Start of Changes made by Kiran.K dated 17072007.
    m_fieldcat 'BELNR' '' 'FI Doc.No.' '' 12 .
    End of changes made by Kiran.K dated 17072007
    m_fieldcat 'GJAHR' '' 'FISCAL YEAR' '' 11.
    m_fieldcat 'WT_QSSHH' '' 'TAX BASE AMT.' 'X' 13 .
    m_fieldcat 'WT_QBSHH' '' 'TAX' 'X' 13 .
    m_fieldcat 'AWKEY1' '' 'INVOICE No.' '' 13 .
    m_fieldcat 'BLDAT' '' 'DOCUMENT DATE' '' 08 .
    m_fieldcat 'BUDAT' '' 'POSTING DATE' '' 08 .
    m_fieldcat 'LIFNR' '' 'VENDOR CODE' '' 10 .
    m_fieldcat 'NAME1' '' 'VENDOR NAME' '' 35 .
    m_fieldcat 'ORT01' '' 'CITY' '' 35 .
    m_fieldcat 'J_1ICSTNO' '' 'CST No.' '' 40 .
    Start of changes by Kiran.K dated 17072007.
    m_fieldcat 'J_1ILSTNO' '' 'TIN NUMBER.' '' 40.
    m_fieldcat 'J_1IPANNO' '' 'PERMANENT A/C No.' '' 40.
    End of changes by Kiran.K dated 17072007.
    itlayout-zebra = 'X'.
    itlayout-colwidth_optimize = 'X'.
    data : itsort TYPE slis_t_sortinfo_alv with header line.
    DATA :itsort1 TYPE slis_sortinfo_alv.
    CLEAR itsort.
    itsort1-spos = 10."column position
    itsort1-fieldname = 'LIFNR'."field name
    itsort1-tabname = 'ITFINAL'."internal table
    *itsort1-up = 'X'.
    *itsort1-group = 'UL'.
    *itsort1-subtot = 'X'.
    APPEND itsort1 TO itsort.
    CLEAR itsort.
    itsort1-spos = 5."column position
    itsort1-fieldname = 'WT_QSSHH'."field name
    itsort1-tabname = 'ITFINAL'."internal table
    *itsort1-up = 'X'.
    *itsort1-group = 'UL'.
    itsort1-subtot = 'X'.
    APPEND itsort1 TO itsort.
    *CLEAR itsort.
    *itsort1-spos = 4. "column position
    *itsort1-fieldname = 'WT_QBSHH'."field name
    *itsort1-tabname = 'ITFINAL'."internal table
    **itsort1-up = 'X'.
    **itsort1-group = 'UL'.
    *itsort1-subtot = 'X'.
    *APPEND itsort1 TO itsort. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    is_layout = itlayout
    i_callback_user_command = 'LIST1'
    i_callback_top_of_page = 'TOP'
    it_fieldcat = itfieldcat[]
    i_save = 'A'
    is_variant = ITVARIANT
    it_events = itevent[]
    is_print = ITPRINTPARAMS
    it_sort = itsort[]
    TABLES
    t_outtab = itfinal
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM. "alv
    *& Form list1
    ALV Interactive-
    -->R_UCOMM text
    -->RS_SELFIELDtext
    FORM list1 USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
    CASE r_ucomm.
    WHEN '&IC1'.
    IF rs_selfield-fieldname = 'BELNR'.
    READ TABLE itfinal INDEX rs_selfield-tabindex.
    SET PARAMETER ID 'BLN' FIELD itfinal-belnr.
    start of changes made by Kiran.K dated 18072007.
    SET PARAMETER ID 'BUK' FIELD ITFINAL-BUKRS.
    SET PARAMETER ID 'GJR' FIELD ITFINAL-GJAHR.
    *End of changes made by Kiran.K dated 18072007.
    CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
    ENDIF.
    ENDCASE.
    ENDFORM. "list1
    *& Form TOP
    Top of page for ALV Report
    FORM top.
    DATA : name1(60),
    month_text(250),
    string1(100),
    date3(10),
    date4(10),
    title(65).
    WRITE: DATE1 TO date3,
    DATE2 TO date4.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    i_list_type = 0
    IMPORTING
    et_events = itevent
    EXCEPTIONS
    LIST_TYPE_WRONG = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    string1 = 'TDS on Work Contracts for'.
    CONCATENATE string1 itfinal-bukrs date3 'to' date4 INTO title SEPARATED BY space.
    walistheader-typ = 'H'.
    walistheader-info = title.
    APPEND walistheader TO itlistheader.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = itlistheader
    I_LOGO = ''.
    I_END_OF_LIST_GRID =
    ENDIF.
    CLEAR itlistheader.
    ENDIF.
    ENDFORM. "TOP
    *& Form classical
    Form to display the values in Classical Report
    FORM classical.
    FORMAT RESET.
    FORMAT COLOR COL_NORMAL.
    sort itfinal by lifnr.
    LOOP AT itfinal.
    sl_no = sl_no + 1.
    itfinal-awkey1 = itfinal-awkey+0(10).
    WRITE:/ sy-vline,
    2 sl_no,
    7 sy-vline,
    10 itfinal-bukrs,
    21 sy-vline,
    23 itfinal-belnr hotspot,
    35 sy-vline,
    38 itfinal-gjahr,
    47 sy-vline,
    48 itfinal-wt_qsshh,
    69 sy-vline,
    70 itfinal-wt_qbshh,
    91 sy-vline,
    94 itfinal-awkey1,
    108 sy-vline,
    110 itfinal-budat,
    125 sy-vline,
    *Start of changes made by Kiran.K dated 18072007.
    127 itfinal-bldat,
    138 sy-vline.
    *End of changes made by Kiran.K dated 18072007.
    hide itfinal-belnr.
    at end of lifnr.
    uline.
    new-page.
    clear: sl_no.
    endat.
    ENDLOOP.
    write:/ sy-vline.
    ENDFORM. "classical
    at line-selection.
    set parameter id 'BLN' field itfinal-belnr.
    call transaction 'FB03' AND SKIP FIRST SCREEN.
    TOP-OF-PAGE.
    DATA : name1(60).
    DATA : month_text(127),
    string(99).
    FORMAT RESET.
    FORMAT COLOR COL_POSITIVE.
    string1 = 'TDS on Work Contracts for'.
    CONCATENATE string1 itfinal-bukrs date1 'to' date2 INTO title SEPARATED BY space.
    WRITE :/ title.
    SKIP 1.
    CONCATENATE itfinal-name1 ',' itfinal-ort01
    INTO name1 SEPARATED BY space.
    WRITE :/ 'Vendor Code :', itfinal-lifnr.
    WRITE :/ 'Vendor Name and City :', name1.
    SKIP 1.
    *Start of changes by Kiran.K dated 17072007.
    *Changed TNGST as TIN and PAN No is added.
    WRITE :/ 'TIN No :', itfinal-j_1ilstno,
    / 'CST Registration No :', itfinal-j_1icstno,
    / 'PERMANENT A/C No. :',itfinal-j_1ipanno.
    *End of changes by Kiran.K dated 17072007.
    SKIP 1.
    Display the coloumn headings
    FORMAT RESET.
    FORMAT COLOR COL_HEADING.
    WRITE :/ sy-uline.
    WRITE:/ sy-vline,
    2 'SI.No',
    7 sy-vline,
    10 'Comp.Code',
    21 sy-vline,
    22 'FI.Doc.No',
    35 sy-vline,
    37 'Fiscal Yr.',
    47 sy-vline,
    49 'Tax Base Amt.',
    69 sy-vline,
    71 'Tax Amt.',
    91 sy-vline,
    94 'Invoice No.' ,
    108 sy-vline,
    110 'Posting Date',
    125 sy-vline,
    127 'Doc.Date',
    138 sy-vline,
    ***Solution
    Just add SUBTOTAL in the fieldcatalog of the particular field.
    I_FIELDCAT-DO_SUM = 'X'.
    Or Tey This:
    Data: I_SORT TYPE SLIS_T_SORTINFO_ALV,
    WA_SORT TYPE SLIS_SORTINFO_ALV.
    *---Sort
    WA_SORT-SPOS = '1'.
    WA_SORT-FIELDNAME = 'LINE'.
    WA_SORT-UP = 'X'.
    WA_SORT-SUBTOT = 'X'.
    APPEND WA_SORT TO I_SORT.
    CLEAR WA_SORT.
    Pass this in FM,
    IT_SORT = I_SORT
    Or Tey This:
    Use FM REUSE_ALV_EVENTS_GET to get all events in ur ALV report.then use event SUBTOTAL_TEXT to print subtotal.
    following are the events that u can use in ALV :
    CALLER_EXIT
    USER_COMMAND
    TOP_OF_PAGE
    TOP_OF_COVERPAGE
    END_OF_COVERPAGE
    FOREIGN_TOP_OF_PAGE
    FOREIGN_END_OF_PAGE
    PF_STATUS_SET
    LIST_MODIFY
    TOP_OF_LIST
    END_OF_PAGE
    END_OF_LIST
    AFTER_LINE_OUTPUT
    BEFORE_LINE_OUTPUT
    REPREP_SEL_MODIFY
    SUBTOTAL_TEXT
    GROUPLEVEL_CHANGE

  • Need Some MM related ALV reports

    hi experts,
    I want some MM related ALV reports.
    please help me out.
      thanks a lot,
       prerna.

    Hi Prerna,
    check these sites
    http://www.geocities.com/mpioud/Abap_programs.html
    http://www.geocities.com/mpioud/Z_DEMO_ALV_REFRESH_BUTTON.html
    http://www.sapdesignguild.org/resources/MiniSG-old/from_develop/norm_status_icons.htm#positioning_4
    http://www.sap-img.com/fu037.htm
    http://help.sap.com/saphelp_470/helpdata/en/bf/3bd1369f2d280ee10000009b38f889/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    http://www.sap-img.com/abap-function.htm
    http://www.sap-img.com/abap/reincarnation-of-reuse-alv-fieldcatalog-merge.htm
    http://www.sap-img.com/fu015.htm
    http://www.sapgenie.com/abap/code/abap28.htm
    http://www.sapdevelopment.co.uk/reporting/alv/alv_variousfcat.htm
    Give me ur mail id i will send some documentation.
    Do reward if it helps,
    Laxmi.

  • 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

  • ALV GRID print problem

    Hi guys,
    When I execute my report I can see all fields ok, but when I decide to print it the columns and fields are been displaced. I tried to fix with the fielcatalog but it isn't possible. Can anybody help me?
    Thanks a lot
    Best regards.
    Ana

    Hi  Menegazzo Marco  ,
    I call the alv :
    ***fieldcatalog***
    LS_FCAT-COL_POS = '1'.
      LS_FCAT-FIELDNAME = 'BUKRS' .
      LS_FCAT-TABNAME = 'BKPF'.
      LS_FCAT-INTTYPE = 'C' .
      LS_FCAT-OUTPUTLEN = '4' .
      LS_FCAT-COLTEXT = 'Sociedad ' .
      LS_FCAT-SELTEXT = 'Sociedad ' .
    LS_FCAT-JUST = 'X'.
      LS_FCAT-COL_OPT  = ' '.
      APPEND LS_FCAT TO PGT_FIELDCAT .
      CLEAR LS_FCAT.
      LS_FCAT-COL_POS = '2'.
      LS_FCAT-FIELDNAME = 'BELNR' .
      LS_FCAT-TABNAME = 'BKPF'.
      LS_FCAT-INTTYPE = 'C' .
      LS_FCAT-OUTPUTLEN = '10' .
      LS_FCAT-DD_OUTLEN = '10'.
      LS_FCAT-COLTEXT = 'Nº doc. Contable' .
      LS_FCAT-SELTEXT = 'Nº doc. Contable' .
      LS_FCAT-JUST = 'X'.
      LS_FCAT-COL_OPT  = ''.
      APPEND LS_FCAT TO PGT_FIELDCAT .
      CLEAR LS_FCAT.
      LS_FCAT-COL_POS = '3'.
      LS_FCAT-FIELDNAME = 'GJAHR' .
      LS_FCAT-TABNAME = 'BKPF'.
      LS_FCAT-INTTYPE = 'N' .
      LS_FCAT-OUTPUTLEN = '4' .
      LS_FCAT-COLTEXT = 'Ejercicio' .
      LS_FCAT-SELTEXT = 'Ejercicio' .
      LS_FCAT-JUST = 'X'.
      LS_FCAT-COL_OPT  = ' '.
      APPEND LS_FCAT TO PGT_FIELDCAT .
      CLEAR LS_FCAT.
    **end fieldcatalog**
    *layout**
    PGS_LAYOUT-CWIDTH_OPT = 'X'.
      PGS_LAYOUT-COL_OPT = 'X'.
    *end layout**
    *print*
    GS_PRINT-NO_COLWOPT = 'X'.
    *end print*
        CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
            I_STRUCTURE_NAME              = 'S_ALV'
            IS_LAYOUT                     = GS_LAYOUT
            IS_PRINT                      = GS_PRINT
          CHANGING
            IT_OUTTAB                     = LT_ALV[]
            IT_FIELDCATALOG               = GT_FIELDCAT
          EXCEPTIONS
            INVALID_PARAMETER_COMBINATION = 1
            PROGRAM_ERROR                 = 2
            TOO_MANY_LINES                = 3
            OTHERS                        = 4.
        IF SY-SUBRC <> 0.
    *--Exception handling
        ENDIF.
    Thanks a lot.

  • Problem with ALV : fieldcatlog

    Hi,
    I am trying to use 'REUSE_ALV_GRID_DISPLAY' to display  a simple ITAB.
    For some reason, its giving a runtime error.
    Pls help me to indentify the problem. Am enclosing the code over here.
    Thanks in advance
    Hrishi
    *& Report  ZTEST3
    REPORT  ZTEST3 line-size 400.
    TABLES:  EKKO, LFA1, MAKT, EKET, EKPO, cdhdr.
    *Data Declaration
    TYPES:  BEGIN OF FINAL,
          ebeln type ekko-ebeln,
            BEDAT type ekko-bedat,
            lifnr type ekko-lifnr,
            ernam type ekko-ernam,
            name1 type lfa1-name1,
            matnr type ekpo-matnr,
            eindt type eket-eindt,
            MAKTX type MAKT-MAKTX,
            MBLNR type MSEG-MBLNR,
            eldat type eket-eldat,
            end of FINAL.
    DATA:  ITAB TYPE STANDARD TABLE OF FINAL INITIAL SIZE 10 WITH HEADER LINE.
    all ALV declarations
    type-pools: slis.                                 "ALV Declarations
    DATA:   fieldcatalog        TYPE slis_t_fieldcat_alv with header line,
            G_REPID             TYPE SY-REPID,
            GS_PRINT            TYPE SLIS_PRINT_ALV,
            GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
            GT_EVENTS           TYPE SLIS_T_EVENT,
            GT_SORT             TYPE SLIS_T_SORTINFO_ALV,
            GS_LAYOUT           TYPE SLIS_LAYOUT_ALV,
            COL_POS TYPE I.
    -----------------SELECTION SCREEN----------------------
      selection-screen begin of block b1 with frame title text-001.
      select-options podate for EKKO-bedat.
      selection-screen end of block b1.
    *................... GET DATA..................
    SELECT EKKO~EBELN
           EKKO~BEDAT
           EKKO~LIFNR
           EKKO~ERNAM
           LFA1~NAME1
           MAKT~MATNR
           EKET~EINDT
           MAKT~MAKTX
           MSEG~MBLNR
           eket~eldat
    INTO CORRESPONDING FIELDS OF ITAB
    FROM
    ( EKKO INNER JOIN LFA1
    ON EKKO~LIFNR = LFA1~LIFNR
    INNER JOIN MSEG
    ON EKKO~EBELN = MSEG~EBELN
    INNER JOIN MKPF
    ON MSEG~MBLNR = MKPF~MBLNR
    INNER JOIN EKPO
    ON EKKO~EBELN = EKPO~EBELN
    INNER JOIN MAKT
    ON EKPO~MATNR = MAKT~MATNR
    INNER JOIN EKET
    ON EKKO~EBELN = EKET~EBELN
    WHERE EKKO~BEDAT IN PODATE  .
    APPEND ITAB. CLEAR ITAB.
    ENDSELECT.
    *LOOP AT ITAB.
    at first.
         write: / 'VENDOR NO' color 6 INVERSE,' VENDOR NAME' COLOR 6
    *INVERSE,48'MATERIAL NO' COLOR 6 INVERSE,67'MATERIAL DESCRIPTION' COLOR 6 INVERSE,108'PO.NUMBER' COLOR 6 INVERSE,119'DATE' COLOR 6 INVERSE,129'CREATED BY' COLOR 6 INVERSE,143'G R NO' COLOR 6 INVERSE, 154'GR DATE' COLOR 6 INVERSE,
    *167'DELIVERY DATE PROMISED' COLOR 6 INVERSE.
         ULINE.
       endat.
    *WRITE:/ ITAB-LIFNR,ITAB-NAME1,ITAB-MATNR,ITAB-MAKTX,ITAB-EBELN,ITAB-BEDAT,ITAB-ERNAM,ITAB-MBLNR, ITAB-ELDAT, ITAB-EINDT, itab-udate.
    *ENDLOOP.
    CDHDROBJECTCLAS AND CDHDRTCODE EQ 'ME28'.
    *LOOP AT ITAB.
    *SELECT * FROM CDHDR WHERE OBJECTid = ITAB-EBELN AND .
    *ITAB-UDATE = CDHDR-UDATE.
    *APPEND ITAB. CLEAR ITAB.
    *ENDSELECT.
    *ENDLOOP.
      fieldcatalog-fieldname   = 'ebeln'.
      fieldcatalog-seltext_m   = 'po Number'.
      fieldcatalog-col_pos     = 0.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'bedat'.
      fieldcatalog-seltext_m   = 'po date'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'lifnr'.
      fieldcatalog-seltext_m   = 'vendor no'.
      fieldcatalog-col_pos     = 2.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'ernam'.
      fieldcatalog-seltext_m   = 'created by'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'name1'.
      fieldcatalog-seltext_m   = 'vendor name'.
      fieldcatalog-col_pos     = 4.
       fieldcatalog-outputlen   = 15.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'matnr'.
      fieldcatalog-seltext_m   = 'material number'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-fieldname   = 'eindt'.
      fieldcatalog-seltext_m   = 'date promised'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'maktx'.
      fieldcatalog-seltext_m   = 'material desc'.
      fieldcatalog-col_pos     = 7.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'mblnr'.
      fieldcatalog-seltext_m   = 'GR no'.
      fieldcatalog-col_pos     = 8.
      fieldcatalog-outputlen   = 15.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'eldat'.
      fieldcatalog-seltext_m   = 'gr date'.
      fieldcatalog-col_pos     = 9.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = g_repid
                it_fieldcat             = fieldcatalog[]
                 is_layout               = GS_layout
               is_variant              = z_template
           tables
                t_outtab                = itab
                exceptions
                program_error           = 1
                others                  = 2.

    Hi,
    I just noticed that fieldcatalog-fieldnames are not capitalized.
    Please see the following sample code:
      PERFORM f_build USING:
        'MATNR'      text-003,    "material
        'MAKTX'      text-004,    "material description
        'INVBEG'     text-005,    "inv beg
        'INVAMT'     text-006,    "inv amount
        'SOLD'        text-007,     "sold
        'CANCEL'    text-008,    "cancelled
        'INVEND'     text-009.    "inv end
    *&      Form  f_build
          Build ALV fieldcatalog
    FORM f_build USING p_fieldname
                       p_fieldtext LIKE wa_fieldcatalog-seltext_l.
      CLEAR wa_fieldcatalog.
      wa_fieldcatalog-fieldname      = p_fieldname.
      wa_fieldcatalog-seltext_l      = p_fieldtext.
      APPEND wa_fieldcatalog TO it_fieldcatalog.
    ENDFORM.                    " f_build

  • Value not populating in report of MB5T ALV report

    I had written a logic in implicit of this standard report and  iam trying to populate the value in the ALV fieldcatalog.
    Iam unable see the value on output screen though the value gets calculated correctly in debug mode.
    Any suggestions

    Hi  venkata 
    use COMMIT WORK.....maybe it's too fast and it is unable to store the value...
    and try to set a break.point before the call of ALV..and check if the table is correctly calculated.
    regards
    Marco
    Edited by: Menegazzo Marco on May 24, 2010 4:09 PM

  • Query on ALV

    I have a query on ALV.
    When am doing a addition for a currency field with some negative amounts and positive amounts, the Sumation of all amounts are not happening.
    Could someone please help me on this.
    Thanks in advance.
    Prince

    Hi,
    In ALV fieldcatalog, please pass the CFIELDNAME and CTABNAME.
    CFIELDNAME = Currency Key,
    CTABNAME = Currency key table name.
    like use below code in the fieldcatalog
    LS_FIELDCAT-CFIELDNAME    = 'WAERK'.
    LS_FIELDCAT-CTABNAME      = 'VBAP'.
    I think summation is working fine.
    rewards if helpful.
    Regards,
    Subbarao

  • Drop down in ALV grid

    I am able to display the editable ALV. I am able to edit and save into my ztable. now, the issue is in editable cells I am able to enter through keyboard, but I want data for particular field from standard tables i.e. I am not getting dropdown as we get in normal ALV display. if this is solved my entire issue is solved.

    Hi,
    Create the serach help for the field in the ALV fieldcatalog.
    If you were using OO ALV, then you need to register the field for F4.
    it_f4-fieldname = 'Field name'
    it_f4-register = 'X'.
    it_f4-chngeafter = 'X'
    APPEND it_f4 .
          CALL METHOD grid->register_f4_for_fields
           EXPORTING
              it_f4 = it_f4[].
    Regards,
    Satish Kanteti

  • Search help problem in ALV output for field TD24A-DISMM

    Hi Abap-Experts,
          I have one issue regarding simple ALV report.
          I need to display search-help for field DISMM.  I have used below code in ALV fieldcatalog.
          ts_fieldcat - tabname = 'TD24A'.
          ts_fieldcat - tabname = 'DISMM'.
          I have attached search-help for fields such as MATNR and WERKS too.
          The search-helps are getting displayed for MATNR as well as WERKS.
          But, the search-help is not gettting displayed for field DISMM(RP-TYPE) .
             The output displayed is done using Simple ALV.     
            Could anyone please help me and correct my code or logic i have used.

    Hi,
      I have changed code a bit...and used T438A table.
      CLEAR ts_fieldcat.
      ts_fieldcat-col_pos = '5'.
      ts_fieldcat-fieldname = 'DISMM'.
      ts_fieldcat-seltext_l = text-014.
      ts_fieldcat-outputlen =  2.
      ts_fieldcat-reptext_ddic  = ''.
      ts_fieldcat-ref_tabname   = 'T438A'.
      ts_fieldcat-ref_fieldname = 'DISMM'.
    ts_fieldcat-ddic_outputlen = '2'.
      ts_fieldcat-input         = 'X'.
      APPEND ts_fieldcat TO gt_fieldcat.
    still it is not showing me the F4 help in simplae ALV output..
    kindly help me

Maybe you are looking for

  • How do I use my Nokia Lumia 635 with Target's Brig...

    I purchased my 635 on eBay and the seller said it was an unlocked phone. When I put the Brightspot SIM card into the phone, it asks me which "Cellular Connection Profile" I want to use for the SIM card, and the only two options are T-Mobile or MetroP

  • Apple Pro Speakers from G4 Cube with Mac mini

    To listen music with my Mac mini, I used Apple Pro Speakers that originally came with the G4 Cube. But since june 2010, my system (Mac OS X) does not recognize these speakers. The error message (via command 'dmesg') is : Couldn't alloc class "AppleUS

  • Parameter for ORDER BY in DAX query not respected

    I have an SSRS table fed by a parameterized DAX query (utilizing the methods in thesearticles). I have all of my parameters working just fine except for those feeding my closing ORDER BY statement (I am offloading the sorting to the Tabular for sever

  • Itune 10.5 Can't access to Store - Very Annoyed

    Iphone 4 upgrade ios 5. HP with Win 7 64 bit. Home wireless 512 bit/sec. Upgrade to Itune 10.5, cant access to store. Trying every method suggested by ASC not working. Flushing, firewall, anti-virus, all having said nothing happen. Uninstalled and re

  • Platform 8.1 SP3 Package Installer error

    I downloaded the Platform 8.1 SP3 package installer and received an error when installing. The error message states that the file is corrupt - error 2. I have tried this twice and get the same result each time. I have 2 GB of disk space free and am r