Application Development 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: 

Programmatically retrieve all data for a Business Object Type

Former Member
0 Kudos

Hi,

I want to retrieve all data for a Business Object Type and send it to an external applications.

I think the correct way to do this is via an IDOC.

How do I generate such an IDOC programmatically. I want to use some Remote Enabled Function Module to do this.

Any suggestions?

Simon

3 REPLIES 3

former_member186746
Active Contributor
0 Kudos

Hi Simon,

What data of the BO are you talking about,

Simply the definitions of the BO, (all the methods, attributes and events, plus the abap code) in that case activate the trace

ST03 and then display a business object to see which tables are consulted for displaying the info for a BO, probably a bapi exists which retrieves the same info

Or are you interested in the attributes of the BO once it is instantiated? (check include <CNTN01> plus the macros swf_create_object and swc_get_property, use these as searchstring in the workflow forum for more info on how to use them

Also what is the exact functional requirement which lead to this question, there could be other solutions to it.

Kind regards, Rob Dielemans

0 Kudos

Hi Rob,

Let me explain what I am trying to achieve.

Lets say we have a SAP system containing e.g. a number of Employees (i.e. a number of instances of the Employee type). Now, I want to connect to the SAP system (probably through a RFC connection) from an external application (a C program) and retrieve all the data (keys and attributes) for these instances.

It would be comparable to a:

'select * from table employee'

in database terminology.

I then want to move the data through my C appl. and store it elsewhere.

I am very new to SAP, so maybe I use the wrong words to describe the problem.....

Best regards,

Simon

0 Kudos

Hi Simon,

I think the easiest solution would be to simply identify which attributes you need of BO EMPLOYEET (I'm guessing you want info of this BO)

Then check the abap of all of these attributes and copy that in a new remotely called function module. Most of the employee data is stored in several infotypes, these infotypes have corresponding tables, e.g. PA0000, PA0001 etc.

The other option would be to use the aforementioned method of instantiating the bo programmatically with the macro swc_create_object and retrieving the data with swc_get_property.

Either instantiate business object EMPLOYEET, or BUS1065

Kind regards, Rob Dielemans