How to display 2 lines of fieldcat in alv

hi,all.
   I wonder how to display 2 lines of fieldcat in alv,no matter grid,list ,oo.   whatever.
   thanks in anvance.

Hi,
it's only possible in alv-list (3 lines).
A.

Similar Messages

  • How to display an image in an alv grid in each corresponding row?

    Hi,
    please tell me how to  display an image in an alv grid in each corresponding row, like;;
    tony            23   newyork      <image>
    Mkitharyan  63   washington  <image>
    NOT BY HOTSPOTS/URL.

    you can put image in each cell you want:
    data lo_cmp_usage type ref to if_wd_component_usage.
      lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
      if lo_cmp_usage->has_active_component( ) is initial.
        lo_cmp_usage->create_component( ).
      endif.
      DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
      lo_INTERFACECONTROLLER =   wd_this->wd_cpifc_alv( ).
        DATA lo_value TYPE ref to cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(    ).
    data col type ref to  CL_SALV_WD_COLUMN.
    col = lo_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'IMAGE' ).
    data image type ref to cl_salv_wd_uie_image.
    CREATE OBJECT image.
    image->SET_SOURCE_FIELDNAME( 'IMAGE' ).
    COL->SET_CELL_EDITOR( image  ).

  • How to display Lines and Boxes in SAP Script

    hi,
    Can any one help me how to display Lines and Boxes in SAP Script.
    Regards
    kiran

    The SAP printer drivers based on page-oriented printers use these commands when creating output whereas the line printers and non-supported page-oriented printers ignore these commands.
    Syntax:/: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    This command draws a box of the specified size at the specified position.
    The following calculation is performed internally to determine the absolute output position of a box on the page:
    X(abs) = XORIGIN + XPOS
    Y(abs) = YORIGIN + YPOS
    WIDTH determines the width of the box.
    Default: WIDTH value of the SIZE command.
    HEIGHT determines height of the box.
    Default: HEIGHT value of the SIZE command.
    FRAME determines the thickness of frame.
    Default: 0 (no frame).
    INTENSITY determines the box contents as a grayscale percentage.
    Default: 100 (full black)
    The other details I guess is provided by friends who have posted before me.
    Regards,
    K.Sibi

  • How to display line items twice in a single page in sap script

    HI,
      I am working on check printing. I copied the standard driver program and form to Zprogram and ZForm. Which are RFFOUS_C(print program) and F110_PRENUM_CHECK(Form Name).
    I want to display the line items twice in the same page and sub sequent pages.
    Currently I am able to display line items only once.
    Example:
    PAGE1.
    line item1
    line item2
    line item3
    line item4
    line item5
    line item1
    line item2
    line item3
    line item4
    line item5
    line items 1 to 5 which are in main window.
    How to achive this problem.
    Regards,
    vinod

    Hi
    I had the same request for a check form in Canada. I solved it by writing the line item output into variables and print these variables in a second window. It was ~10 hours of effort, not a real nice technical solution but it worked.
    If you require I can send you a PDF of the sap script form definition. You can contact me at [email protected] Answers can take 1 week or more. 
    Best regards
    JD

  • How to display table data without  using ALV  and table element.

    Hi,
            Its possible to display table data without using ALV  and table element.
           Every time i am fetching data based on (customer,status) fields and displaying these data in my output using alv
           (every time i am fetching single row data ),
           But problem is alv occupying more space in the output , i want to display data part only i dont want field names,
           settings and header data etc..things.
          Give solution to  display data part..
    Regards,
    Rakhi.

    Hi,
    Does you mean that you need ALV without default Function Toolbar...? If this is the case, the easy solution would have been to use Table Element rather. But, if you need to use ALV only without Function Toolbar, you can do away with that as well.
    In that case, after calling GET_MODEL, you need to add few more lines of codes to achieve your goal. Those lines are --
      DATA LV_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
        LV_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
    * Standard Filter Function setting to FALSE
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_COMPLEX_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_COMPLEX_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_FILTERLINE_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_DISPLAY_SETTINGS_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_VIEW_LIST_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_HEADERCLICK_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_HIERARCHY_ALLOWED( ABAP_FALSE ).
    * Standard Filter Function setting to FALSE Ends
    Here as you can easily notice that LV_VALUE is instantiated on CL_SALV_WD_CONFIG_TABLE. Now, using this LV_VALUE, you set standard functions as False to dis-allow their display.
    Hope this answers your query.
    Thanks.
    Kumar Saurav.

  • How to display three months data in ALV grid control

    Hi
    Thanks for all.I have tried now it is working but as per requirement month name and cumulative total will display like this format.cumulative total means month1amount+ month2amount+month3amount.And one more thing month range will change some times means sometimes i will give January date to march date and sometimes i will give July date to October date. but date range is same means between dates range is three months.
    please tell me how to display.
    GAS PRESSURE WELDING COST EFFECTIVENESS                                        Dec-11                         Cummulativetotal
    Sr. No             Item             Unit           Rate          Qty           Amount             
    GAS PRESSURE WELDING COST EFFECTIVENESS                                      Jan-12
    Sr. No             Item             Unit           Rate          Qty           Amount             
    GAS PRESSURE WELDING COST EFFECTIVENESS                                     Feb-12
    Sr. No             Item             Unit           Rate          Qty           Amount             
    Thanks & Regards,
    Vasu.
    Moderator message: only one thread per issue, please.
    Edited by: Thomas Zloch on Feb 20, 2012

    Hi
    Thanks for all.I have tried now it is working but as per requirement month name and cumulative total will display like this format.cumulative total means month1amount+ month2amount+month3amount.And one more thing month range will change some times means sometimes i will give January date to march date and sometimes i will give July date to October date. but date range is same means between dates range is three months.
    please tell me how to display.
    GAS PRESSURE WELDING COST EFFECTIVENESS                                        Dec-11                         Cummulativetotal
    Sr. No             Item             Unit           Rate          Qty           Amount             
    GAS PRESSURE WELDING COST EFFECTIVENESS                                      Jan-12
    Sr. No             Item             Unit           Rate          Qty           Amount             
    GAS PRESSURE WELDING COST EFFECTIVENESS                                     Feb-12
    Sr. No             Item             Unit           Rate          Qty           Amount             
    Thanks & Regards,
    Vasu.
    Moderator message: only one thread per issue, please.
    Edited by: Thomas Zloch on Feb 20, 2012

  • How to disable line selection functionality in ALV.

    Hallo guys,
    I need to disable the ALV functionality to select one(or more) lines.
    How to hide this push button on the right side?
    Thanks.

    hi
    good
    check this
    *& Report  ZDEMO_ALVGRID_SELROW                                        *
    *& Example of a simple ALV Grid Report                                 *
    *& The basic ALV grid, Enhanced to display capture each row a user has *
    *& selected                                                            *
    REPORT  zdemo_alvgrid_selrow                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      SEl,                         "stores which row user has selected
      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-box_fieldname     = 'SEL'.
                                     "set field name to store row selection
      gd_layout-edit              = 'X'. "makes whole ALV table editable
      gd_layout-zebra             = 'X'.
    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 corresponding fields of table it_ekko.
    endform.                    " DATA_RETRIEVAL
          FORM USER_COMMAND                                          *
          --> R_UCOMM                                                *
          --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
      Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
        Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
        Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
        Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
        WHEN '&DATA_SAVE'.  "user presses SAVE
        loop at it_ekko into wa_ekko.
          if wa_ekko-sel EQ 'X'.
          Process records that have been selected
          endif.
        endloop.
      ENDCASE.
    ENDFORM.
    thanks
    mrutyun^

  • How to display second list under an alv already displayed

    hi
    I have a list being displayed using grid control...i need to display anotehr list data below the first list please suggest?
    block list display will not have sorted and all functinality ? do i need touse block list display function module??
    regards
    arora

    Hi Arora Nishant,
    REUSE_ALV_BLOCK_LIST_INIT
    then
    REUSE_ALV_BLOCK_LIST_APPEND " for each fieldcat
    create two diff fieldcate for both alv output and use this FM for each fieldcat to append it in output..
    it's having sorting Functionality as well as export functionalities... etc etc..
    then
    REUSE_ALV_BLOCK_LIST_DISPLAY
    Done..
    See below example...
    REPORT ZILESH_ALV3 LINE-COUNT 100 .
    **& tables declaration
    TABLES: MARA.
    **& type-pools declaration
    TYPE-POOLS: SLIS.
    **& data declaration
    DATA: G_REPID TYPE SY-REPID.
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, "mara
    WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA : IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV, "makt
    WA_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV.
    DATA : IT_FIELDCAT2 TYPE SLIS_T_FIELDCAT_ALV, "marc
    WA_FIELDCAT2 TYPE SLIS_FIELDCAT_ALV.
    DATA: GT_PRINT TYPE SLIS_PRINT_ALV,
    WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
    XS_EVENT TYPE SLIS_ALV_EVENT,
    GT_XEVENTS TYPE SLIS_T_EVENT,
    GT_YEVENTS TYPE SLIS_T_EVENT,
    GT_ZEVENTS TYPE SLIS_T_EVENT,
    WA_SORT TYPE SLIS_SORTINFO_ALV,
    IT_SORT TYPE SLIS_T_SORTINFO_ALV.
    DATA: BEGIN OF IT_MARA OCCURS 0,
    MATNR LIKE MARA-MATNR,
    MTART LIKE MARA-MTART,
    MATKL LIKE MARA-MATKL,
    MEINS LIKE MARA-MEINS,
    NTGEW LIKE MARA-NTGEW,
    END OF IT_MARA.
    DATA: BEGIN OF IT_MAKT OCCURS 0,
    MATNR LIKE MAKT-MATNR,
    SPRAS LIKE MAKT-SPRAS,
    MAKTX LIKE MAKT-MAKTX,
    MAKTG LIKE MAKT-MAKTG,
    END OF IT_MAKT.
    DATA: BEGIN OF IT_MARC OCCURS 0,
    MATNR LIKE MARC-MATNR,
    WERKS LIKE MARC-WERKS,
    LADGR LIKE MARC-LADGR,
    MTVFP LIKE MARC-MTVFP,
    DISPR LIKE MARC-DISPR,
    DISMM LIKE MARC-DISMM,
    DISPO LIKE MARC-DISPO,
    END OF IT_MARC.
    **& initialisation
    INITIALIZATION.
      G_REPID = SY-REPID.
    **& selection screen
      SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-001.
      SELECT-OPTIONS: S_MATNR FOR MARA-MATNR,
      S_MTART FOR MARA-MTART.
      SELECTION-SCREEN END OF BLOCK B.
    **& start of selection
    START-OF-SELECTION.
      PERFORM GET_MARADETAILS.
      PERFORM GET_MAKTDETAILS.
      PERFORM GET_MARCDETAILS.
    **& Form get_maradetails
    *text
    *--> p1 text
    *<-- p2 text
    FORM GET_MARADETAILS .
      SELECT MATNR
      MTART
      MATKL
      MEINS
      NTGEW FROM MARA
      INTO TABLE IT_MARA
      WHERE MATNR IN S_MATNR AND
      MTART IN S_MTART.
    ENDFORM. " get_maradetails
    **& Form get_maktdetails
    *text
    *--> p1 text
    *<-- p2 text
    FORM GET_MAKTDETAILS .
      SELECT MATNR
      SPRAS
      MAKTX
      MAKTG FROM MAKT INTO TABLE IT_MAKT
      FOR ALL ENTRIES IN IT_MARA
      WHERE MATNR = IT_MARA-MATNR..
    ENDFORM. " get_maktdetails
    **& Form get_marcdetails
    *text
    *--> p1 text
    *<-- p2 text
    FORM GET_MARCDETAILS .
      SELECT MATNR
      WERKS
      LADGR
      MTVFP
      DISPR
      DISMM
      DISPO FROM MARC
      INTO TABLE IT_MARC
      FOR ALL ENTRIES IN IT_MARA
      WHERE MATNR = IT_MARA-MATNR.
    ENDFORM. " get_marcdetails
    **& end of selection
    END-OF-SELECTION.
      PERFORM SORT_LIST.
      PERFORM MODIFY_FIELDCAT.
      PERFORM EVENT_LIST.
      PERFORM BLOCK_LIST.
    **& Form modify_fieldcat
    *text
    *--> p1 text
    *<-- p2 text
    FORM MODIFY_FIELDCAT .
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-TABNAME = 'IT_MARA'.
      WA_FIELDCAT-SELTEXT_L = 'MATERIAL NUM'.
      WA_FIELDCAT-COL_POS = 1.
      WA_FIELDCAT-OUTPUTLEN = 18.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'MTART'.
      WA_FIELDCAT-TABNAME = 'IT_MARA'.
      WA_FIELDCAT-SELTEXT_L = 'MAT TYPE'.
      WA_FIELDCAT-COL_POS = 2.
      WA_FIELDCAT-OUTPUTLEN = 5.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'MATKL'.
      WA_FIELDCAT-TABNAME = 'IT_MARA'.
      WA_FIELDCAT-SELTEXT_L = 'MAT GROUP'.
      WA_FIELDCAT-COL_POS = 3.
      WA_FIELDCAT-OUTPUTLEN = 10.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'MEINS'.
      WA_FIELDCAT-TABNAME = 'IT_MARA'.
      WA_FIELDCAT-SELTEXT_L = 'UNIT'.
      WA_FIELDCAT-COL_POS = 4.
      WA_FIELDCAT-OUTPUTLEN = 5.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'NTGEW'.
      WA_FIELDCAT-TABNAME = 'IT_MARA'.
      WA_FIELDCAT-DO_SUM = 'X'.
      WA_FIELDCAT-SELTEXT_L = 'QUANTITY'.
      WA_FIELDCAT-COL_POS = 5.
      WA_FIELDCAT-OUTPUTLEN = 15.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      CLEAR WA_FIELDCAT1.
      WA_FIELDCAT1-FIELDNAME = 'MATNR'.
      WA_FIELDCAT1-TABNAME = 'IT_MAKT'.
      WA_FIELDCAT1-SELTEXT_L = 'MATERIAL NUM'.
      WA_FIELDCAT1-COL_POS = 1.
      WA_FIELDCAT1-OUTPUTLEN = 18.
      APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
      CLEAR WA_FIELDCAT1.
      WA_FIELDCAT1-FIELDNAME = 'SPRAS'.
      WA_FIELDCAT1-TABNAME = 'IT_MAKT'.
      WA_FIELDCAT1-SELTEXT_L = 'LANGUAGE'.
      WA_FIELDCAT1-COL_POS = 2.
      WA_FIELDCAT1-OUTPUTLEN = 2.
      APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
      CLEAR WA_FIELDCAT1.
      WA_FIELDCAT1-FIELDNAME = 'MAKTX'.
      WA_FIELDCAT1-TABNAME = 'IT_MAKT'.
      WA_FIELDCAT1-SELTEXT_L = 'MAT DESC'.
      WA_FIELDCAT1-COL_POS = 3.
      WA_FIELDCAT1-OUTPUTLEN = 40.
      APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
      CLEAR WA_FIELDCAT1.
      WA_FIELDCAT1-FIELDNAME = 'MAKTG'.
      WA_FIELDCAT1-TABNAME = 'IT_MAKT'.
      WA_FIELDCAT1-SELTEXT_L = 'GRP DESC'.
      WA_FIELDCAT1-COL_POS = 4.
      WA_FIELDCAT1-OUTPUTLEN = 40.
      APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
      CLEAR WA_FIELDCAT1.
      CLEAR WA_FIELDCAT2.
      WA_FIELDCAT2-FIELDNAME = 'MATNR'.
      WA_FIELDCAT2-TABNAME = 'IT_MARC'.
      WA_FIELDCAT2-SELTEXT_L = 'MATERIAL NUM'.
      WA_FIELDCAT2-COL_POS = 1.
      WA_FIELDCAT2-OUTPUTLEN = 18.
      APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
      CLEAR WA_FIELDCAT2.
      WA_FIELDCAT2-FIELDNAME = 'WERKS'.
      WA_FIELDCAT2-TABNAME = 'IT_MARC'.
      WA_FIELDCAT2-SELTEXT_L = 'PLANT'.
      WA_FIELDCAT2-COL_POS = 2.
      WA_FIELDCAT2-OUTPUTLEN = 4.
      APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
      CLEAR WA_FIELDCAT2.
      WA_FIELDCAT2-FIELDNAME = 'LADGR'.
      WA_FIELDCAT2-TABNAME = 'IT_MARC'.
      WA_FIELDCAT2-SELTEXT_L = 'LOAD GRP'.
      WA_FIELDCAT2-COL_POS = 3.
      WA_FIELDCAT2-OUTPUTLEN = 4.
      APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
      CLEAR WA_FIELDCAT2.
      WA_FIELDCAT2-FIELDNAME = 'MTVFP'.
      WA_FIELDCAT2-TABNAME = 'IT_MARC'.
      WA_FIELDCAT2-SELTEXT_L = 'GRP CHK'.
      WA_FIELDCAT2-COL_POS = 4.
      WA_FIELDCAT2-OUTPUTLEN = 4.
      APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
      CLEAR WA_FIELDCAT2.
      WA_FIELDCAT2-FIELDNAME = 'DISPR'.
      WA_FIELDCAT2-TABNAME = 'IT_MARC'.
      WA_FIELDCAT2-SELTEXT_L = 'MRP PROFILE'.
      WA_FIELDCAT2-COL_POS = 5.
      WA_FIELDCAT2-OUTPUTLEN = 4.
      APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
      CLEAR WA_FIELDCAT2.
      WA_FIELDCAT2-FIELDNAME = 'DISMM'.
      WA_FIELDCAT2-TABNAME = 'IT_MARC'.
      WA_FIELDCAT2-SELTEXT_L = 'MRP TYPE'.
      WA_FIELDCAT2-COL_POS = 6.
      WA_FIELDCAT2-OUTPUTLEN = 4.
      APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
      CLEAR WA_FIELDCAT2.
      WA_FIELDCAT2-FIELDNAME = 'DISPO'.
      WA_FIELDCAT2-TABNAME = 'IT_MARC'.
      WA_FIELDCAT2-SELTEXT_L = 'MRP CON'.
      WA_FIELDCAT2-COL_POS = 7.
      WA_FIELDCAT2-OUTPUTLEN = 4.
      APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
      CLEAR WA_FIELDCAT2.
    ENDFORM. " modify_fieldcat
    **& Form BLOCK_LIST
    *text
    *--> p1 text
    *<-- p2 text
    FORM BLOCK_LIST .
      CLEAR WA_LAYOUT.
      WA_LAYOUT-ZEBRA = 'X'.
      WA_LAYOUT-TOTALS_TEXT = 'TOTAL'.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          I_CALLBACK_PROGRAM       = G_REPID
          I_CALLBACK_PF_STATUS_SET = ' '
          I_CALLBACK_USER_COMMAND  = 'user_command'.
    *IT_EXCLUDING =
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          IS_LAYOUT                  = WA_LAYOUT
          IT_FIELDCAT                = IT_FIELDCAT[]
          I_TABNAME                  = 'IT_MARA'
          IT_EVENTS                  = GT_XEVENTS
          IT_SORT                    = IT_SORT
          I_TEXT                     = ' '
        TABLES
          T_OUTTAB                   = IT_MARA
        EXCEPTIONS
          PROGRAM_ERROR              = 1
          MAXIMUM_OF_APPENDS_REACHED = 2
          OTHERS                     = 3.
      IF SY-SUBRC = 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
      IS_LAYOUT = WA_LAYOUT
      IT_FIELDCAT = IT_FIELDCAT1
      I_TABNAME = 'IT_MAKT'
      IT_EVENTS = GT_YEVENTS
    *IT_SORT =
      I_TEXT = ' '
      TABLES
      T_OUTTAB = IT_MAKT
      EXCEPTIONS
      PROGRAM_ERROR = 1
      MAXIMUM_OF_APPENDS_REACHED = 2
      OTHERS = 3
      IF SY-SUBRC = 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
      IS_LAYOUT = WA_LAYOUT
      IT_FIELDCAT = IT_FIELDCAT2
      I_TABNAME = 'IT_MARC'
      IT_EVENTS = GT_ZEVENTS
    *IT_SORT =
      I_TEXT = ' '
      TABLES
      T_OUTTAB = IT_MARC
      EXCEPTIONS
      PROGRAM_ERROR = 1
      MAXIMUM_OF_APPENDS_REACHED = 2
      OTHERS = 3
      IF SY-SUBRC = 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
      EXPORTING
      I_INTERFACE_CHECK = ' '
      IS_PRINT = GT_PRINT
      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 =
      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. " BLOCK_LIST
    **& Form EVENT_LIST
    *text
    *--> p1 text
    *<-- p2 text
    FORM EVENT_LIST .
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
      XS_EVENT-FORM = 'XTOP_OF_PAGE'.
      APPEND XS_EVENT TO GT_XEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_PAGE.
      XS_EVENT-FORM = 'XEND_OF_PAGE'.
      APPEND XS_EVENT TO GT_XEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
      XS_EVENT-FORM = 'XTOP_OF_LIST'.
      APPEND XS_EVENT TO GT_XEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_LIST.
      XS_EVENT-FORM = 'XEND_OF_LIST'.
      APPEND XS_EVENT TO GT_XEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_PAGE.
      XS_EVENT-FORM = 'YEND_OF_PAGE'.
      APPEND XS_EVENT TO GT_YEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
      XS_EVENT-FORM = 'YTOP_OF_PAGE'.
      APPEND XS_EVENT TO GT_YEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
      XS_EVENT-FORM = 'YTOP_OF_LIST'.
      APPEND XS_EVENT TO GT_YEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_LIST.
      XS_EVENT-FORM = 'YEND_OF_LIST'.
      APPEND XS_EVENT TO GT_YEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_PAGE.
      XS_EVENT-FORM = 'ZEND_OF_PAGE'.
      APPEND XS_EVENT TO GT_ZEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
      XS_EVENT-FORM = 'ZTOP_OF_PAGE'.
      APPEND XS_EVENT TO GT_ZEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
      XS_EVENT-FORM = 'ZTOP_OF_LIST'.
      APPEND XS_EVENT TO GT_ZEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_LIST.
      XS_EVENT-FORM = 'ZEND_OF_LIST'.
      APPEND XS_EVENT TO GT_ZEVENTS.
      CLEAR XS_EVENT.
    ENDFORM. " EVENT_LIST
    *&      Form  XTOP_OF_PAGE
    *       text
    FORM XTOP_OF_PAGE.
      WRITE:/ 'TOP OF PAGE FOR MARA'.
    ENDFORM.                    "XTOP_OF_PAGE
    *&      Form  YTOP_OF_PAGE
    *       text
    FORM YTOP_OF_PAGE.
      WRITE:/ 'TOP OF PAGE FOR MAKT'.
    ENDFORM.                    "YTOP_OF_PAGE
    *&      Form  ZTOP_OF_PAGE
    *       text
    FORM ZTOP_OF_PAGE.
      WRITE:/ 'TOP OF PAGE FOR MARC'.
    ENDFORM.                    "ZTOP_OF_PAGE
    *&      Form  XEND_OF_PAGE
    *       text
    FORM XEND_OF_PAGE.
      WRITE:/ 'END OF PAGE FOR MARA'.
    ENDFORM.                    "XEND_OF_PAGE
    *&      Form  YEND_OF_PAGE
    *       text
    FORM YEND_OF_PAGE.
      WRITE:/ 'END OF PAGE FOR MAKT'.
    ENDFORM.                    "YEND_OF_PAGE
    *&      Form  ZEND_OF_PAGE
    *       text
    FORM ZEND_OF_PAGE.
      WRITE:/ 'END OF PAGE FOR MARC'.
    ENDFORM.                    "ZEND_OF_PAGE
    *&      Form  XTOP_OF_LIST
    *       text
    FORM XTOP_OF_LIST.
      WRITE:/ 'TOP OF LIST FOR MARA'.
    ENDFORM.                    "XTOP_OF_LIST
    *&      Form  YTOP_OF_LIST
    *       text
    FORM YTOP_OF_LIST.
      WRITE:/ 'TOP OF LIST FOR MAKT'.
    ENDFORM.                    "YTOP_OF_LIST
    *&      Form  ZTOP_OF_LIST
    *       text
    FORM ZTOP_OF_LIST.
      WRITE:/ 'TOP OF LIST FOR MARC'.
    ENDFORM.                    "ZTOP_OF_LIST
    *&      Form  XEND_OF_LIST
    *       text
    FORM XEND_OF_LIST.
      WRITE:/ 'END OF LIST FOR MARA'.
    ENDFORM.                    "XEND_OF_LIST
    *&      Form  YEND_OF_LIST
    *       text
    FORM YEND_OF_LIST.
      WRITE:/ 'END OF LIST FOR MAKT'.
    ENDFORM.                    "YEND_OF_LIST
    *&      Form  ZEND_OF_LIST
    *       text
    FORM ZEND_OF_LIST.
      WRITE:/ 'END OF LIST FOR MARC'.
    ENDFORM.                    "ZEND_OF_LIST
    **& Form sort_list
    *text
    *--> p1 text
    *<-- p2 text
    FORM SORT_LIST .
      CLEAR WA_SORT.
      WA_SORT-FIELDNAME = 'MTART'.
      WA_SORT-SUBTOT = 'X'.
      APPEND WA_SORT TO IT_SORT.
      CLEAR WA_SORT.
      WA_SORT-FIELDNAME = 'MATKL'.
      WA_SORT-SUBTOT = 'X'.
      APPEND WA_SORT TO IT_SORT.
      CLEAR WA_SORT.
    ENDFORM. " sort_list
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7

  • How to display selected table fields in ALV report.

    Hi,
    I am displaying data from table EKPO using ALV through this query.
    select * from ekpo into table itab_ekpo up to 25 rows.
    bt if i need to display selected fields like
    select ebeln matnr netpr from ekpo into table itab_ekpo up to 25 rows.
    IT gives  error GETWA_NOT_ASSIGNED.
    FIELD SYMBOL HAS NOT YET BEEN ASSIGNED
    CAN ANYONE PLZ HELP ME.

    Hi ,
          I am pasting the code in which i am getting the error.Plz help.
    REPORT  ZHALV.
    tables:ekpo.
    data itab_ekpo type ekpo occurs 100 with header line.
    types: begin of itab_new,
           f_ebeln type ekpo-ebeln,
           f_matnr type ekpo-matnr,
           f_netpr type ekpo-netpr,
           end of itab_new.
    data itab1 TYPE STANDARD TABLE OF itab_new initial size 0.
    type-pools: slis.
    DATA: lt_fieldcat TYPE slis_t_fieldcat_alv,
          lf_fieldcat TYPE slis_fieldcat_alv.
    DATA:    ws_repid TYPE sy-repid VALUE 'ZHALV'.
    DATA:  l_layout   TYPE slis_layout_alv.
    selection-screen Begin of block block1 with frame title text-111.
    select-options : S_EBELN for EKPO-EBELN.
    selection-screen end of block block1.
    INITIALIZATION.
    start-of-selection.
      select ebeln matnr netpr from ekpo into table itab1 up to 10 rows WHERE EBELN IN S_EBELN.
    *select * from ekpo into table itab_ekpo up to 25 rows.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM GET_DETAILS.
    end-of-selection.
    *&      Form  build_fieldcatalog
          text
    FORM build_fieldcatalog .
    PURCHASING DOCUMENT NUMBER
      CLEAR lf_fieldcat.
      lf_fieldcat-fieldname = 'EBELN'.
      lf_fieldcat-ref_tabname = 'EKKO'.
      lf_fieldcat-ref_fieldname = 'EBELN'.
    MATERIAL NUMBER
      CLEAR lf_fieldcat.
      lf_fieldcat-fieldname = 'MATNR'.
      lf_fieldcat-ref_tabname = 'EKPO'.
      lf_fieldcat-ref_fieldname = 'MATNR'.
      APPEND lf_fieldcat TO lt_fieldcat.
    NET PRICE IN PURCHASING DOCUMENT
      CLEAR lf_fieldcat.
      lf_fieldcat-fieldname = 'NETPR'.
      lf_fieldcat-ref_tabname = 'EKPO'.
      lf_fieldcat-ref_fieldname = 'NETPR'.
      lf_fieldcat-cfieldname = 'WAERS'.
      lf_fieldcat-do_sum = 'X'.
      APPEND lf_fieldcat TO lt_fieldcat.
    ENDFORM.                    " build_fieldcatalog
    *&      Form  GET_DETAILS
          text
    FORM GET_DETAILS.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
                                 I_INTERFACE_CHECK                 = ' '
                                 I_BYPASSING_BUFFER                = ' '
                                 I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = ws_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                  = 'EKPO'
                                 I_BACKGROUND_ID                   = ' '
                                 I_GRID_TITLE                      =
                                 I_GRID_SETTINGS                   =
                                 IS_LAYOUT                         =
                                  IT_FIELDCAT                       = lt_fieldcat
                                 IT_EXCLUDING                      =
                                 IT_SPECIAL_GROUPS                 =
                                 IT_SORT                           =
                                 IT_FILTER                         =
                                 IS_SEL_HIDE                       =
        I_DEFAULT                         = 'X'
        I_SAVE                            = 'A'
                                 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
                                 I_HTML_HEIGHT_TOP                 = 0
                                 I_HTML_HEIGHT_END                 = 0
                                 IT_ALV_GRAPHICS                   =
                                 IT_HYPERLINK                      =
                                 IT_ADD_FIELDCAT                   =
                                 IT_EXCEPT_QINFO                   =
                                 IR_SALV_FULLSCREEN_ADAPTER        =
                               IMPORTING
                                 E_EXIT_CAUSED_BY_CALLER           =
                                 ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = itab1
          EXCEPTIONS
                                 PROGRAM_ERROR                     = 1
                                OTHERS                            = 2.
      IF SY-SUBRC <> 0.
        WRITE: 'SY-SUBRC: ', SY-SUBRC .
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *append itab_ekpo to i_tab.
    ENDFORM.                    "GET_DETAILS

  • How to insert line with values in ALV (CL_GUI_ALV_GRID)?

    Hi,
    Does anyone know how to get control of new line inserted in ALV (I am using class CL_GUI_ALV_GRID) before the new line is shown to the user. What I want the user to see is not a completely blank line, but a new line with certain fields filled with data.
    I have tried with ALL events in CL_GUI_ALV_GRID but without any luck. If I create my own user command and insert it in the alv menu I get control, but not with the standards. Why?
    Please help
    Kind regards - Keld Gregersen

    Hi,
    I created a nice work around...
    CLASS lcl_event_handler DEFINITION.
    handle_toolbar
    FOR EVENT toolbar OF cl_gui_alv_grid
    IMPORTING e_object e_interactive,
    handle_user_command
    FOR EVENT user_command OF cl_gui_alv_grid
    IMPORTING e_ucomm.
    ENDCLASS. "lcl_event_handler DEFINITION
    CLASS lcl_event_handler IMPLEMENTATION.
    METHOD handle_toolbar.
    DATA:
    l_toolbar TYPE stb_button.
    Here I replace SAP standard functions with own functions
    READ TABLE e_object->mt_toolbar INTO l_toolbar
    WITH KEY function = '&LOCAL&APPEND'.
    IF sy-subrc = 0.
    l_toolbar-function = 'OWN_APPEND'.
    MODIFY e_object->mt_toolbar FROM l_toolbar INDEX sy-tabix.
    ENDIF.
    READ TABLE e_object->mt_toolbar INTO l_toolbar
    WITH KEY function = '&LOCAL&COPY_ROW'.
    IF sy-subrc = 0.
    l_toolbar-function = 'OWN_COPY_ROW'.
    MODIFY e_object->mt_toolbar FROM l_toolbar INDEX sy-tabix.
    ENDIF.
    ENDMETHOD. "handle_toolbar
    METHOD handle_user_command.
    CASE e_ucomm.
    WHEN 'OWN_APPEND'.
    CALL METHOD ref_alv->check_changed_data
    IMPORTING
    e_valid =
    CHANGING
    c_refresh = 'X'
    CREATE YOUR OWN CODE HERE
    CALL METHOD ref_alv->refresh_table_display
    EXPORTING
    is_stable = 'X'
    i_soft_refresh =
    EXCEPTIONS
    finished = 1
    others = 2
    ENDMETHOD. "handle_user_command
    ENDCLASS. "lcl_event_handler IMPLEMENTATION
    Kind regards
    Keld Gregersen

  • How to display line items corresponding to Header  adobe form

    Hi ,
    As I am new to Adobe Form, So struggling with below problem related with Adobe Form.
    For example, I have data in an internal table :
    Stage      item
    100         A
    100         B
    100         C
    200         D
    200         E
    Here you have for field 'Stage'  value '100' , I have 3 line items, for value '200' , it is 2 line items and so on.
    My requirement is , I have to show Stage field at top and corresponding line items should be displayed in table.
    Stage: 100
    item
    A
    B
    C
    Stage: 200
    D
    E
    I have used Nested table concept to achieve it but didn't get expected output.
    Please help me out.

    Hi,
         If all of your line items are getting displayed in different pages, to my knowledge, there may be two possibilities.
    1) May be the size of the main window can accomodate only one line item. If one item data fills up the window, then there wont' be any space for the next line item data to be accomodated in the same window in the same page, so, the system triggers the next page. Like-wise for each item data. If this is the case, increase the height of the main window to display items in same page.
    2) Check the driver program. Find the Write_form block, which is written inside an item loop. May be there is a Form-control Function module( Control_form with parameter 'NEW-PAGE' ) being called after the write_fom block, within the loop. If this is the case, remove the control_form FM section to make the data display in same page.
    Best Regards,
    Kumaar.S

  • How to display different icon within WDA alv table base on row data ?

    Hi,
    is that possible to display different icon for every row within ALV table depending on the row data ?
    for instance if the status 'S' display ~Icon/SuccessMessage and 'E' display ~Icon/ErrorMessage ?
    because base on this code below i only can set 1 icon for the whole row data.
    LOOP AT lt_columns ASSIGNING <fs_column>.
        CASE <fs_column>-id.
          WHEN 'ICO'.
            CREATE OBJECT lr_caption.
               lr_caption->set_image_source( value = '~Icon/SuccessMessage').
               <fs_column>-r_column->set_cell_editor( lr_caption ).
        ENDCASE.
      ENDLOOP.
    Thank you in advance.
    Fernand

    Hello,
    Yes it is possible to display different images based on data.
    For that what you can do is create one attribute 'STATUS' of type string in context node which you are mapping to ALV.
    And fill that attribute with the path to image based on your requirement like for status 'S' set the attribute to ~Icon/SuccessMessage and if status is 'E', set it to ~Icon/ErrorMessage at runtime.
    Now in the settings for ALV use the following code:
    * Display icon in column seatsocc
      DATA: lr_column TYPE REF TO cl_salv_wd_column,
            lr_image TYPE REF TO cl_salv_wd_uie_image,
            lv_icon TYPE string.
      lr_column = lv_model->if_salv_wd_column_settings~get_column( 'SEATSOCC' ).
      CREATE OBJECT lr_image.
      lr_image->SET_SOURCE_FIELDNAME( 'STATUS' ).
      lr_column->set_cell_editor( lr_image ).
    in the above code, column 'SEATSOCC' will be displayed as an icon.
    Sample code to fill the attribute 'STATUS'
    LOOP AT lt_flights INTO ls_flight.
        lv_seatsfree = ls_flight-seatsmax - ls_flight-seatsocc.
        IF lv_seatsfree = 0.
          ls_flight-status = 'ICON_RED_LIGHT'.
        ELSEIF lv_seatsfree <= 50.
          ls_flight-status = 'ICON_YELLOW_LIGHT'.
        ELSE.
          ls_flight-status = 'ICON_GREEN_LIGHT'.
        ENDIF.
        MODIFY lt_flights FROM ls_flight.
      ENDLOOP.
    Hope this helps!
    Regards,
    Srilatha
    Edited by: Srilatha M on Jun 25, 2010 12:02 PM

  • How to display sub total text in ALV grid display reporting

    Hi,
    I want to display a text 'SUB TOTAL'  in Sub total  row  of an ALV report.
    Presently I am getting the name of the field used in sorting to get sub totals. But I required to display own text. Could you please give me solution.
    Thanks
    Giridhar Karnam

    For doing this u need to simply modify the layout properties, please award points if found helpful
    DATA: L_LAYOUT TYPE SLIS_LAYOUT_ALV.
    L_LAYOUT-SUBTOTALS_TEXT = 'GEN SUBTOT'.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            I_CALLBACK_PROGRAM = SY-REPID
            IS_LAYOUT          = L_LAYOUT
            IT_FIELDCAT        = IT_FIELDCAT
          TABLES
            T_OUTTAB           = IT_FINAL
          EXCEPTIONS
            PROGRAM_ERROR      = 1
            OTHERS             = 2.

  • How to display line items in a script...

    Dear All,
    My internal table for script is having 5 line items.
    But in output of script I'm getting 5 line items, 1 each in 5 different pages of script.
    But I need them one below the other in the same page...
    Plz give step by step procedure for the above requirement.
    Thanks & Regards
    Nagaraj

    Hi,
    Did u call any new-page command for every new line item?
    KIndly provide the code...
    Rgds,
    Pavan

  • ALV Graphs: How to set line type graph as default graph

    Hi All,
    I need to develop a line graph. The fields on the X-axis will change dynamically. Some times they may be 10 field and some times they may be more than 100 fields. I tried with Function Module GFW_PRES_SHOW_MULT. But I can only display maximum 32 fields. Can anyone tell me exact program which helps me to full fill my requirement. It will be a great help if you could told how do display line type graph as default graph in ALV.  In REUSE_ALV_GRID_DISPLAY there is a Exporting parameter MT_CHART_TYPES but this help you only to enter description for X-axis and Y-axis.
    Many thanks in advance.

    I would call GRAPH_MATRIX_2D with options depending on representation you wish
    look at the program GRBUSG_1 to see how to use it
    there you have some options to display bar chart, but you could use other values (complete list of options is available in documentation of function module GRAPH_MATRIX_2D - click on parameter OPTS in help display to see full explanation)
    exemple:
    P2TYPE = LN to display lines

Maybe you are looking for