Merge records of one column in ALV?

Hi friends,
i am creating alv grid report(with out oops). i am calculating value for one field that value is common for all the records . so i want to display that as common value instead of displaying number of lines .
is there any possibility to merge records of one column. using it_sort i tried . but it is not coming. since it is a currency field and i need to do display in the subtotal field.
please let me know if u have the solution.
regards,
kani.
Edited by: Julius Bussche on Sep 8, 2008 7:31 AM

kani,
refwer sample code.
DATA: gt_sort TYPE slis_t_sortinfo_alv,
gs_sort TYPE slis_sortinfo_alv.
CLEAR gs_sort.
gs_sort-fieldname = 'LDDAT'.
gs_sort-spos = 1.
gs_sort-up = 'X'.
gs_sort-subtot = 'X'.
APPEND gs_sort TO gt_sort.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_user_command = 'PROCESS_USER_COMMANDS'
is_layout = w_layout
it_fieldcat = i_fieldcat[]
it_sort = gt_sort[]
i_default = 'X'
i_save = 'A'
it_events = v_events
is_print = w_print
TABLES
t_outtab = i_final1

Similar Messages

  • How to get one column of ALV table as dropdown by key.

    Hi experts,
                  How can I get one column of ALV table as dropdown and editable. If  user wants to change that column value he can just select from that dropdown and click on update button. Can I provide tool tip to that column as " Select from drop down to change the status "?
      Please Help.
    Thanks,
      Pratibha

    You just need to change the cell editor of that column in ALV.
    So first get access to the alv model object (adjusting the code below for your ALV Component Usage name - mine was ALV_ADV):
    DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
      l_ref_cmp_usage =   wd_this->wd_cpuse_alv_adv( ).
      IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
        l_ref_cmp_usage->create_component( ).
      ENDIF.
      DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
      l_salv_wd_table = wd_this->wd_cpifc_alv_adv( ).
      DATA l_table TYPE REF TO cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
    Then access the column object you want to change:
    DATA l_column TYPE REF TO cl_salv_wd_column.
      l_column = l_table->if_salv_wd_column_settings~get_column( 'REGION' ).
    Then create the cell editor for DDLB and set it as the new cell editor for this column:
    DATA ddlb TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
      create object ddlb
        exporting
          selected_key_fieldname = 'REGION'.
      ddlb->set_tooltip( `Select from drop down to change the status` ).
      l_column->set_cell_editor( ddlb ).

  • Display concatenad fields under one column in alv.

    How can I concatenate three or four fields(Taken from different tables) and can display under one column in ALV report?
    I want to display:
    final_column = production orderStatusmaterial type+maintenance status (concatenation of four fields).
    production order: caufvd-aufnr
    status: tj02t-txt04
    material type: mara-mtart
    maintenance status:mara-pstat
    I want to display only final_column in my alv output screen.
    Kindly guide.
    Thanks and regards.
    Thanks and regards.
    Message was edited by:
            cinthia nazneen

    Please  go through the below   code and  do the same   for appearing  the   four fields  of different table into  One Field catalog at   Display  by Concatenating .
    DATA  :v_tmp  type  string .
    Loop at  itab1.
    Read table  itab2  key field1 = itab1-field1 .
    Read table  itab3  key field1 = itab1-field1 .
    Read table  itab4  key field1 = itab1-field1 .
    Concatenate  itab1-field1 itab2-field1 itab3-field1 itab4-field1 into v_tmp.
      fieldcatalog-fieldname   = 'V_TMP'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endloop.
    Reward points if it is usefull .....
    Girish

  • Icon and text together in one column in alv list

    Hello Everyone,
    I want to display icon and text together in one column in ALV list.
    I am using reuse_alv_grid_display function module.
    Currently, i am able to see icon only in the column but i want to see both icon and text in one column in ALV.
    Please let me know if this scenario is possible in ALV and how.
    Thanks in advance.
    Regards, Tarun

    Hi,
    Check this code....
    REPORT  ZTEST_ALV_CHECK     MESSAGE-ID ZZ           .
    TYPE-POOLS: SLIS,icon.
    DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          L_LAYOUT TYPE SLIS_LAYOUT_ALV/
    DATA: BEGIN OF ITAB OCCURS 0,
          VBELN LIKE VBAK-VBELN,
          POSNR LIKE VBAP-POSNR,
          ICON(1),
         END OF ITAB.
    SELECT VBELN
           POSNR
           FROM VBAP
           UP TO 20 ROWS
           INTO TABLE ITAB.
    loop at itab.
    if sy-tabix = 1 or sy-tabix = 2.
    itab-icon = '1'.
    elseif sy-tabix = 10 or sy-tabix = 20.
    itab-icon = '2'.
    else.
    itab-icon = '3'.
    endif.
    modify itab index sy-tabix.
    endloop.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-SELTEXT_L = 'VBELN'.
    X_FIELDCAT-HOTSPOT = 'X'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 1.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-SELTEXT_L = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 2.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    L_LAYOUT-lights_fieldname = 'ICON'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM       = SY-REPID
        IS_LAYOUT                = L_LAYOUT
        IT_FIELDCAT              = IT_FIELDCAT
      TABLES
        T_OUTTAB                 = ITAB
      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.
    Regards
    vijay

  • Want to Count Number of records in one Column in a page

    Hi all,
    According to the requirement I am using format with multiple columns in the report page, i want to count the records in each column, according to the count i want to display one message at the end of the column like "***continue in next column ***" &
    "***continue in next page **" & "*End of Records**"
    Note: My report may contain multiple pages r will end up with only single column
    Can any one help me on this....
    Edited by: Sridhar Naljala on Mar 16, 2009 5:39 PM

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • How can I select random records from one column

    How can I random select 400 records from a column contains more than 500,000 records? And how long will it take in oracle? Thanks.

    here is one option: (just change 5 to suit your needs...)
    SQL>select * from (
      2  select object_name
      3  from all_objects
      4  order by dbms_random.random
      5  ) where rownum < 5
      6  /
    OBJECT_NAME
    UTL_SYS_COMPRESS
    GV_$LOG_HISTORY
    GV_$LOGMNR_LOGS
    WWV_FLOW_THEME_7
    SQL>/
    OBJECT_NAME
    WWV_FLOW_UPGRADE_REPORT
    WRI$_ADV_SQLT_STATISTICS_PK
    V_$DATABASE
    GV_$SERVICEMETRIC
    SQL>/
    OBJECT_NAME
    WWV_FLOW_CREATE_FLOW_API
    WRH$_SERVICE_WAIT_CLASS_BL
    EXU8SNAPL
    GV$SERVICEMETRIC_HISTORY
    SQL>                well, regarding how long will it take... it depends from lots of variables...
    Cheers,
    Andrea

  • Display two lines under one column in ALV

    Hello Friends,
    I have a situation... i need to display two or three lines under single column in ALV report.
    example:
    col1               col2           col3                col4
    AAA               10            456.78             TEST PURPOSE HBDFJEHBEJBE EBDF B EFH
                                                                 EDEHFKHEKFHEKJCFEKJFHKEJHFKEHFEFJK
                                                                 DJFHGCGD
    AAA               20            121.78             TEST PURPOSE HBDFJEHBEJBE EBDF B EFH
    BBB               10            11.78               TEST PURPOSE HBDFJEHBEJBE EBDF B EFH EJ
                                                                 EFKBEJF KEFHEKJFHEJ KFEHKE HFKEH
                                                                 MEFBHEJFB EFBEJ EFGJEGF JEGFEGEKJE KEFHK
                                                                 EFKEFEKLKL
    Anyone has idea?
    Thanks in advance
    Regards
    Raghu

    Hi,
      You can do this by doing some additional coding..
    Ex..
    **  Let's assume you are using the internal table t_output for displaying the ALV...
    **  and t_final contains the data..t_text which contains the multiple lines texts...for the
    ** column col4...
         DATA: s_output LIKE LINE OF t_output.
         DATA: v_flag      TYPE xfeld.
         LOOP AT t_final INTO s_final.
    * Clear the work areas.
            CLEAR: v_flag,
                         s_output.
    * Move all the data.
           MOVE ls_final TO s_output.
            LOOP AT t_text WHERE col1 = s_final-col1.
    * First time move all the columns to the output internal table...for the rest of the records
    * just populate the col4..
                IF v_flag IS INITIAL.                     " For the first time.
                   s_output-col4 = t_text-text.         " Move the text.
                   APPEND s_output TO t_output.
                   v_flag = 'X'.
                ELSE.
                   clear s_output.
                   s_output-col4 = t_text-text.         " Move the text.
                   APPEND s_output TO t_output.
                ENDIF.
            ENDLOOP.
    * IF there is no text found just append the output internal table with blank col4.
            IF sy-subrc <> 0.
                   APPEND s_output TO t_output.
            ENDIF.
         ENDLOOP.
    Hope the example is clear...
    Thanks
    Naren

  • Reused alv grid - Sum one column of ALV Grid

    I'd like that one column of my alv grid to be sum...
    How can i do that abap'ly speaking...
    regards

    hi,
    DATA: lr_field type ref to cl_salv_wd_field.
    *For total calculations...
    if wd_comp_controller->gref_model_efforts is not initial.
    CALL METHOD wd_comp_controller->gref_model_efforts->if_salv_wd_std_functions~set_aggregation_allowed
    EXPORTING
    value = abap_true.
    lr_field = wd_comp_controller->gref_model_efforts->if_salv_wd_field_settings~get_field( 'BILLABLE_VALUE' ). "The column name for which total needs to be done.
    lr_field->if_salv_wd_aggr~create_aggr_rule( aggregation_type =
    if_salv_wd_c_aggregation=>aggrtype_total ).
    endif.
    Refer this :
    Alv subtotal and total
    Thanx.

  • Hi Gurus! how to count number of records in any column of ALV Grid report

    Hi Guys!
    I want to know how can we count the number of records in any column selected by the user. Like for oe customer there might be 20 sale order that means for 10 customer there will be 200 Sale order. So if i select cutomer number column ti should give 10 out put and whern select sale order it should give 200 as output.
    -Anurag Jain

    Hi,
    Either you can use the hotspot_click event or double_click to show the Pop-up info of the Sales Order count or customer Count depending on the selection.
    In the hotspot_click event  method you have E_ROW_ID E_COLUMN_ID..using these you can find the Sales Ordert or customer Number.. Loop the internal table and find the Count.
    In the double_click event  method you have E_ROW E_COLUMN..using these you can find the Sales Ordert or customer Number.. Loop the internal table and find the Count.

  • How to hide one column in Alv if it doesnt contain any value

    Hi,
      In alv Grid if one coulmn doesnt conatin any value.I doesnt want to display in ALV grid.Is dat possible. Plz help.

    Hello Anu
    When you prepare your fieldcatalog check the column of the output itab for its contents, e.g.:
    " Itab GT_FCAT contains fieldcatalog.
    " Itab GT_OUTTAB contains ALV list data.
    " Condition: column "MY_COLUMN" should contain at least single value > 0
      LOOP AT gt_outtab TRANSPORTING NO FIELDS
                     WHERE ( my_column > 0 ).
        EXIT.
      ENDLOOP.
      IF ( syst-subrc NE 0 ).  " Column "MY_COLUMN" contains no value > 0, then hide column
        READ TABLE gt_fcat INTO ls_fcat
                  WITH KEY fieldname = 'MY_COLUMN'.
        IF ( syst-subrc = 0 ).
          ls_fcat-no_out = 'X'.  " not displayed, but visible in layout
          ls_fcat-tech = 'X'.     " not displayed, not available in layout
          MODIFY GT_FCAT FROM ls_fcat INDEX syst-tabix.
        ENDIF.
      ENDIF.
    Regards
      Uwe

  • Regarding displaying Trafic light on one column of ALV

    Hi
      I want to display trafic light(red or yellow) on the first column of the ALV report.Is it possible by any alv field catalog field ?

    use this demo code  - in this code the form fill_itab is related to ur requirement,see loop at itab ,in tht form..u wil find the way to use traffic lights..
    *& Report  ZGILL_ALV                                                   *
    REPORT  ZGILL_ALV    message-id rp                           .
    type-pools slis.
    tables: zgill_main,zgill_details.
    data z_fieldcat type slis_t_fieldcat_alv.
    data begin of itab occurs 0.
    DATA ICON TYPE ICON-ID.
         include structure zgill_main.
    data salary like zgill_details-salary.
    data end of itab.
    *data itab1 like table of itab with header line.
    data : WA_SORT TYPE SLIS_SORTINFO_ALV,
           IT_SORT TYPE SLIS_T_SORTINFO_ALV,
           WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
           IT_FIELDTAB TYPE SLIS_T_FIELDCAT_ALV,
           WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    PARAMETERS: p_list  radiobutton group A1,
                P_GRID  RADIOBUTTON GROUP A1.
    SELECT-OPTIONS: S_PERNR FOR ZGILL_MAIN-PERNR.
    start-of-selection.
    perform fill_itab.
    perform sort_list.
    **************Start of scenario without container******************************************
    *********Method 1***********
    perform fill_fieldcat.  " Manuallly Preparing Fiedl Catalog
    *********Method 2***********
    *perform fill_fieldcat1 changing z_fieldcat.   "Preparing field catalog with merge function
    perform display_alv.
    *****************end of scenario without container*****************************************
    *&      Form  fill_itab
          text
    -->  p1        text
    <--  p2        text
    form fill_itab .
    *select * from zgill_main up to 20 rows INTO CORRESPONDING FIELDS OF TABLE itab.
    *ITAB1[] = ITAB[].
    select apernr aname aorg adob b~salary INTO CORRESPONDING FIELDS OF TABLE itab
           from zgill_main as a join zgill_details as b on apernr = bpernr
           WHERE A~PERNR IN S_PERNR.
    LOOP AT ITAB.
    IF ITAB-PERNR < 1111.
    ITAB-ICON = '@08@'.
    ELSEIF ITAB-PERNR > 1111 AND ITAB-PERNR < 11111111.
    ITAB-ICON = '@09@'.
    ELSEIF ITAB-PERNR GE 11111111.
    ITAB-ICON = '@0A@'.
    ENDIF.
    MODIFY ITAB INDEX SY-TABIX.
    ENDLOOP.
    endform.                    " fill_itab
    *&      Form  display_alv
          text
    -->  p1        text
    <--  p2        text
    form display_alv .
    data repid like sy-repid.
    REPID = SY-REPID.
    WA_LAYOUT-ZEBRA = 'X'.
    WA_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'.
    WA_LAYOUT-SUBTOTALS_TEXT = 'SUBTOTAL'.
    WA_LAYOUT-TOTALS_TEXT = 'TOTAL'.
    IF P_GRID = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = repid
       IT_FIELDCAT                       = IT_FIELDTAB
       IT_SORT                           = IT_SORT
       IS_LAYOUT                         = WA_LAYOUT
    TABLES
        t_outtab                          = itab[]
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2.
    IF sy-subrc <> 0.
       message e016 with 'Error in Display'.
    ENDIF.
    ELSEIF P_LIST = 'X'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = repid
       IT_FIELDCAT                       = IT_FIELDTAB
       IT_SORT                           = IT_SORT
       IS_LAYOUT                         = WA_LAYOUT
    TABLES
        t_outtab                          = itab[]
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2.
    IF sy-subrc <> 0.
       message e016 with 'Error in Display'.
    ENDIF.
    ENDIF.
    endform.                    " display_alv
    *&      Form  fill_fieldcat1
          text
    -->  p1        text
    <--  p2        text
    form fill_fieldcat1  changing d_fcat type slis_t_fieldcat_alv.
    data repid like sy-repid.
    data d_fcat1 type slis_t_fieldcat_alv with header line.
    REPID = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = repid
       I_INTERNAL_TABNAME           = 'ITAB'
       I_STRUCTURE_NAME             = 'ZGILL_MAIN'
      I_CLIENT_NEVER_DISPLAY       = 'X'
      I_INCLNAME                   =
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
    CHANGING
        ct_fieldcat                  = d_fcat[]
    EXCEPTIONS
       INCONSISTENT_INTERFACE       = 1
       PROGRAM_ERROR                = 2
       OTHERS                       = 3.
    IF sy-subrc <> 0.
       message e016 with 'Error in preparing fiedl catalog'.
    ENDIF.
    loop at d_fcat into d_fcat1.
    case d_fcat1-fieldname.
    when 'NAME'.
    d_fcat1-reptext_ddic = 'Emp Name'.
    MODIFY D_FCAT FROM D_FCAT1.
    WHEN 'PERNR'.
    d_fcat1-reptext_ddic = 'Emp Num'.
    MODIFY D_FCAT FROM D_FCAT1.
    WHEN 'ORG'.
    d_fcat1-reptext_ddic = 'Org Unit'.
    MODIFY D_FCAT FROM D_FCAT1.
    endcase.
    clear d_fcat1.
    endloop.
    endform.                    " fill_fieldcat1
    *&      Form  sort_list
          text
    -->  p1        text
    <--  p2        text
    form sort_list .
    CLEAR WA_SORT.
    WA_SORT-FIELDNAME = 'DOB'.
    WA_SORT-SPOS = '1'.
    WA_SORT-UP = 'X'.
    WA_SORT-SUBTOT = 'X'.
    APPEND WA_SORT TO IT_SORT.
    CLEAR WA_SORT.
    WA_SORT-FIELDNAME = 'NAME'.
    WA_SORT-SPOS = '1'.
    WA_SORT-UP = 'X'.
    APPEND WA_SORT TO IT_SORT.
    CLEAR WA_SORT.
    endform.                    " sort_list
    *&      Form  fill_fieldcat
          text
    -->  p1        text
    <--  p2        text
    form fill_fieldcat .
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'ITAB'.
    WA_FIELDCAT-FIELDNAME = 'ICON'.
    WA_FIELDCAT-SELTEXT_L = 'TRAFFIC'.
    WA_FIELDCAT-ICON = 'X'.
    WA_FIELDCAT-ddictxt = 'l'.
    WA_FIELDCAT-COL_POS = 1.
    WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO IT_FIELDTAB.
    CLEAR WA_FIELDCAT .
    WA_FIELDCAT-TABNAME = 'ITAB'.
    WA_FIELDCAT-FIELDNAME = 'PERNR'.
    WA_FIELDCAT-SELTEXT_L = 'EMP NUMBER'.
    WA_FIELDCAT-ddictxt = 'l'.
    WA_FIELDCAT-COL_POS = 2.
    WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO IT_FIELDTAB.
    CLEAR WA_FIELDCAT .
    when 'maktx'.
    WA_FIELDCAT-TABNAME = 'ITAB'.
    WA_FIELDCAT-FIELDNAME = 'NAME'.
    WA_FIELDCAT-SELTEXT_L = 'EMP NAME'.
    WA_FIELDCAT-ddictxt = 'l'.
    WA_FIELDCAT-COL_POS = 3.
    WA_FIELDCAT-OUTPUTLEN = 15.
    APPEND WA_FIELDCAT TO IT_FIELDTAB.
    CLEAR WA_FIELDCAT .
    WA_FIELDCAT-TABNAME = 'ITAB'.
    WA_FIELDCAT-FIELDNAME = 'ORG'.
    WA_FIELDCAT-SELTEXT_L = 'ORG UNIT'.
    WA_FIELDCAT-COL_POS = 4.
    WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO IT_FIELDTAB.
    CLEAR WA_FIELDCAT .
    WA_FIELDCAT-TABNAME = 'ITAB'.
    WA_FIELDCAT-FIELDNAME = 'DOB'.
    WA_FIELDCAT-SELTEXT_L = 'BIRTH DATE'.
    WA_FIELDCAT-COL_POS = 5.
    WA_FIELDCAT-OUTPUTLEN = 12.
    APPEND WA_FIELDCAT TO IT_FIELDTAB.
    CLEAR WA_FIELDCAT .
    WA_FIELDCAT-TABNAME = 'ITAB'.
    WA_FIELDCAT-FIELDNAME = 'SALARY'.
    WA_FIELDCAT-SELTEXT_L = 'SALARY'.
    WA_FIELDCAT-COL_POS = 6.
    WA_FIELDCAT-OUTPUTLEN = 25.
    WA_FIELDCAT-do_sum = 'X'.
    APPEND WA_FIELDCAT TO IT_FIELDTAB.
    endform.                    " fill_fieldcat

  • Two header line in one column of alv grid.

    Hi Experts,
    My requirement is that I have to create an ALV report with columns having two lines of
    headings. Like a main heading called Consultants under which 5 to 10 columns of departments
    and then Contractors underwhich there would be 5 to 10 departments. Right now my report has
    the depts of contractors and consultants in one line but the headings above that I am not
    able to generate.
    Will anybody please be able to provide a sample code if this is possible.
    like,,,
               Heading 1        |  Heading 2   |     Heading3       |                   line 1     
    hed4  |  hed5  |  hed6  |                     |  hed7   |  hed8    |                  line 2

    Unfortunately the current ALV framework doesn't support multiple line headers in ALV. There are some nasty hacks available. But none of them are full-proof.
    BTW there are many posts related to similar requirements.
    BR,
    Suhas

  • Merging Two Columns in ALV

    Hi Experts,
    I have a requirement, and I need to merge the the two columns in ALV. How can I do this?
    Points will be rewarded for helpful answers.
    Thanks in advance...

    Hi Salem
    Check this sample code
    LOOP AT itab.
    CONCATENATE itab-amount itab-currency INTO itab-combined.
    MODIFY itab.
    ENDLOOP.
    You will probably need to embellish just that concat command as all fields will be treated as TYPE C.
    Then inhibit the display of the original fields ‘amount’ and ‘currency’ by setting NO_OUT=’X in the fieldcat loop (or other method).
    There may be a FM to merge/format amounts and currency but I couldn’t find one on quick search.
    The option 'USING EDIT MASK' from WRITE command is also available in ALV structure IT_FIELDCAT.
    I have only used it in write and for simple stuff, but it may have some options for you.
    Check '==conv' for output conversion routine...
    Reward all helpfull answers
    Regards
    Pavan

  • Multiple records one column separated by comma BUT!

    Gurus,
    I'm trying to write a SQL statement to insert multiple records in one column. I'm aware of the multiple String Aggregation Techniques out there BUT ...
    This works like a champ!!!
    select wm_concat(bnuinfc) as emp_id
    from bnu,agr,baz
    where bnunamc = bazbnunamc and
    agrkeyi = bazagrkeyi and
    agrkeyi = 21;
    emp_id
    70348,70111
    But I get errors if I add multiple columns and joins
    select distinct
    katinac ,
    prsvf2c ,
    prsvf18c,
    prsvf19c,
    prsvf20c,
    kvtbezc ,
    artvf9c ,
    artanrc ,
    artvf6c ,
    artbnrc ,
    dokvf3c ,
    prokeyi ,
    probezc ,
    doksnei ,
    pagpags ,
    wm_concat(bnuinfc) as emp_id,
    dokkeyi,
    dokdlad ,
    agrbezc,
    stabezc,
    prsnums,
    systimestamp
    from art,aez,pro,dok,wob,sta,kat,prs,srz,bnu,agr,baz,pag,kvt,kav
    where
    artkeyi = aezartkeyi and
    prokeyi = aezprokeyi and
    aezkavkeyi = artkavkeyi and
    aezkavkeyi = katkavkeyi and
    prokatkeyi = katkeyi and
    kavkvtkeyi = kvtkeyi and
    katkeyi = kavkatkeyi and
    prokavkeyi = katkavkeyi and
    prskavkeyi = artkavkeyi and
    dokkatkeyi = katkeyi and
    wobobjkeyi=dokkeyi and
    pagdokkeyi = dokkeyi and
    prosnei = doksnei and
    prosnli = doksnei and
    UPPER(DOKNLBC) = bnunamc and
    bazagrkeyi = agrkeyi and
    agrkeyi = 21 and
    prokatkeyi = dokkatkeyi and
    probezc <> '---Page element---' and
    wobvarkeyi=dokkavkeyi and
    stakeys=srzstakeys and
    srzrolkeyi = 70 and
    wobstakeys=stakeys and
    prsartkeyi = artkeyi;
    ORA-00937: not a single-group group function - Not really sure how this needs to be done!
    How do I get this to work with mulltiple columns and joins on the bnuinfc column??? Is there a better method?

    Hi,
    Don't use wm_concat. It's undocumented, so it could disappear in the next version of Oracle, or it could do something slightly different, which you might not notice until you've gotten wrong results for months.
    If you like wm_concat, then install and use STRAGG, which you can copy from
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2196162600402
    Stragg seems to do the same thing as wm_concat. (Since wm_concat is undocumented, we can only guess at what it actually does. We can be sure what stragg dioes, and that it will keep doing exactly the same thing if we change versions.)
    Either way, you're calling an aggregate fucntion, so everyhting in your SELECT clause has to be one of the GROUP BY expressions or an aggregate.
    You could make a really big GROUP BY clause, but if you're joining tables, it may be simpler and more efficient to compute stragg in a sub-query, which just uses one table, and then join the results to the other tables.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Simplify the question as much as possible. I'll be you could get a good example of your problem using no more than 5 columns from 2 tables. (If you used scott.emp and scott.dept to illustrate the problem, you wouldn't even have to post sample data.)
    Always say which version of Oracle you're using.

  • Display value and description of one field in alv grid

    Hi Folks,
       I want to display value and description of one field as one column in alv grid.
    for example iam having Xfield = 01,02,03.
    and 01 iam having text value as xxx,
    01 xxx
    02 yyy
    03 zzz
    Im report display the values are displaying as 01,02,03..
    but i want to display it as 01 xxx,02 yyy, 03 zzz.
    Please do needful.
    Thx.

    Hi, swetha
    You can do this with "concatenate".
    example:
    In you code check where you final internal table is getting filled up before that do this concatenate and then append it.
    data t_text type string.
    t_text = textfield
    CONCATENATE 'Xfield'
                     t_text
                      INTO wa_workarea SEPARATED BY space.
    cheers,
    Bhavana

Maybe you are looking for

  • JSP and SSO

    Hi, In the oracle database I have my own schema (let's say it is called mySchema) where I have created a package PKG_MINE. The package contains, among others a function getItems which makes queries on portal30 tables. When I execute the code of this

  • Iphoto and MobileMe - duplicate pictures, distorted...

    I posted this originally under MobileMe and have received no answers at all and it's more an iPhoto 11 issue I think..... I'm having trouble with iPhoto and my MobileMe gallery. I don't know what I'm doing wrong. I upload photos to the MobileMe galle

  • Multiplexer error - There was an error during formatting

    Hello, I'm using a brand new iMac 3.06Ghz and iDVD '08. The system software is completely fresh will all relevant updates applied. When burning to physical DVD's or to disk images, I'm frequently getting the following error message: http://skitch.com

  • My bt bill ? I feel that Im being ripped off!!!

    why is it when i phone bt with an enquiary about my last phone bill, (broadband usage package 1) i just keep getting told that i have to change my package? my last bill was £58.50,that was for december, my phone bill for calls was £0.90, or there abo

  • RSS FEED TO SIMPLY SHOW UPDATE

    i know RSS from flash has been covered loads in this forum and i've googled this as well but i can't find a solution. all i need is a simple RSS that would show that my portfolio has been updated to other people without opening my site. i don't need