AlV!  Field Catalog Merge!

Hi!
   What is Field catalog merge in ALV

Hi,
YOU HAVE TWO WAYS TO BUILD A FIELD CATALOG
1) FIRST METHOD
data w_fieldcat type slis_fieldcat_alv.
type-pools : slis.
tables : sflight.
data : i_fieldcat type slis_T_fieldcat_alv.
data v_repid like sy-repid.
data : begin of i_sflight occurs 0,
       carrid like sflight-carrid,
       connid like sflight-connid,
       fldate like sflight-fldate,
        end of i_sflight.
w_fieldcat-tabname = 'I_SFLIGHT'.
w_fieldcat-fieldname = 'CARRID'.
w_fieldcat-outputlen = '10'.
w_fieldcat-col_pos = '1'.
w_fieldcat-row_pos = '1'.
w_fieldcat-seltext_l = 'Carrie ID'.
w_fieldcat-seltext_M = 'Carrie ID'.
w_fieldcat-seltext_S = 'Carrie ID'.
w_fieldcat-HOTSPOT = 'X'.
append w_fieldcat to i_fieldcat.
clear w_fieldcat.
w_fieldcat-tabname = 'I_SFLIGHT'.
w_fieldcat-fieldname = 'CONNID'.
w_fieldcat-outputlen = '10'.
w_fieldcat-col_pos = '1'.
w_fieldcat-row_pos = '1'.
w_fieldcat-seltext_l = 'CONNI ID'.
w_fieldcat-seltext_M = 'CONNI ID'.
w_fieldcat-seltext_S = 'CONNIID'.
w_fieldcat-HOTSPOT = 'X'.
append w_fieldcat to i_fieldcat.
clear w_fieldcat.
w_fieldcat-tabname = 'I_SFLIGHT'.
w_fieldcat-fieldname = 'FLDATE'.
w_fieldcat-outputlen = '10'.
w_fieldcat-col_pos = '1'.
w_fieldcat-row_pos = '1'.
w_fieldcat-seltext_l = 'FLDATE.
w_fieldcat-seltext_M = 'FLDATE'.
w_fieldcat-seltext_S = 'FLDATE'.
w_fieldcat-HOTSPOT = 'X'.
append w_fieldcat to i_fieldcat.
clear w_fieldcat.
2)  SECOND METHOD
data w_fieldcat type slis_fieldcat_alv.
type-pools : slis.
tables : sflight.
data : i_fieldcat type slis_T_fieldcat_alv.
data v_repid like sy-repid.
data : begin of i_sflight occurs 0,
       carrid like sflight-carrid,
       connid like sflight-connid,
       fldate like sflight-fldate,
        end of i_sflight.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
       exporting
            i_program_name     = v_repid
            i_internal_tabname = 'I_SFLIGHT'
            i_inclname         = v_repid
       changing
            ct_fieldcat        = I_fieldcatalog_TYPE.
Reward points if helpful
THANKS
Venki

Similar Messages

  • Field catalog merge in Classes

    Hi,
    I need to use field catalog merge without using FM . not manual field catalog.I want to call Class and use in ALV.
    Regards,
    Nandha

    Hi Nandha,
    why you can't use FM?
    it's common to use LVC_FIELDCATALOG_MERGE using ALV GRID CONTROLL (with class).

  • Error in updating ALV field catalog in selection tool for Planning Book

    Hi ,
    I am Implementing BADI  '/SAPAPO/SDP_SELECTOR' to upload Custom Fields Data in Planning Book Selection Window under APO Location Product. These Custom Fields are maintained in Custom Table.So from Table whatever Custom Fields are availabe all the fields needs to be available in for selection. Once selection is done the same data to be uploaded into Planning Book.
    This BADI is working Fine upto 4 fields but if any extra fields are added in the table 'Error in updating ALV field catalog in selection tool' error Pop Up is coming. Here i am using Folloowing Methods
    1). INIT_OBJECT_LIST
    2). F4
    3). LOC_PROD_VALUE_LIST
    Please help on the same if u have any idea or clue.
    Thanks.

    Hi Srinivas!
    Where did you get your implementation from?
    It would be nice if you could debug your code!
    For the F4 method, have you seen this note?
    Note 544904 - Sample source code f.BAdI /SAPAPO/SDP_SELECTOR ('F4'method)
    Also check this note. It contains selection modifications in the BAdI:
    Note 376902 - SDP selector: Basis corrections for BADI
    I do not know your release and support package in your SCM, but you can find a lot of notes related to this BAdI.
    Thank you!
    Will
    SCM Support Consultant

  • Error in updating ALV field catalog in selection

    Dear all,
    I'm trying to use the standard transaction /SAPAPO/TSKEYFMAIN in order to check the TS values.
    After filling the selection variant, the system shows the following error:
    'Error in updating ALV field catalog in selection'
    Could you please provide me with further details about the error? What could be the possible solution to avoid it?
    Many thanks,
    SM

    Hi Marius,
    thanks for your answer.
    I would like to use the /SAPAPO/TSKEYFMAIN transaction to check massively the values in the time series KFs and not just the consistency of them.
    So do you know any other transaction to do it or do you have an idea about the error of /SAPAPO/TSKEYFMAIN?
    Thanks for your help!
    SM

  • ALV Field catalog problem

    Hi All
    I am doing field catalog merge for a structure using the FM
    'LVC_FIELDCATALOG_MERGE' . I am passing the structure to this FM.
    Initially there were 14 fields in the structure. I added a new field
    and activated the structure. But it still shows only 14 fields instead of 15.
    Please Reply ASAP.
    Thanks.
    Praveena.

    Yes, go in debug mode.Keep a break point at K_KKB_FIELDCAT_MERGE.
    This fm has following code. Keep a break point in second ALV_CHECK_BUFFER.
      call function 'ALV_CHECK_BUFFER'
        exporting
          i_buffer_type      = 'A'
          i_buffer_active    = i_buffer_active
          i_bypassing_buffer = i_bypassing_buffer
          i_refresh_buffer   = ' '
        importing
          e_import           = l_import
          e_export           = l_export
          e_delete           = l_delete.
      call function 'ALV_CHECK_BUFFER'
        exporting
          i_buffer_type      = 'B'
          i_buffer_active    = i_buffer_active
          i_bypassing_buffer = i_bypassing_buffer
          i_refresh_buffer   = ' '
        importing
          e_import           = l_import_b
          e_export           = l_export_b
          e_delete           = l_delete_b.
    After the second ALV_CHECK_BUFFER executes, clear value of variable l_import_b. This will help you to see new added fields to your structure in report output.

  • When do we need field catalog merge in ALV

    Hi all,
    When do we actually need fieldcatalog merge in ALV's
    Regards
    Saroja.

    Hi
    When you want the field catalog to be populated directly from the internal table or a structure, you can use this function module. If you are populating the field catalog from an internal table in an include other than your top include, then the include name also has to be passed to the function module.
    reward if helpful
    regards,
    madhu

  • Doubt in using field catalog merge function

    hi all,
        When I am using the function maodule reuse_alv_fieldcatalog_merge for building the field catalog in alv list,it was giving abend message as
    'Field catalog is empty'.
         what might be the reason for such message?can some one help me out with the solution to get rid of that.
        I cant populate the catalog manually because I need to display nearly 40 fields in the output.
             Thanks in advance.

    hI
    Supports the creation of the field catalog for the ALV function modules
    based either on a structure or table defined in the ABAP Data
    Dictionary, or a program-internal table.
    The program-internal table must either be in a TOP Include or its
    Include must be specified explicitly in the interface.
    The variant based on a program-internal table should only be used for
    rapid prototyping since the following restrictions apply:
    o Performance is affected since the code of the table definition must
    always be read and interpreted at runtime.
    o Dictionary references are only considered if the keywords LIKE or
    INCLUDE STRUCTURE (not TYPE) are used.
    If the field catalog contains more than 90 fields, the first 90 fields
    are output in the list by default whereas the remaining fields are only
    available in the field selection.
    If the field catalog is passed with values, they are merged with the
    'automatically' found information.
    Below is an example ABAP program which will populate a simple internal table(it_ekpo) with data and
    display it using the basic ALV grid functionality(including column total). The example details the main
    sections of coding required to implement the ALV grid functionality:
    Data declaration
    Data retrieval
    Build fieldcatalog
    Build layout setup
    *& Report ZDEMO_ALVGRID *
    *& Example of a simple ALV Grid Report *
    *& The basic requirement for this demo is to display a number of *
    *& fields from the EKKO table. *
    REPORT zdemo_alvgrid .
    TABLES: ekko.
    type-pools: slis. "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
    ebeln TYPE ekpo-ebeln,
    ebelp TYPE ekpo-ebelp,
    statu TYPE ekpo-statu,
    aedat TYPE ekpo-aedat,
    matnr TYPE ekpo-matnr,
    menge TYPE ekpo-menge,
    meins TYPE ekpo-meins,
    netpr TYPE ekpo-netpr,
    peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
    wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
    gd_tab_group type slis_t_sp_group_alv,
    gd_layout type slis_layout_alv,
    gd_repid like sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform display_alv_report.
    *& Form BUILD_FIELDCATALOG
    * Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    * There are a number of ways to create a fieldcat.
    * For the purpose of this example i will build the fieldcatalog manualy
    * by populating the internal table fields individually and then
    * appending the rows. This method can be the most time consuming but can
    * also allow you more control of the final product.
    * Beware though, you need to ensure that all fields required are
    * populated. When using some of functionality available via ALV, such as
    * total. You may need to provide more information than if you were
    * simply displaying the result
    * I.e. Field type may be required in-order for
    * the 'TOTAL' function to work.
    fieldcatalog-fieldname = 'EBELN'.
    fieldcatalog-seltext_m = 'Purchase Order'.
    fieldcatalog-col_pos = 0.
    fieldcatalog-outputlen = 10.
    fieldcatalog-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    * fieldcatalog-do_sum = 'X'.
    * fieldcatalog-no_zero = 'X'.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'EBELP'.
    fieldcatalog-seltext_m = 'PO Item'.
    fieldcatalog-col_pos = 1.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'STATU'.
    fieldcatalog-seltext_m = 'Status'.
    fieldcatalog-col_pos = 2.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'AEDAT'.
    fieldcatalog-seltext_m = 'Item change date'.
    fieldcatalog-col_pos = 3.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MATNR'.
    fieldcatalog-seltext_m = 'Material Number'.
    fieldcatalog-col_pos = 4.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MENGE'.
    fieldcatalog-seltext_m = 'PO quantity'.
    fieldcatalog-col_pos = 5.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MEINS'.
    fieldcatalog-seltext_m = 'Order Unit'.
    fieldcatalog-col_pos = 6.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'NETPR'.
    fieldcatalog-seltext_m = 'Net Price'.
    fieldcatalog-col_pos = 7.
    fieldcatalog-outputlen = 15.
    fieldcatalog-do_sum = 'X'. "Display column total
    fieldcatalog-datatype = 'CURR'.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'PEINH'.
    fieldcatalog-seltext_m = 'Price Unit'.
    fieldcatalog-col_pos = 8.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    endform. " BUILD_FIELDCATALOG
    *& Form BUILD_LAYOUT
    * Build layout for ALV grid report
    form build_layout.
    gd_layout-no_input = 'X'.
    gd_layout-colwidth_optimize = 'X'.
    gd_layout-totals_text = 'Totals'(201).
    * gd_layout-totals_only = 'X'.
    * gd_layout-f2code = 'DISP'. "Sets fcode for when double
    * "click(press f2)
    * gd_layout-zebra = 'X'.
    * gd_layout-group_change_edit = 'X'.
    * gd_layout-header_text = 'helllllo'.
    endform. " BUILD_LAYOUT
    *& Form DISPLAY_ALV_REPORT
    * Display report using ALV grid
    form display_alv_report.
    gd_repid = sy-repid.
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    i_callback_program = gd_repid
    * i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
    * i_callback_user_command = 'USER_COMMAND'
    * i_grid_title = outtext
    is_layout = gd_layout
    it_fieldcat = fieldcatalog[]
    * it_special_groups = gd_tabgroup
    * IT_EVENTS = GT_XEVENTS
    i_save = 'X'
    * is_variant = z_template
    tables
    t_outtab = it_ekko
    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. " DISPLAY_ALV_REPORT
    *& Form DATA_RETRIEVAL
    * Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
    from ekpo
    into table it_ekko.
    endform. " DATA_RETRIEVAL

  • Reg: ALV Field catalog refresh

    Hello All,
    Initially I have to display an ALV grid. Upon a buttons click(User Command)  , an additional col should be displayed for which the field catalog of the ALV needs to be changed. Iam using FM ''REUSE_ALV_GRID_DISPLAY'.My question is , how cld v refresh filedcatalog ? To refresh the grid data , we use selfield-refresh = 'X'. Is there any thing some thing like that to refresh fieldcat or v have to build the fieldcat again?
    I have pasted part of code below:
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name   = sy-repid
          i_structure_name = 'TRIGS_IGT_WRKLIST'
        CHANGING
          ct_fieldcat      = c_tab_fieldcat_main.
      LOOP AT c_tab_fieldcat_main ASSIGNING <l_wa_fieldcat_main>.
        IF <l_wa_fieldcat_main>-fieldname = 'BUSTRANSCAT_TEXT' OR
        <l_wa_fieldcat_main>-fieldname = 'VALUATION_AREA' OR
        <l_wa_fieldcat_main>-fieldname = 'VALUATION_CLASS' OR
        <l_wa_fieldcat_main>-fieldname = 'COMPANY_CODE' OR
        <l_wa_fieldcat_main>-fieldname = 'PRODUCT_TYPE' OR
        <l_wa_fieldcat_main>-fieldname = 'SECURITY_ACCOUNT' OR
        <l_wa_fieldcat_main>-fieldname = 'SECURITY_ID' OR
        <l_wa_fieldcat_main>-fieldname = 'IGT_STATUS_TEXT' OR
        <l_wa_fieldcat_main>-fieldname = 'POSDATE' OR
        <l_wa_fieldcat_main>-fieldname = 'TRLDATE' OR
        <l_wa_fieldcat_main>-fieldname = 'COMPANY_ID' OR
        <l_wa_fieldcat_main>-fieldname = 'COUNTERPARTY' OR
        <l_wa_fieldcat_main>-fieldname = 'UNITS' OR
        <l_wa_fieldcat_main>-fieldname = 'POSITION_CURR' OR
        <l_wa_fieldcat_main>-fieldname = 'DEAL_NUMBER' OR
        <l_wa_fieldcat_main>-fieldname = 'POSITION_AMT' .
        ELSE.
          <l_wa_fieldcat_main>-no_out = 'X'.
        ENDIF.
    Assign postion
        IF <l_wa_fieldcat_main>-fieldname = 'BUSTRANSCAT_TEXT'.
          <l_wa_fieldcat_main>-col_pos   = 2.
          <l_wa_fieldcat_main>-ddictxt   = 'M'.
          <l_wa_fieldcat_main>-outputlen = '5'.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'COMPANY_CODE'.
          <l_wa_fieldcat_main>-col_pos  = 3.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'VALUATION_AREA'.
          <l_wa_fieldcat_main>-col_pos  = 4.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'PRODUCT_TYPE'.
          <l_wa_fieldcat_main>-col_pos  = 5.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'SECURITY_ID'.
          <l_wa_fieldcat_main>-col_pos  = 6.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'SECURITY_ACCOUNT'.
          <l_wa_fieldcat_main>-col_pos  = 7.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'DEAL_NUMBER'.
          <l_wa_fieldcat_main>-col_pos  = 8.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'IGT_STATUS_TEXT'.
          <l_wa_fieldcat_main>-col_pos  = 9.
          <l_wa_fieldcat_main>-ddictxt  = 'M'.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'POSDATE'.
          <l_wa_fieldcat_main>-col_pos  = 10.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'TRLDATE'.
          <l_wa_fieldcat_main>-col_pos  = 11.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'COMPANY_ID'.
          <l_wa_fieldcat_main>-col_pos  = 12.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'UNITS'.
          <l_wa_fieldcat_main>-col_pos  = 13.
        ENDIF.
        IF <l_wa_fieldcat_main>-fieldname = 'POSITION_AMT'.
          <l_wa_fieldcat_main>-col_pos  = 14.
        ENDIF.
      ENDLOOP.
      CASE sy-ucomm.
        WHEN 'MATCH'.
          READ TABLE c_tab_fieldcat_main ASSIGNING <l_wa_fieldcat_main>
            WITH KEY fieldname = 'MATCHED'.
          CHECK sy-subrc EQ 0.
          <l_wa_fieldcat_main>-col_pos  = 1.
          <l_wa_fieldcat_main>-seltext_s = 'Matched Pairs'.
          <l_wa_fieldcat_main>-seltext_m = 'Matched Pairs'.
          <l_wa_fieldcat_main>-seltext_l = 'Matched Pairs'.
          <l_wa_fieldcat_main>-no_out = ' '.
        WHEN 'REVERSAL'.
          READ TABLE c_tab_fieldcat_main ASSIGNING <l_wa_fieldcat_main>
            WITH KEY fieldname = 'ICON_REVERSAL'.
          CHECK sy-subrc EQ 0.
          <l_wa_fieldcat_main>-col_pos  = 1.
          <l_wa_fieldcat_main>-icon = 'X'.
          <l_wa_fieldcat_main>-outputlen = 3.
          <l_wa_fieldcat_main>-no_out  = ' '.
      ENDCASE.
    Thanks,
    Sri

    Hi
    U need to use the fm REUSE_ALV_GRID_LAYOUT_INFO_SET, here you can change the catalog table.
    Max

  • ALV Field Catalog Mystery

    HI All,
    I am hoping someone on here can help.
    I have an ALV grid program where I build a field catalog.
    I have been asked to add 2 more fields.
    When I add these fields they do not display in the list but can be added through 'Change Layout'.
    I have tried setting the output length of the new fields, I have tried making sure no_out is initial.
    I have tried re-positioning them where other fields wre displayed. The old fields are gone but my new fields do not appear and have to be added through the 'change layout' option.
    eg. these are my two added extra fields.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos      = 35.
      ls_fieldcat-fieldname    = 'FEE_EARNER_BP'.
      ls_fieldcat-seltext_m    = 'Client'.
      ls_fieldcat-outputlen    = 10.
      ls_fieldcat-no_out       = ''.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos      = 36.
      ls_fieldcat-fieldname    = 'FEBP_NAME'.
      ls_fieldcat-seltext_m    = 'Client Name'.
      ls_fieldcat-outputlen    = 123.
      ls_fieldcat-no_out       = ''.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
    Any help/advice appreciated.
    Many Thanks
    David

    Hi.
    The usual cause of this is that the ALV is using a particular display variant, which of course does not "know" about the two new fields.
    Perhaps this display variant is being specified in your selection screen.  Or perhaps one of the display variants has been set as the default display variant.
    John

  • ALV Field Catalog Help

    Hi friends,
    I am trying create a field catalog with FM for my internal table. I know I must use "Like" for my internal fields. But I have same field types in my internal. If I use like this. I cann't create field catalog with catalog merge ( I must use this FM for hide/show columns -my prev. message-)
    What is your recommend to me for definiton of my internal table. How can create field catalog using REUSE_ALV_FIELDCATALOG_MERGE FM.
    My internal table is :
    Types : Begin Of TRapor,
              Renk,            "Sat&#305;r Rengi
              Bilesen_Kodu     Like Mseg-Matnr,   "Malzeme Numaras&#305;
              Tanim            Like Makt-Maktx,   "Malzeme K&#305;sa Metni
              Batch            Like Mseg-Charg,   "Parti Numaras&#305; - Batch
              Birim            Like Mseg-Meins,   "Temel ölçü birimi
              Malzeme_Fire(12) Type P Decimals 2, "Teorik Malzeme Fire % si
              Batch_Fire(12)   Type P Decimals 2, "Teorik Batch Fire % si
              OMiktar          Like Mseg-Menge,   "Önceki Dönem Miktar
              OYuzde(12)       Type P Decimals 2, "Önceki Dönem Yuzde
              OTeorik          Like Mseg-Menge,   "Önceki Dönem Teorik
              OSapma_Deger     Like Mseg-Menge,   "Önceki Dönem Sapma De&#287;eri
              OSapma_Oran(12)  Type P Decimals 2, "Önceki Dönem Sapma Oran&#305;
              SMiktar          Like Mseg-Menge,   "Seçim Dönemi Miktar
              SYuzde(16)       Type P Decimals 2, "Seçim Dönemi Yüzde
              STeorik          Like Mseg-Menge,   "Seçim Dönemi Teorik
              SSapma_Deger     Like Mseg-Menge,   "Seçim Dönemi Sapma De&#287;eri
              SSapma_Oran(12)  Type P Decimals 2, "Seçim Dönemi Sapma Oran&#305;
              Hareket          Like Mseg-Bwart,
              Isyeri           Like Crhd-Arbpl,
            End Of TRapor.
    Data : IRapor Type Standard Table Of TRapor With Header Line.

    :((( It dowsn't work. What is wrong :((( I give NO_FIELDCATALOG_AVAILABLE error. When I debugging After processing merge FM my alvfc is empty (0x172)
    Type-Pools : Slis.
    Tables : Mseg, S226, Mara, Mkpf, Crhd, Plpo, Mkal.
    Types : Begin Of TRapor,
              Renk(4)          Type C,            "Sat&#305;r Rengi
              Bilesen_Kodu     Like Mseg-Matnr,   "Malzeme Numaras&#305;
              Tanim            Like Makt-Maktx,   "Malzeme K&#305;sa Metni
              Batch            Like Mseg-Charg,   "Parti Numaras&#305; - Batch
              Birim            Like Mseg-Meins,   "Temel ölçü birimi
              Malzeme_Fire(12) Type P Decimals 2, "Teorik Malzeme Fire % si
              Batch_Fire(12)   Type P Decimals 2, "Teorik Batch Fire % si
              OMiktar          Like Mseg-Menge,   "Önceki Dönem Miktar
              OYuzde(12)       Type P Decimals 2, "Önceki Dönem Yuzde
              OTeorik          Like Mseg-Menge,   "Önceki Dönem Teorik
              OSapma_Deger     Like Mseg-Menge,   "Önceki Dönem Sapma De&#287;eri
              OSapma_Oran(12)  Type P Decimals 2, "Önceki Dönem Sapma Oran&#305;
              SMiktar          Like Mseg-Menge,   "Seçim Dönemi Miktar
              SYuzde(16)       Type P Decimals 2, "Seçim Dönemi Yüzde
              STeorik          Like Mseg-Menge,   "Seçim Dönemi Teorik
              SSapma_Deger     Like Mseg-Menge,   "Seçim Dönemi Sapma De&#287;eri
              SSapma_Oran(12)  Type P Decimals 2, "Seçim Dönemi Sapma Oran&#305;
              Hareket          Like Mseg-Bwart,
              Isyeri           Like Crhd-Arbpl,
            End Of TRapor.
    *Data : IRapor Type Table Of TRapor With Header Line.
    Data : IRapor Type Standard Table Of TRapor With Header Line.
    Data : ZRapor Type TRapor Occurs 0 With Header Line.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : alvwa TYPE slis_fieldcat_alv.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = sy-repid
    i_internal_tabname = 'ZRAPOR'
    i_inclname = sy-repid
    CHANGING
    ct_fieldcat = alvfc
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    *---------------Display
    LOOP AT alvfc INTO alvwa WHERE fieldname = 'BILESEN_KODU'.
    alvwa-ddictxt = 'L'.
    alvwa-seltext_l = 'Heading'.
    alvwa-outputlen = 15.
    MODIFY alvfc FROM alvwa.
    ENDLOOP.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    it_fieldcat = alvfc
    i_callback_program = sy-repid
    i_callback_user_command = 'ITAB_USER_COMMAND'
    TABLES
    t_outtab = zrapor
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    ENDFORM.                    " Gecici
    FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
    slis_selfield.
    LOOP AT alvfc INTO alvwa.
    IF alvwa-fieldname = 'BUTXT'.
    if alvwa-no_out = 'X'.
      alvwa-no_out = ''.
    else.
      alvwa-no_out = 'X'.
    endif.
    *alvwa-no_out = 'X'.
    MODIFY alvfc FROM alvwa.
    ENDIF.
    ENDLOOP.
    *------- Field Catalogue
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = sy-repid
    i_internal_tabname = 'ZRAPOR'
    i_inclname = sy-repid
    CHANGING
    ct_fieldcat = alvfc
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    *---------------Display
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    it_fieldcat = alvfc
    i_callback_program = sy-repid
    i_callback_user_command = 'ITAB_USER_COMMAND'
    TABLES
    t_outtab = zrapor
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    *----------- IMPORTANT.
    *----------- IMPORTANT.
    whatrow-exit = 'X'.
    ENDFORM. "itab_user_command

  • ALV Field Catalog Generation

    Hello Experts,
    To prepare the field catalog for a ALV Grid Display, i created a DDIC structure which looks as below.
    DDIC structure from SE11.These are total 12 fields.
    DOKAR
    Types
    DOKAR
    CHAR
    3
    0
    Document Type
    DOKNR
    Types
    DOKNR
    CHAR
    25
    0
    Document number
    DOKTL
    Types
    DOKTL
    0
    0
    Documentation - text lines
    DOKVR
    Types
    DOKVR
    CHAR
    2
    0
    Document Version
    DKTXT
    Types
    DKTXT
    CHAR
    40
    0
    Document description
    DOSTX
    Types
    DOSTX
    CHAR
    16
    0
    Description of document status
    KTXT
    Types
    TDWOT_KTXT
    CHAR
    20
    0
    Object Description
    STABK
    Types
    STABK
    CHAR
    2
    0
    Status of a document (language-dependent)
    CAD_POS
    Types
    CAD_POS
    CHAR
    1
    0
    CAD: Assignment document  <-> material
    VRKSTAT
    Types
    VRKSTAT
    CHAR
    1
    0
    Link status of a document
    CVHIER
    Types
    CVHIER
    CHAR
    1
    0
    Document is in Hierarchy
    REVLV
    Types
    REVLV
    CHAR
    2
    0
    Revision Level
    When i try to run the FM:LVC_FIELDCATALOG_MERGE to generate field catalog i get 19 columns. Where as i should get only 12.
    Below are the columns,
    COL_POS     FIELDNAME
             1  DOKAR
             2  DOKNR
             3  ID
             4  OBJECT
             5  LANGU
             6  TYP
             7  DOKVERSION
             8  LINE
             9  DOKFORMAT
            10  DOKTEXT
            11  DOKVR
            12  DKTXT
            13  DOSTX
            14  KTXT
            15  STABK
            16  CAD_POS
            17  VRKSTAT
            18  CVHIER
            19  REVLV
    Can you let understand why the DDIC scan giving result like this ?
    Thanks,
    Naresh

    Hello,
    This is because the type DOKTL:

  • ALV field catalog not found

    Hello there,
    I am having problem changing a classic ABAP report to ALV as am hitting the error "field catalog not found".
    I am using  this 2 functions to help me convert it to ALV format.
    and a snippet from my code :
        MODIFY gt_i_data FROM wa_i_data TRANSPORTING priokx.
         ENDLOOP .
      gt_report[] = gt_i_data[].
      perform f_assign_alv.
      perform f_display_alv.
    1.f_assign_alv
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name     = c_repid
                i_internal_tabname = 'GT_REPORT'
                i_inclname         = c_repid
           CHANGING
                ct_fieldcat        = gt_fieldcat.
    2._display_alv.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_grid_title  = v_grid_title
                is_layout     = v_layout
                it_fieldcat   = gt_fieldcat
           TABLES
                t_outtab      = GT_REPORT
           EXCEPTIONS
                program_error = 1
                OTHERS        = 2.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    I noticed during debug,inside 'REUSE_ALV_GRID_DISPLAY' the possible location of error cud be at :
    if i_screen_start_column is initial and -
    >all these values are empty
         i_screen_start_line   is initial and
         i_screen_start_column   is initial and
         i_screen_end_line     is initial.
        gt_grid-flg_popup = space.
        call screen 500.  else. -
    >point of error
        gt_grid-flg_popup = 'X'.
        call screen 700
                  starting at i_screen_start_column i_screen_start_line
                  ending   at i_screen_end_column i_screen_end_line.
      endif.
    Need your expert advice, please guide.Thanks so much!!

    Hi Neesha,
    If you are using FM 'REUSE_ALV_FIELDCATALOG_MERGE', during data/types declaration, you have to use the LIKE keyword and not the TYPE keyword.
    If you use TYPE, the fieldcat will not be populated.
    DATA: BEGIN OF GT_REPORT OCCURS 0,
    ebeln LIKE ekpo-ebeln,
    ebelp LIKE ekpo-ebelp,
    matnr LIKE ekpo-matnr,
    werks LIKE ekpo-werks,
    menge LIKE ekpo-menge,
    netpr LIKE ekpo-netpr,
    peinh LIKE ekpo-peinh,
    netwr LIKE ekpo-netwr,
    END OF GT_REPORT.
    Regards,
    Jovito.
    Edited by: dsouzajovito on Jan 10, 2011 11:32 AM

  • Problem Modifying ALV Field Catalog

    Hi,
    One grid of my ALV report displays material numbers as 0100.2000. But when I use method FILE_SAVE_DIALOG to save ALV report to Excel, the material number changes to 100.2.
    I have tried modifying my field catalog as shown at end of this message, but it doesn't change the output in Excel.
    Does anyone have a fix for this problem? I will award points! - Beth
    FORM build_fieldcatalog.
      DATA: ls_fieldcat TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                i_structure_name = 'ZBOM_ALV'
           CHANGING
                ct_fieldcat      = gt_fieldcat.
      LOOP AT gt_fieldcat INTO ls_fieldcat where fieldname eq 'COLUMN3'.
            ls_fieldcat-DATATYPE = 'NUMC'.
            ls_fieldcat-LZERO = 'X'.
            ls_fieldcat-REF_TABLE = ''.
            ls_fieldcat-DECIMALS_O = '4'.
            ls_fieldcat-INTTYPE = 'N'.
            ls_fieldcat-OUTPUTLEN = '20'.
        MODIFY gt_fieldcat FROM ls_fieldcat.
      ENDLOOP.
    ENDFORM.                               " build_fieldcatalog

    Hi,
    If you want to save any data like 0100.2000 in the excel, you need to write it as Number with decimal places 4, so it will take 4 decimal places . coming to your ALV, you need to pass the same structure to the Excel i mean the passing variable should be lilke Number with 4 decimal places ..
    Regards
    Sudheer

  • Regarding alv field catalog!

    hi.  iam new to ALV. my query is,
    iam building the fieldcatalog manualy by populating the internal table fields individually and then appending the rows. This method is most time consuming.
    Can anyone suggest alternate method with an example? points will be rewarded.!!

    Hi Padamshree,
    you can use MACRO to build field catalog.
    like i used here for building and
    then call FM "'REUSE_ALV_GRID_DISPLAY' for ALV grid.
    DEFINE m_fieldcat.
        add 1 to ls_fieldcat-col_pos.
        ls_fieldcat-fieldname   = &1.
        ls_fieldcat-ref_tabname = 'BSIK'.
        ls_fieldcat-do_sum      = &2.
        ls_fieldcat-cfieldname  = &3.
        append ls_fieldcat to lt_fieldcat.
      END-OF-DEFINITION.
      DEFINE m_sort.
        add 1 to ls_sort-spos.
        ls_sort-fieldname = &1.
        ls_sort-up        = 'X'.
        ls_sort-subtot    = &2.
        append ls_sort to lt_sort.
      END-OF-DEFINITION.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv,
        lt_sort     TYPE slis_t_sortinfo_alv,
        ls_sort     TYPE slis_sortinfo_alv,
        ls_layout   TYPE slis_layout_alv.
      m_fieldcat 'BUKRS' ''  ''.
      m_fieldcat 'LIFNR' ''  ''.
      m_fieldcat 'GJAHR' ''  ''.
      m_fieldcat 'BELNR' ''  ''.
      m_fieldcat 'HKONT' ''  ''.
      m_fieldcat 'WRBTR' ''  ''.
      m_fieldcat 'WAERS' ''  ''.
      m_fieldcat 'SHKZG' ''  ''.
      m_sort 'BUKRS' 'X'.
      m_sort 'LIFNR' 'X'.
      m_sort 'GJAHR' ''.
      m_sort 'BELNR' ''.
    m_sort 'BUDAT' ''.
      ls_layout-cell_merge = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                is_layout   = ls_layout
                it_fieldcat = lt_fieldcat
                it_sort     = lt_sort
           TABLES
                t_outtab    = ITAB1.
    ENDFORM.                    " DISPLAY_DATA
    Regards,
    Sachin.

  • BUILD ALV FIELD CATALOG

    Hi All,
    I want to include all the fields of PRPS in the ALV list.How can i build a field catalog having all fields of PRPS?
    Thanks,
    Rakesh.

    hi
    Actually fieldcatalog is used if we are selecting only a set of fields in a table..then we need to build a fieldcatalog fo those
    fields.
    Here ur requirement is for all the fields of the table PRPS.So
    u code like this: include structure PRPS
    In the Reuse_alv_list_display --pass the structure name to
    I_STRUCTURE_NAME.
    this solves ur problem..
    thnx
    sravani
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Apr 30, 2008 5:07 PM

Maybe you are looking for