Query for listing several values in same field

Hi,
is there a function for listing more than one value in the same field, only with comma seperation?
For example, I want to group by cardcode from ORDR and list all docnum's like this:
Cardcode    Docnum's
21355          98765, 95498, 95164
21564          95484, 54684, 95654, 98465
21865          95484, 12486
Kind regards
Kjetil Sandvik

HI,
Thank for your replies.
We need to update all old orders for sure, but my idea was to use this query:
Select CardCode, COUNT(Address2) From ORDR Where Docstatus <> 'C' GROUP BY address2, cardcode order by cardcode, address2
The results will give me two lines for each customer and count the addresses, so then I know that the count of one of the lines must me changed. Let's say there is 20 orders with new address and 20 orders with old address, my intention was to manually change the 20 orders that is old. Instead of checking all 40, It would help alot to list all order numbers in a column beside in the query.
BR
Kjetil

Similar Messages

  • How to query for a NULL value?

    Hi all,
    how can I query for a NULL value in a ViewObject. I tried to set null as where-clause param [setWhereClauseParam(0, null)]. But the created statement looks like this:
    SELECT ...
    FROM ...
    WHERE param = null
    I would expect it to create something like WHERE param IS NULL. I hope anybody has a solution for this.
    Thanks,
    Axel

    I think you should use setWhereClause("COL_NAME IS NULL")
    You could use setWhereClauseParam(0, "NULL"), but only if you have a predefined query similar to: "SELECT X, Y, Z FROM A WHERE X IS :0" (which is a pretty useless query, as you can ONLY set "NULL" as the value for ":0").

  • How to give two values of same field in read Statment

    Hi,
    Please Tell me how to give the two values of same field in read statements Condition.
    i.e
      Read table it_tab with key matnr = '1' or matnr = '2'.
    With Regards
    Kesavaperumal

    Hi Kesavaperumal,
    <li>You can not use OR operator with READ TABLE statement.
    <li>You have to use different fields of the internal table in where condition.
    <li>If you want to compare with two values, you need to use LOOP statement.
    LOOP AT it_mara WHERE matnr = '1' or matnr = '2'.
    "Write code
    ENDLOOP.
    Thanks
    Venkat.O

  • Query returns list of objects with all fields = NULL

    Hi there,
    I must be doing something wrong. I have tried to query for all activities and all contacts using the code pattern shown below (for activities):
    Activity_ServiceLocator serviceLocator = new Activity_ServiceLocator();
    serviceLocator.setActivityEndpointAddress(config.get(CONFIG_KEY_URL) + ";jsessionid=" + sessionId);
    ActivityQuery aq = new ActivityQuery();
    ListOfActivityQuery laq = new ListOfActivityQuery();
    laq.setActivity(aq);
    ActivityQueryPage_Input aqpi = new ActivityQueryPage_Input();
    aqpi.setListOfActivity(laq);
    laq.setPagesize(new BigInteger("100"));
    laq.setStartrownum(new BigInteger("0"));
    ActivityQueryPage_Output aqpo = serviceLocator.getActivity().activityQueryPage(aqpi);
    When I do getListOfActivity() from the ActivityQueryPage object, I get a non-empty list, however, when I loop over the list, it seems that all fields in all the objects are NULL. This, even though I have checked in the system that the activities (appointments) all contain fields with data.
    As mentioned, when I try to query for all contacts using the exact same code pattern, I also get a non-empty list of (contact) objects with non-empty fields .. So, I guess I'm doing a simple mistake (since I have hundreds of contacts in my CRM system), but which?
    Thx in advance

    Okay, I partly found the answer myself. It appears that one has to explicitly set a (empty) query type for the fields that one wants returned from the query .. At least this appears to return the field value of the returned objects .. But is this really the correct way of doing it?
    A few related questions;
    1) What is the purpose of the UseChildAnd? I cannot read this from the documentation!
    2) Is there any more documentation than the Oracle CRM On Demand Release 16? I would like to have some more documentation on
    a) how to make a cross table query, e.g. across activities and contacts (for instance, give me all contact who have an appointment tomorrow), and
    b) how to use the QueryType.
    Any references to something that can enlighten me? :-)

  • Querying for custom picklist values

    Hello all,
    I have created a new field on my opportunity type called "Industry" and gave it picklist values. However, the system is not allowing me to query for the values using the Picklist web service. Am I missing a step here, or does the system not allow querying for custom picklist field values? I can get to certain lists of picklist values for Opportunity (Type, Probability, some others) but not the picklist I created. Am I doing something wrong?
    Thanks!
    -Kevin Green

    Hi,
    Find integration tag for custom field in Field Setup. When you call getPicklist method, pass three values like Object type(ex: Lead), integratin tag for the custom field, "" ( this is language, this field is no need for English languague)
    Hope this willl work
    Raja Kumar Malla
    [email protected]

  • Using Broadcaster to run a query for sequential Variable Values

    Hi SDN Community
    I came across a powerpoint slide regarding broadcasting which i hope to use in one of our reports.
    We are on SAP BW 35.
    Broadcaster has been used
    Your opinion would be greatly valued in regards to the direction i should proceed for our particular purpose.
    We basically have a report which is a web report.  This contains much html and javascript enhancements.
    But it essentially has queries with a series of variables.
    The customer would like the Queries to be cached for each variable value for performance reasons, on a daily basis.
    eg. Run the same query for Variable value BMABRM, then BMASRM, etc...
    In a loop fashion.
    Do not need to set a process chain to trigger broadcaster, or rather simply to schedule the broadcaster to run daily.
    I would basically then want to run this (cache) query in an iterative fashion, ie. rerun it for all the sites.
    Can you please make a recommendation to which is the best approach, whether a process chain should be set up, and any experience you may have had setting up a query to rerun for different variable values.  We would of course want the query to run successfully before rerunning it for the next variable to avoid locks, etc.
    Thank you in advance.
    Simon

    Hi Rahul,
    i have been trying to use the process chain functionality to do this but unsure how to do it.
    Which objects do you use in the process chain:
    Trigger Event Data Change (for Broadcaster)
    or Execute APD Model
    or Precalculation of Web Templates
    i am unsure how to incorporate the queries into the process chain.
    If you have any steps , it would be much appreciated.
    Thank you.
    Simon

  • Query for SP to make a udf field mandatory

    Hi,
    I got a UDF with name (Received By) in Header of GRPO document if the user does not fill the field the document should not be added. I know this is possible by SP but can any one give me the query for it. I searched i got certain query but i dont Know how to use it Or modify it for my case. Pls help me!
    Thanks,
    Gopal

    ALTER proc [dbo].[SBO_SP_TransactionNotification]
    @object_type nvarchar(25),                     
    @transaction_type nchar(1),               
    @num_of_cols_in_key int,
    @list_of_key_cols_tab_del nvarchar(255),
    @list_of_cols_val_tab_del nvarchar(255)
    AS
    begin
    -- Return values
    declare @error  int                    
    declare @error_message nvarchar (200)           
    select @error = 0
    select @error_message = N'Ok'
    IF @transaction_type = 'A' AND @object_type = '13'
    BEGIN
    if exists (Select T0.cardcode from oinv T0 where T0.UDFName is null and T0.DocEntry=@list_of_cols_val_tab_del)
         begin
              SET @error = 10
              SET @error_message = N'UDF is Null'
         end
    END
    select @error, @error_message
    end
    I have written the above code for AR Invoice Screen.
    Replace 'T0.UDFName' in the Select Statement to your UDF Name

  • Display of calculated field value in same field using form personalization.

    Hi All,
    What could be the solution, if i want to have the formula on same display field.
    say..your entering value in grams and convert into ml in the same field of (:Q_RES.DISPLAY5)
    Conversion formula:
    (TO_CHAR(TO_NUMBER(:Q_RES_DISPLAY5)-(0.35))/((1.025)*(0.9986))/3)
    When I move out of THIS field, it should convert using above formula and store it in same field.
    Appreciate your efforts.
    Thanks a lot...

    What could be the solution, if i want to have the formula on same display field.
    say..your entering value in grams and convert into ml in the same field of (:Q_RES.DISPLAY5)
    Conversion formula:
    (TO_CHAR(TO_NUMBER(:Q_RES_DISPLAY5)-(0.35))/((1.025)*(0.9986))/3)
    When I move out of THIS field, it should convert using above formula and store it in same field.
    Appreciate your efforts.

  • Column selector for list of values

    Hi,
    is it possible to use column selector to select list of values of a certain column? I mean similar to dashboard prompts? We may have a situation that the environment we use does not allow us to use dashboard prompts in certain cases. If not, is there a way to separate lov's from each other in pivot tables? Now if we select two columns, lov will look like column1-column2 with all possible combinations and we don't want that.
    BR,
    Mari

    Use a pivot table view to achieve this requirement.
    open pivot view properties-->place the required column in the pages--->try the result
    It will work like a prompt in the report.
    mark if helpful/correct..
    thanks,
    prassu

  • Refresh a query driven list based on a search field

    I have a text field in a control block that I am using as a search criteria.
    I have another list whose source query is based on the previously mentioned text field's value.
    As I am typing in the text field, I want the list to update based on what I have typed.
    For example, as I type ORACLE, the list would show all O records, then OR records, then ORA records, then ORAC records, and so on and so on.
    I have been unable to find when/where the trigger exists that will allow me to do this.
    Can anyone help?

    Hello nameless,
    first: do not use timers, because they have a negative influence on the performance.
    use a pre-query trigger in which you check the value of your text field. In this trigger you can set the block property WHERE of the block to be queried like: "column_name LIKE '%'||:block_name.item_name||'%'
    with this all records containing the text in your text item will be shown. You could also add a radio button with three values: Starts with, Contains, Ends with. When you implement the functionality like this, the USER controls what happens and not the programme.
    greetz,
    Hans

  • Adding  values in same field inside loop

    Dear Experts,
    suppose in my o/p i am displaying material number and its value:
    material No:      Qty
    matnr                1000
    matnr                2000
    matnr                3000
    matnr                4000
    matnr                5000
    Now I want my third field  ( SUM ) such that the value displayed should
    get added to the next value displayed, till the loop ends for each particular material.
    material No:     Qty           Sum
    matnr               1000        1000     " (1000)
    matnr               2000        3000     " (1000 + 2000)
    matnr               3000        6000     " (1000 + 2000 + 3000)
    matnr               4000      10000     " (1000 + 2000 + 3000 + 6000)
    matnr               5000      15000     " (1000 + 2000 + 3000 + 6000 + 10000)
    Actually my requirement is :
    First I need to get  material and Quantity from MSEG table 
    then I need to compare this material and quantity in MBEW table  to get the total stock
    particular material.
    so my condition is like :
    if i_mseg~sum GE mbew-lbkum.
      delete i_mseg.
    endif.
    Please advice.

    Hi Karthik ,
    Pls try this.
    REPORT  ztest.
    TYPES: BEGIN OF ty_mseg,
           matnr TYPE mseg-matnr,
           menge TYPE mseg-menge,
           sum TYPE mseg-menge,
           END OF ty_mseg.
    TYPES : BEGIN OF ty_mbew,
            matnr TYPE mseg-matnr,
            lbkum TYPE mbew-lbkum,
            END OF ty_mbew.
    DATA : it_mseg TYPE TABLE OF ty_mseg,
           wa_mseg TYPE ty_mseg,
           it_mbew TYPE TABLE OF ty_mbew,
           wa_mbew TYPE ty_mbew.
    DATA : sum TYPE mseg-menge.
    START-OF-SELECTION.
      wa_mseg-matnr = '1111'.
      wa_mseg-menge = '1000'.
      APPEND wa_mseg TO it_mseg.
      wa_mseg-matnr = '1112'.
      wa_mseg-menge = '1000'.
      APPEND wa_mseg TO it_mseg.
      wa_mseg-matnr = '1113'.
      wa_mseg-menge = '1000'.
      APPEND wa_mseg TO it_mseg.
      SELECT matnr lbkum
                FROM  mbew INTO TABLE it_mbew
                    FOR ALL ENTRIES IN it_mseg
        WHERE matnr = it_mseg-matnr.
      LOOP AT it_mseg INTO wa_mseg.
        READ TABLE it_mbew INTO wa_mbew WITH KEY matnr = wa_mseg-matnr.
        CHECK sy-subrc = 0.
        IF wa_mseg-menge LT wa_mbew-lbkum.
          ADD wa_mseg-menge TO sum.
          wa_mseg-sum = sum.
          MODIFY it_mseg FROM wa_mseg.
          WRITE : / wa_mseg-matnr,wa_mseg-menge,wa_mseg-sum.
        ELSE.
          DELETE it_mseg FROM wa_mseg.
        ENDIF.
      ENDLOOP.
    I just hard-coded some materials for checking with the logic.You can get materials list directly from mseg as per your selection criterian right!

  • Query to count differents values of a field

    I have to do counts to the quantity of entitys in the database i have to obtain the quantity of registries for entities that appear
    Buenas, les comento estoy trabajando con plsql y se me presenta un problema, necesito contar la cantidad de registros que devuelve la query por entidad, estoy trabajando con un procedure y evaluando con un cursor, pero no se como hacer trabajar la query para devolver ese valor
    ENTITY OVERALL DATE          HOUR     
    ======     =====     ====          ====
    ENT1          5          20100318          12:00
    ENT2          20          20100318          12:00
    ENT3          12          20100318          12:00
    CURSOR1
    SELECT distinct(rp.cod_entidad),
    YYYYYYYYY,
    to_date(to_char(SYSDATE,'YYYYMMDD'),'YYYY-MM-DD') as fecha_pago,
    to_char(sysdate,'hh-mi-ss') as hora_pago
    FROM registry rp, product pc
    where pc.nro_solicitud = rp.nro_solicitud
    and pc.resp_2= 'OK'
    and pc.resp_1= 'OK'
    Edited by: 862673 on 31/05/2011 10:01

    I must build a query to tell me how many records per entity is, YYYYYYY is not a field, i dont know that I write
    TABLE
    ====
    ENTITY      Cliente          telefono
    ======      =======          ========
    ENT1      indiana          234 54231
    ENT1      jose           566 78954
    ENT1      esteban      234 1234
    ENT3      juan           23434567
    ENT3      jacinto      56745
    ENT3      Perez           23467677
    ENT2      indiana          678967
    ENT1      jaime           234
    RESULT
    =====
    ENTITY OVERALL
    ====== =======
    ENT1     4
    ENT2     1
    ENT3     3
    SELECT cod_entidad
    ,     COUNT (DISTINCT yyyyyyyyy)     AS overall
    FROM      registry rp,
         product pc
    where      pc.nro_solicitud     = rp.nro_solicitud
    and     pc.resp_2          = 'OK'
    and      pc.resp_1          = 'OK'
    GROUP BY cod_entidad
    Edited by: 862673 on 31/05/2011 13:41

  • AT SELECTION-SCREEN ON VALUE-REQUEST FOR not input value in input field

    Dear All,
    I make search help for field ARBPL in selection screen are not excepted selected value.
    Code is
    SELECT-OPTIONS:  p_arbpl FOR zdmde-arbpl MODIF ID two.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_arbpl-low.
    REFRESH sh_arbpl.
    SELECT * from crhd into CORRESPONDING FIELDS OF TABLE sh_arbpl.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
       EXPORTING
         RETFIELD               = 'P_ARBPL'
         DYNPROFIELD            = 'P_ARBPL'
         VALUE_ORG              = 'S'
       TABLES
         VALUE_TAB              = sh_arbpl.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_arbpl-high.
    REFRESH sh_arbpl.
    SELECT * from crhd into CORRESPONDING FIELDS OF TABLE sh_arbpl.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
       EXPORTING
         RETFIELD               = 'P_ARBPL'
         DYNPROFIELD            = 'P_ARBPL'
         VALUE_ORG              = 'S'
       TABLES
         VALUE_TAB              = sh_arbpl.
    Please tell how to input selected field from search help into input field in both low and high.
    Would appreciate your reply .
    Regards,
    Pooja

    Hi Pooja,
    For getting the response back from the user selection , please get the return code too. Before that instead of directly using the table crhd structure.. please do create a type declaration of that table , make sure that the field that you wanted to get using search help be specified at last of declaration type like this
    TYPES: BEGIN OF ty,
       OBJTY TYPE CR_OBJTY,
            ARBPL TYPE ARBPL,
    END OF ty.
    this is because the return parameter t_rtn will holds the last value of type which been selected by user.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD               = 'P_ARBPL'
          DYNPROFIELD            = 'P_ARBPL'
          VALUE_ORG              = 'S'
        TABLES
          VALUE_TAB              = sh_arbpl
          return_tab             = t_rtn.
    LOOP AT  t_rtn INTO x_rtn .
       ENDLOOP.
    try executing this code.
    TABLES crhd.
    TYPES: BEGIN OF ty,
       OBJTY TYPE CR_OBJTY,
            ARBPL TYPE ARBPL,
       END OF ty.
    DATA: sh_arbpl TYPE TABLE OF ty.
           DATA: dynpfields TYPE TABLE OF DYNPREAD,
    x_dynpfields TYPE dynpread,
    t_rtn TYPE STANDARD TABLE OF DDSHRETVAL ,
    x_rtn TYPE  DDSHRETVAL.
    SELECT-OPTIONS:  p_arbpl FOR crhd-ARBPL MODIF ID two.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_arbpl-low.
    REFRESH sh_arbpl.
    SELECT  * from crhd into CORRESPONDING FIELDS OF TABLE sh_arbpl WHERE werks eq '1000'.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD               = 'P_ARBPL'
          DYNPROFIELD            = 'P_ARBPL'
          VALUE_ORG              = 'S'
        TABLES
          VALUE_TAB              = sh_arbpl
          return_tab             = t_rtn.
    LOOP AT  t_rtn INTO x_rtn .
       ENDLOOP.
    x_dynpfields-fieldname = 'P_ARBPL-LOW' .
       x_dynpfields-fieldvalue = x_rtn-fieldval.
       APPEND x_dynpfields TO dynpfields.
       CALL FUNCTION 'DYNP_VALUES_UPDATE'
         EXPORTING
           dyname                     = sy-cprog
           dynumb                     = sy-dynnr
         TABLES
           dynpfields                 = dynpfields
    *   EXCEPTIONS
    *     INVALID_ABAPWORKAREA       = 1
    *     INVALID_DYNPROFIELD        = 2
    *     INVALID_DYNPRONAME         = 3
    *     INVALID_DYNPRONUMMER       = 4
    *     INVALID_REQUEST            = 5
    *     NO_FIELDDESCRIPTION        = 6
    *     UNDEFIND_ERROR             = 7
    *     OTHERS                     = 8
    Regards,
    Sivaganesh

  • Query for list of supported auth mechanisms

    Is there a way to query a BO server for a list of supported authentication mechanisms such as secEnterprise or trusted secret or secWinAD, etc?

    I haven't tested but this should work:
    InfoObject oIfoObject = (IInfoObject) oInfoStore.query("select si_id from ci_systemobjects where si_name='Auth Plugins'").get(0);
    IInfoObjects authPlugins = oInfoStore.query("select * from ci_systemobjects where si_parentid=" + oInfoObject.getID());
    for(int i=0; i<authPlugins.size(); i++)
           IInfoObject authPlugin = (IInfoObject) authPlugins.get(i);
           // above returns a specific plugin object: secLDAP, secWinAD, secSAPR3, secEnterprise all what your installation supports
    //  cast the InfoObject to IsecWinAD if si_kind=' secWinAD' or si_name is secWinAD
    if(authPlugin.getTitle().equalsIgnoreCase("secWinAD"))
                  IsecWinAD winad = (IsecWinAD) authPlugin;
                  int availability =  winad.getAvailaility(); //0 - if plugin is not configured\ready to use, 1 if ready to use and configured.
                  String enabled =winad.properties().getProperty("SI_TRUSTED_AUTH_ENABLED").getValue().toString(); // returns true if trusted aut is enabled for this plugin, false otherwise.
    I don't think you can read any property to retrieve the trusted key. The above code will give the auth plugins that are available in your install, which ones are ready and configured ( I have checked only the AD ones above) and if trusted auth is enabled. Check query builder properties if you are trying to get additional info for the auth plugins.

  • Query for list of specifications

    Hi Experts,
    We need to execute query which should contain list of specifications with and without material assignments.Selection criteria is based on generation variant.
    Please let us know from which tables we can get the above list.
    Thanks for your help!!
    Regards,
    Sivasankar
    Message was edited by: Sivasankar P
    Message was edited by: Sivasankar P

    Hi Chris,
    This issue is not related to consultant and it is related to end user. We have query which is already defined to pick up specifications with material.Now they have requested us to get the query even there is no material assigned to specifications.
    So we have planned to remove material from query, so if we remove ESTMJ from query whether it will have impact on some other tables.(like ESTDJ,ESTRH,ESDTH,etc..)
    Thanks for your help!!
    Query:
    *delete report if there is no material
    SORT I_ESTRH BY RECNROOT.
       SORT I_ESTMJ BY RECNROOT.
       IF I_ZESTRHESTDJESTDH[] IS NOT INITIAL OR
          I_ZESTRHESTDJESTDH1[] IS NOT INITIAL.
         LOOP AT I_ESTRH INTO WA_ESTRH.
           MOVE SY-TABIX TO V_INDEX.
           READ TABLE I_ESTMJ INTO WA_ESTMJ WITH KEY RECNROOT = WA_ESTRH-RECNROOT
                                                                   BINARY SEARCH.
           IF SY-SUBRC NE 0.
             READ TABLE I_ZESTRHESTDJESTDH WITH KEY SUBID_ESTRH = WA_ESTRH-SUBID
                                                                  BINARY SEARCH.
             IF SY-SUBRC NE 0.
               READ TABLE I_ZESTRHESTDJESTDH WITH KEY SUBID = WA_ESTRH-SUBID
                                                              BINARY SEARCH.
               IF SY-SUBRC NE 0.
                 READ TABLE I_ZESTRHESTDJESTDH1 WITH KEY SUBID = WA_ESTRH-SUBID
                                                                 BINARY SEARCH.
                 IF SY-SUBRC NE 0.
                   READ TABLE I_ZESTRHESTDJESTDH1 WITH KEY SUBID_ESTRH = WA_ESTRH-SUBID
                                                                         BINARY SEARCH.
                   IF SY-SUBRC NE 0.
                     DELETE I_ESTRH INDEX V_INDEX.
                   ENDIF.
                 ENDIF.
               ENDIF.
             ENDIF.
           ENDIF.
         ENDLOOP.
       ENDIF.
    Regards,
    Sivasankar

Maybe you are looking for

  • HP Envy 4501 won't scan multiple pages into a single document

    My HP Envy 4501 Printer won't let me scan multiple pages into a single pdf document. I already made sure that the checkbox "Create a separate file for each scanned page" is not checked under the file section in advanced settings. After I scan the fir

  • Making a button for a song

    I am making an iWeb site to showcase music but the QT loads slowly and I ran across a way to make a HTML snippet with inserted code here: http://web.me.com/toad.hall/Demo_2/Widget-Window.html. My question is how to accomplish "URL to location of link

  • P965 doesn't POST, power flicking on and off

    I have a P965, with an E6600, an Nvidia 8800 GTS(320mb), a OCZ GameXStream 600 watt psu, 2 GB of Patriot Extreme Performance RAM(DDR2 800). I haven't any real trouble with my computer for quite a while, but I recently got a new laptop and haven't use

  • JAI problem

    Hi all, I have small problem. In my application I'm using JAI package (imported). When I run my app in Eclipse, everything works perfectly. But when I compile this app to JAR file (Export to JAR), I have error in console as follows: java.lang.NoClass

  • SAP Modules and Tcodes

    Hi Can anyone help me with the table name in SAP that contains list of modules. I also need a list of  module wise tcodes. Wht are the table names that can help me in this case? Looking forward to hear from you. You can mail me at [email protected] R