ALV list with only 1 field

Hi guru's,
I want to create an ALV list with only a char255 field.
<all_table> contains data of sflight and is of type sflight(dynamically).
I want to show the data as one line.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
       EXPORTING
            tabname   = 'TPPARFIL'
            fieldname = 'LINE'
      TABLES
            dfies_tab = it_dfies.
  READ TABLE it_dfies INDEX 1.
  IF sy-subrc IS INITIAL.
  MOVE-CORRESPONDING it_dfies TO wa_fieldcat.
  wa_fieldcat-scrtext_s = 'Results:'.
    APPEND wa_fieldcat TO gt_fieldcat.
  ENDIF.
t_output[] = <all_table>.
  CALL FUNCTION 'LVC_TRANSFER_TO_SLIS'
       EXPORTING
            it_fieldcat_lvc = gt_fieldcat
       IMPORTING
            it_fieldcat_alv = it_fieldcat_alv.
  PERFORM fill_alv_layout.
* Show list
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
            i_callback_program = lv_repid
            i_grid_title       = sy-title
             is_layout          = gs_layout
            it_fieldcat        = it_fieldcat_alv[]
       TABLES
            t_outtab           = t_output
       EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
*&      Form  fill_alv_layout
  FORM fill_alv_layout.
    CLEAR: gs_layout.
    gs_layout-max_linesize         = 160.
    gs_layout-min_linesize         = 160.
    gs_layout-detail_initial_lines = 'X'.
    gs_layout-zebra                = 'X'.
    gs_layout-edit_mode            = 'A'.
    gs_layout-numc_sum             = 'X'.
    gs_layout-colwidth_optimize    = 'X'.
    gs_layout-window_titlebar      = sy-title.
    gs_layout-totals_only          = 'X'.
  ENDFORM.                    " fill_alv_layout
When I run this it only gives an empty view of the fields with type char255.
Regards,
Wim

hi,
As per your code I think your internal table is empty. Please set debugger after internal table fill and check. If the data is there then please check your field catalog entry.
Regards,
Sachin

Similar Messages

  • Printing multiple screen objects (ALV+GFW) with only 1 print dialog pop-up?

    All,
    This is related to my previous post at:
    Re: How to print multiple ALV Grids with only one print dialog?
    but there is still one open question...
    My requirement is to create reports that will be called through portals; those reports are a combination of charts and the associated list output describing the data of each chart.
    In my first report (4 charts), I created a screen with 8 custom containers: 4 on the left hand side for the charts and 4 to the right for the list output.
    To create the charts I am using the Graphical Framework (GFW) and for the ALVs the new CL_SALV* classes.
    Everything works fine on the screen, but the users also want to print the report. I got them to the point where they will accept a separate printout (page) for every object (e.g. chart and ALV) of the report.
    I put a print button through the GUI status on the screen and trigger the associated print events in the program; this works fine as well, but the problem is that for every output (in this case 8) a print dialog appears and prompts the user for a printer selection. This the users won't accept and - quite frankly - I wouldn't either ;).
    Now, in my previous post someone pointed me to the use of the REUSE* function modules to append the ALVs and then print them together; this works and reduces the print dialog to only one for the ALVs.
    Even though this is an option, I am still kind of hesitant: why using all the great new OO stuff via the CL_SALV* classes to bring the ALVs on the screen, just to go back to the old approach for the printouts???
    Especially since I still can’t figure out how to combine the GFW objects in one print – or even better – how to suppress the dialog by passing the information behind the scenes either.
    As of now, I have 2 options:
    - 8 print dialogs (OO only)
    - 5 print dialogs (using the REUSE approach for the ALVs and triggering the chart prints individually)
    Does anyone see a way to bring it down to ONE?
    Thanks,
    Guenther
    Message was edited by: Guenther Schober
    Update: I found the solution for the ALVs!
    Even though I am using the
    "new-page print on parameters G_S_PRINT_PARAMETERS no dialog" statement, the dialogs still appeared; reason for this was that I also set:
    "L_O_PRINT->SET_PRINT_ONLY( IF_SALV_C_BOOL_SAP=>TRUE )" before I output the ALV table.
    After removing this, the ALVs are printing without pop-up!!!
    Unfortunately the GFWs still prompt for the printer selection

    Hi,
    Mine is also same requirement and i could not even generate multiple print dialogs.Can i have your code to compare with my code please.
    I am displaying container information on 200 screen PBO. I have added one custom print button to the grid tool bar(remaing container toolbar print buttons i have disabled). Once i click on custom print button a popup is coming and when i click on continue(one container informtion print is coming) and  it is coming to 100 screen(in this, i am calling selection screen as a subscree) and subsequent print dialog is not coming.
    Thanks & Regards
    Ramu

  • Create a Procedural ALV Report with editable fields and save the changes

    Hi,
    I am new to ABAP. I have created a Procedural ALV Report with 3 fields. I want to make 2 fields editable. When executed, if the fields are modified, I want to save the changes. All this I want to do without using OO concepts. Please help . Also, I checked out the forum and also the examples
    BCALV_TEST_GRID_EDIT_01
    BCALV_TEST_GRID_EDIT_02
    BCALV_TEST_GRID_EDIT_04_FORMS
    BCALV_TEST_GRID_EDITABLE
    BCALV_EDIT_01
    BCALV_EDIT_02
    BCALV_EDIT_03
    BCALV_EDIT_04
    BCALV_EDIT_05
    BCALV_EDIT_06
    BCALV_EDIT_07
    BCALV_EDIT_08
    BCALV_FULLSCREEN_GRID_EDIT
    But all these are using OO Concepts.
    Please help.
    Regards,
    Smruthi

    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,
      line_color(4) TYPE c,     "Used to store row color attributes
    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.
      PERFORM data_retrieval.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      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-edit             = 'X'
      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-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-info_fieldname =      'LINE_COLOR'.
    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_pf_status_set = 'STATUS'
                i_callback_top_of_page   = 'TOP-OF-PAGE'
               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.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      DATA: ld_color(1) TYPE c.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekko.
      LOOP AT it_ekko INTO wa_ekko.
        ld_color = ld_color + 1.
        IF ld_color = 8.
          ld_color = 1.
        ENDIF.
        CONCATENATE 'C' ld_color '10' INTO wa_ekko-line_color.
        MODIFY it_ekko FROM wa_ekko.
      ENDLOOP.
    ENDFORM.                    " DATA_RETRIEVAL
          FORM top-of-page                                              *
    FORM top-of-page.
      WRITE:/ 'This is First Line of the Page'.
    ENDFORM.
          FORM status                                                   *
    FORM status USING rt_extab TYPE slis_t_extab.  .
      SET PF-STATUS 'ALV'.
    ENDFORM.
          FORM USER_COMMAND                                          *
    -->  RF_UCOMM                                                      *
    -->  RS                                                            *
    FORM user_command USING rf_ucomm LIKE sy-ucomm
                             rs TYPE slis_selfield.            
      DATA ref1 TYPE REF TO cl_gui_alv_grid.
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = ref1.
      CALL METHOD ref1->check_changed_data.
      CASE rf_ucomm.
    when 'SAVE'.
    get all the modified entries and store them in an internal table and udpate them in to the required transaction or your custom table.
    endcase.
    endform.
    ENDFORM.
    here u need to 2 performs for PF status and USER_COMMAND in the ALV parameters.
    create a custom PF status and create push buttons and assign your ok codes in your PF status.
    if the field has to be edited in the ALV then pass EDIT = 'X' for that field in the fieldcatlog preparation.
    Hope this will help you.
    Regards,
    phani.

  • Printing ALV list with ADS (pdf printer) in non-english charset

    Hello!
    I have an issue about printing alv list with pdf printer in non-english charset. We have two printers. One for alv lists (SWINCF: Casc.Fonts SAPWIN Unicode) and one for pdf forms(adobe document service). I want to use one printer for any documents. But PDF printer prints non-english charset like ########.
    What can I do ?

    Hi, Roman!
    I want to use PDF printer for both types of output. I have a dedicated java instance for ADS.
    There is a device type for our Kyocera Printer. My pdf printer prints ALV list good exept russian charset.
    It prints like #####

  • ALV LIST with few checkboxes fields

    Hi everyone,
    I want to create an ALV with 2 fields that are checkboxes.
    I am succeeding to create an ALV with one checkbox field.
    How do we do in order to create an ALV with 2 checkboxes fields using ALV LIST ?
    I know that we have to specify in the layout of the ALV the name of the field we want it to be checkbox.
    For example :
      gs_layout-box_fieldname   = 'FLAG'.            
    But, how do we specify a second checkbox field ?
    Thanks.
    Regards.

    Slight modification to my earlier post. this is with 2 checkboxes.
    REPORT  ztest_alv_checkbox.
    TYPE-POOLS: slis.
    DATA: it_fcat TYPE  slis_t_fieldcat_alv,
          wa_cat LIKE LINE OF it_fcat.
    DATA: BEGIN OF it_alv OCCURS 0,
           check1(1),
           check2(1),
           carrid LIKE sflight-carrid,
           connid LIKE sflight-connid,
          END OF it_alv.
    DATA:it_events TYPE slis_t_event,
         wa_events LIKE LINE OF it_events.
    SELECT carrid
           connid
      FROM sflight
      INTO CORRESPONDING FIELDS OF TABLE it_alv
      UP TO 20 ROWS.
    wa_cat-fieldname = 'CHECK1'.
    wa_cat-input = 'X'.
    wa_cat-edit = 'X'.
    wa_cat-checkbox = 'X'.
    wa_cat-seltext_l = 'Check'.
    wa_cat-tabname = 'IT_ALV'.
    APPEND wa_cat TO it_fcat.
    CLEAR wa_cat.
    wa_cat-fieldname = 'CHECK2'.
    wa_cat-input = 'X'.
    wa_cat-edit = 'X'.
    wa_cat-checkbox = 'X'.
    wa_cat-seltext_l = 'Check'.
    wa_cat-tabname = 'IT_ALV'.
    APPEND wa_cat TO it_fcat.
    CLEAR wa_cat.
    wa_cat-fieldname = 'CARRID'.
    wa_cat-seltext_l = 'Carrid'.
    wa_cat-tabname = 'IT_ALV'.
    APPEND wa_cat TO it_fcat.
    CLEAR wa_cat.
    wa_cat-fieldname = 'CONNID'.
    wa_cat-seltext_l = 'Connid'.
    wa_cat-tabname = 'IT_ALV'.
    APPEND wa_cat TO it_fcat.
    wa_events-name = slis_ev_end_of_list.
    wa_events-form = 'MODIFY_LIST'.
    APPEND wa_events TO it_events.
    CLEAR wa_events.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program = sy-repid
        it_fieldcat        = it_fcat
        it_events          = it_events
      TABLES
        t_outtab           = it_alv
      EXCEPTIONS
        program_error      = 1
        OTHERS             = 2.
    IF sy-subrc NE 0.
    ENDIF.
    "After The list display i am modifying the report output
    "using the END_OF_LIST event of ALV
    "here conditionally i can make the cell input off
    *&      Form  MODIFY_LIST
    *       text
    FORM modify_list.
      DATA: l_lines TYPE i,
            l_index TYPE i.
      l_lines  = l_lines + 3.
      "because we have 3 lines extra occupied by lables.
      "if we have header,i mean top of page add the no.of lines
      "how many ever top of page have + 3 for labels.
      DESCRIBE TABLE it_alv LINES l_lines.
      l_lines  = l_lines + 3.
      "understnad this part alone.
      DO l_lines TIMES.
        IF sy-index GT 3.
          l_index = sy-index - 3.
          READ TABLE it_alv INDEX l_index.
          "this is my condition..
          IF sy-subrc = 0 .
            IF it_alv-carrid <> 'AA'.  "place your condition here.
              "accordingly you can disable the checkbox
              "use the below logic
              READ LINE sy-index INDEX sy-lsind.
              IF sy-subrc = 0.
                MODIFY LINE sy-index INDEX sy-lsind
                           FIELD FORMAT  it_alv-check1 INPUT OFF
                                         it_alv-check2 INPUT OFF.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDDO.
    ENDFORM.                    "MODIFY_LIST

  • ALV list with empty data - What could have gone wrong?

    Dear experts,
    I'm currently working on some codes to display data (the tables involved really do contain data), but when the codes are executed, the ALV list does not contain any data in it (only the column headers are fine).
    What could have gone wrong? I've been staring at the codes for hours now. Please help. Appreciate any help at all. 
    Displaying ALV data with REUSE_ALV_LIST_DISPLAY:
    form display_alv_data .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
    *     I_INTERFACE_CHECK              = ' '
    *     I_BYPASSING_BUFFER             =
    *     I_BUFFER_ACTIVE                = ' '
          I_CALLBACK_PROGRAM             = w_prog
    *     I_CALLBACK_PF_STATUS_SET       = ' '
    *     I_CALLBACK_USER_COMMAND        = ' '
    *     I_STRUCTURE_NAME               =
    *     IS_LAYOUT                      =
          IT_FIELDCAT                    = gt_field_cat[]
    *     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
    *     IR_SALV_LIST_ADAPTER           =
    *     IT_EXCEPT_QINFO                =
    *     I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    *   IMPORTING
    *     E_EXIT_CAUSED_BY_CALLER        =
    *     ES_EXIT_CAUSED_BY_USER         =
        TABLES
          T_OUTTAB                       = gt_final
        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_data
    Retrieving data from the database tables into the internal table:
    form retrieve_data .
      " For internal table 1
      SELECT ekbe~ebeln
             mseg~mblnr
             ekbe~belnr
             ekbe~ebelp
             ekbe~matnr
             ekbe~menge
             ekbe~dmbtr
             ekbe~werks
             mseg~lgort
             mseg~lifnr
             lfa1~name1
      FROM ekbe INNER JOIN mseg ON ekbe~ebeln = mseg~ebeln
                INNER JOIN lfa1 ON mseg~lifnr = lfa1~lifnr
      INTO CORRESPONDING FIELDS OF TABLE gt_1
      WHERE mseg~bwart = '101' AND      " Movement type: Goods Receipt
            ekbe~vgabe = '2' AND        " Transaction / event type for Invoice Verification Number
            ekbe~matnr IN s_m_num AND
            mseg~lifnr IN s_v_num.
      " For internal table 2
      SELECT ekbe~ebeln
             makt~maktx
             eket~eindt                 
      FROM ekbe INNER JOIN makt ON ekbe~matnr = makt~matnr
                INNER JOIN eket ON ekbe~ebeln = eket~ebeln
      INTO CORRESPONDING FIELDS OF TABLE gt_2
      WHERE eket~eindt IN s_d_date.
      " For internal table 3
      SELECT ekbe~ebeln
             ekko~bedat
             ekko~ekorg
             ekko~ekgrp
             ekko~bukrs
      FROM ekbe INNER JOIN ekko ON ekbe~ebeln = ekko~ebeln
      INTO CORRESPONDING FIELDS OF TABLE gt_3
      WHERE ekko~bedat IN s_p_date AND
            ekko~ekorg IN s_p_org AND
            ekko~ekgrp IN s_p_grp.
      " For the final internal table
      SORT: gt_1, gt_2, gt_3.
      LOOP AT gt_1.
        MOVE-CORRESPONDING gt_1 TO gt_final.
        READ TABLE gt_2 WITH KEY gfs_ebeln = gt_1-gfs_ebeln BINARY SEARCH.
        MOVE-CORRESPONDING gt_2 TO gt_final.
        READ TABLE gt_3 WITH KEY gfs_ebeln = gt_1-gfs_ebeln BINARY SEARCH.
        MOVE-CORRESPONDING gt_3 TO gt_final.
        APPEND gt_final.
      ENDLOOP.
    endform.                    " retrieve_data

    Dear forumers,
    I apologize for the rather late reply. The SAP server that I've been working on was down since Thursday evening and I wasn't able to debug much into the codes. Nevertheless, I really do appreciate all of your inputs and help here.
    Rob,
    I've just debugged my codes again and found out that in the first place, there is no data contained in the internal table gt_1 at all. My rough guess is because I've misused the INNER JOIN wrongly here (see code comments below):-
      SELECT ekbe~ebeln
             mseg~mblnr
             ekbe~belnr
             ekbe~ebelp
             ekbe~matnr
             ekbe~menge
             ekbe~dmbtr
             ekbe~werks
             mseg~lgort
             mseg~lifnr
             lfa1~name1  " this line should probably be commented out
      FROM ekbe INNER JOIN mseg ON mseg~ebeln = ekbe~ebeln
                        INNER JOIN lfa1 ON lfa1~lifnr = mseg~lifnr   " this line should probably be commented out - the table join here is not based on table ekbe at all
      INTO CORRESPONDING FIELDS OF TABLE gt_1
      WHERE mseg~bwart = '101' AND     
            ekbe~vgabe = '2' AND 
            ekbe~matnr IN s_m_num AND
            mseg~lifnr IN s_v_num.
    Next, I commented out certain lines further and found that there is still no data contained in the internal table gt_1 again, as follows:-
      SELECT ekbe~ebeln
             mseg~mblnr
             ekbe~belnr
             ekbe~ebelp
             ekbe~matnr
             ekbe~menge
             ekbe~dmbtr
             ekbe~werks
             mseg~lgort
             mseg~lifnr
             " lfa1~name1
      FROM ekbe INNER JOIN mseg ON mseg~ebeln = ekbe~ebeln
                        " INNER JOIN lfa1 ON lfa1~lifnr = mseg~lifnr
      INTO CORRESPONDING FIELDS OF TABLE gt_1.
      " WHERE mseg~bwart = '101' AND     
            " ekbe~vgabe = '2' AND 
            " ekbe~matnr IN s_m_num AND
            " mseg~lifnr IN s_v_num.
    There should be data contained in table ekbe here. What could have really gone wrong now?

  • ALV list with 2 header lines

    Dear gurus,
    Need help in displaying ALV list report. the below report is an example of AR aging report. The report output is as below:
    DEC
    NOV
    OCT
    SEP
    0-30
    31-60
    61-90
    90+
    xx
    xx
    xx
    xx
    SUBTOTAL
    The first 2 lines are the list header. While the 'x' is the amount.
    How can i display the above output with 2 header lines? I was thinking of using the  REUSE_ALV_FIELDCATALOG_MERGE function. But it will have 2 lines of body row too. In fact, i only one one row in the body. But if i define the header lines manually, i would not able to do the subtotal at the end of the alv list. I need to have the subtotal too.
    Thanks in advance!

    Hi,
    For this requirement you need to populate the fld catalog using row_pos and col_pos fields specifing proper position.
    See this code snippet ..... this is only possible for ALV list.
    TYPE-POOLS: slis.
    DATA: ld_fieldcat    TYPE slis_fieldcat_alv.
    DATA: t_alv_fieldcat TYPE STANDARD TABLE OF slis_fieldcat_alv.
    DATA : it_fld TYPE slis_t_fieldcat_alv,
           wa_fld TYPE slis_fieldcat_alv.
    data: BEGIN OF itab OCCURS 0,
            carrid    like sflight-carrid,
            connid    like sflight-connid,
            planetype like sflight-planetype,
            seatsmax  like sflight-seatsmax,
          END OF itab.
    START-OF-SELECTION.
    SELECT carrid connid planetype seatsmax
           FROM sflight
           INTO TABLE itab.
      CLEAR: ld_fieldcat.
      ld_fieldcat-row_pos       = '1'.
      ld_fieldcat-col_pos       = '1'.
      ld_fieldcat-tabname       = 'ITAB'.
      ld_fieldcat-fieldname     = 'CARRID'.
      ld_fieldcat-ref_tabname   = 'SFLIGHT'.
      ld_fieldcat-outputlen     = '10'.
      APPEND ld_fieldcat TO t_alv_fieldcat.
      CLEAR ld_fieldcat.
      CLEAR: ld_fieldcat.
      ld_fieldcat-row_pos       = '1'.
      ld_fieldcat-col_pos       = '2'.
      ld_fieldcat-tabname       = 'ITAB'.
      ld_fieldcat-fieldname     = 'CONNID'.
      ld_fieldcat-ref_tabname   = 'SFLIGHT'.
      ld_fieldcat-outputlen     = '10'.
      APPEND ld_fieldcat TO t_alv_fieldcat.
      CLEAR ld_fieldcat.
      CLEAR: ld_fieldcat.
      ld_fieldcat-row_pos       = '2'.
      ld_fieldcat-col_pos       = '1'.
      ld_fieldcat-tabname       = 'ITAB'.
      ld_fieldcat-fieldname     = 'PLANETYPE'.
      ld_fieldcat-ref_tabname   = 'SFLIGHT'.
      ld_fieldcat-outputlen     = '10'.
      APPEND ld_fieldcat TO t_alv_fieldcat.
      CLEAR ld_fieldcat.
      CLEAR: ld_fieldcat.
      ld_fieldcat-row_pos       = '2'.
      ld_fieldcat-col_pos       = '2'.
      ld_fieldcat-tabname       = 'ITAB'.
      ld_fieldcat-fieldname     = 'SEATSMAX'.
      ld_fieldcat-ref_tabname   = 'SFLIGHT'.
      ld_fieldcat-outputlen     = '10'.
      APPEND ld_fieldcat TO t_alv_fieldcat.
      CLEAR ld_fieldcat.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          it_fieldcat        = t_alv_fieldcat[]
        TABLES
          t_outtab           = ITAB. "internal table
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Regards,
    Amitava

  • ALV list with count of the table

    Dear all,
    My requirement is i want display the output as alv list along with the count of the table .
    i got the count  but unable to diplay the  below the list.
    please suggest me.
    Thanks& Regards,
    RP

    If you are using a custom control on the screen and then a custom container you can easily do this.
    Create a screen(Size 200 x 240), place a custom control on the screen and make it to the max size  200 x 240. Now in the attributes of the custom control, check the Resizing option for both horizontal and vertical, with some minimum numbers there.
    Now, your ALV grid automatically occupies all the space available on the screen irrespective of the size if the screen and you will have only one scroll bar.
    Regards,
    Ravi
    Note - Please mark all the helpful answers

  • ALV List with checkboxes

    Hello experts,
    I'm working on an object where in I need to display an ALV List (using Funct Modules) with checkboxes.
    When I select the checkboxes,and click on a button (Eg.Refresh Button) , I need to get all the details of the selected rows (checked rows) in a seperate ALV List (in a Dailog).
    Could any one of u please suggest me about selecting the row which has been checked(Checkboxes in ALV ).
    Thanks in advance.
    Sanghamitra

    Hi sangha,
    1. To get a taste of it,
       just copy paste this program.
    2. It will display alv (t001)
       It will show CHECKBOXES (besides every row)
       TICK some rows,
      and DOUBLE-CLICK ON any row.
    3.  It will display all the row numbers which have been checked/ticked.
    4.
    report abc.
    TYPE-POOLS : slis.
    Data
    DATA : BEGIN OF itab OCCURS 0.
            INCLUDE STRUCTURE t001.
    DATA : flag tyPE c,
           END OF itab.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : alvly TYPE slis_layout_alv.
    Select Data
    SELECT * FROM t001 INTO TABLE itab.
    *------- Field Catalogue
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = sy-repid
        i_internal_tabname     = 'ITAB'
        i_inclname             = sy-repid
      CHANGING
        ct_fieldcat            = alvfc
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.
    Display
    alvly-box_fieldname = 'FLAG'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        it_fieldcat             = alvfc
        i_callback_program      = sy-repid "<-------Important
        i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important
        is_layout               = alvly
      TABLES
        t_outtab                = itab
      EXCEPTIONS
        program_error           = 1
        OTHERS                  = 2.
    CALL BACK FORM
    FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
    slis_selfield.
      data : msg(100) type c.
      LOOP AT itab.
        if itab-flag = 'X'.
          msg = sy-tabix.
          condense msg.
          concatenate 'Row Number ' msg ' ' into msg
          separated by space.
          message msg type 'I'.
        endif.
      ENDLOOP.
    ENDFORM. "ITAB_user_command
    regards,
    amit m.

  • ALV List- Order a field under another one

    Hi, gurus.
    I got a problem with an ALV list.
    I got a record in my internal table with local currency imports and foreign currency imports.
    I must write the foreign currency import in another row (with row_pos = 2), but the "second row" data begin with first field, not with the local currency field.
    What can I do to order it in the right way?
    I want to show, for example:
    <account>  <description> <local currency>      <import>
                                              <foreign currency> <import>
    I hope you can help me.
    Thanks for all.
    Have a nice day.

    Hi,
    What you can do is to loop internal table, and for each row, create a new one.
    data: lwa_table2 like line of it_table1.
    Loop it_table1 into wa_table1.
       lwa_table2 = wa_table1.
       clear: lwa_table2-<Foreign currency>, lwa_table2-<import>.
       append lwa_table2 to it_table2.
       clear lwa_table2.
       lwa_table2-<foreign currency> = wa_table1-<foreign currency>
       lwa_table2-<import> = wa_table1-<import>.
       append lwa_table2 to it_table2.
       clear lwa_table2.
    Endloop.
    Call Function ALV LIST DISPLAY with it_table 2.
    Regards
    Ernesto

  • ALV grid with editable fields

    Dear Colleagues,
    I develop an ALV grid with OO standard methods. Before the first display of the table I define the editable fields. It works fine.
    I have a problem : if the table is empty and I press the standard icons "Append a line" or "Insert a line", the new line don't have the defined editable characteristics.for fields. Is there a standard method which I have forgotten ?
    Thanks a lot and kind regards
    Peter

    vs_toolbar_excluding = cl_gui_alv_grid=>mc_fc_loc_delete_row.
        APPEND vs_toolbar_excluding TO i_toolbar_excluding.
        vs_toolbar_excluding = cl_gui_alv_grid=>mc_fc_loc_append_row.
        APPEND vs_toolbar_excluding TO i_toolbar_excluding.
        vs_toolbar_excluding = cl_gui_alv_grid=>mc_fc_loc_copy_row.
        APPEND vs_toolbar_excluding TO i_toolbar_excluding.
        vs_toolbar_excluding = cl_gui_alv_grid=>mc_fc_loc_insert_row.
        APPEND vs_toolbar_excluding TO i_toolbar_excluding.
        vs_toolbar_excluding = cl_gui_alv_grid=>mc_fc_loc_copy.
        APPEND vs_toolbar_excluding TO i_toolbar_excluding.
        vs_toolbar_excluding = cl_gui_alv_grid=>mc_fc_loc_cut.
        APPEND vs_toolbar_excluding TO i_toolbar_excluding.
        vs_toolbar_excluding = cl_gui_alv_grid=>mc_fc_loc_paste.
        APPEND vs_toolbar_excluding TO i_toolbar_excluding.
        vs_toolbar_excluding = cl_gui_alv_grid=>mc_fc_loc_undo.
        APPEND vs_toolbar_excluding TO i_toolbar_excluding.
        vs_toolbar_excluding = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
        APPEND vs_toolbar_excluding TO i_toolbar_excluding.
    * Displaying the output in ALV Grid
        vs_layout_grid-no_rowmark = 'X'.
        vs_layout_grid-zebra      = 'X'.
        vs_layout_grid-cwidth_opt = 'X'.
        vs_layout_grid-edit       = 'X'.
        vs_layout_grid-ctab_fname = 'CT'.
        vs_layout_grid-stylefname = 'CELLTAB'.
        CALL METHOD v_grid->set_table_for_first_display
          EXPORTING
            i_save                        = 'X'
            is_layout                     = vs_layout_grid
            it_toolbar_excluding          = i_toolbar_excluding[]
          CHANGING
            it_outtab                     = itab[]
            it_fieldcatalog               = it_fieldcat[]
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
        IF sy-subrc NE 0.
          MESSAGE 'ALV Grid display unsuccessful' TYPE 'I'.
          STOP.
        ENDIF.                             " IF sy-subrc NE 0
      ELSE.                                " IF w_custom_container...
    * Refresh the container if it already exists
        CALL METHOD v_grid->refresh_table_display
          EXCEPTIONS
            finished = 1
            OTHERS   = 2.
        IF sy-subrc NE 0.
          MESSAGE 'Refreshing the container is not successful' TYPE 'I'.
          STOP.
        ENDIF.                            

  • ALV GRID with icon fields. When exports to Excel, icon fields are emtpy.

    Hi all,
    In our SAP system (6.0 ECC) we've noticed the following behaviour:
    In ALV GRID with icons (color lights for example...) when we export the list to Excel format with the standard button bat, the icon column is always empty.
    We think that in previous SAP version (4.7), the code corresponding to the icon appeared (For example @08@ for green light).
    It's possible to have tha same functionality in this new version like in 4.7?
    Regards.
    Edited by: Ole ES on Nov 17, 2010 6:05 PM

    Hi,
    Check the format in which you export to Excel (MHTML, XML, ...) and try antoher one.
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/66/79ad48157f11d2953700a0c930328a/content.htm
    I think the integrated Excel mode shows '@08@'.
    Best regards,
    Guillaume

  • How to display ALV list with more than 1 structure?

    Hello everyone,
    I am using REUSE_ALV_LIST_DISPLAY to generate a report that displays vendor/customer items with purchases/sales total. I have 2 internal table for this. For every vendor/customer i need a total table right after, this have a different structure. I cannot use REUSE_ALV_BLOCK_LIST_ as this is not capable of calculating the subtotal per currency and from the documentation it says do not use.
    Any idea on how to proceed?
    Thanks!

    Call ALV list function module per table structure.
    Closing this thread.

  • ALV List with two rows of heading

    Hi All,
    I am working on ALV list display. I have six columns of heading in my ALV. Out of the six columns i need to display five columns in the first row and the sixth heading will be in the second row first column.
    Ex:
    A  B  C D  E F
    G
    I need to display a row of values for Column G for every row of A,B,C,D,E,F.
    How is this possible with ALV list display.
    Ex.
    A     B     C     D      E     F
    G
    v1A  v1B  v1C  v1D   v1E  v1F
    v1G
    v2A  v2B  v2C  v2D   v2E  v2F
    v2G
    v3A  v3B  v3C  v3D   v3E  v3F
    v3G
    Looking forward to ur reply.
    Regards
    Ramanan

    Hi,
    You can use a hierachial list to display your output as required.
    You can check the example program BCALV_TEST_HIERSEQ_LIST.
    Regards,
    Ankur Parab
    Edited by: Ankur Parab on Jun 15, 2009 12:33 PM

  • Compare editable alv output with database fields

    I generated 1 editable alv report with attaching flat file data,
    but i want to change the wrong fields in alv output and compare with database filds for validation.
    but when i do this . it takes previous entries of flat file.
    how can i solve it?

    Your title is much better than in the first post, however your problem description hasn't changed.
    Let me guess, you are importing a flat file, present the contents in an editable ALV grid, some values are being changed, and now the changed values do not reflect in the internal table, instead you are seeing the values as imported from the file?
    If yes -> FAQ, please search for the many previous discussions of this topic.
    Thomas

Maybe you are looking for

  • Photo Gallery & Vimeo & YouTube Widgets does not appear

    Hello Forum, I created a new homepage. www.pengpalast.de - If you click on "the holycoaster s(hit) circus" at the front and then on photo, you will see, that there is no gallerx. But i created one in I Web, also a Trailer (with the embeddes function

  • Runtime analysis for a Method

    Hi, Need some help on how to find the Runtime Analysis for a method in Class, as i am getting some performance issues with the statements in the method.  Please let me know ASAP about this Runtime Analysis for a method in a class

  • Editing multiple pages

    The question is - am I able to edit a navigation menu just on the main page of my site, so its content would be updated on all the other pages automatically? What is needed to do so? The site is built using just HTML and CSS.

  • VRF configuration on IOS-XR 4.1.

    Hi I have some questions about VRF configuration on IOS-XR 4.1. I'm trying to configure BGP routing with vrf and I get the following error when trying to commit my config: =================================================== address-family ipv4 unicas

  • How do i dawnload music to my iphone?

    Helo, i would like 2 dawnload my mp3 (windows media payer) 2 my new iphone 4. what should i do?