Displaying data in Two line in ALV report

Hi,
I want to know how to display the data in alv in two lines for Fild name as well as for fild value
like in below case
wa_fieldcata-fieldname  = 'WRBTR'.
   wa_fieldcata-seltext_l  = 'AMOUNT IN DOCUMENT CURRENCY'.
   wa_fieldcata-outputlen  = 18.
   wa_fieldcata-DO_SUM     = 'X'.
   APPEND wa_fieldcata TO it_fieldcat.
   CLEAR wa_fieldcata.
by this on alv COLUMN headig is coming as 'AMOUNT IN DOCUMENT CURRENCY' in one linw  i want to display  'AMOUNT IN '   in first line and then 'DOCUMENT CURRENCY' below that
'AMOUNT IN
DOCUMENT CURRENCY' ***
similarly how to display value of three fidls in one column
like for a vendor   I have one column  Vandor name in that column i want to display from table LFA1, 
NAME1
NAME2
NAME3
NAME4,
in one column only how to do it.
regards,
zafar

Hi,
Ref . early reply  can u help me how to uset his in ALV code  and can u give some example for this  how to display it in two lines  as my column heading is of 60 characters 5 word i want to display it in two line in one column only  .
How to use : SLIS_EV_AFTER_LINE_OUTPUT
to get this.
or is there any other method.
regards,
  zafar

Similar Messages

  • Interactive Reports: Display data on two lines per row?

    Is it somehow possible to display a single row across two lines in an interactive report?
    Something like this:
    Row1 Field 1, Row1 Field 2, Row1 Field 3
    Row1 Field 4 (spanning across the other fields)
    Row2 Field 1, Row2 Field 2, Row2 Field 3
    Row2 Field 4 (spanning across the other fields)
    Row3 Field 1, Row3 Field 2, Row3 Field 3
    Row3 Field 4 (spanning across the other fields)
    ... etc
    For example, I have a "Remarks" column that would look better on its own line, rather than being squeezed into the same row with the other columns.
    I realize that this layout might not be possible out-of-the-box, but I was thinking that perhaps some javascript/jQuery trick could be used. Unfortunately, my jQuery-fu is not strong yet, so I'm asking for help...
    (I also know that this type of layout is possible using a classic report with a custom template, but I would prefer to use the Interactive Report if at all possible.)
    - Morten

    Hi,
    Try this to page HTML header
    <style>
    .apexir_WORKSHEET_DATA td{white-space:nowrap!important;}
    </style>At least it work with firefox 3.5 for me
    Br, Jari

  • Field description in two line in ALV report

    Hi ,
    In ALV report I  want the description for each field to be displayed in two lines . For example
    the description for field matnr is " Material No for grade A " which is displayed in one line . But i want to display it as :  Material No
                                                           for grade A
    in two lines . Is it possible . Please help me out .
    Neetesh

    Hi Neetesh,
      Its not possible to display as you like in 2 lines header for single column. But i can provide the alternative way , it won't good logically. Please try the following logic.
    Let suppose you have 10 fields F1-f10. Each field has the 2 lines header. So take 20fields in your fields catalog ie take 10 dummy fields which are equal lenght of the fields F1-f10. and for the last 10 fields(F11-F20) set the row pos as 2, set the second line header to these field(F11-F20). So you will succed to display the 2 level header for single column. But the problem here is you will get one empty row additional row for each row. Because you have taken (F11-F20) fields are dummy and don't have the data also. This solution will works only in the case of ALV List display not in Grid Display.
      But Before that tell to your customer about this problem , Because I have done the same things when my customer giving important to 2 lines header and he accepeted that also.
    If suppose you have the data in 2 lines for each column then this solution will work fine. Thats what i implemented in my ALV Report.
    Warm Regards,
    Vijay.

  • Problem in displaying Total No.of Lines in ALV report header.

    Hi guys,
    my field symbol internal table is having records in which "Compliance" field is having YES or NO values. now requirement is to display
    Total No. of Compliances which are having YES.
    lets say, internal table is having 10 lines. in which compliance field is having 6 YES and 4 No respective values .
    now i want to display header as No. of Compliances :  6
    following is my code to display Total no.of lines in internal tables.
    * total no. of records selected
       DESCRIBE TABLE <table> LINES ld_lines.
       ld_linesc = ld_lines.
       CONCATENATE text-004 ld_linesc
                         INTO t_line SEPARATED BY space.
       wa_header-typ  = 'A'.
       wa_header-info = t_line.
       APPEND wa_header TO t_header.
       CLEAR: wa_header, t_line,ld_lines, ld_linesc .
    My data is there in Field-Symbol table.
    Now i want to display No.of compliances . could anybody please help me out in this.
    Thanks in Advance.
    Regards
    satish

    HI,
    You can use another option like below,
    <Table>[] = <Table1>[]
    delete table1 where compliance = 'NO'.
    DESCRIBE TABLE <Table1> LINES ld_lines. .. follow your logic as above.
    Hope this will helps you,
    Thanks & Regards,
    Suresh M

  • How to display two lables in alv report

    Is there any chance to display two lables in alv report
    for example..
    AMOUNT
    Rs | Ps
       |
    like that this for an example.
    thanks,
    JB

    Hai Babu
    Go through the following Code
    using Classes & Methods
    try with the following Code( Just copy the code & try with in SE38 Tcode & Execute it that all)
    REPORT ZALV_SALES_HEADER_DETAIL MESSAGE-ID Z50650(MSG) .
    TABLES
    TABLES: VBAK . "SALES DOCUMENT HEADER
    DATA OBJECTS DECLARATION
    DATA: IT_VBAK TYPE STANDARD TABLE OF ZVBAK_STRUC,
    IT_VBAP TYPE STANDARD TABLE OF ZVBAP_STRUC,
    GS_LAYOUT TYPE LVC_S_LAYO,
    GS1_LAYOUT TYPE LVC_S_LAYO,
    GRID TYPE REF TO CL_GUI_ALV_GRID,
    CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
    VBAK_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
    VBAP_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
    WA_VBAK LIKE LINE OF IT_VBAK,
    WA_VBAP LIKE LINE OF IT_VBAP,
    SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
    TOP_OF_PAGE_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
    GRID_VBAP TYPE REF TO CL_GUI_ALV_GRID,
    TOP_PAGE TYPE REF TO CL_DD_DOCUMENT,
    FLAG(1).
    *"EVENT RECIEVER CLASS DEFINITION
    CLASS LCL_EVENT_RECIEVER DEFINITION DEFERRED.
    DATA: OBJ_EVENT TYPE REF TO LCL_EVENT_RECIEVER.
    SELECTION-SCREEN
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
    PARAMETERS: P_VBTYP LIKE VBAK-VBTYP DEFAULT 'C'.
    SELECTION-SCREEN: END OF BLOCK B1.
    CLASS DEFINITION AND DECLARATIONS
    CLASS LCL_EVENT_RECIEVER DEFINITION.
    PUBLIC SECTION.
    EVENTS:DOUBLE_CLICK,
    TOP_OF_PAGE.
    METHODS:HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
    IMPORTING E_ROW .
    METHODS: HANDLE_TOP_OF_PAGE FOR EVENT TOP_OF_PAGE OF CL_GUI_ALV_GRID.
    ENDCLASS. "LCL_EVENT_RECIEVER DEFINITION
    CLASS LCL_EVENT_RECIEVER IMPLEMENTATION
    CLASS LCL_EVENT_RECIEVER IMPLEMENTATION.
    METHOD: HANDLE_DOUBLE_CLICK.
    READ TABLE IT_VBAK INDEX E_ROW-INDEX INTO WA_VBAK.
    PERFORM FETCH_ITEM_DETAILS USING WA_VBAK.
    PERFORM ALV_GRID.
    ENDMETHOD. "HANDLE_DOUBLE_CLICK
    METHOD: HANDLE_TOP_OF_PAGE.
    CALL METHOD TOP_PAGE->ADD_TEXT
    EXPORTING
    TEXT = 'SALES HEADER & ITEM DETAILS'.
    CALL METHOD TOP_PAGE->DISPLAY_DOCUMENT
    EXPORTING
    PARENT = TOP_OF_PAGE_CONTAINER.
    ENDMETHOD. "HANDLER_TOP_OF_PAGE
    ENDCLASS. "LCL_EVENT_RECIEVER IMPLEMENTATION
    AT SELECTION-SCREEN
    AT SELECTION-SCREEN.
    IF S_VBELN IS NOT INITIAL.
    SELECT COUNT(*)
    FROM VBAK
    WHERE VBELN IN S_VBELN.
    IF SY-DBCNT = 0.
    MESSAGE E000 WITH 'NO TABLE ENTRIES FOUND FOR LOW KEY SPECIFIED'.
    ENDIF.
    ENDIF.
    START-OF-SELECTION.
    START-OF-SELECTION.
    PERFORM FETCH_SALES_HEADER_RECORD.
    PERFORM CREATE_CALL. "CREATION OF OBJECTS & CALLING METHODS
    END-OF-SELECTION.
    END-OF-SELECTION.
    *& Module STATUS_0100 OUTPUT
    text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'ZSTATUS'.
    SET TITLEBAR 'xxx'.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Form FETCH_SALES_HEADER_RECORD
    text
    --> p1 text
    <-- p2 text
    FORM FETCH_SALES_HEADER_RECORD .
    SELECT
    VBELN
    AUDAT
    VBTYP
    AUART
    AUGRU
    NETWR
    WAERK
    FROM VBAK
    INTO CORRESPONDING FIELDS OF TABLE IT_VBAK
    WHERE VBELN IN S_VBELN
    AND VBTYP = P_VBTYP.
    ENDFORM. " FETCH_SALES_HEADER_RECORD
    *& Form CREATE_CALL
    text
    --> p1 text
    <-- p2 text
    FORM CREATE_CALL .
    IF CUSTOM_CONTAINER IS INITIAL.
    CREATE OBJECT CUSTOM_CONTAINER
    EXPORTING
    PARENT =
    CONTAINER_NAME = 'CUSTOM_CONTAINER'
    STYLE =
    LIFETIME = lifetime_default
    REPID =
    DYNNR =
    NO_AUTODEF_PROGID_DYNNR =
    EXCEPTIONS
    CNTL_ERROR = 1
    CNTL_SYSTEM_ERROR = 2
    CREATE_ERROR = 3
    LIFETIME_ERROR = 4
    LIFETIME_DYNPRO_DYNPRO_LINK = 5
    OTHERS = 6
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CREATE OBJECT SPLITTER
    EXPORTING
    TOP = 5
    PARENT = CUSTOM_CONTAINER
    ROWS = 3
    COLUMNS = 1
    EXCEPTIONS
    CNTL_ERROR = 1
    CNTL_SYSTEM_ERROR = 2
    OTHERS = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD SPLITTER->GET_CONTAINER
    EXPORTING
    ROW = 1
    COLUMN = 1
    RECEIVING
    CONTAINER = TOP_OF_PAGE_CONTAINER.
    CALL METHOD SPLITTER->GET_CONTAINER
    EXPORTING
    ROW = 2
    COLUMN = 1
    RECEIVING
    CONTAINER = VBAK_CONTAINER.
    CALL METHOD SPLITTER->GET_CONTAINER
    EXPORTING
    ROW = 3
    COLUMN = 1
    RECEIVING
    CONTAINER = VBAP_CONTAINER.
    CREATE OBJECT GRID
    EXPORTING
    I_SHELLSTYLE = 0
    I_LIFETIME =
    I_PARENT = VBAK_CONTAINER
    I_APPL_EVENTS = space
    I_PARENTDBG =
    I_APPLOGPARENT =
    I_GRAPHICSPARENT =
    I_NAME =
    EXCEPTIONS
    ERROR_CNTL_CREATE = 1
    ERROR_CNTL_INIT = 2
    ERROR_CNTL_LINK = 3
    ERROR_DP_CREATE = 4
    OTHERS = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    GS_LAYOUT-GRID_TITLE = 'SALES HEADER DETAILS.'(100).
    CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME = 'ZVBAK_STRUC'
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    IS_LAYOUT = GS_LAYOUT
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    CHANGING
    IT_OUTTAB = IT_VBAK
    IT_FIELDCATALOG =
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR = 2
    TOO_MANY_LINES = 3
    OTHERS = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.
    CREATE OBJECT OBJ_EVENT .
    SET HANDLER OBJ_EVENT->HANDLE_DOUBLE_CLICK FOR GRID.
    SET HANDLER OBJ_EVENT->HANDLE_TOP_OF_PAGE FOR GRID.
    CREATE OBJECT TOP_PAGE
    EXPORTING
    STYLE = 'ALV_GRID'
    CALL METHOD TOP_PAGE->INITIALIZE_DOCUMENT.
    CALL METHOD GRID->LIST_PROCESSING_EVENTS
    EXPORTING
    I_EVENT_NAME = 'TOP_OF_PAGE'
    I_DYNDOC_ID = TOP_PAGE.
    CALL SCREEN 100.
    ENDFORM. " CREATE_CALL
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE USER_COMMAND_0100 INPUT.
    CASE SY-UCOMM.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Form FETCH_ITEM_DETAILS
    text
    --> p1 text
    <-- p2 text
    FORM FETCH_ITEM_DETAILS USING WA_VBAK TYPE ZVBAK_STRUC .
    SELECT
    VBELN
    POSNR
    MATNR
    MATWA
    PMATN
    CHARG
    FROM VBAP
    INTO TABLE IT_VBAP
    WHERE VBELN = WA_VBAK-VBELN.
    IF SY-SUBRC <> 0.
    MESSAGE E000 WITH 'NO RECORDS FOUND FOR SPECIFIED KEY'.
    ENDIF.
    ENDFORM. " FETCH_ITEM_DETAILS
    *& Module STATUS_0200 OUTPUT
    text
    MODULE STATUS_0200 OUTPUT.
    SET PF-STATUS 'ZSTATUS'.
    SET TITLEBAR 'xxx'.
    ENDMODULE. " STATUS_0200 OUTPUT
    *& Module USER_COMMAND_0200 INPUT
    text
    MODULE USER_COMMAND_0200 INPUT.
    CASE SY-UCOMM.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0200 INPUT
    *& Form alv_grid
    text
    --> p1 text
    <-- p2 text
    FORM ALV_GRID .
    IF FLAG = ''.
    FLAG = 'X'.
    CREATE OBJECT GRID_VBAP
    EXPORTING
    I_SHELLSTYLE = 0
    I_LIFETIME =
    I_PARENT = VBAP_CONTAINER
    I_APPL_EVENTS = space
    I_PARENTDBG =
    I_APPLOGPARENT =
    I_GRAPHICSPARENT =
    I_NAME =
    EXCEPTIONS
    ERROR_CNTL_CREATE = 1
    ERROR_CNTL_INIT = 2
    ERROR_CNTL_LINK = 3
    ERROR_DP_CREATE = 4
    others = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.
    GS1_LAYOUT-GRID_TITLE = 'SALES ITEM DETAILS.'(100).
    CALL METHOD GRID_VBAP->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME = 'ZVBAP_STRUC'
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    IS_LAYOUT = GS1_LAYOUT
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    CHANGING
    IT_OUTTAB = IT_VBAP
    IT_FIELDCATALOG =
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR = 2
    TOO_MANY_LINES = 3
    OTHERS = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " alv_grid
    Thansk & regards
    Sreenivasulu P

  • How to display the header data on different position in alv report

    hi all,
    how to display the header data on different position in alv report.
    for example ,
    customer                                                   name
      xxxx                                                         xxxx
                     vendor        name     street 
                      xxxx         xxxx      xxxxx
    pls   help me .

    hi
    as per my understanding you need to trnasfer header internal table data  to pdf..
    please check the following links for internal table to pdf..
    Convertion of Internal table data to PDF
    This link is related to ur issue
    Re: how to insert the calling of the FM: OTF to PDF
    Thanks

  • How to insert horizontal lines in alv report?

    hi,
        i have to insert horizontal lines in alv report.( RM07MLBB )
            actually my requirement is:
                               basis list = RM07MLBB.
    first secondary list = another report is called here ( RM07DOCS )
                      i want to insert horizontal lines in the first secondary list, when i execute individually RM07DOCS , i can get horizontal lines, but when i dounle click in the basic list --> in the first secondary list , i am not getting the horizontal lnes.
    functional modules used are REUSE_ALV_HIERSEQ_LIST_DISPLAY & REUSE_ALV_GRID_DISPLAY.
        here in this program,
                        is_layout = alv_layout.
    hence i tried to give     
                  alv_layout-no_hline = ' '. 
    but not effecting.
              can some one please tell me , how to insert lines in the alv report.
    thanks in advance,
    Dastagir.

    hello,
         so i cannot insert horizontal lines in the first secondary list according to my sorting condition, i.e., in a single block there should be :
           if same delivery challan number is repeating they should come in the same block,
    for the corresponding delivery challen number, if have po number, is repeating , they also should come in the same block.
                       in this way i have to seperate the blocks containing EXNUM , EBELN CONDITIONED.

  • Display Currency symbol with value in ALV Report

    Hi Experts,
    I need to display currency symbol with value in ALV Report like if currency type is dollar then $200.
    Here I am using field catalog type slis_t_fieldcat_alv and suing field merge catalog FM: 'REUSE_ALV_FIELDCATALOG_MERGE'
    I tried like this
        IF <fs_fieldcat>-fieldname = 'STPRS'.
          <fs_fieldcat>-seltext_s = 'Std Cost '.
          <fs_fieldcat>-seltext_m = 'Std Cost'.
          <fs_fieldcat>-seltext_l = 'Std Cost '
           <fs_fieldcat>-tabname = 'MBEW'.
          <fs_fieldcat>-ctabname = 'T001'.
          <fs_fieldcat>-cfieldname ='WAERS'.
          <fs_fieldcat>-datatype = 'CURR'.
        ENDIF.
    Please any one can suggest the solution for this.
    Advance Thanks.
    Regards,
    Bala Achari

    Hİ,
    Check this link.
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=24379571
    Take care.
    Çağatay

  • How to display subtotals in separate column in alv report?

    hi,
    I am displayed the subtotals  for QUantity field BDMNG in Reuse_alv_grid_display  in the same column.
    but I want to display subtotal in separate column.
    How to display subtotals in separate column in alv report?
    thanks&regards.
    samba.k

    Hi
    As far as i know you can't do this,the option you have is to create one more column (subtotal) and populate it by manual calculation at every subtotal (not alv subtotal but yours) .
    Best Regards
    Yossi

  • Different Pricing date for two line items

    Hi guru's
    How to give different pricing dates for two line items
    in a sales order
    To elaborate
    I have two line items one i need pricing date order date
    second one i need pricing date should be delivery date
    Thanks in advance
    Srinivas

    Dear Srinivas,
             While creating sales order select the item which you want to change the pricing date then go to menu>GOTO>Item -->Click on Sales A here you can able to change the pricing date as you like.
    You can change the pricing date of the item in the sales order through sales order change mode but that sales order should be open.
    I hope it will help you,
    Regards,
    Murali.

  • How to Increase Line space between two lines in ALV Grid

    hi,
    I want to increase the line space between any two lines in ALV GRID. Can anybody has solution for this issue.
    Regards,
    Madan

    Hi Madan
    It's not possible
    Regards
    Gregory

  • ALV report : to display description in two lines.

    Hi all,
    In a ALV grid display,  I want to print description(40 characters) of a field in two lines(20 characters in each).
    Please suggest me how to achive the same.
    Thanks in advance.

    make the description field of 20 char legth in your final internal table.
    while passing data to your final internal table, pass all fields along with 20chars from description to one line of final table and in the same loop add another row with all fields blank but the description with rest of the fields..
    loop at it_1 into it_s.
    is_final-desc = it_s-desc+0(20).
    apppend is_fianl to it_final.
    clear is_final.
    is_fianl-desc = it_1-desc+20(20).
    apppend is_fianl to it_final.
    clear it_s.
    endloop.

  • How To Add Two Heading in ALV Report

    Hello Guys,
    Currently I am Working on a report Contain 45 Column. Each 45 Column have there own heading like Days Target,Days Achieve..like this.
    Our Requirement is That
    1.Upper side of the First 10 Column one more heading required like Production  Details .
    2. From 11 to 20 One More Heading Called Furnace Oil. like that only.
    I ask users That is not possible in ALV but they are adhere to that requirement.
    Can it's is possible in ALV Grid To have a two Heading Column.
    Thanks in Advance.
    Regards
    Swati Namdev

    Hi swati,
    Normally the specified requirment is not possible with the ALV...
    But you can try with the tricky way... where you need to use the Hierarchical ALV.
    Here you need to specify the two fields in the header table for the specified headings, and you need to declare these two fields in the item table also.
    But in this case you will have one blank line on the report output(for the header data).
    Regards,
    Satya.

  • How to select multiple lines in ALV report

    hi gurus,
    I am working on an interactive ALV report where i have to select multiple lines from the basic list into an internal table, based on check box clicks. Using RS_SELFIELD i can select only 1 row. The coding has been done based on Call Function. Can u please suggest some way.
    Regards,
    Satyajit

    hi,
    try like this
    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    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.
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          fieldcatalog1 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.
    DATA : BEGIN OF det_tab OCCURS 0,
            ebeln LIKE ekpo-ebeln,
           END OF det_tab.
    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-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      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'.
      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_user_command  = 'USER_COMMAND'
          i_callback_pf_status_set = 'SET_STAT'
          is_layout                = gd_layout
          it_fieldcat              = fieldcatalog[]
          i_save                   = 'X'
        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'.
          IF rs_selfield-fieldname = 'EBELN'.
            READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
            SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
            CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
          ENDIF.
        WHEN 'DET'.  "button add by me
          CLEAR det_tab.
          REFRESH det_tab.
          LOOP AT it_ekko INTO wa_ekko WHERE sel = 'X'.
            MOVE-CORRESPONDING wa_ekko TO det_tab.
            APPEND det_tab.
          ENDLOOP.
          PERFORM build_cat.
          PERFORM dis_data.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  set_stat
    *       text
    *      -->RT_EXTAB   text
    FORM set_stat USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZSTAT' EXCLUDING rt_extab.
    ENDFORM.                    "set_stat
    *&      Form  build_cat
    *       text
    FORM build_cat.
      CLEAR fieldcatalog1.
      REFRESH fieldcatalog1.
      fieldcatalog1-fieldname = 'EBELN'.
      fieldcatalog1-tabname = 'DET_TAB'.
      fieldcatalog1-seltext_m = 'Order No.'.
      fieldcatalog1-outputlen = 10.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR fieldcatalog1.
    ENDFORM.                    "build_cat
    *&      Form  dis_data
    *       text
    FORM dis_data.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = 'ZTEST_DS'
          it_fieldcat        = fieldcatalog1[]
          i_save             = 'X'
        TABLES
          t_outtab           = det_tab.
    ENDFORM.                    "dis_data
    here i have copied standard gui status of ALV into my z status ZSTAT and add one button DET......
    here u can select morethan one line using control(ctrl)
    reward if usefull...

  • Logic needed to print blank line in alv report

    hi experts,
    can anyone please tell me the logic for this
    i want to logic one is
    1) in alv report contains
    a set of data contains 100 (5 datas)
    and a set of data contain 200(5 datas)
    i want to have one coloum containing serial no
    ex for 100 i want to move no '5' to one coloumn ,but it should display only ones not for all 5 records.
    same for 200 also i want to move 7 to this ,it should b displayed ones
    i used for at new command alos its not working
    2)suppose for particular date, 200 related records is not there
    it should conatin blank line,displaying 'NIL'.
    SO THE OPT FROMAT MUST BE
    MATNR            DOCNO
    100                  1000
    100                  1000
    100                    "
    100                     "
    100                    "
    200                   2000
    200                      "
    200                     "
    200                    "
    200                    "
    SUPPOSE 200 RECORD IS NOT THERE THE OPT SHLD B
    100           1000
    100            1000
    200           NIL

    Arun,
    1)
    If you are using the  function module REUSE_ALV_GRID_DISPLAY, then use the internal table it_sort with a row for the column where you want the suppression of repeated values.
    2)
    If you are using the  function module REUSE_ALV_GRID_DISPLAY, then simply ensure that your internal table t_outtab has the rows that you need containing 'NIL'.
    John

Maybe you are looking for

  • How to change apple id for app updates

    The user id that displays on my ipod is correct on the settings menu but when I try to update my apps, the apple id that displays (and wants a password) is one that I no longer use.  How can I change the apple id for this one function to my current c

  • How do I download Firefox to a disk and not the hard drive?

    My computer had virus/worm etc. Internet explorer was damaged and can't access the internet. Need to download from another computer. Want to download Firefox to a disk. How do I do this? Thank You!

  • Customize Personal Data to be read only (EP6 SP15)

    Hi, Are there an easy way to make the 'Personal Data’ (Employee Self Service) read-only without changing the Webdynpros? I was not able to find any customisation options on the IMG to do this and would like to stay away from editing the Webdynpros if

  • Flight List App - RFC_ERROR_SYSTEM_FAILURE

    Hi all, I have the following message when clicking on the 'Search' button of the Flight List WD application : 'See RFC trace file or SAP system log for more details, error key: RFC_ERROR_SYSTEM_FAILURE'. The JCO destinations work fine (metadata and a

  • Muse site won't open keeps crashing-please help

    my site wont open.  I have been working from an external because I have had to work on it on two different computers.  today when I came home and tried to open my site on my laptop this is the error message I got as Muse crashed:  Adobe Muse encounte