"select distinct" from itab data?

Hi anyone know how to do a "select distinct" from itab data and do some calculation.
For example:
This is my itab result data:
Col1 | Col2    | Col3 | col4
123  |000010 |a      |  10.00
123  |000010 |b      |  2.00
123  |000010 |c      |  3.00
123  |000020 |a      |  10.50
123  |000020 |b      |  2.50
123  |000020 |c      |  3.50
123  |000030 |a      |  50.00
123  |000030 |b      |  6.00
123  |000030 |c      |  7.00
I need to do some calculation of a value a - (b value + c value) = x value and x value update back to value a col where the value of a, b, c must be match of col2.
ideally return 000010: x value =  5.00
                    000020: x value = 4.50
                    000030: x value = 37.00
How can I able to differential the data from cols2?
aish.

hi,
u can do this:
loop at itab.
  loop at itab into wa_itab where col2 = itab-col2.   " process all 10's, 20's
    ....do ur codition chk n calculations  here          " populate the data into new itab
  endloop.
  delete itab where col2 = itab-col2.                      " after processing delete them.
endloop.
do the calculations and populate into new internal table in the loop itself.

Similar Messages

  • Select multiple from itab kind of popup

    We have an internal table displayed through an alv. (context ND_DATA)
    The itab has a boolean field named rowactive.
    The grid has a  filter (invisible) set so that it only shows rows that are active.
    Lets say we have 20 rows, 8 of which are active (and therefore displayed).
    The user needs to be able to activate additional rows to be displayed in the grid.
    I wanted to give the user a button to push, and on its action, display an itab
    of the (12) unasserted rows for him to select(multiple) from.  On exit, this would
    set the active flag on ND_DATA for the selected rows so that they would
    appear in the grid. ( I hard coded this and the presentation through the grid works fine).
    My question is what is the best way to present for selection
    certain columns from the the values which have not been asserted .
    So, I think that I am looking for a select multiple from itab kind of popup - is there such a thing ?
    loop at context node where rowactive = false
      append context node record to itab
    endloop
    popup for multiple selection from itab
    loop at selected rows
    set ND_DATA-rowactive=abap_true
    endloop
    BTW  I want the underlying grid to remain visible during this operation
    Other ideas welcomed...
    Thanks...
    ...Mike

    Found another way using dynamic menus

  • Select distinct for a date column in present. service when creating prompt

    hi all
    I am trying to create some new prompts in my answers and I have the following problem. When I try to create a new prompt on a date column ( for example Modification Date), when I try to run this report on this prompt it is displaying the same date a lot of times ( for example 2/4/11 it is being displayed 4 times).
    Is there any way i can change this, so to display distinct dates?
    Thank you and best regards

    Hi Deva
    I am trying to use this, but in the system are being saved the date + hour.
    When i try select distinct modification date from My_view, i still have the same dates because they have different hours.
    When i try select disctinct to_date(modification_date)..... I am having an error in BI.
    Please help me to solve this issue.
    Regards

  • Select distinct from an infoset query

    Hello
    I need to select distinct / delete duplicate from an infoset query created thru SQ02.
    Please let me to know how this can be done?
    Many thanks in advance!
    regards
    Sanjyot

    Hi,
    You can verywell use infoset query if you are doing following things
    Join using Keyfields to retreive data from tables
    If not using keyfields create index for those table fields  in those fields which will improve in accessing database
    Try to use minimum of tables of small size dont try to join big tables like GLPCA and all.
    Try to load small set of data like a period or month. Dont try for a year or so.
    if your performance is good for aperiod you can go for a year.
    If you are good in function module you can try function module in which you will have the option of specifying no of records to be selected usign package size.
    Hope this helps for you.
    Thanks,
    Arun

  • Getting selected values from a data table

    My data table gets values directly from a result set.
    I went through http://balusc.blogspot.com/2006/06/using-datatables.html#top ,
    however, the data table shown in this example takes values from a simple list. I have trouble in getting selected values.
    Can anyone suggest how to select multiple values. here is a small code sample of what I have
    SessionBean
    ResultSet rs= db.retrieve_draft();
    datamodel = new ResultSetDataModel();
    datamodel.setWrappedData(rs);This is the JSF
    <h:dataTable binding="#{Engineer.dataTable1}" headerClass="list-header" id="dataTable1"
    rowClasses="list-row-even,list-row-odd" style="left: 144px; top: 192px; position: absolute"
    value="#{SessionBean1.datamodel}" var="currentRow">
    <h:column id="column1">
    <h:outputText id="outputText77" value="#{currentRow['report_number']}"/>
    <f:facet name="header">
    <h:outputText id="outputText78" value="Report Number"/>
    </f:facet>
    </h:column>Edited by: ktip on Jul 29, 2008 11:04 AM

    Here is what I was doing :
    This is my Session Bean (viz. SessionBean1)
    private CachedRowSetDataProvider draft_infoDataProvider;
        private CachedRowSetXImpl draft_RowSet;
        public CachedRowSetDataProvider getDraft_info() {
            return draft_infoDataProvider;
        public void setDraft_info(CachedRowSetDataProvider draft_info) {
            this.draft_info = draft_infoDataProvider;
        public CachedRowSetXImpl getDraft_RowSet() {
            return draft_RowSet;
        public void setDraft_row(CachedRowSetXImpl draft_row) {
            this.draft_row = draft_RowSet;
    public void get_drafts()
                Class.forName("com.mysql.jdbc.Driver");
                String url = "jdbc:mysql://localhost:3308/test";
                String dbUser = "root";
                String dbPassword = "adminadmin";
                con = DriverManager.getConnection(url, dbUser, dbPassword);
            String  sql="SELECT report_id from reports WHERE status='Draft' ";
            ResultSet rs=null;
            try
                Statement stmt1=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
                rs=stmt1.executeQuery(sql);
                draft_RowSet=new CachedRowSetXImpl();
                draft_RowSet.populate(rs);
                draft_infoDataProvider=new CachedRowSetDataProvider(draft_RowSet);
                result="ok";
            catch(SQLException e)
              System.out.println(e); 
              result="fail";
    Here is my jsp page (developed in Netbeans 6.1) showing the data table
    <webuijsf:table augmentTitle="false" binding="#{Engineer.table1}" clearSortButton="true" deselectMultipleButton="true"
                                            id="table1" selectMultipleButton="true" sortPanelToggleButton="true"
                                            style="left: 48px; top: 144px; position: absolute; width: 450px" title="Table" width="0">
             <webuijsf:tableRowGroup id="tableRowGroup1" rows="10" sourceData="#{SessionBean1.draft_infoDataProvider}" sourceVar="currentRow">
                      <webuijsf:tableColumn headerText="report_number" id="tableColumn1" sort="test_report.report_number">
                                            <webuijsf:staticText id="staticText1" text="#{currentRow.value['reports.report_id]}"/>
                        </webuijsf:tableColumn>
             </webuijsf:tableRowGroup>
       </webuijsf:table>Doing all this just resulted in a javax.Naming.Exception : Data Source is null
    I tested this piece of code to give me the number of rows in the underlying rowset and it worked well. But somehow I could not get to display the data. Am I missing something?
    Edited by: ktip on Jul 31, 2008 1:21 PM

  • Selecting records from multiple dates but specific time

    Hi:
    I've to select records of multiple dates but the time should be 00:00:00 to 06:00:00 (i.e. 12 AM - 6 AM)
    For date part this can be done:
    WHERE
    START_TIME BETWEEN TO_DATE('04-01-2012', 'MM-DD-YYYY') AND TO_DATE('04-05-2012', 'MM-DD-YYYY')
    But how can I fix the time mentioed above.
    Please let me know.
    Thanks/Tanvir

    WHERE
    START_TIME BETWEEN TO_DATE('04-01-2012', 'MM-DD-YYYY') AND TO_DATE('04-05-2012', 'MM-DD-YYYY')
    and start_time - trunc(start_time) between 0 and 6/24start_time - trunc(start_time) will give you the fraction of a day. So 6/24 means 06:00.
    (When you use to_char(trunc(sysdate,'hh'),'hh24') between 0 and 6 you will also retrieve records with start_time 06:01 for example. So this would not meet your requirements as far as I understood.)
    Edited by: hm on 10.04.2012 01:26

  • Obtain List of Field Symbols Declared and Assigning from ITAB DATA

    Hi Gurus,
    3 simple problems (apparently , appreciate responses.
    Problem 1
    How to get the list of names of <field-symbols> of type table declared in an abap program?
    Problem 2
    Create DATA "XXXX" TYPE TABLE OF ty_fcat. Where "XXX" name is obtained from an internal table with data names...Can i use the read the statement on the internal table and creat the DATA?
    Problem 3
    Matching the name of the field-symbol obtained from the abap program with a "name" stored in an ITAB. If the name matches do the following:-
      CREATE DATA 'XXXX' TYPE TABLE OF ty_fcat. (remember 'XXXX' is obtained by reading internal table.
      ASSIGN 'XXXX->* TO <ITAB> (obtained from the abap program)
    Appreciate guidance on this matter. thank you!!!! God Bless!
    Edited by: Salman Akram on Sep 27, 2010 4:03 PM
    Edited by: Rob Burbank on Sep 27, 2010 2:59 PM

    Hi Salman,
    1) Once you assign some table to your field symbol, its dynamic type will be the same as the table assigned.
    So you use the same approach as described in your last thread.
    "suppose you have a table assigned to <tab>
    "describe it by name
    lr_tabdescr ?= cl_abap_typedescr=>describe_by_data( <tab> ).
    lr_strucdescr ?= lr_tabdescr->GET_TABLE_LINE_TYPE( ).
    "and get its line type components
    it_components = lr_strucdescr->get_components( ).
    loop at it_components.
    "show all component names
      write: it_components-name.
    endloop.
    2) This statement has such form
    data lr_data type ref to data.
    CREATE DATA lr_data TYPE ...
    In here lr_data must be data reference  (no its name). TYPE can be provided dynamically in form of ('SOME_DDIC_TYPE'). So in your case this statement is not correct. You can't provide lr_data dynamically.
    So this one you will have to elaborate a bit in order we could understand what you want to achieve.
    3) Here I totally don't know what you mean. I think this relates somehow to first two points. So please tell us what is the requirement from the scratch, maybe this will shed more light on your issue.
    BTW: Please post such questions in ABAP General as this is not DDIC related issue.
    Regards
    Marcin

  • How To Hide Time Selection Box from Advance Date Filter in Powerview

    Hi Experts,
    Is there any way to hide Time Selection box appearing in Advance Filter mode for Dates in PowerView??
    Thanks and Regards,
    Mukesh Singh

    Hi Mukesh,
    We can click the Advanced Filter Mode icon on the first to the right of the field name in the Filters area to switch between basic and advanced filters modes. At this time, we can select date and time in the selection box. But there is no such feature for
    us to hide the time selection box in current release of Power View.
    As per my understanding, we can select a time that has no impact on the data in the time selection box to work around this issue.
    Thank you for your understanding.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Why do you always have to select distinct on add data aggregates?

    Seems to me if you group by all the dimensions and aggregate the measures you shouldn't have dupes?

    Firefox doesn't do email, it's strictly a web browser.
    If you are using Firefox to access your mail, you are using "web-mail". You need to seek support from your service provider or a forum for that service.
    If your problem is with Mozilla Thunderbird, see this forum for support.
    [https://support.mozillamessaging.com/en-US/home] <br />
    or this one <br />
    [http://forums.mozillazine.org/viewforum.php?f=39]

  • Select distinct records without using distinct

    hi experts,
    my retrieved data like these:
    cnt_id cnt_type rcrd_id wrkflw_id
    558848     PRODUCT     553503     248     
    558848     PRODUCT     553503     248     
    558848     PRODUCT     553503     248     
    558808     PRODUCT     553463     248     
    558808     PRODUCT     553463     248     
    558808     PRODUCT     553463     248     
    558810     PRODUCT     553463     248     
    558810     PRODUCT     553463     248     
    558810     PRODUCT     553463     248
    now i want to select one record for each cnt_id without using any distinct function .. how can i do that?
    regards,
    SKP

    you can use the below query
    select * from t where rowid in (select max(rowid)
    from t group by cnt_id)You're query is not the equivalent of DISTINCT.
    SQL> ed
    Wrote file afiedt.buf
      1  create table t as
      2            (select 558848 as cnt_id, 'PRODUCT' as cnt_type, 553503 as rcrd_id, 248 as wrkflw_id from dual union all
      3             select 558848, 'RETURN', 553503, 248 from dual union all
      4             select 558848, 'PRODUCT', 553503, 248 from dual union all
      5             select 558808, 'PRODUCT', 553463, 248 from dual union all
      6             select 558808, 'PRODUCT', 553463, 248 from dual union all
      7             select 558808, 'PRODUCT', 553463, 248 from dual union all
      8             select 558810, 'PRODUCT', 553463, 248 from dual union all
      9             select 558810, 'PRODUCT', 553463, 248 from dual union all
    10*            select 558810, 'PRODUCT', 553463, 248 from dual)
    11  /
    Table created.
    Elapsed: 00:00:00.01
    SQL> select * from t where rowid in (select max(rowid) from t group by cnt_id);
        CNT_ID CNT_TYP    RCRD_ID  WRKFLW_ID
        558810 PRODUCT     553463        248
        558808 PRODUCT     553463        248
        558848 PRODUCT     553503        248
    Elapsed: 00:00:00.00
    SQL> select distinct * from t;
        CNT_ID CNT_TYP    RCRD_ID  WRKFLW_ID
        558810 PRODUCT     553463        248
        558808 PRODUCT     553463        248
        558848 RETURN      553503        248
        558848 PRODUCT     553503        248
    Elapsed: 00:00:00.00
    SQL>

  • Ho to do a select distinct with many colums

    Hi,
    How can I do a select distinct from many colums so that I get only one result for each case.
    e.g if I want to select from employees table.
    Hire_date,salary,job_id,department_id

    This could be one of the solutions !
    SQL> SELECT * FROM DS;
    DEPTNO JOB             ID
        101 MANAGER        500
        101 ANALYST        520
        105 ANALYST        520
        101 MANAGER        501
        102 MANAGER        501
        102 PROGRAMMER     605
        102 PROGRAMMER     501
        103 CLERK          605
    8 rows selected.
    SQL> select case when row_number() over(partition by deptno order by deptno)>1
      2  then null else deptno end "DEPTNO",
      3  case when row_number() over(partition by job order by job) >1
      4  then null else job    end "JOB",
      5  case when row_number() over(partition by id  order by id )>1
      6  then null else id  end "ID" from ds;
    DEPTNO JOB             ID
        101 ANALYST        520
            MANAGER        500
                           501
        102
                           605
            PROGRAMMER
        103 CLERK
        105
    8 rows selected.

  • Data from itab to be store in text file in desktop

    hi
    i am tyring to store the data from itab into a text file in desktop,but its now owrking.
    i am using open dataset statment,but no where data is storing.My code:
    TYPES : BEGIN OF ST_DEMO,
    REG_NO(10) TYPE C,
    NAME(20)   TYPE C,
    ADDR(20)   TYPE C,
    END OF ST_DEMO.
    DATA : WA_DEMO TYPE ST_DEMO,
    IT_DEMO TYPE TABLE OF ST_DEMO,
    L_FNAME TYPE dxfile-filename .
    PARAMETERS: P_FNAME(128) TYPE C DEFAULT '\usr\sap\put\vipin.txt' OBLIGATORY.
    L_FNAME = P_FNAME.
    WA_DEMO-REG_NO = '100001'.
    WA_DEMO-NAME = 'ANAND'.
    WA_DEMO-ADDR = 'NAGARKOVIL'.
    APPEND WA_DEMO TO IT_DEMO.
    OPEN DATASET L_FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    WRITE :5 'REG NUM',16 'NAME',37 'ADDRESS' .
    LOOP AT IT_DEMO INTO WA_DEMO.
      IF SY-SUBRC = 0.
        TRANSFER WA_DEMO TO L_FNAME.
        WRITE :/5 WA_DEMO-REG_NO,16 WA_DEMO-NAME,37 WA_DEMO-ADDR.
      ENDIF.
    ENDLOOP.
    close DATASET L_FNAME.
    please tell me where is the prob?I wan to schedule it for background job.
    regds
    vipin

    hi
    here is the code for :  "data from itab to be store in text file in desktop"
    TABLES: vbak.    " standard table
    *                           Type Pools                                 *
    TYPE-POOLS: slis.
    *                     Global Structure Definitions                     *
    *-- Structure to hold data from table CE1MCK2
    TYPES: BEGIN OF tp_itab1,
           vbeln LIKE vbap-vbeln,
           posnr LIKE vbap-posnr,
           werks LIKE vbap-werks,
           lgort LIKE vbap-lgort,
           END OF tp_itab1.
    *-- Data Declaration
    DATA: t_itab1 TYPE TABLE OF tp_itab1.
    DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
    *                    Selection  Screen                                 *
    *--Sales document-block
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
    SELECTION-SCREEN END OF  BLOCK b1.
    *--Display option - block
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
    PARAMETERS: alv_list RADIOBUTTON GROUP g1,
                alv_grid RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF  BLOCK b2.
    *file download - block
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
    PARAMETERS: topc AS CHECKBOX,
                p_file TYPE rlgrap-filename.
    SELECTION-SCREEN END OF  BLOCK b3.
    *                      Initialization.                                *
    *                      At Selection Screen                            *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
        EXPORTING
          dynpfield_filename = 'P_FILE'
          dyname             = sy-cprog
          dynumb             = sy-dynnr
          filetype           = 'P'      "P-->Physical
          location           = 'P'     "P Presentation Srever
          server             = space.
    AT SELECTION-SCREEN ON s_vbeln.
      PERFORM vbeln_validate.
    *                           Start Of Selection                         *
    START-OF-SELECTION.
    *-- Fetching all the required data into the internal table
      PERFORM select_data.
    *                           End Of Selection                           *
    END-OF-SELECTION.
      IF t_itab1[] IS NOT INITIAL.
        IF topc IS NOT INITIAL.
          PERFORM download.
          MESSAGE 'Data Download Completed' TYPE 'S'.
        ENDIF.
        PERFORM display.
      ELSE.
        MESSAGE 'No Records Found' TYPE 'I'.
      ENDIF.
    *                           Top Of Page Event                          *
    TOP-OF-PAGE.
    *& Form           :      select_data
    * Description     : Fetching all the data into the internal tables
    *  parameters    :  none
    FORM select_data .
      SELECT vbeln
         posnr
         werks
         lgort
         INTO CORRESPONDING  FIELDS OF TABLE t_itab1
         FROM vbap
         WHERE  vbeln IN s_vbeln.
      IF sy-subrc <> 0.
        MESSAGE 'Enter The Valid Sales Document Number'(t04) TYPE 'I'.
        EXIT.
      ENDIF.
    ENDFORM.                    " select_data
    *& Form        : display
    *  decription  : to display data in given format
    * parameters   :  none
    FORM display .
      IF alv_list = 'X'.
        PERFORM build_fieldcat TABLES i_fieldcat[]
                               USING :
    *-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
       'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'    ''            1,
       'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'    ''            2,
       'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'    ''            3,
       'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'    ''            4.
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            i_callback_program       = sy-repid
    *        i_callback_pf_status_set = c_pf_status
            i_callback_user_command  = 'USER_COMMAND '
    *        it_events                = t_alv_events[]
            it_fieldcat              = i_fieldcat[]
          TABLES
            t_outtab                 = t_itab1[]
          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.
      ENDIF.
      IF alv_grid = 'X'.
        PERFORM build_fieldcat TABLES i_fieldcat[]
                                 USING :
    *-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
         'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'    ''            1,
         'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'    ''            2,
         'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'    ''            3,
         'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'    ''            4.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program       = sy-repid
    *        i_callback_pf_status_set = c_pf_status
            i_callback_user_command  = 'USER_COMMAND '
            it_fieldcat              = i_fieldcat
          TABLES
            t_outtab                 = t_itab1[]
        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.
      ENDIF.
    ENDFORM.                    " display
    *& Form        : vbeln_validate
    *  description : to validate sales document number
    * parameters   :  none
    FORM vbeln_validate .
      DATA: l_vbeln TYPE vbak-vbeln.
      SELECT SINGLE vbeln
        FROM vbak
        INTO l_vbeln
        WHERE vbeln IN s_vbeln.
      IF sy-subrc NE 0.
        MESSAGE 'ENTER THE VALID SALES DOCUMENT NO:' TYPE 'I'.
        EXIT.
      ENDIF.
    ENDFORM.                    " vbeln_validate
    *& Form       :build_fieldcat
    * Description : This routine fills field-catalogue
    *  Prameters  : none
    FORM build_fieldcat TABLES  fpt_fieldcat TYPE slis_t_fieldcat_alv
                        USING   fp_field     TYPE slis_fieldname
                                fp_table     TYPE slis_tabname
                                fp_length    TYPE dd03p-outputlen
                                fp_ref_tab   TYPE dd03p-tabname
                                fp_ref_fld   TYPE dd03p-fieldname
                                fp_seltext   TYPE dd03p-scrtext_l
                                fp_col_pos   TYPE sy-cucol.
    *-- Local data declaration
      DATA:   wl_fieldcat TYPE slis_fieldcat_alv.
    *-- Clear WorkArea
      wl_fieldcat-fieldname       = fp_field.
      wl_fieldcat-tabname         = fp_table.
      wl_fieldcat-outputlen       = fp_length.
      wl_fieldcat-ref_tabname     = fp_ref_tab.
      wl_fieldcat-ref_fieldname   = fp_ref_fld.
      wl_fieldcat-seltext_l       = fp_seltext.
      wl_fieldcat-col_pos         = fp_col_pos.
    *-- Update Field Catalog Table
      APPEND wl_fieldcat  TO  fpt_fieldcat.
    ENDFORM.                    "build_fieldcat
    *& Form        : download
    *  description : To Download The Data
    *  Parameters  :  none
    FORM download .
      DATA: l_file TYPE string.
      l_file = p_file.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = l_file
          filetype                = 'ASC'
        TABLES
          data_tab                = t_itab1
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 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.
    ENDFORM.                    " download
    hope it will help you
    regards
    rahul

  • ODI: Way to select Distinct data while doing Join of tables at Source

    HI,
    Our requirement is to do a join on multiple tables selecting distinct data from those table at source.
    But we are not able to see the Distinct Box in flow tab.
    Any thoughts to resolve our problem
    Pratik

    You can not put DISTINCT clause selectively .
    If you choose to opt for DISTINCT then Oracle will apply the distinct to all columns present in the select list .
    So at your IKM level just click the distinct check box .. run your interface and find out the query generated .
    See if your requirement is getting fullfilled or not .
    Thank,
    Sutirtha

  • Select Distinct Fields from non related table

    Hi Experts,
    I have to fetch Distinct Fields from table zdcxy along with the fields from the table zvend but there is no primary key forigen key relationship also if I wanted use join condition. I need to move fields from both the table into output file and 1 part I implemented but I am unable to do second part plz any body can help me its argent. below I pasted part of code along with two requirements.
    1.Select all data (Location - LIFNR, Descr u2013 ZPLTNAMEC, CJI_CUSTOMER u2013 CJI customer flag) from ZVEND table.
    2.Select all distinct DCs and BUs from zdcxy table.
    SELECT * FROM ZVENDPLT INTO CORRESPONDING FIELDS OF TABLE IT_VENDPLT.
    *select distinct zdc from zdcxy into corresponding fields of table it_map.
    *select distinct zbu from zdcxy into corresponding fields of table it_map.
      IF SY-SUBRC  = 0.
        LOOP AT IT_VEND.
          MOVE :  IT_VENDPLT-LIFNR              TO IT_TAB-FIELD1,
                  IT_VENDPLT-ZPLTNAMEC          TO IT_TAB-FIELD2,
                  IT_VENDPLT-CJI_CUSTOMER       TO IT_TAB-FIELD3,
           CONCATENATE :IiT_TAB-FIELD1   IT_TAB-FIELD2   IT_TAB-FIELD3   IT_TAB-FIELD4
    INTO IT_LOAD-RECORD SEPARATED BY SEPARATOR.
          TRANSFER IT_LOAD TO OUT_FILE.
    ENDLOOP.
    Can any body explain me hw to fetch DC and Bu from the table zdcxy and keep in the same loop of   it_vend.
    Second thing is that I need to give information about records into second output file hw to do that means I opened one more file and I am unable to move the record history there plz help me.
    Thanks in advance

    Plz any body can help me it's argent.
    Thanks
    Basu

  • How to select set of unique data records from internal table

    Hi
    I am looking for a command in order to select all unique data-records from an internal table without using a loop. Does anybody know a command that could do this?
    <b><u>An illustrating example:</u></b>
    <i>Example:
    Table content
    a 1
    a 2
    a 3
    b 1
    b 2
    c 1
    c 2
    c 3
    d 1</i>
    So I am looking for a command that should provide a, b, c & d for the first column or 1, 2 & 3 for the second column<b></b>

    Hi,
    SELECT DISTINCT  MATNR
                    FROM MARA
                   into table i_mara.
    Best regards,
    Prashant

Maybe you are looking for

  • How to rename iMovie events?

    How do you change the name of an iMove event in iMovie 11?  I have tried clicking (and double-clicking) on the event name, but nothing happens.  Pls note I am trying to change the event name within iMovie, not within Finder.  Thx

  • HELP! I want to center a website on a page which contains multiple div's

    Hello, I created a one page website that has multiple div tags. It is a portfolio site that has links to images. I used the hide/reveal behavior so there is no redirection to another page. I want the site to be centered on my web page. I tried using

  • [Best Practices] Which versioning strategy for the web applications?

    Hi all, An important question when starting to develop a web application is how to correctly make the releases follow-up? That involves to adopt a versioning strategy to definitely fix the version numbers which will be associated to each release. The

  • Using or expression with country Set-TransportRule -SenderADAttributeContainsWords

    I want create a Transport Rule to add a disclaimer, but I'm having difficult to use OR in SenderADAttributeContainsWords -SenderADAttributeContainsWords "CountryOrRegion:US" or "CountryOrReginon:GB" (it worked as ended and never add the disclaimer) -

  • Wwv flow Apache connection

    Hi everyone, We got this bug in the Apache log error: [Fri Oct 14 15:22:35 2011] [error] [client xx.xx.x.xxx] [ecid: xxxxxxxxxxxxx,x] mod_plsql: /devl/apex/wwv_flow.show HTTP-404 \nwwv_flow.show: SIGNATURE (parameter names) MISMATCH\nVARIABLES IN FOR