Recently I discovered a very interesting standard class in SAP ECC 5.0.It is called CL_RS_WHERE.It contains methods which can be effectively used to create dynamic SQL statements.It is primarily used for building BW queries but it works very well in the R/3 environment also.In this blog I would like to demonstrate a small example I did using this class.
Note:
Here I have hardcoded the values for sales order,sales organization and material for demonstration purposes.You can either change these values or modify the code as per your own needs.