In BO 3.1:
Instead:
Query providetgetQuery=providername.getQuery();
try this:
Query providetgetQuery;
if (providername.hasCombinedQueries()) {
providetgetQuery = (Query) providername.getCombinedQueries().getQueryNodeAt(0);
} else {
providetgetQuery = providername.getQuery();
}
In BO 4.0:
At the moment this part of Report SDK is unavailable. Look what is available: http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_rebean_omd.pdf
It should be available in BO 4.1: http://scn.sap.com/community/bi-platform/blog/2012/11/18/what-is-coming-in-businessobjects-bi41-customer-validation-asug-webcast