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

Convert SAP standard ABAP program to a Function Module

Former Member
0 Likes
3,277

Hi all,

Can we convert a SAP standard report to a function module ?

Thanks

John

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,884

yes you can,

but you need to do copy paste for the code part.

1st,

if you have selection screen you can use that as import parameter of that function module.

2nd,

if you want a table output from that FM, define a table parameter in that FM as the final table of the report.

3rd,

the logic and coding can be the same as it is,

the declaration part can be copied to the top include of the FM.

and other subroutines can be moved to the subroutine include.

but the main thing is to check the objective of yours from that FM.

can you please tell us which report are you talking about?

9 REPLIES 9
Read only

Former Member
0 Likes
1,884

Hi,

I guess you could. Define the function module interface to be the same as the report selections and then use SUBMIT.... to run the report with the option EXPORTING LIST TO MEMORY to get the report output.

Regards,

Nick

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,884

yes , you can . but it depends how the report is executed .. i mean via selection parameters ?

Read only

Former Member
0 Likes
1,885

yes you can,

but you need to do copy paste for the code part.

1st,

if you have selection screen you can use that as import parameter of that function module.

2nd,

if you want a table output from that FM, define a table parameter in that FM as the final table of the report.

3rd,

the logic and coding can be the same as it is,

the declaration part can be copied to the top include of the FM.

and other subroutines can be moved to the subroutine include.

but the main thing is to check the objective of yours from that FM.

can you please tell us which report are you talking about?

Read only

0 Likes
1,884

Hi Soumyaprakash

The transaction of the SAP report is S_ALR_87012284 and its corresponding program is RFBILA00

Read only

0 Likes
1,884

HI

let's know why u need to transform a report in a function module

Max

Read only

0 Likes
1,884

Hi ,

The requirement is something like this :

We need to build a dashboard using Xcelsius tool fetching the data from SAP R/3 system. The above mentioned report is run by the client in its R/3 system and now they also want to see that data in a dashboard.

Xcelsius cannot connect directly to a R/3 system though it can connect to a BW system. So, here we're using Crystal reports as the data source for our dashboard and Crystal reports can only understand SAP R/3 tables, clusters, function modules etc. but not the whole report.

We know that above mentioned report is a huge one and to replicate the same logic in Crystal reports is a mammoth task, and that's why we are planning to develop a function module using this report which in turn can be used by Crystal reports.......

Your valuable suggestions are appreciated !

Thanks

John

Read only

0 Likes
1,884

There are a number of remote enabled FMs that submit reports. Why don;t you have a look at them to see if any meet your requirements. If none do, they should at least give you an idea of how to proceed.

Rob

Read only

0 Likes
1,884

Hi

Rob is right, probably the problem can be the report retunrs an ALV list, so u can create a rfc returns a table arranged like the output structure for ALV, this RFC should have an interface just replaces the selection-screen of the report.

Probably u the easier solution ca be to create a copy of that report exports the output table to memory instead of generating an ALV list.

This Z-report can be submitted by the RFC imports the output table from memory and returns it as results.

Max

Read only

0 Likes
1,884

Hi all,

In selection screen if we are having select-options then we will make it as import parameter for function module.

But in logic if we are fetching the data from that select-options in program then while coming to function module what we use instead of that select-option

eg: select * from usr02 into itab where uname in <Import parameter>?.