LStrike
LStrike

Reputation: 1648

BAPI_MDDATASET_CREATE_OBJECT MDX Query

I would like to make a BAPI call from Java to the BAPI BAPI_MDDATASET_CREATE_OBJECT.

Therefore I want to use the following MDX Query:

SELECT
[0DISTR_CHAN].Members ON COLUMNS,
[0MATERIAL].Members ON ROWS
FROM [$/PKG/AB_C01]

Because the Parameter "COMMAND_TEXT" is to short I made 4 entries like this: enter image description here

Now I run the BAPI and get a DATASETID in return. I use this id with the next BAPI BAPI_MDDATASET_CHECK_SYNTAX.

But now I get an exception:

E RS_EXCEPTION 000 Es ist eine Ausnahme Aufgetreten.

enter image description here

English Version:

E RS_EXCEPTION 000 An exception has occurred.

enter image description here

Why is this so?

This MDX query seems to be OK, because in transaction MDXTEST this query is working.

Any suggestions?

Upvotes: 0

Views: 381

Answers (2)

Nikita Bannikov
Nikita Bannikov

Reputation: 75

I had the same problem only with c# and sap connector. I solved it. Need to use all commands in one context:

RfcSessionManager.BeginContext(destination);
Create_Object();
CheckSyntax();
etc.
RfcSessionManager.EndContext(this.destination);

Upvotes: 1

whytheq
whytheq

Reputation: 35605

The following will return a large table that is n * m where n are the number of columns and m is the number of rows:

SELECT
[0DISTR_CHAN].Members ON COLUMNS,
[0MATERIAL].Members ON ROWS
FROM [$/PKG/AB_C01]

n = number of members in this dimension [0DISTR_CHAN] + 1
m = number of members in this dimension [0MATERIAL]

This is not an answer but maybe will help to discover if the mdx is the problem. If you simplify the above to just a single member on rows, and a single member on columns do you still get an error?

SELECT
  {[0DISTR_CHAN].[0DISTR_CHAN].[someMemberY]} ON COLUMNS,
  {[0MATERIAL].[0MATERIAL].[someMemberX]} ON ROWS
FROM [$/PKG/AB_C01];

Upvotes: 0

Related Questions