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

RFC Function to get view data

Former Member
0 Likes
3,915

Hi

I have to get data from maintemence view and use it in a .NET program. I want to be able to get data from a maintenence view the same way as rfc_read_table gives me data from a r/3 table.

I think it is possible to create an abap function that takes a parameter <viewname> and calls the function Viewproc_<viewname> and then returns the TOAL table form Viewproc.

As far as i can see, foreach view, there is an abap function Viewproc_<viewname> that can give me the data i need.

Any comments or ideas? Or even better an abap problem that can solve my problem.

Im a university student with very little SAP experience, so i appreciate all the help i can get.

Thanks

12 REPLIES 12
Read only

BKesav
Explorer
0 Likes
2,488

Hi,

You can use BAPI function modules for non-SAP environments, just invoke a SAP BAPI (RFC) function from .net application. by connecting thru SAP.Connector.dll to SAP.

Check the tcode BAPI, search for the object type methods

or

use search help by typng BAPI* in SE37, function builder field.

Hope this help you, if it is wrong, pls post the answer here. ThanQ

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
2,488

Why dont you use rfc_read_table itself ?

Read only

0 Likes
2,488

Hi

The rfc_read_table does not allow me to read from a maintenance view

Read only

0 Likes
2,488

You cannot select data from a maintenance view.

Read only

0 Likes
2,488

Hi

Maybe i just have a hard time understanding SAP. To my knowledge, mainteneance views are generated on the fly and the data is not stored in a single table. Thats why rfc_read_table cannot be used. Right?

But - the FM view_maintenance_call can give me the relevant data in the SAP userinterface. Why cant i just enable RFC on that module?

Or perhaps one could build a module that gets the data form view_Maintenance_Call and returns it in some kind of temporary table. Please notice that i only need to read data, and not alter it. I therefor only need to pass the 2 non optional parameters to the function. Action (Display) and VIEW_NAME

Read only

0 Likes
2,488

Hi

Keshav is right, the maintenance view can't be used for data selection, if you need to use it for the join you can try to define a new view, but a DATABASE VIEW but arranged as maintenance.

Then u can try to use RFC_READ_TABLE to read the database view

Max

Edited by: max bianchi on Nov 4, 2010 10:17 AM

Read only

0 Likes
2,488

Thanks for the reply.

The problem is that i need to extract configuration data the same way as it is presented in the IMG.

For example the PP-PI "Process order types" that are maintained in the view "V_T003O_40".

All i want is a table with that data returned through an rfc function.

I have to extract large amounts of data, and manually creating database views for all views are unfortunately not an option.

Read only

0 Likes
2,488

Hello,

As mentioned you can't SELECT data from Maintenance View using Open SQL statements. Alternatively you can access the data via the FM 'VIEW_GET_DATA'.

The FM 'VIEW_GET_DATA' is not remote enabled. You can wrap this FM in a custom FM & try.

BR,

Suhas

Read only

0 Likes
2,488

Hi

If it's so u can try the solution suggested by Suhas: it seems to sound good

Max

Read only

0 Likes
2,488

Hi

Thats sounds like the way to go. I have absolutely no ABAP expreience, and therefor no chance of coding a FM wrapper to expose the "VIEW_GET_DATA" method. How long time would you estimate that a such module would take to develop for a pro ABAP programmer?

Thanks in advance

Kristian

Read only

Former Member
0 Likes
2,488

Hello Kris,

You can make use of the standard SAP Vie maintenance FM "VIEW_MAINTENANCE_CALL". But the only pre-requisties is that you need to create the table maintenence view for your custom tables.

Let me know if you have any questions.

Thanks,

Greetson

Read only

0 Likes
2,488

Hi

I have asked a SAP technician to enable RFC for the VIEW_MAINTENANCE_CALL. It was not possible: Here is his explanation why:

"unfortunately i cannot acrivate rfc for the module. I have tried to activate it, but then most datadefinitions must be corrected, since LIKE and TYPE are not valid definitions to RFC calls."

So it seems like im back to square one:(