Create a collection based on an exisiting collection

I have a collection that has a install with a deadline running for the last week. I see that there are still machines pending installation. The current collection has a maintenance window set which includes over 1500 machines. Since 95 % of them completed
I need to remove the completed from the collection and leave the exisiting machine behind to continue the installation. 
So either create a way to move completed machine to a completed collection or just remove them from the existing collection or
Create a limiting collection that contain machines in progress and unknown machines from the original collection. 

Hi,
You could try to create a Configuration Baseline to detect the installation. Right click the Baseline deployment to create a collection according to the Baseline evaluation results. Is this possible?
How to Create Windows Configuration Items for Compliance Settings in Configuration Manager
http://technet.microsoft.com/en-us/library/gg712331.aspx
Best Regards,
Joyce
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place.

Similar Messages

  • Is there a way to create a collection based on the "previous import"?

    is there a way to create a collection based on the "previous import"? that would make it easy to mobile sync the last import to my ipad, and do further picking/rejecting while away from my laptop.

    well, yes, of course i could do it that way. i guess i wasn't specific enough. is there a way to create a smart collection, with the photos in the "previous import" as members of the smart collection.  earlier i mentioned about using this smart collection to mobile sync with my ipad, to do further flagging.
    so my intention, use a smart collection to mobile sync with my ipad, and the smart collection to include the photos from my previous import.
    i guess another way to ask the question, is there a way to create a smart collection, by using some rule or condition in the smart collection, to automatically include previous import photos.
    the documentation says that "previous import" is a collection, even though it shows up in the catalogue side bar section. but i see no way to choose that collection when making a smart collection.
    jd

  • SCCM2012: Can you create a Query-based "User Collection" using an IP Subnet (or IP Address range) in the Query?

    The topic says it all (I hope).  I am new to 2012 and I have tried to accomplish this feat all day, which includes researching online, but I have had zero success in finding anything helpful.
    Obviously I can create "Device Collections" based on the IP Subnets, and I can do a "Direct Rule" in "User Collections" for the desired IP Subnet, but I do not want to do this because I need the results to update if/when
    any changes occur during a "scheduled/incremental update".
    The only thing I could find for the "User Collections" was this:
    select *  from  SMS_R_User where SMS_R_User.FullUserName = SMS_R_User.UserName and SMS_R_System.IPAddresses like "111.11.1%"
    EXAMPLE (Query for Devices):
    select *  from  SMS_R_System where SMS_R_System.IPAddresses like "111.11.1%"
    Is there a way to Query SCCM (2012) and display the Usernames of computers that login to the (sole) Domain through a specified (or desired) IP Subnet?

    Why do you want to install software by location for a user? Why do you care?
    Why would you want to create a collected of Users with software installed? PCs have the SW install not users so how would you use it?
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ
    I was asked to setup these (Device and User Collections) in this manner so we can limit future distributions/deployments of Applications (and/or Packages) and (OS) Images by these groupings.  Apparently there will be occasions where deployments will need
    to be segmented as such because the company wants to have them grouped in this manner.  If there is a better option available than this, which I would not doubt since I am new to SCCM 2012, then I would appreciate the information.
    IMO, you need to go back to the person asking and get and better understand of exactly what they want and more importantly why.  Making a collection, just in case doesn't make sense.
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • How to create monitor based on the data collected by rule?

    I have an application which comes with a built-in command: GetBackLogNm.exe. Running this command can get the current backlog number in the system.
    Now I need to create a monitor which should trigger the alert if the backlog keeps increasing for 2 hours. I am thinking of creating a rule which run command GetBackLogNm.exe to get the number and save it into DW. Then create a monitor based on the collected
    data. Is it the correct way? If so, can anyone give me a outline how to do so? An example would be much appreciated if possible.
    Thanks!

    Hi Jonathan, thanks for the quick reply. But System.ConsolidatorCondition seems only available for SCOM 2012. I didn't find it in 2007 libraries.
    However the idea your and Vladimir showed in this
    post is really helping. I kind of solved the issue not using the exactly the components (since it is available in 2012 only) but following the same logic.
    In general I did this:
    1. create a script rule which execute the command to get backlog number; then save the log number in the DW and the registry.
    2. just like System.Performance.DeltaValueCondition, when the second time the rule triggered by schedule, it will compare the current backlog number and the last known number stored in the registry. If the value is exceeding given threshold AND bigger than
    the last known back log number, the rule increase an counter which is also stored in the registry
    3. create an unit monitor to monitor the counter stored in the registry and will trigger the alert if the counter exceeding a given value.
    This solved the issue. But I feel a little not comfortable to store data in the registry.
    So one quick question which might be out of the this topic: what is a good way to store the data generated by one workflow and then share it with another workflow or reuse sometime later? In my case here, I used the registry key. Cook down is one option
    to share data but it is very strict and can't solve the issue I have in this case.
    Thanks again!

  • How to create Collection Based on Status Message

    It's possible create a collection based on Status Message?
    If yes, please post how
    tks
    Allan

    the query given by matthew is WQL but not SQL.you cannot run the WQL query in SQL which do not support.
    The error what you get is expected .some of the wmi entries that exist in sms provider may not appear in sccm query design.
    Do not click on show query design as sms_statusmessage attributes cannot be retrived .After you
    created the WQL Query ,just paste in query box and click Ok (Ignore the error message box).
    wait for sometime and see if that display any computers.
    Eswar Koneti | Configmgr blog:
    www.eskonr.com | Linkedin: Eswar Koneti
    | Twitter: Eskonr

  • Need help creating a device collection based on members of a user collection

    Hello everyone,
        I am working on developing a device collection based on the membership of a user collection. The purpose of the device collection is to provide us with the capability of deploying software to users while the users are logged off their systems.
    I would love to use AD security groups but unfortunately that isn't an available approach in this case. I have been experimenting with SQL queries to find the best way to obtain the results I want and the following query works like a champ:
    Select SYS.Name0,
    v_R_User.Unique_User_Name0
    FROM v_R_System AS SYS
    JOIN v_UserMachineRelationship ON SYS.Name0=v_UserMachineRelationship.MachineResourceName
    JOIN v_R_User ON v_UserMachineRelationship.UniqueUserName=v_R_User.Unique_User_Name0
    JOIN v_FullCollectionMembership AS FCM on FCM.ResourceID = v_R_User.ResourceID
    JOIN v_Collection AS COLMEM ON COLMEM.CollectionID = FCM.CollectionID
    Where FCM.CollectionID = 'cha0000B'
    The problem arises when I attempt this same query in SCCM 2012, I don't get any results from this query so of course it won't work to base a Device Collection from. Here is the WQL:
    Select SYS.Name,
    SMS_R_User.UniqueUserName
    FROM SMS_R_System AS SYS
    JOIN SMS_UserMachineRelationship ON SYS.Name=SMS_UserMachineRelationship.MachineResourceName
    JOIN SMS_R_User ON SMS_UserMachineRelationship.UniqueUserName=SMS_R_User.UniqueUserName
    join sms_v_FullCollectionMembership AS FCM on FCM.ResourceID = SMS_R_User.ResourceID
    join SMS_v_Collection AS COLMEM ON COLMEM.CollectionID = FCM.CollectionIDwhere FCM.CollectionID = 'cha0000B'
    I am hoping that someone will be able to look at my SQL and tell me how I can get the WQL right so I can use this query properly or provide suggestions to accomplish what I need.
    Thanks in advance for the assist,
    Chris Bolton

    Hi Torsten,
         While your suggestion of that link was close, it still went in the direction of using security groups as the basis for device queries and that isn't the direction I am pursuing. I had a colleague look at my original query and he identified
    that I had some unnecessary redundancy but that didn't resolve my SQL -> WQL inconsistency. I continued to play with the query and the following SQL also works (and actually works a bit better for my purposes)
    select distinct v_R_System.Name0,
    v_R_User.Unique_User_Name0
    FROM v_R_System
    JOIN v_R_User on v_R_User.Full_User_Name0 = v_R_System.User_Name0
    JOIN v_UserMachineRelationship ON v_R_System.Name0 = v_UserMachineRelationship.MachineResourceName
    JOIN v_FullCollectionMembership on v_R_User.Unique_User_Name0 = v_FullCollectionMembership.SMSID
    WHERE v_FullCollectionMembership.CollectionID = 'cha0000b'
    however when I translate it to WQL I still am unable to get results (here is the WQL version)
    select distinct sms_R_system.Name,
    sms_R_User.UniqueUserName
    FROM sms_R_system
    JOIN SMS_R_User on SMS_R_User.FullUserName = SMS_R_System.UserName
    JOIN SMS_UserMachineRelationship ON SMS_R_System.Name = SMS_UserMachineRelationship.MachineResourceName
    JOIN SMS_FullCollectionMembership on SMS_R_User.UniqueUserName = SMS_FullCollectionMembership.SMSID
    WHERE SMS_FullCollectionMembership.CollectionID = 'cha0000b'
    I think I am on the verge of getting this right but it sure seems to be a challenge. Is there a "WQL Workbench" that I could use that is similar to SQL Management Studio inside of which I could test these queries rather than having to use the rather clunky
    SCCM "Edit Query Statement" dialog box?
    Thanks again,
    Chris Bolton

  • Using JavaScript need to Sort subsite site collection based on date in descending order

    Hi,
    Below is my code, where i need to sort the " webCollection
    = web.getSubwebsForCurrentUser(null)" web collection based on the web.get_created() in
    descending order. How could i do it any suggestions. Also i need it in JavaScript.
    <script src="/_layouts/15/sp.runtime.js" type="text/javascript"></script>
    <script src="/_layouts/15/SP.js"></script>
    <script type="text/javascript">
    var context = SP.ClientContext.get_current();
    var web = context.get_web();
    ExecuteOrDelayUntilScriptLoaded(getWebProperties, "sp.js");
        function getWebProperties() {
                    webCollection = web.getSubwebsForCurrentUser(null);
            context.load(webCollection)
            //ctx.load(this.web);
            context.executeQueryAsync(Function.createDelegate(this, this.onSuccess),
                Function.createDelegate(this, this.onFail));
        function onSuccess(sender, args) {
            //alert('web title:' + this.web.get_title() + '\n ID:' + this.web.get_id()
    + '\n Created Date:' + this.web.get_created());
            alert("Number of sites: " + webCollection.get_count());
                   var webEnumerator = webCollection.getEnumerator();
                    while (webEnumerator.moveNext()){
       var web = webEnumerator.get_current();
      alert("Title="+web.get_title() +"\n"+ "Created="+web.get_created());
        function onFail(sender, args) {
            alert('failed to get list. Error:'+args.get_message());
    //getWebProperties();
    </script>
    Thanks!
    MCTS- Please vote and mark posts as answered where appropriate.

    Hi,
    According to your post, my understanding is that you wanted to sort the subsite based on the date in descending order.
    You can refer to the following code snippets, it sorts the subsites by the date in descending order.
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    // When the body is loaded, the onload event handler executes each function whose name is contained in this array.
    _spBodyOnLoadFunctionNames.push("callCSOM");
    function callCSOM()
    $("#Button1").click(function()
    ExecuteOrDelayUntilScriptLoaded(RetriveSites, "sp.js");
    var currentcontext = null;
    var currentweb = null;
    function RetriveSites()
    currentcontext = new SP.ClientContext.get_current();
    currentweb = currentcontext.get_web();
    this.subsites = currentweb.get_webs();
    currentcontext.load(this.subsites);
    currentcontext.executeQueryAsync(Function.createDelegate(this, this.ExecuteOnSuccess),
    Function.createDelegate(this, this.ExecuteOnFailure));
    function ExecuteOnSuccess(sender, args)
    var subsites = '';
    var enum1 = this.subsites.getEnumerator();
    var siteCreatedTime = '';
    var array=new Array();
    while (enum1.moveNext())
    var site = enum1.get_current();
    array.push(new Array(site.get_created(),site.get_title()));
    alert(array);
    array=sortMethod(array);
    alert(array);
    function sortMethod(arr) {
    var i, j, stop, len = arr.length;
    for (i=0; i<len; i=i+1)
    for (j=1;j<len - i; j++)
    // change the "<" to ">" would be sort by the Ascending.
    if (new Date(arr[j-1][0]) < new Date(arr[j][0]))
    //swap(j, j+1);
    var temp = arr[j-1];
    arr[j-1] = arr[j];
    arr[j] = temp;
    //alert(new Date(arr[j]));
    return arr;
    function ExecuteOnFailure(sender, args) {
    alert("error");
    </script>
    <input id="Button1" type="button" value="Run Code"/>
    Results:
    Sort before:
    Sort after:
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected].
    Jason Guo
    TechNet Community Support

  • Dynamic computers collection based on User State Migration associations

    At our company, we have a group of computers with the follwoing situation:
    User works on machine with WindowsXP, there is already prepared new machine, with Windows 7 installed, and delivered to user. I have prepared 2 task sequences - "State Capture" and "State Restore", both deployed to separate device collections.
    Now, what I do is create old/new computer association in the User State Migration tab, add old computer to Capture collection, let the TS complete, add new computer to Restore collection, and let the TS complete. After all these steps user can begin to work
    on the new machine with his/her profile and data migrated.
    But I would like to speed things a little bit, and allow my
    colleagues to perform such "migration" by simply adding computers association. To achieve that, I need to create a query, that would assign computers to collections, based on the existing associations in the User State Migration tab. The problem is,
    I fail to find appropriate rule in query wizard. Is it possible at all?
    I need computer to be added to Capture collection upon detection of it being source computer in the USM tab, and removed from collection upon finished TS, with the target computer added to Restore collection at the same moment and removed from the collection
    upon finished restore TS.
    I would greatly appreciate any help or pointing into right direction.

    Hi,
    There is a blog about removing computer from collection after SCCM task sequence. But it is for SCCM 2007. You could have a look on this blog to see if the script can be edited to meet your requirements.
    Remove computer association from collection
    after SCCM task sequence
    Note: Microsoft provides third-party contact information to help you find technical support. This
    contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Update a file from WSP in several site collection based on my SiteDefinition

    Hi,
    i have a minimalisitic SiteDefinition with a Stapling Feature. The Stapling Feature includes one site-scoped and another web-scoped feature. Within the Site-Scoped Feature i am deploying tweo pages.
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Module Name="MyBoxModule">
    <File Path="MyBoxModule\default.aspx" Url="default.aspx" Type="Ghostable" IgnoreIfAlreadyExists="FALSE" />
    <File Path="MyBoxModule\hilfe.aspx" Url="hilfe.aspx" Type="Ghostable" IgnoreIfAlreadyExists="FALSE" />
    </Module>
    </Elements>
    My question:
    I need to update these files each time my definition changes and the solution gets updated. For example after 2-3 month the customer wants to change the contents of the default.aspx but has created > 100 SiteCollections based on my SiteDefinition. Manually
    changing it would be a huge time expensive job. How can i build the pages in some way, that i change the pages in my solution and provide a update so that automatically after upadting the WSP the default.aspx and the hilfe.aspx are "overwritten or
    gets updated" by the file in inside the new solution.
    Best Regards
    Bog
    Developers Field Notes | www.bog1.de

    Hi,
    If you have a requirement to change a page which exists in many sites in a batch, you can use PowerShell to iterate through multiple sites and replace the original page with
    a new one in one execution.
    Iterate through site collections using PowerShell
    http://technet.microsoft.com/en-us/library/ff607950.aspx
    http://sharepoint-r3dinfo.blogspot.com/2013/08/powershell-script-to-iterate-through.html
    Use PowerShell to Upload a New File Version to SharePoint
    http://blogs.technet.com/b/heyscriptingguy/archive/2013/04/28/weekend-scripter-use-powershell-to-upload-a-sharepoint-file-version.aspx
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • Can I bulk collect based on a date variable?

    I'm want to use some sort of Bulk collect to speed up this query inside a PL/SQL block (we're in 10g). I have seen examples of using a FORALL statement but I don't know how to accommodate the variable v_cal_date. My idea is to be able to run the script to update a portion of the table "tbl_status_jjs" based on a date range that I provide. tbl_status_jjs contains a list of dates by minute of the day for an entire year and a blank column to be filled in.
    I though of using something like FORALL v_cal_date in '01-apr-2009 00:00:00'..'01-jun-2009 00:00:00' -- somehow need to increment by minute!? ... but that doesn't seem right and i can't find any exmples of a bulk collect based on a date. How do I bulk collect on a date variable? Can I use the date/time from a subset of records from the final table in some sort of cursor?
    Thanks
    Jason
    -- loop through one day by minute of the day and update counts into table  
    v_cal_date Date       :=TO_DATE('01-apr-2005 00:00:00','dd-mm-yyyy hh24:mi:ss');
    intX := 1;
    WHILE intX <= 1440 LOOP
        UPDATE tbl_status_jjs
               SET  (cal_date, my_count) =
                    (SELECT      v_cal_date,
                                 NVL(SUM(CASE WHEN v_cal_date >= E.START_DT AND v_cal_date < E.END_DT THEN 1 END),0) AS my_count
                     FROM        tbl_data_jjs E
               WHERE cal_date = v_cal_date;
        v_cal_date := v_cal_date + (1/1440);
        intX := intX + 1;
        COMMIT;
    END LOOP;

    Here are the two tables. The goal is to find an efficient way to count how many records in tbl_data have a start_dt before and a end_dt after each cal_date in tbl_status.
    01-apr-2005 00:05:00 ==> 3
    01-apr-2005 00:25:00 ==> 1
    DROP TABLE tbl_status;
    CREATE TABLE tbl_status
    (   CAL_DATE    DATE,
        MY_COUNT    NUMBER);
    DECLARE
        start_date Date       :=TO_DATE('01-jan-2006 00:00:00','dd-mm-yyyy hh24:mi:ss');
        end_date   Date       :=TO_DATE('01-jan-2006 01:00:00','dd-mm-yyyy hh24:mi:ss');
    BEGIN
        INSERT INTO tbl_status (CAL_DATE)
        SELECT  start_date + ( (LEVEL - 1) / (24 * 60))
        FROM    dual
        CONNECT BY    LEVEL <= 1 + ( (end_date - start_date) * (24 * 60) );
    END;
    DROP TABLE tbl_data;
    CREATE TABLE tbl_data
    (   START_DT    DATE,
        END_DT      DATE);
    INSERT INTO tbl_data VALUES (TO_DATE('2006-01-01 00:05:00', 'yyyy-mm-dd hh24:mi:ss'), TO_DATE('2006-01-01 00:15:00', 'yyyy-mm-dd hh24:mi:ss'));
    INSERT INTO tbl_data VALUES (TO_DATE('2006-01-01 00:05:00', 'yyyy-mm-dd hh24:mi:ss'), TO_DATE('2006-01-01 00:20:00', 'yyyy-mm-dd hh24:mi:ss'));
    INSERT INTO tbl_data VALUES (TO_DATE('2006-01-01 00:05:00', 'yyyy-mm-dd hh24:mi:ss'), TO_DATE('2006-01-01 00:30:00', 'yyyy-mm-dd hh24:mi:ss'));
    INSERT INTO tbl_data VALUES (TO_DATE('2006-01-01 00:35:00', 'yyyy-mm-dd hh24:mi:ss'), TO_DATE('2006-01-01 00:40:00', 'yyyy-mm-dd hh24:mi:ss'));
    DECLARE
        v_cal_date Date       :=TO_DATE('01-jan-2006 00:00:00','dd-mm-yyyy hh24:mi:ss');
        intX Integer          :=1;
    BEGIN
        WHILE intX <= 60 LOOP
            UPDATE tbl_status
                   SET  (cal_date, my_count) =
                        (SELECT      v_cal_date,
                                     NVL(SUM(CASE WHEN v_cal_date >= E.START_DT AND v_cal_date < E.END_DT THEN 1 END),0) AS my_count
                         FROM        tbl_data E
                   WHERE cal_date = v_cal_date;
            v_cal_date := v_cal_date + (1/1440);
            intX := intX + 1;
            COMMIT;
        END LOOP;
    END;Edited by: Jason_S on Oct 21, 2009 9:00 AM -- i messed up the years/months .. fixed now
    Edited by: Jason_S on Oct 21, 2009 9:13 AM

  • Collections based on Software Update Group compliance

    Hi!
    Is it possible to create a collection based on software update group compliance? This is for software update groups which are
    not deployed, they are just monitor groups (for example, groups for yearly or quarterly software update compliance).
    I would like to create a collection that lists all devices which are non-compliant in software update groups with names like "%Client Updates" - is this possible?
    The reason for this is so I can impose some stricter Compliance Settings (among some other stuff) on devices that are not compliant.
    I looked around a bit, but I could not find anything that I can use. Even Google couldn't solve my question :/

    you can try something like this:
    This collection is basically sub selected query get list of computers that do not have specific assignment enabled.
    select *  from  SMS_R_System where SMS_R_System.ResourceId not in (SELECT distinct SMS_UpdateComplianceStatus.MachineID  FROM SMS_UpdateComplianceStatus JOIN SMS_UpdateDeploymentSummary ON SMS_UpdateComplianceStatus.CI_ID = SMS_UpdateDeploymentSummary.CI_ID
    WHERE SMS_UpdateDeploymentSummary.AssignmentName like "%Client Updates%")
    Eswar Koneti | Configmgr blog:
    www.eskonr.com | Linkedin: Eswar Koneti
    | Twitter: Eskonr

  • Collection Based on Null Value from Custom MOF extended value

    I extended the MOF to create collections based on registry keys and its working great!
    I would like to know how to modify the below query that looks for "Automatic" to actually return all servers without this value - a collection of servers without this custom registry value we are using.
    Below is the working query for finding servers with "Automatic" - how can I adjust this to give me all servers without any value here? I want all servers with a NULL value....
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_ServerReboot_ServerReboot_1_0 on SMS_G_System_ServerReboot_ServerReboot_1_0.ResourceId
    = SMS_R_System.ResourceId where SMS_G_System_ServerReboot_ServerReboot_1_0.Reboot = "Automatic" order by SMS_R_System.NetbiosName
    What we want:
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_ServerReboot_ServerReboot_1_0 on SMS_G_System_ServerReboot_ServerReboot_1_0.ResourceId
    = SMS_R_System.ResourceId where SMS_G_System_ServerReboot_ServerReboot_1_0.Reboot = "NULL" order by SMS_R_System.NetbiosName

    Use "is null" like this.
    SMS_G_System_ServerReboot_ServerReboot_1_0.Reboot is Null
    http://www.enhansoft.com/

  • How do i loop through a pl/sql collection based on a condition.

    hi, can any one help me or provide me sample code where  i have to loop through a collection  based on condition . just like where clause in sql. your help is highly appreciated....
    {code}
    create table MODEL1
      model_id  NUMBER ,
      model_seq NUMBER,
      p_ind     VARCHAR2(1)
    insert into model1 (MODEL_ID, MODEL_SEQ, P_IND)
    values (4, 103, 'U');
    insert into model1 (MODEL_ID, MODEL_SEQ, P_IND)
    values (3, 102, 'P');
    insert into model1 (MODEL_ID, MODEL_SEQ, P_IND)
    values (2, 101, 'U');
    insert into model1 (MODEL_ID, MODEL_SEQ, P_IND)
    values (1, 100, 'P');
    MODEL PROCEDURE......
    procedure (  param1,param2)        ( assume this procedure is being called from other procedure and collection has been populated already)
    TYPE  l_tab is table of  MODEL1%rowtype;
    begin
    loop through l_tab records where  ltab.model_id=param1  and  p_ind =p
    Join based on if else condition.
    if   param2 is not null then
       l_tab.model_seq=param2 and ltab.p_ind='P'
    if param2 is null then
             l_tab.p_ind='P'          etc...........
       {code}

    Hi,
    Try something like this:
    DECLARE
    TYPE L_TAB IS  TABLE OF MODEL1%rowtype;
    TAB L_TAB;
    param1 number := 1;
    param2 number := 999;
    BEGIN
    select
      model_id
      ,model_seq
      ,p_ind
    bulk collect into TAB
    from
      MODEL1
    DBMS_OUTPUT.PUT_LINE('PARAM1: ' || PARAM1);
    DBMS_OUTPUT.PUT_LINE('PARAM2: ' || PARAM2);
    DBMS_OUTPUT.PUT_LINE('     MODEL_ID, MODEL_SEQ, P_IND' );
    FOR X IN TAB.FIRST .. TAB.LAST
    LOOP
    DBMS_OUTPUT.PUT_LINE('OLD: ' || TAB(X).MODEL_ID || '         ' || TAB(X).MODEL_SEQ || '        ' || TAB(X).P_IND );
        IF TAB(X).model_id = param1 AND TAB(X).p_ind = 'P' THEN
          IF param2       IS NOT NULL THEN
            TAB(X).model_seq := param2;
    --        TAB(X).p_ind := 'P';     -- THIS IS NOT NEEDED SINCE THE CONDITION STATE L_TAB(X).P_IND = 'P' ALREADY
    NULL;
          END IF;
          IF param2     IS NULL THEN
    --          TAB(X).p_ind  := 'P'; -- THIS IS NOT NEEDED SINCE THE CONDITION STATE L_TAB(X).P_IND = 'P' ALREADY
    NULL;
          END IF;
        END IF;
    DBMS_OUTPUT.PUT_LINE('NEW: ' || TAB(X).MODEL_ID || '         ' || TAB(X).MODEL_SEQ || '        ' || TAB(X).P_IND );
    END LOOP;
    END;
    PARAM1: 1
    PARAM2: 999
         MODEL_ID, MODEL_SEQ, P_IND
    OLD: 4         103        U
    NEW: 4         103        U
    OLD: 3         102        P
    NEW: 3         102        P
    OLD: 2         101        U
    NEW: 2         101        U
    OLD: 1         100        P
    NEW: 1         999        P
    Regards,
    Peter

  • How to sort a collection based on their date?

    how do i sort a collection based on their respective dates which are in Calendar format?

    this is my codes
    /** This class is use to sort the call list base on their date
    import java.util.*;
    public class a implements Comparator
         /** compare the objects base on their types
         *     @obj1 the first object to be compared
         *     @obj2 the second object to compare with the first object
         public int compare(Object obj1, Object obj2)
         if (obj1 == obj2)
              return 0;
         if (obj1 == null || obj2 == null)
              return 0;
         if (!(obj1 instanceof Call) || !(obj2 instanceof Call))
              return 0;
         Call lhs = (Call) obj1;
         Call rhs = (Call) obj2;
         int s = lhs.getDate().compareTo(rhs.getDate());
         if (s != 0)     
              return s;
         return 1;
    this is the error
    a.java:21: cannot resolve symbol
    symbol : method compareTo (java.util.Calendar)
    location: class java.util.Calendar
         int s = lhs.getDate().compareTo(rhs.getDate());

  • R/3 - XI Idoc Collection Based On Same tRFC Call

    We have solution where RSEOUT00 sends idocs out in one tRFC call to a system running Mercator.  These idocs represent 1 transaction if you will, and are then mapped into 1 outbound file.
    I am trying to figure out what the best option to do this in XI is.  The requirement is to not collect based on a deadline, but to collect based on the chunk of idocs that were released online by the user in the same RSEOUT00 transaction.
    Is this possible or any suggestions to accomplish this?  I do have the flexibility to customize RSEOUT00 (its already custom actually) and have been toying with the idea of sending another message that is an "all are sent" or even something like a control message with a listing of all of the idoc numbers that belong to that group, but have yet to come up with a design that I'm comfortable with as the idocs are all sent asynchronously thorugh tRFC.
    Thanks
    Peter

    Hi Peter,
    If we can check the TID of the IDOC then that make your job easy..is it not ?
    Because all the IDOCs send in one tRFC call will have the same TID..
    Now i am trying to see what is the best way to get that...i checked standard context objects given by SAP ..it doesnot have this TID :(...
    I have suggestion ..this will work for sure...however it maynot be the most optimal one...
    In the BPM where you are collecting IDOCs...after the recieve..have a mapping from IDOC to a dummy message which will basically return TID....now this mapping should be an ABAP mapping ...now from the ABAP code...query the IDXSNDPOR table and get the TID for the current IDOC and return it..
    Back in the BPM, check if this is a new TID or not...if it is new..we can bundle it and stop the collection...
    if we have a better way to get the TID.....we can make this better...
    Thanks.

Maybe you are looking for