Groupby condition in output table

Hello,
I have to implement a groupby condition and remove the duplicate records from output table. I could do that in sql and my query looks like this:
select col1,col2,col3, COUNT(col3) from TARGET_TABLE group by col1, col2, col3 having count(col3) >=2
I get 99 records when i run this query in sql. I need that 99 records to go in as error table output in DI and remaining records to TARGET_TABLE.
Where can i insert the sql and get two outputs (final output) and (error table).
Appreciate your ideas.
Arun

Built-in transforms inside DS will let you achieve this. Connect the source table to a Query transform - say Query1
Inside Query1:
Map all the source columns col1,col2,col3 to target as it is. Add a column - say CNT_COL3 with datatype int.
In the mapping tab, use Count (col3). Add col1,col2 and col3 to the Group By tab of Query1
Connect a validation transform next to Query1.
Inside Validation transform:
Enable validation for CNT_COL3. Provide the condition as < 2 (Since this your the pass condition)
In the Action on Failure tab, check 'Send to Fail'
Connect the Pass path from Validation to Target table and Fail path to Error table. Values will be populated as required.
Regards,
Suneer

Similar Messages

  • How to hide columns in the output table in webdynpro based on input

    Hi Experts,
       I have 2 inputs and 1 input is optional.If both inputs are given proper table output is displayed,but if only 1 input is given a column is empty in the output table  so i want to hide this column dynamically at runtime based on my inputs.And i want to hide some empty rows also at runtime based on inputs.
    Can anyone help me out to solve this.
    Thanks in advance.
    Regards,
    Anita.

    Hi Anitha,
    What i understood from your question is,you want to control the table from your inputs.I have a one question for you what do you want to show defaultly i.e when you run the application what you want to show,either no table or table with some values.
    Any how i am giving solution in this way.
    If both inputs are given proper table output is displayed
    Write your below logic in the WDDOMODIFYVIEW )
    Here i am assuming that you already have a table element in the view.
    Get the values entered in the input fields and compare those 2 values ,if the condition is satisfied then bind the values which you want to show in the table to the context node.
    but if only 1 input is given a column is empty in the output table so i want to hide this column dynamically at runtime based on my inputs
    You are telling that you know the empty column.If so get the view element reference and use the REMOVE_COLUMN to remove the column.
    data:lr_table type ref to cl_wd_table,
           lr_column type ref to L_WD_TABLE_COLUMN.
    lr_table ?= view->get_element( 'TABLE1' ).
    CALL METHOD LR_TABLE->REMOVE_COLUMN
        EXPORTING
          ID          = 'TABLE1_color'
         INDEX      =
        RECEIVING
          THE_COLUMN = lr_column.
    i want to hide some empty rows also at runtime based on inputs.
    Removing the rows is very simple.if you know the key fields data of internal table from your input fields then do in this way.
    delete itab from wa where key1= "12" and key2="abd".
    Now bind the internal table to context node.
    LO_ND_hcm->BIND_TABLE(
          NEW_ITEMS            = it_final
          SET_INITIAL_ELEMENTS = ABAP_TRUE ).

  • Additional column for output table

    Hi,
    I have created an ABAP function wherein I am reading table to output in a table. Code as follows
    SELECT * FROM <source_table>
    INTO CORRESPONDING FIELDS OF TABLE <t_output_table>
    WHERE <conditions>
    Import tab has two import parameters.
    Export tab has none.
    Changing has none.
    Table tab has
    PARAMETER NAME as t_output_table,
    TYPING as LIKE,
    ASSOCIATED TYPE as source table
    What I want to do next is to add another field to the output which will be substring of one of the field of source table. For example if FieldA of source table has value "abcdefgh", I want to return "defgh" as additional column of the output table.
    Appreciate any help !!
    IMS

    Hi,
    You would need to create a structure that includes your extra column. Use this structure as the reference in your tables tab.
    Now when you have selected the data in the table.
    loop at the table.
    populate the new column according to your logic.
    Modify the new column.
    endloop.
    Hope this solves the problem.
    Regards,
    Anju

  • Condition dependent output not triggering

    Hi,
    We created a new PO action definition. Processing time is 4 Processing when saving document. The processing time not permitted is 00XX0 Selection report. The schedule automatically flag is checked. In the action determination section, the determination technology is set at "Determination using conditions that can be transported" and the rule type is set at "Workflow conditions". This action definition has one processing type "Smart forms print".
    A condition dependent output is configured for the action definition indicated above. This condition has the default settings from action definition checked. In the processing detail tab we have a specific printer we want to use. In the schedule condition this is what I configured:
    (  " --- Vendor medium ---
         &EC Purchase Order.Sending Medium& = PRN
      ) " --- Vendor medium ---
      and    (  " --- OA address number ---
         &EC Purchase Order.Vendor Address.Address Number& = 12642
      ) " --- OA address number ---
    We have a vendor with additional ordering addresses. I got the additional address number from table BUT020. Vendor has medium "PRN" in table BBP_SENDMEDIUM.
    When I create PO using the vendor and selecting the additional address (# 12642), the immediate output to the specified printer is not triggered. I mean the condition dependet output configured is not being triggered.
    Please, can anyone give me some tips about what I am doing wrong.
    Thanks and regards, Jose Oyon.

    Hi, If you want to work with Condition-Dependent PO Output, you have
    to set the conditions for output in Define action for Purchase order
    output. Under Action determination and Action summarization you can
    choose from different option.  Also clean-up customizing inconsistencies using transaction SPPFCADM and adjust to determination technology  "Determination Using Conditions" to retest. Check note 564826 which may be helpful.
    Best Regards
    Lauren

  • More than one join condition for 2 tables in obiee

    Hello,
    I am using obiee 11g.
    There are 2 tables tableA and tableB where the join condition is like (tableA.col1=tableB.col1) or (tableA.col1 is null and tableB.col1 is null)
    where should i do these type of joins.
    I tried putting in physcial layer->f(x) but giving error like here only columns an d opertaors are allowed.
    Thanks

    ok here it goes.
    I have a tableA with columns col1(pk),col2 and other columns
    I have tableB with columns col1(pk),col2..Only these 2 columns.
    Now distinct tableA.col2 values are put in tableB.col2. For those distinct values i have put the tableB.col1 values.
    Now tableA.col2 as well as tableB.col2 can be null beacuse there may be null values in tableA.col2.
    Now in tableB i have added one more row which has col1 as value and col2 as null.
    Now when in physical layer when i do tableA.col2=tableB.col2 i dont get the null values.
    What i want is whenever the tableA.col2 and tableB.col2 is null then take tableB.col1 for those vales.
    So when i query i do
    select * from tableA,tableB where
    ((tableA.col2=tableB.col2) or (tableA.col2 is null and tableB.col2 is null))
    What i want is when i do a join i should be able to give this OR condition in rpd thats it.
    because when i do in where clause of content tab it goes like a AND condition and not OR.
    Thanks
    Edited by: user123 on Jul 5, 2011 1:57 PM

  • How to refresh output table in alv tree?

    Hi !
    I searched,
    there is many solutions.
    FRONTEND_UPDATE,
    refresh_table_display,
    or expand_nodes..
    But I want just fresh output table.
    Look this, please.
    IF p_tree IS NOT INITIAL.
        CALL METHOD g_container2->set_focus
          EXPORTING
            control = p_tree.
        CALL METHOD p_tree->frontend_update.
      CALL METHOD p_tree->refresh_table_display
       EXCEPTIONS
          program_error = 1
          OTHERS        = 2.
    *=> this method is privated. So I can't use it.
      ENDIF.
       CHECK p_tree IS INITIAL.
    create tree object
      CREATE OBJECT p_tree
        EXPORTING
          parent              = g_container2
          node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
          no_html_header      = 'X'
          item_selection      = 'X'.
      DATA lt_fieldcat TYPE lvc_t_fcat.
      DATA ls_head TYPE treev_hhdr.
      PERFORM get_tree_head USING ls_head.
      PERFORM get_tree_fieldcat TABLES lt_fieldcat.
      CALL METHOD p_tree->set_table_for_first_display
        EXPORTING
          is_hierarchy_header = ls_head
          i_background_id     = 'ALV_BACKGROUND'
        CHANGING
          it_outtab           = gt_template
          it_fieldcatalog     = lt_fieldcat.
      PERFORM add_node USING p_tree.
      PERFORM register_tree_events USING p_tree.
      SET HANDLER lcl_event_receiver=>on_link_click FOR p_tree.
      CALL METHOD g_container2->set_focus
        EXPORTING
          control = p_tree.
    I just want refresh only output table( gt_template) without create object.
    method FRONTEND_UPDATE can't solve this problem.
    Please,
    If you know the solution about this problem,
    give me an answer.
    Thank you so much,
    From Juhee Bhang.
    Edited by: Ju-hee Bhang on Jun 2, 2009 10:48 AM

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
           i_callback_program                = sy-cprog
           i_callback_pf_status_set          = 'PF_STATUS'
           i_callback_user_command           = 'CALLBACK_USER_COMMAND' "----->is the form name in
           i_callback_top_of_page            = 'TOP_OF_PAGE'                             which we write the code
           is_layout                         = s_layout
           it_fieldcat                       = t_fieldcat
           it_sort                           = t_sort
        I_DEFAULT                         = 'X'
           i_save                            = 'A'
           is_variant                        = s_variant
          TABLES
            t_outtab                          = t_output[]
         EXCEPTIONS
           program_error                     = 1
           OTHERS                            = 2.
    FORM callback_user_command USING i_ucomm       LIKE sy-ucomm
                                     i_wa_selfield TYPE slis_selfield.
      i_wa_selfield-refresh = 'X'.
    Endform

  • Error in ALV : Field Does not exists in Output table .

    Hi All,
    In my ALV report, program get dumped and showing error when i tried to put a col named Distribution channel ion the alv.
    I have put the Distribution cannel field in the IT_FInal table , but still getting folwong errors :
    Error : Field Symbol is not been assigned.
    As Instructed i have passed            I_INTERFACE_CHECK              = 'X'.
    By this i am getting detail error that :
    Field Distribution channel does not exists in Output table & Heading for List is missing .
    But i have maintained the distribition channel in IT_Final table
    Please suggest wheather we have to define dis channel in any other place.
    Thanks in advance.
    Can any one help me regrarding this.
    Thanks in advance.

    Hello,
    You have to populate the same in the fieldcatalog as well, i think you have not maintained this field there.
    BR,
    Suhas
    PS: Also make it a point to follow-up on your previous post: [Error in ALV : Field Symbol not been assigned.|Error in ALV : Field Symbol not been assigned.]

  • How to select from multiple output tables in the SAP Data Source

    Hi,
    We're using the SAP Data Source to display SAP data in our portal from the Bapi: BAPI_INFORECORD_GETLIST. When defining the Bapi Meta Data we can select data from one of the two output tables (INFORECORD_GENERAL and INFORECORD_PURCHORG). But we want to select data from both tables (some columns we want to show are in INFORECORD_GENERAL and some are in INFORECORD_PURCHORG) .
    How can we do this ?
    With regards,
    Ramon van der Weiden

    You can query multiple TimesTen databases, but your original question was about joining tables from two databases, which is not supported.
    Using Cache Connect to Oracle to query an Oracle database is not distributed. It's still one single Oracle database you are querying. You cannot join a table in the TimesTen database with a table in the Oracle database, this is not allowed.
    If you are willing to share your business requiremens, we can take a look and see what solution might work for you. Would you like to discuss this offline?
    Susan

  • Set the records in ALV output table

    Dear Experts,
    How to set the number of records in the ALV output as 10..i.e .. When user executes WD application the output
    of the ALV output table should contains only 10 records in every page.
    Thanks in advance.

    Hi Venkat
    Use the method SET_VISIBLE_ROW_COUNT of interface IF_SALV_WD_TABLE_SETTINGS.
    the following code may help you.
    DATA: l_ref_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
      DATA : lr_table_settings TYPE REF TO if_salv_wd_table_settings.
      l_ref_cmp_usage =   wd_This->wd_CpUse_Appr( ).
      if l_ref_cmp_usage->has_active_component( ) is initial.
        l_ref_cmp_usage->create_component( ).
      endif.
      l_ref_INTERFACECONTROLLER =   wd_This->wd_CpIfc_Appr( ).
      data:
        l_VALUE type ref to Cl_Salv_Wd_Config_Table.
      l_VALUE = l_ref_INTERFACECONTROLLER->Get_Model(
    lr_table_settings = l_value.
    lr_table_settings->set_visible_row_count( 10).
    Regards
    Naresh
    Edited by: Naresh Kumar Malik on Jun 20, 2008 11:46 AM

  • Function Module for creating condition record (XKOMV table record)

    Hi,
    I have a requirement as like below,
    In the repair order i need to sum the GRWR condition type's  conditional values for all the line items (Except deliverable line item) and then i need to create an condition type GRWR under the deliverable line item with the above calculated conditional values,
    the table XKOMV will be having details about all the line item's condition types, in this table i need to add one more new record with the condition type of GRWR and the above calculated conditional values under the deliverable line item.
    for the above logic i am using the user exit
    USEREXIT_SAVE_DOCUMENT_PREPARE
    All the above things need to be done when the user click the save button in the transaction (VA01/VA02).
    Problem here is table XKOMV contains somany fields so manually we can't create xkomv record, is there any Function module to create condition type record?
    Regards,
    Manikumar
    Edited by: Manikumar Shanmugam on Mar 8, 2008 3:53 PM

    Hi,
       You can use Function module PRICING_CHECK to check condition record. Do a where-used list on it to see how to call it.
    Regards
    Kiran Sure

  • Conversion with Conditional Text in Table

    I'm taking the first steps in converting Unstructured Frame to Structure. One document is pretty clean except for one issue: my structure breaks around conditional text in tables. (The tables have a f3ew issues oftheir own, but the conditional text seems to compound the problem) I'm not sure how this should be dealt with. The structure tags are shown in the view below.
    And here is the Structure View:
    Is this something that can be set up with a qualifier, and if so, How? Also, in the conversion map table, Is there any order dependency, as well, concerning where the Conditional Text element appears?

    Jane,
    As far as I am concerned I do not see anything unexpected. You get dotted lines in the Structure View apparently because the element <B1_Body1> seems not to be allowed in the Element <CELL>. It looks like you worked with the defaults of the Conversion Table. Have you created your own EDD and imported the Element Definitions? Is <B1_Body1> a legal element inside <CELL>?
    From my experience the Conditional Text feature works very much in parallel to the element structure. It comes from the format-based world and the structure has no means to handle text conditions. If you want to work with text conditions in the future, you would use »attribute-based condition management« as made possible through the plug-in AXCM or FrameMaker’s built-in feature »Filter by attribute«. There is no built-in method to change text conditions into certain attribute values – but it is possible to automate this move via the FDK or FrameScript or ExtendScript (from FM10).
    - Michael

  • Condition type value table ????

    I want the value of the Condition type of taxes in the Purchase Order
    When we open the PO , Click on Invoice and then on Taxes, the screen shows Condition types and there values.
    From which table i can get these values on the basis of the Purchase Order.

    Hi,
    KONV  tablefor conditions.
    EKBZ  Table .
    KONV-KSCHL for condition type.
    KONV-KWERT Condition value
    KONV-KBETR Rate Percentage.
    Reward if useful.
    Regards,
    Narasimha
    Edited by: narasimha marella on May 15, 2008 9:00 AM
    Edited by: narasimha marella on May 15, 2008 9:14 AM

  • Column width in output table cannot be changed

    Hi All,
    I have a visual composer model with an input form used to display variables to call a BW query. The query result is displayed in an output table.
    Multiple fields are displayed in the output table.
    On the layout tab of the visual composer model, I have changed the column width of the different output fields.
    After initial execution, the column widths of the different columns correspond to the settings in the layout tab. When I submit the query, example after entering the selection variables in the input screen and pressing submit, all columns widths change to 1 width. All columns now have the same width.
    We installed the latest VC version and hotpackages but this does not help.
    How can I change the column width of an output table?
    Best Regards,
    Filip

    Hi All,
    this column problem I know really good and there is a solution:
    Click on the Output-Port of your Query and then click on Configure. You will see on the right side the property "Dynamic Port". Uncheck that and you will see that the column width is like in the layout tab.
    This is only in Queries. In Function Modules you dont have to do this.
    Best Regards,
    Murat Yurtoglu

  • How to add additional field into output table for RFIDYYWT(Generic Withholding Tax Reporting)

    Hi Experts,
    How to add additional field into output table VENDORS/WH TAX TYPES AND CODES in RFIDYYWT(Generic Withholding Tax Reporting).
    I have no idea how to start with, please give some advice.
    Thanks!
    Ice

    Dear Ice,
    Use Append structure, see given link:
    https://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eb61446011d189700000e8322d00/content.htm
    Regards,
    Abbas.

  • Excel ( VB ) to ABAP RFC WEB SERVICE Call - No Errors - Blank Output Table

    Trying to get Excel talk to ABAP RFC Web Service.
    -  Excel - 2007 ( Since it is Excel 2007, I didn't had to add any Office Web Services Toolkit or any add on )
    -  ECC 6.0
    Excel (VB) not throwing any error, but is not giving any output ( expecting a table output ).
    ABAP RFC WebService with Uid Pwd Authentication.
    Activated binding for ABAP RFC via SOAMANAGER for clnt 600.
    Using WSDL of WS of Clnt 600 in Excel via VB
    Basic ABAP RFC -
    1 optional import param ( Input Param )
    1 table output  ( Tables Param )
    Basic VB Call Code  -
    Call projHoursWS.wsm_YProjHours("", arProjHours)
    To test if VB and WebService are talking to each other, when i temperorarily change the Authentication method ( uid/pwd ) of Webservice in Sicf it throws "NO MATCHING AUTH" .. So VB and ABAP WS are talking to each other.
    Debugged VB in Excel, not throwing any error , but is always returning the output table (arProjHours) Empty.
    Missing anything?

    Hi,
    Try turning on the ICF Recorder in TCode SICF (check SAP Help for usage details) to establish that the request is reaching SAP successfuly.
    You'll also be able to catch the response that's being generated by SAP this way. Then turn off the ICF recorder.
    Best Regards, Trevor

Maybe you are looking for

  • How do i get an artist's music to appear under his/her artist name if it only appears under the album name?

    I recently imported the album Hall of Fame by Big Sean into my iTunes. I have the music in my iPhone. When i go to search for Big Sean in my phone under the "artist" section, his name comes up, but the Hall of Fame album is not one of the albums list

  • WRT54G V8.2 Wireless disconnecting

    Hello, I have recently updated my firmware for my router and ever since (might be a coincidence or not) my wireless will disconnect and my router's page is also unaccessable at that point. I can still see my wireless network and when I attempt to con

  • Oracle 10g on VMS

    Guys, Need some input on can we install Oracle 10g on VMS OS. Actually we have an application running on VMS and DB is RDB. Planning for migration to Oracle. Needs to know will Oracle be supported in VMS or do we need to move the scripts too to UNIX

  • Can anyone explain Resource Related Billing process?

    I tried reading everywhere about Resource Related Billing. Trying to learn about this. Please help me in understand this. What is the document flow for this? Is it like -  Service Order(or Sales Documetn) is created.......then Delivery.....Invoice...

  • Trial version or Sneak Preview for the SAP NW 7.0 Enhancement Package 2

    Hi, Is there any trial version or Sneak Preview available for this version? Could you please share download-able link with me? Thanks in Advance, Prashant Jagdale