cancel
Showing results for 
Search instead for 
Did you mean: 

How to call Instance Methods and set property values in BAPI?

Former Member
0 Kudos

In Project systems, for the three business objects viz.

Network, ProjectDefinition and WBS, there are two kinds of methods which are available : class methods and instance methods. We have tried calling some instance methods, for instance, BAPI_PROJECTDEF_GETDETAIL to get details pertaining to a project. While importing this BAPI, it shows two elements for mapping i.e. Current Internal Project(string) and Current External Project(string). We supplied these values for an existing project. Upon running this call through an XML client at our end, it

returned an error "Module Unknown Exception". This general message is present on every instance method thus far. Upon searching in BAPI Explorer for Project System->ProjectDefinition->GetDetail, we found that this BAPI didn't take any input parameter.

Following message was displayed in BAPI Exlorer for this BAPI:

"... Obligatory import parameters are the external and internal keys CURRENTEXTERNALPROJE and CURRENTINTERNALPROJE of the project definition.The system reads parameters contained in the structure

BAPI_PROJECT_DEFINITION_EX ..."

i) How to supply the values of Obligatory import parameters.

ii) What are the possible causes of this exception.

iii) How to call an instance method. We are using same mechanism for calling class as well as instance methods so far, we have been to call only class level methods successfully. Is there anything special that we

need to do to call instance methods.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

what version is the SAP PS running? If WebAs or higher, create an inbound synch interface containing your two parameters in the request structure and as many as you require in your response structure. Generate an Inbound ABAP proxy, where you can plug in some code, i.e. create and instantiate an object of the required type and make the call to the BAPI.

If SAP PS on lower than WebAs, then create a wrapper function module and make it RFC enabled. Then plug your code in here and do the same thing.

Watch out for commits!

Cheers,

Mark