Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to call BOR object-> method in custom program

Former Member
0 Likes
4,215

hi all,

I have the following details:

BOR object : INSTLN

Method: createdirect

I need to call the above method in my custom program.

I need to call it entirely. Means if it contains fn modules I dont want to call those fn modules seperately.

hi all,

I have the following details:

BOR object : INSTLN

Method: createdirect

I need to call the above method in my custom program.

I need to call it entirely. Means if it contains fn modules I dont want to call those fn modules seperately.

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
1,743

Hello

Please note that the business object model is only a semantic model and has absolutely nothing in common with ABAP-OO.

If you call transaction SWO1 with BOR object INSTLN on ECC 6.0 there is a single "method" implemented:

- UtilInstallation.ChangeFacts => implemented by BAPI_UTILINSTALLATION_CHANFACT

Regards

Uwe

Read only

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes
1,743

Hi Sammy,

Phil Soady from SAP Australia provided me with this little gem a few years back. The actual documentation for this can be found somewhere in the workflow programming area, but I just looked and couldn't find it for you. Anyway, this is a sample program I built to show how to do this. In this example I call the Display method of the Sales Document BO.


INCLUDE <cntn02>.
INCLUDE <cntn03>.

FUNCTION zcallbomethod.
*"----------------------------------------------------------------------

*"*"Local interface:

*"----------------------------------------------------------------------

* Data declaration
***************************************************
  DATA: vbak_ref TYPE swc_object.

* Declare and initialise container
***************************************************
  swc_container container.
  swc_create_container container.

* Create object reference to sales document
*************************************************
  swc_create_object vbak_ref 'VBAK' '0000000009'. "Sales Document Number

* Call Display
***************************************************
  swc_call_method vbak_ref 'Display' container.

* Error handling

  IF sy-subrc NE 0.

    .....

  ENDIF.

ENDFUNCTION.

Cheers

Graham Robbo