cancel
Showing results for 
Search instead for 
Did you mean: 

Calling SAPScript from a FM

Former Member
0 Kudos
488

Hi,

I have a FM module which should call a SAPScript. It works fine with

static information on the SAPScript, but it does not work with dynamic

elements. For example, I have certain fields in my FM which content I

would like to print, but those variables are always empty. I copied my

FM to a regular ABAP report and it works fine. When I debug it, I can

see the contents of the fields in the FM, but they get cleared in the SAPScript.

By the way, I execute the FM with Single Test, because there is not ABAP

which will execute it later on. It will be executed via RFC.

Does anyone had this problem before and found a solution?

Thanks in advance!!!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi there

The variables you want to print in the SAPScript must be declared in the TOP include

of the function group to be available to the SAPScript

Regards

Anthony

Former Member
0 Kudos

Hi,

In addition to Anthony's point.

Do check whether you have declared the interface as a global interface.

Hope this solves your problem.

Regards,

Francis Gabriel

0 Kudos

How are the variables you are attempting to pass to your SAPScript defined?  If they are local variables to the FM I do not believe that they will be available to your form (as you are calling that via another function group using the START_FORM, WRITE_FORM FMs).

However, if they are export / tables parameters in your FM then I am still not clear on why they are not being passed across.  If this is the case, it may be useful for you to post some of your code and definitions in order that a more helpful response can be forthcoming.

Kind Regards

Rosie Brent

Analyst/Programmer

TKA Tallent Chassis Ltd.

0 Kudos

A further point occured to me after posting my original response.

Since you know when submitted using an ABAP report your SAPScript and driver program code work as expected, why not create your RFC FM as a 'wrapper' doing nothing but SUBMITting your ABAP report and RETURNing to the RFC a success / failure in production of your SAPScript output?

It may be the most simple solution to your problem.

Kind Regards

Rosie Brent

Analyst/Programmer

TKA Tallent Chassis Ltd.