Query on ALV

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

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

Similar Messages

  • Adding the ABAP code to SAP Query to support Query's ALV Double click.

    Hi, Expert.
    I need to add some ABAP Code into SAP Query (or Infoset) to support the double click event on ALV cell of result of query.
    Is it possible & How to do ?
    Thank you very much.
    Best Regard
    Nattapash C.

    Hi, Gautham.
    I've put BREAK-POINT in all code section e.g. INITIALIZATION, END-OF-SELECTION..
    I found there are some section for add code that will be executed when query is processing before output data to ALV.
    What I need to know is Where I can input the code after ALV output. For support the Double Click Event on Query's ALV cell.
    Best Regard,
    Nattapash C.

  • Query in alv using oops

    Hello ......
    i have developed z table, initially there are no entries in it.
    i create a z program and create a alv display using method SET_TABLE_FOR_FIRST_DISPLAY
    then i have used method set_ready_for_input .
    i will now execute the z program..
    i will have a std toolbar on screen, there will be three icons insert, delete and append (std tool bar)
    as i have told earlier that there are no entries, so when i will press insert button it will be show empty one row in that table, it will be in  edit mode due to method set_ready_for_input ..
    now my query is suppose there are 3 col and i vl enter value in 3 columns shown in table after pressign insert button, how to get those values in internal table so that later on i can update a z table .
    Edited by: medha24 on Apr 15, 2011 11:59 AM

    thanks friends, let me more clear with u all,
    when i will execute the program, i can only see headings of alv display rather table........
    to create entries , i m pressing insert button, which comes as in-built as alv std  toolbar.....
    now when i press insert, it will show me one empty row, i vl enter some values in it.....
    how i will get those entries in my internal table......
    which method,, wht event........?

  • Query in alv report output

    Hi all,
    I am getting the output in proper format i.e,, with good font size but when i take the print out then it is showing me in small font..
    my query is that how to increase the font size....and
    i am using function module alv_hirarchy
    thanks in advance
    Regards
    Ravi

    Hai Ravi Vardhan
    Check with the following Code
    REPORT  ZALV_HIER .
    type-pools:slis.
    tables: ekko,ekpo.
    data:begin of it_ekko occurs 0,
         ebeln like ekko-ebeln,
         bukrs like ekko-bukrs,
         lifnr like ekko-lifnr,
         bedat like ekko-bedat,
         end of it_ekko.
    data: begin of it_ekpo occurs 0,
           sno like ekpo-ebeln,
           ebelp like ekpo-ebelp,
           menge like ekpo-menge,
           netwr like ekpo-netwr,
           end of it_ekpo.
    data v_repid like sy-repid.
    data it_fieldcat type slis_fieldcat_alv occurs 0 with header line.
    data  x_keyinfo type slis_keyinfo_alv.
    select-options:s_ebeln for ekko-ebeln.
      initialization.
       v_repid = sy-repid.
      s_ebeln-low = '1000'.
      s_ebeln-sign = 'I'.
      s_ebeln-option = 'EQ'.
      S_ebeln-high = '5000'.
      append s_ebeln.
    start-of-selection.
    perform get_data.
    perform get_field.
    perform get_key.
    perform key_modify.
    perform display.
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    form get_data.
    select ebeln
           bukrs
           lifnr
           bedat
          from ekko  into table it_ekko." where ebeln in s_ebeln.
    select ebeln
           ebelp
           menge
           netwr from ekpo into table it_ekpo." where ebeln in s_ebeln.
    endform.                    " get_data
    *&      Form  get_field
          text
    -->  p1        text
    <--  p2        text
    form get_field.
    call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    exporting
       i_program_name               = v_repid
       i_internal_tabname           = 'IT_EKKO'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
       i_inclname                   = v_repid
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      changing
        ct_fieldcat                  = it_fieldcat[] .
    call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    exporting
       i_program_name               = v_repid
       i_internal_tabname           = 'IT_EKPO'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
       i_inclname                   = v_repid
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      changing
        ct_fieldcat                  = it_fieldcat[]
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_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.
    endform.                    " get_field
    *&      Form  get_key
          text
    -->  p1        text
    <--  p2        text
    form get_key.
    x_keyinfo-header01 = 'EBELN'.
    x_keyinfo-item01 = 'SNO'.
    endform.                    " get_key
    *&      Form  DISPLAY
          text
    -->  p1        text
    <--  p2        text
    form display.
    *loop at it_ekko where ebeln eq '4500005016'.
    write it_ekko-ebeln.
    endloop.
    *loop at it_ekpo where sno eq '4500005016'.
    write it_ekpo-sno.
    endloop.
    *loop at it_fieldcat where key eq space .
    write : / it_fieldcat-fieldname,it_fieldcat-key.
    *endloop.
    *loop at it_ekko.
    loop at it_ekpo where sno eq it_ekko-ebeln.
       write : / it_ekpo-menge,it_ekpo-ebelp.
      endloop.
      endloop.
    call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
      exporting
      I_INTERFACE_CHECK              = ' '
       i_callback_program             = v_repid
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      IS_LAYOUT                      =
        it_fieldcat                    = it_fieldcat[]
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
        i_tabname_header               = 'IT_EKKO'
        i_tabname_item                 = 'IT_EKPO'
      I_STRUCTURE_NAME_HEADER        =
      I_STRUCTURE_NAME_ITEM          =
        is_keyinfo                     = x_keyinfo
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_BUFFER_ACTIVE                =
      I_BYPASSING_BUFFER             =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      tables
        t_outtab_header                = it_ekko
        t_outtab_item                  = it_ekpo
    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
    *&      Form  key_modify
          text
    -->  p1        text
    <--  p2        text
    form key_modify.
    loop at it_fieldcat.                 "Avoid Repitiotion of data.
      case it_fieldcat-fieldname.
       when 'SNO'.
          if it_fieldcat-tabname = 'IT_EKPO'.
           it_fieldcat-no_out = 'X'.
           it_fieldcat-key = space.
          endif.
          endcase.
    modify it_fieldcat index sy-tabix.
    endloop.
    endform.                    " key_modify
    Thanks & regards
    Sreenivasulu P

  • Hi experts 1 query regarding alv report running in background

    when i run my alv report with 40 columns in background in spool when i get output disturbed 20 lines of first row is moving to second row so when i download to excel the o/p is completely disturbed and no use for me is there any way to solve this problem.please reply

    hi ,
    this will solve your problem
    http://www.****************/Tutorials/ALV/Spool/width.htm
    Increasing the width of the spool when using ALV List
    By Aafaque Husain, YASH Technologies
    Whenever an ALV report (with more number of columns) is scheduled in background, the output will be displayed in a zigzag fashion as shown below:  
    If we try to download the output from the spool or try to view the output, then we observe that the output is not in an appropriate fashion.  
    To get the right format of output in the spool we generally increase the u201Cno. of columns fieldu201D in the Format typesu201D. Have a look at the following screenshot:   
    Sometimes even when we change this field, we get the output truncated at the end, like last few columns are not displayed. There is certain limitation for this field, so that even if increase this value again, we find no change in the output display in spool. 
    This value is effective only when we check the check box u201CNumber of columns from list display formatu201D in the SPAD transaction.
    Ø       GO to SPAD Transaction code
    Ø       In the menu Settings -> Spool System as shown belowu2026
    Ø       In the others tab check the first check box in the Output Controller block, SAVE and exit.
    Now Schedule the ALV report again by providing the output device and format, and then we get the full output in the spool as shown below: 
    Regards,
    Madhavi

  • Query Regarding ALV - Very Urgent

    Hi experts,
    I have defined a ALV grid in my program using the startdard function module as editable. Now I want the grid to be displayed in the screen with my pf-status. how can i do that?.
    Here is the sample code.
    REPORT  zadvcformsub
      NO STANDARD PAGE HEADING MESSAGE-ID zf
      LINE-SIZE 255 LINE-COUNT 66.
    INCLUDE zftsvar .
    TYPE-POOLS : slis.
    TABLES : zftsregstr, zftsintnum, zftscusttc,
             zadvcform,  konv, knvv, sscrfields.
    DATA : it_fieldcat   TYPE  slis_t_fieldcat_alv.
    DATA : w_layout    TYPE  slis_layout_alv,
           w_fieldcat  TYPE  slis_fieldcat_alv.
    DATA : BEGIN OF it_initial OCCURS 1,
            bukrs(4)      TYPE c,
            wkreg(3)      TYPE c,
            zkunag(10)    TYPE c,
            validfrom(10) TYPE c,
            validto(10)   TYPE c,
            vkorg(4)      TYPE c,
            aland(3)      TYPE c,
            zformtype(1)  TYPE c,
            frmintno(10)  TYPE c,
            uname(12)     TYPE c,
            datum(10)     TYPE c,
            uzeit(8)      TYPE c,
           END OF it_initial.
    DATA : BEGIN OF it_part OCCURS 1,
            zkunag    LIKE zadvcform-zkunag,
            frmintno  LIKE zadvcform-frmintno,
            validfrom LIKE zadvcform-validfrom,
            validto   LIKE zadvcform-validto,
           END OF it_part.
    DATA : w_sno(2)     TYPE c,
           w_cust(10)   TYPE c,
           w_cform(10)  TYPE c,
           w_from(10)   TYPE c,
           w_to(10)     TYPE c,
           w_blank1(10) TYPE c,
           w_blank2(10) TYPE c,
           w_blank3(10) TYPE c,
           w_blank4(10) TYPE c,
           w_string_len TYPE i,
           w_sel_line(255) TYPE c,
           w_indx(2) TYPE c.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF BLOCK b1  WITH FRAME TITLE text-001.
    SELECT-OPTIONS:
          s_bukrs FOR zadvcform-bukrs NO INTERVALS NO-EXTENSION OBLIGATORY,
          s_aland FOR zadvcform-aland NO INTERVALS NO-EXTENSION OBLIGATORY,
          s_wkreg FOR zadvcform-wkreg NO INTERVALS NO-EXTENSION OBLIGATORY,
          s_vkorg FOR zadvcform-vkorg NO INTERVALS NO-EXTENSION OBLIGATORY,
      s_fmtyp FOR zadvcform-zformtype NO INTERVALS NO-EXTENSION OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION.
    AT SELECTION-SCREEN.
    START-OF-SELECTION.
      w_fieldcat-fieldname = 'ZKUNAG'.
      w_fieldcat-tabname = 'IT_PART'.
      w_fieldcat-ref_fieldname = 'ZKUNAG'.
      w_fieldcat-ref_tabname = 'ZADVCFORM'.
      w_fieldcat-seltext_l = 'Customer Code'.
      w_fieldcat-ddictxt = 'L'.
      w_fieldcat-input = 'X'.
      w_fieldcat-edit  = 'X'.
      APPEND w_fieldcat TO it_fieldcat.
      w_fieldcat-fieldname = 'FRMINTNO'.
      w_fieldcat-tabname = 'IT_PART'.
      w_fieldcat-ref_fieldname = 'FRMINTNO'.
      w_fieldcat-ref_tabname = 'ZADVCFORM'.
      w_fieldcat-seltext_l = 'C Form No'.
      w_fieldcat-ddictxt = 'L'.
      w_fieldcat-input = 'X'.
      w_fieldcat-edit  = 'X'.
      APPEND w_fieldcat TO it_fieldcat.
      w_fieldcat-fieldname = 'VALIDFROM'.
      w_fieldcat-tabname = 'IT_PART'.
      w_fieldcat-ref_fieldname = 'VALIDFROM'.
      w_fieldcat-ref_tabname = 'ZADVCFORM'.
      w_fieldcat-seltext_l = 'Valid From'.
      w_fieldcat-ddictxt = 'L'.
      w_fieldcat-input = 'X'.
      w_fieldcat-edit  = 'X'.
      APPEND w_fieldcat TO it_fieldcat.
      w_fieldcat-fieldname = 'VALIDTO'.
      w_fieldcat-tabname = 'IT_PART'.
      w_fieldcat-ref_fieldname = 'VALIDTO'.
      w_fieldcat-ref_tabname = 'ZADVCFORM'.
      w_fieldcat-seltext_l = 'Valid To'.
      w_fieldcat-ddictxt = 'L'.
      w_fieldcat-input = ' '.
      w_fieldcat-edit  = ' '.
      APPEND w_fieldcat TO it_fieldcat.
      DO 15 TIMES.
        CLEAR it_part.
        APPEND it_part.
      ENDDO.
      SET PF-STATUS 'ZADVCFORM_COPY'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-cprog
         i_callback_pf_status_set = 'ZADVCFORM_COPY'
          it_fieldcat              = it_fieldcat
          i_grid_title             = 'Advanced C Form Submission'
        TABLES
          t_outtab                 = it_part[]
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE i039(zaba) WITH 'Error in ALV'.
      ENDIF.
    I am geting the editable ALV grid but how to set my gui status.
    regards,
    Arul Jothi.

    Hi,
    Here is an sample code to handle events.
    DATA: I_EVENTS TYPE SLIS_T_EVENT.
    PERFORM F4000_EVENTS_INIT CHANGING I_EVENTS.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
       IT_EVENTS                      = I_EVENTS
      TABLES
        T_OUTTAB                       = I_MARA
    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.
    FORM F4000_EVENTS_INIT USING I_EVENTS TYPE SLIS_T_EVENT.
      DATA: LINE_EVENT TYPE SLIS_ALV_EVENT.
      CLEAR LINE_EVENT.
      LINE_EVENT-NAME = 'TOP_OF_PAGE'.
      LINE_EVENT-FORM = 'F4001_TOP_OF_PAGE'.
      APPEND LINE_EVENT TO I_EVENTS.
      CLEAR LINE_EVENT.
      LINE_EVENT-NAME = 'PF_STATUS_SET'.
      LINE_EVENT-FORM = 'F4002_PF_STATUS_SET'.
      APPEND LINE_EVENT TO I_EVENTS.
      CLEAR LINE_EVENT.
      LINE_EVENT-NAME = 'USER_COMMAND'.
      LINE_EVENT-FORM = 'F4003_USER_COMMAND'.
      APPEND LINE_EVENT TO I_EVENTS.
    ENDFORM.
    FORM F4003_USER_COMMAND USING UCOMM LIKE SY-UCOMM
                                  SELFIELD TYPE SLIS_SELFIELD.
      CASE UCOMM.
        WHEN '&CHNG'.
          READ TABLE I_MARA INDEX SELFIELD-TABINDEX.
          IF I_MARA-MATNR NE SPACE.
            SET PARAMETER ID 'MAT' FIELD I_MARA-MATNR.
            CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
                  CLEAR UCOMM.
          ENDIF.
      ENDCASE.
    ENDFORM.

  • Option Export To Spreadsheet is hidden in the display of a query in ALV rep

    Hi All,
    I have a problem. After implementation of a patch the choice Export to Spreadsheet is hidden in a ALV report.
    The function Spreadsheet in menu option under the Export button now is unavailable. Do You have any experiences with this ? Thanks very much.
    Mirka

    are you sure you use FM 'REUSE_ALV_LIST_DISPLAY'.
    or what FM are you using  ? to display ALV List
    ibrahim

  • Query on ALV List Subtotal texts

    Hi,
    I am using the FM REUSE_ALV_LIST_DISPLAY and my internal table would have data categorized by for ex. two company codes 1000 and 2000.
    My requirement is for the subtotal text to display something like this during the subtotals-
    Total: 1000 <Company code text for 1000>
    instead of the existing
    <w_fieldcat-seltext_> 1000.
    I have tried changing the field seltext_l in the  fieldcat for the first field 'BUKRS', which is working. But i need the changed value of the company code (i.e. like "Total: 2000 <company code text for 2000>" at the next summation level, which i am unable to get as the fieldcat modifications do not reflect in between the ALV list.
    I have also tried changing layout-subtotals_text, but of no use.
    Any pointers/help would be useful.
    Thanks in advance,
    Daksh.

    You need activate the event for SUBTOTAL TEXT and handle the text in there. There is a sample program in BCALV which does the same, take a look at that.
    Regards,
    Ravi
    Note : Please mark all the helpful answers

  • Query regarding ALV

    Hi
      I am using ALV to print my report.
      I want to write some data above or below
        the ALV output. How to do it?
    Regards,
    Abhimanyu.L

    Hi abhimanyu,
    check this code:
    report zus_alv_demo_grid .
    tables:     ekko.
    type-pools: slis.
    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
    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.
    Data declaration for EVENT and PRINT PARAMETER.
    data: gt_events type slis_t_event,
           gd_prntparams type slis_print_alv.
    data declaration for sorting.
    data : it_sortcat   type slis_sortinfo_alv occurs 1,
           wa_sort like line of it_sortcat.
    data :  i_list_comments type slis_t_listheader.
    start-of-selection.
      perform data_retrieval.
    perform user_command.
      perform build_fieldcatalog.
      perform build_layout.
      perform build_events.
      perform build_print_params.
      perform build_sortcat.
      perform display_alv_report.
    end-of-selection.
    *TOP-OF-PAGE.
    PERFORM top-of-page.
    end-of-page.
    *&      Form  build_fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    form build_fieldcatalog.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = '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.
      fieldcatalog-do_sum = 'X'.
      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
          text
    -->  p1        text
    <--  p2        text
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    Set layout field for row attributes(i.e. color)
      gd_layout-info_fieldname =      'LINE_COLOR'.
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for
    *when double
                                            "click(press f2)*
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    endform.                    " build_layout
    *&      Form  data_retrieval
          text
    -->  p1        text
    <--  p2        text
    form data_retrieval.
      data: ld_color(1) type c.
      select ebeln ebelp statu aedat matnr menge meins netpr
    peinh from ekpo  into table it_ekko.
    *Populate field with color attributes
      loop at it_ekko into wa_ekko.
    Populate color variable with colour properties
    Char 1 = C (This is a color property)
    Char 2 = 3 (Color codes: 1 - 7)
    Char 3 = Intensified on/off ( 1 or 0 )
    Char 4 = Inverse display on/off ( 1 or 0 )
              i.e. wa_ekko-line_color = 'C410'
        ld_color = ld_color + 1.
    Only 7 colours so need to reset color value
        if ld_color = 8.
          ld_color = 1.
        endif.
        concatenate 'C' ld_color '10' into wa_ekko-line_color.
    wa_ekko-line_color = 'C410'.
        modify it_ekko from wa_ekko.
      endloop.
    endform.                    " data_retrieval
    *&      Form  display_alv_report
          text
    -->  p1        text
    <--  p2        text
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = gd_repid
                is_layout                = gd_layout
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                i_callback_user_command  = 'USER_COMMAND'
                i_callback_pf_status_set = 'SET_PF_STATUS'
                it_event                 = gt_events
                is_print                 = gd_prntparams
                it_fieldcat              = fieldcatalog[]
                it_sort                 = it_sortcat
                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  user_command
          text
    -->  p1        text
    <--  p2        text
    *&      Form  top-of-page
          text
    -->  p1        text
    <--  p2        text
    form top-of-page.
    *ALV Header declarations
      data: t_header type slis_t_listheader,
            wa_header type slis_listheader,
            t_line like wa_header-info,
            ld_lines type i,
            ld_linesc(10) type c.
    Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      concatenate  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
       sy-datum(4) into wa_header-info."todays date
      append wa_header to t_header.
      clear: wa_header.
    Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' 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.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
           it_list_commentary = t_header
           i_logo             = 'GANESH_LOGO'.
    endform.                    " top-of-page
          FORM user_command                                             *
    -->  R_UCOMM                                                       *
    -->  RS_SELFIELD                                                   *
    form user_command using r_ucomm like sy-ucomm
    rs_selfield type slis_selfield.
      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 'ULHAS'.
          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.
      endcase.
    endform.
          FORM set_pf_status                                            *
    -->  RT_EXTAB                                                      *
    form set_pf_status using rt_extab type slis_t_extab.
      set pf-status 'ZNEWSTATUS'.
    endform.
    *&      Form  build_events
          text
    -->  p1        text
    <--  p2        text
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
       exporting
         i_list_type           = 0
       importing
         et_events             = gt_events[]
    EXCEPTIONS
      LIST_TYPE_WRONG       = 1
      OTHERS                = 2
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      read table gt_events with key name =  slis_ev_end_of_page
                  into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
      read table gt_events with key name =  slis_ev_end_of_list
                  into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " build_events
    *&      Form  build_print_params
          text
    -->  p1        text
    <--  p2        text
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " build_print_params
          FORM END_OF_PAGE                                              *
    form end_of_page.
      data: listwidth type i,
      ld_pagepos(10) type c,
      ld_page(10)    type c.
      write: sy-uline(50).
      skip.  write:/40 'Page:', sy-pagno .
    endform.
          FORM END_OF_LIST                                              *
    form end_of_list.
      data: listwidth type i,
      ld_pagepos(10) type c,
      ld_page(10)    type c.
      skip.  write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  build_sortcat
          text
    -->  p1        text
    <--  p2        text
    form build_sortcat.
    wa_sort-spos      = 1.
    wa_sort-fieldname = 'EBELN'.
    append wa_sort to it_sortcat.
    wa_sort-spos      = 2.
    wa_sort-fieldname = 'EBELP'.
    append wa_sort to it_sortcat.
    endform.                    " build_sortcat
    regards,
    keerthi.

  • Query Regarding ALV : WD ABAP

    HI ,
    The 'Settings' option in ALV in WD ABAP provides an option to the user to select the number of rows as per suitability . I want to check whether these settings can be saved at the user profile level .
    I mean if the user again logs in , he will be able to see as many rows in the ALV table as he selected and saved previously . I mean , is the settings are local to the session or to the user profile . If , the settings can be saved at the user profile level , then how it is achieved .Also , if the column settings can be saved at the user profile level !!
    Best Regards
    Sid

    Hi,
    do you mean this? http://help.sap.com/saphelp_nw2004s/helpdata/en/e9/8ca7428e0d0d31e10000000a1550b0/frameset.htm
    Regards, Heidi

  • Query on ALV display

    Hi All,
    I have a following requirement:
    To display PO Header and line items in ALV.
    Now for header, there should be a check box corresponding to each header line in ALV which will enable user to select that particular line and release PO 
    Is it possible to achieve my requirement?
    Regards
    Shiva

    Specify the first column of ALV grid as
    <b>CHECKBOX  LVC_CHECKB- type  CHAR(1)  SPACE, 'X'</b>
    1. You will have to make the field editable. In the field catalog set the EDIT = 'X' for the check box field.
    2. Once the check box is checked, call the method CHECK_CHANGED_DATA of the grid in the PAI of the screen which will update the internal table. Now, you can just loop at the internal table with a where clause on the check box field.
    loop at itab where checkbox = 'x'.
    endloop.
    same thread...
    Re: Output Format for Amount in SAP Script PO
    Re: Checkbox in ALV

  • Hide columns for ALV list output in SAP Query SQ01/SQ02

    Hi All,
    I have a requirement to hide the columns which are empty in sap query SQ01 alv list output.
    Please let me know this functionality available in Query (SQ01) like normal reports
    Regards,
    Venkat

    Hi,
    We just can't make changes in this case as this are all system generated programs.
    WE have to write our own reports to make things flexible to match our requirements.
    Things you are asking is not possible.
    Regards,
    Suvendu

  • ALV query

    hi all,
    i have a small query regarding alv report.
    How to make individual cells in alv editable and noneditable??
    Regards,
    Satya.

    hi,
    please refer to the below mentioned link... it wil solve almost all your alv related queries.
    http://www.sap-partner.hu/ABAP_HELP_INFO/An%20Easy%20Reference%20for%20ALV%20Grid%20Control.pdf
    <removed_by_moderator>
    preet
    Edited by: Julius Bussche on Aug 26, 2008 11:55 AM

  • ALV Problem

    Moderator message: please use a more meaningful subject in future
    Hi Experts,
    I have one query in ALV report. In ALV output I am not able to see the option for SUM & subtotal icons are not displayed.
    I wanted to display both icons in my ALV output. Any suggestion how I can achieve this requirment.
    Also, icons for Microsoft excel & word processing is not working.
    Please suggest me.
    Regards,
    Poonam
    Edited by: Matt on Dec 19, 2008 6:55 AM

    hi,
    You need to create 'Layout' for displaying the Tool bar.
    If you are Creating ALV using OOPS method , then declare a work area like this,
    Data : ty_lay1 TYPE lvc_s_layo.
    ty_lay1-no_toolbar = ''.
    Then pass this work area to method 'set_table_for_first_display'
    CALL METHOD cl_alv->set_table_for_first_display
        EXPORTING
          is_layout       = ty_lay1
        CHANGING
          it_outtab       = t_output[]
          it_fieldcatalog = t_fieldcat.
    However If you are using FM REUSE_ALV_LIST_DISPLAY or FM REUSE_ALV_GRID_DISPLAY
    then you have to declare above work area like this,
    Data : ty_lay1 TYPE SLIS_LAYOUT_ALV.
    ty_lay1-no_toolbar = ''.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          is_layout       = ty_lay1
        CHANGING
          it_outtab       = t_output[] " Internal table which holds data
          it_fieldcatalog = t_fieldcat. " Field catlog

  • Help needed regarding ALV report

    Hi,
    I have a query regarding ALV report.
    The requirement is as follows:-
    When the user executes the ALV report and if he sums one numeric field column values and filters out some of the field columns ( for example there r 5 columns in the report and the user has filtered out 2 of them and viewing only 3 columns)
    and now the requirements is that when the user runs the report later he should see the modified report ( i mean only 3 cloumns and the total value of the column which he has made) but not the original output which was there when the report was developed.
    First of all i wanna know is it possible to do r not. If yes then how
    Hope u have got what i want.
    eagerly waiting for ur reply.
    regards,
    maqsood

    Hi
    Yes you can! You have to manage the layout variant.
    So when you call your ALV you have to set the parameter I_SAVE = 'A'.
    In this way you'll allow the user to save the variants for layout.
    After you has to have a chance to choose the variant in selection-screen.
    See the demo program BCALV_GRID_11 to manage the variant in selection-screen.
    Max

Maybe you are looking for

  • I installed iTunes on new laptop and it will not allow me to put songs to my phone

    I installed iTunes on new laptop and it will not allow me to put songs to my phone

  • Spot colors not showing correctly in acrobat 11

    Spot colors not showing correctly in the output preview as well as the page correctly. I have a spot pms 295 on a page in a few different areas of text and backgrounds. The spot color shows on 1 of my backgrounds and text and a spot color on another

  • Modify existing SAP Query / Quickview

    Hello, Greetings! We have a requirement to modify an existing SAP Query. This query was created much earlier by a user who is no longer present. We have the query name, user group, and the program for the query. This query, we assume was created usin

  • Po from qutotation to order

    In our business case , we will input po num in quotation. Now while referencing this qutatoion in order we need this po num also to be copied. we maintained copy controls also for this quotation to order but still we are not getting po number from qu

  • Opening two workbooks from Menu gives error

    When ever i try to open a workbook from the Menu while another workbook is opened already. I get an Business Explorer error saying "<internal error> Calling in to BW server failed" I click on OK and then open it second time opens the workbook. BW 3.5