Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member200567
Active Contributor
5,475

Hi,

     May be this is already well-known by everyone (if so, sorry about that) but this doc is just about my experience to queries and defaultsets.

     If there is any mistake, please correct me. If there is some frustration , my bad.

     It is necessary , IMO, to know how actually queries and defaultsets work on OWL to be able to do more things with OWLs.

This is Custom BO definition that is used in the doc.

businessobject SalesOrder {

      element SalesOrderID:LANGUAGEINDEPENDENT_MEDIUM_Text;

   node Item[1,n]{

  element ItemID:LANGUAGEINDEPENDENT_MEDIUM_Text;

  element ItemName:LANGUAGEINDEPENDENT_MEDIUM_Text;

   }

}

       When we open this OWL, all Sales Orders are shown in the table. Because "All SalesOrdres" is selected in Show.

         

             That is automatically configured by the studio as default after we have created an OWL. Let's see how it does.

             In the "Default DefaultSet" property of AdvancedListPane:ObjectWorkList, you will see DefaultSet.

             

                 In the controller tap, you can see that default set under Query with the title All SalesOrders. We can edit the title.

                 There OnSelect event, EventHandler is selected. That event handler executes the query.( we don't need to care about this

                 because this handler is automatically created when we create a defalut set.)

            

              Here, we can restrict that DefaultSet. Let's say, we only want to see the record of SalesOrderID "SO1".

              We can create a parameter for that. First, we need to add SalesOrderID from QueryByElements to Selected Query Parameters

              by clicking the down arrow. Add a new field to Root/SearchParameters. Bind SalesOrderID with that new field.

              

              Now we can do some restriction to our OWL with SalesOrderID. There will be SalesOrderID in Query Parameters of DefaultSet.

              We can add a new operation and create conditions here. In this case, I selected operation to "equals" and set Low Value to "SO1".

         

              I changed the title to "SO1 only".Activate the OWL and let's see the result:

             

             *We can create more default sets under that Query and create more restriction.

              I created a new DefaultSet under Query namely "AllSalesOrder" and I changed the title to "All Sales Orders".

              The event handler "EventHandler1" is automatically created. I did not create any restriction because I want to

              all sales orders this time.

             

           

               That will do nothing to the OWL. We need to add it to DefaultSet mapping.

              

      

             

               Now our OWL will have two selections in Show.

               But the Default DefaultSet is DefalutSet of "SO1" . The "SO1 only" will be selected in Show.

               I am going to change that because I want to show all sales orders as default. That's easy. Just change Default DefaultSet to new default set "AllSalesOrder" that we created a bit earlier.

             

               Result :

              

           

Thanks for reading.

Fred.

Updated : Related Document

How custom queries work on OWL

16 Comments
Labels in this area