cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot execute Function Modules on Crystal Reports 2008 against SAP ECC

Former Member
0 Kudos

Experts,

We are connecting SAP ECC to Crystal Reports 2008. We are able to connect to SAP Tables and create reports but we cannot use / execute Function Modules on Crystal .

We tried to execute simple functions modules on Crystal and then ran the report but the function module does not return any values. We also did a SM50 to check whether we can see any Crystal entries , but we see none. The same FM though executes fine on SAP.

I have followed chapter 14 of SAP Integration Kit 3.1 to create the authorizations ( sorry, we cannot give SAP_ALL as this is a productive environment.) also the transports are fine in \usr\sap\trans\cofiles and data folders..

Regds

Girish

Accepted Solutions (0)

Answers (2)

Answers (2)

IngoH
Active Contributor
0 Kudos

Hi,

in the User Guide for the SAP Integration Kit there are some examples on what kind of output type you can use for the ABAP functions. Is the ABAP function RFC enabled ? Do you see no ABAP Functions at all or are you missing a particular one ?

Ingo

Former Member
0 Kudos

Thanks for taking this up Ingo .

We are trying to use a specific ABAP function called "READ_TEXT" in Crystal, (we are able to see it on Crystal reports, so we assume that RFC is enabled for ABAP functions.) This function has a output type THEAD.

Secondly, we executed this report on Crystal with this function , and then we did SM50 in ECC but we dont see the Crystal connection coming in...... ( though we can see the connection in SM50, when the crystal is executing reports using standard SAP tables)

Please help.

Regds

Girish

Former Member
0 Kudos

Update .....

now we can see a connection in SM50, because we enabled 'Generate RFC trace files' when we create a new connection on Crystal side.

Though when we execute a function module, it still doesnt show any data on Crystal. we tried to put all available fields on the crystal report but still no luck..... the simplest function module we are using is "CONVERT_CURRENCY_BY_RATE"

Please help !

Regds

Girish

Former Member
0 Kudos

Help needed !!! Still no luck......

We have now made a Z function module and "remote enabled", but its still the same.... we can see the connection in SM 50 but nothing shows on crystal.... we have put all the fields available in READ_TEXT or NET_DUE_DATE_GET on Crystal,.. but still no luck...

Any help would be really appreciated .

Regds

Girish

IngoH
Active Contributor
0 Kudos

Do you see any ABAP Functions listed ?

Ingo

Former Member
0 Kudos

Yes, we selected the ABAP function that we wanted i.e NET_DUE_DATE_GET from Make a new connection --> SAP Table Cluster or Function -->FN -->Options --> table name like "%NET_DUE_DATE_GET" and then clicked refresh.

Then this function comes up under FN and we used the same on our Crystal Reports.

Regds

Girish

Former Member
0 Kudos

Any ideas ?

IngoH
Active Contributor
0 Kudos

Hi,

are you able to see and run standard BAPI functions - for example the demo functions from SFLIGHT ?

Ingo

Former Member
0 Kudos

Ingo,

Yes, I can run BAPI_SFLIGHT_GETDETAIL in Crystal ,no issues. The problem comes when I execute READ_TEXT function Module.

I have raised a SAP Message already. (267202/2010) and SAP called me to WeBex into our system ... they checked it but acknowledged that there is a problem with this function.

I woudl recommend you to try this out:

In SE37 , check the exporting param for READ_TEXT ..it is THEAD . If you double click on it , it shows a bunch of fields, which I do get when I bring it over to Crystal. The problem is when this is executed (on Crystal) the values show empty. We debugged the function in SE37 and found that the values are wiped out at the end of the execution which is why Crystal gets it as blank.

(Any ABAP guy should help you get the input values for this function.e.g. you can get it from VA43).

Let me know your comments .

Former Member
0 Kudos

Hi There,

i'm trying the same. If i check the BAPI_SFLIGHT_GETDETAIL in SE37 i need to enter some import-parameters which i do not know. If i enter

AIRLINECARRIER "LH"

CONNECTIONNUMBER ""

DATEOFFLIGT "01012001"

i only get one Row.

RETURN:

EBC_BOR 045Keine Berechtigung für Fluggesellschaft LH

Does anybody know a sample to get more rows? I need a RFC Function-Module which has only single import paramters but deliver many rows.

I also tried the function Module "RFC_READ_TABLE" in SE37 and entered a tablename as an import-parameter (every ERP should have this function module). It delivers all colums and all rows of the definded table in SE37. But if i use this function module in crystal, i can enter the import-parameters but i do not get any result...

Any Ideas ?!

Best regards,

Sebastian

IngoH
Active Contributor
0 Kudos

hi,

on the first part that looks like an authorization issue and you might have to talk to the basis admin person.

When you connect to the function in Crystal Reports do you see the import parameters ?

whats the output type of the function ? Each output needs to have a defined return type

Ingo

Former Member
0 Kudos

Hi Ingo,

the base admins changed my permissions to sap_all so it should not be the problem.

i also see the input and the output-parameters in crystal.

Can you tell me where i see in SE37 if my ABAP-Function module has a defined return type for each output-parameter?

Do you know a sample ABAP funtion module which delivers a table or several rows as an output so that i can compare it with my ABAP function module?

Your help will be appreciated,

Regards

Sebastian

IngoH
Active Contributor
0 Kudos

Hi,

sample function - BAPI_SFLIGHT_GET_LIST

ingo

Former Member
0 Kudos

I used READ_TEXT FM and it returns a few hunderd rows to me.... We are using this in Crystal to get the Sales Contract info......so if you are worried that the FM's do not return multiple rows then this should clear your doubt.

You could ask your ABAP person and he should be able to tell you a bunch of FM's for your testing.

Regds

Girish

Former Member
0 Kudos

Thanks,

i only habe BAPI_SFLIGHT_GETLIST and not BAPI_SFLIGHT_GET_LIST. If i open it in SE37 and switch to the Export-Tab i see

ParameterName Typisierung Bezugstyp Wertübergabe Kurztext

RETURN LIKE BAPIRET2 x Fehlermeldungen

Is this what you mean when you say "every output needs to have a defined return type" ?

regards

Sebastian

Former Member
0 Kudos

Girish,

i have this FM too. Can you give me some input parameters for testing ?

Thanks Sebastian

Former Member
0 Kudos

Believe me , this could get more complex.. I would recommend to talk to you ABAP to give your a FM which returns multiple values.. ( else put in your exact requirement and some one could respond to it.)

anyways, here's the procedure to find input parameters for READ_TEXT

Setup a trace in ST05 for Sales Contract VA43 tcode.

Enter the Contract number and click on Sales or make sure to display the document.

Stop the trace

go to the trace records and find object STXL and see the corresponding SELECT statement.

Use those values from the SQL (ID LANGU NAME, OBJECT) in SE37 and execute the FM. You would get 1 entry in the result. Click the result and you would see multiple rows extracted by the FM.

To do the same on Crystal ... its even more tedius.. Put THEAD ( struct) and READ_TEXT FM on Crystal.

Map all the input fields (even MANDT) from TDHEAD to READ_TEXT param.

The output param is TDLINE / TDNAME, map that as well and execute.

Regds

Girish

Former Member
0 Kudos

Hi Girish,

i found some Input-Parameters in the SE37 Test-Data-Repository. I used them and the READ_TEXT function module gave me one line in "Export Parameters" and one Entry in "Tables" (Table Name: Line) back. Can see them in SAP.

When i changed to crystal and send all input parameters to ERP, i do not get any result for E_HEADER.* or T_LINES.* .

I asked all my ABAP developers here at my company and also a developer from SAP itself, and they gave me a lot of function modules but i never saw any result. I'm trying and trying since two weeks... its frustrating.

regards

sebastian

p.s. i'll try the complex way you'll recommended...i'll report my result...

Edited by: smenzl on Apr 29, 2010 4:41 PM

Former Member
0 Kudos

ok, here's how you link the FM on Crystal:

Bring in Table STXL and FM READ_TEXT on Crystal

Link as under:

STXL READ_TEXT I_CLIENT

MANDT

Former Member
0 Kudos

ok, here's how you link the FM on Crystal:

Bring in Table STXL and FM READ_TEXT on Crystal

Link as under:

STXL READ_TEXT

MANDT I_CLIENT

TDID I_ID

TDNAME I_NAME

TDOBJECT I_OBJECT

TDSPRAS I_LANGUAGE

Output fields should be:

T_LINES or anything that starts with a T_

Click Preview - First 100 records. You should see the result.

Regds

Girish

Former Member
0 Kudos

Hi Girish,

i did exactly what you said. i linked the table STXL to the FM READ_TEXT. I moved T_LINES.TDLINE and T_LINES.TDFORMAT in my Details-Section in Crystal. I clicked on "preview"....

.... no result

Crazy...

regards sebastian

Former Member
0 Kudos

Girish,

i have to leave for today. Can we try a WebEx Remote-Session for tomorrow ? I can send you an invitation to the mail address you've entered at your SAP User's business card...

Regards

Sebastian

Former Member
0 Kudos

You would have to create "Record Selection" entries in Crystal Report and hard code the values first before you execute the crystal report for your testing.

The record selection parameters should be the same that you enter during your FM testing in SE37 ( NAME, OBJECT, LANGUAGE ID etc.. I guess they are 5 of them.)

Webex should be fine with me, if its permitted.

Former Member
0 Kudos

Hi Girish,

i tried the same parameters in crystal which i entered in SE37:

{READ_TEXT.I_ARCHIVE_HANDLE} = "0" and

{READ_TEXT.I_NAME} = "6685642" and

{READ_TEXT.I_LANGUAGE} = "DE" and

{READ_TEXT.I_ID} = "GRUN" and

{READ_TEXT.I_CLIENT} = "040" and

{READ_TEXT.I_OBJECT} = "MATERIAL"

...no result...

AndreasForster
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi, You might need to use the shorter version of the language key in Crystal.

Executing READ_TEXT function within SE37 requires "EN" for English for instance. But when pasing the parameter through Crystal "EN" will not return any values. Here you need to pass "E".

Former Member
0 Kudos

Hi Andreas,

absolutely crazy !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I entered "D" instead of "DE" in Crystal and IT WORKS !!!!!!! THANKS !!!!! Although the Import-Parameter in SE37 delivers with "D" no result and wants a "DE" instead of it.

Can you explain it why ? I think this will fix all my problems regarding funcion modules !!

THANK YOU SO MUCH !!!

Regards

Sebastian

AndreasForster
Product and Topic Expert
Product and Topic Expert
0 Kudos

Nice one. I had the same behaviour once that a function written around READ_TEXT returned data just fine in SE37 but Crystal would not see any data when passing the same parameters.

A colleague ran a trace in SE37 then and we noticed that when calling the function directly in SE37 one enters "EN" as language but internally it uses only "E". So SE37 must have translated the language into the single character before passing it to the function.

Former Member
0 Kudos

Hi there,

i fixed every problem with my Crystal access to the ABAP function modules now. A big "THANK YOU" to Ingo, Girish and Andreas.

A short summary for everyone out there:

- The first tip came from Ingo, that each output parameter has to be definded!

- The ABAP function module has to be RFC compatible

- The last one was that the function module is not that restrictive when the import parameter comes from SE37. Here i can enter a ordernumber without leading zeros "400341" and i get a result. But if the import parameter of the function module comes from Crystal, it's very restrictive. I have to enter the leading zeros "000000400341". The tip from Andreas with "DE" from SE37 and "D" from Crystal was the right one.

Thanks to all !

Sebastian

Former Member
0 Kudos

Hi Girish,

I need help. I am testing this scenario of accessing the READ_TEXT from crystal report. I was able to access the function module and I entered the hard coded values from Record selection and executed the report. Now I was able to get the data for the record selection values. But how do I join STXL with READ_TEXT. I mean instead of hardcode values how to pass the values from STXL to READ_TEXT in order to execute successfully and get the data from the function module. What are the steps involved for this?

Thanks in advance.

BABASHARI

IngoH
Active Contributor
0 Kudos

Hi,

in case your issue is not the original issue I would suggest you open a new entry in the forum.

regards

Ingo

Former Member
0 Kudos

Hi experts,

I have a simular issue

System:

Crystal Reports version   : Crystal Reports 2008 - Version 12.3.0.601

SAP system                         : SAP CRM ABAP 7.0

Preparation:

Build a Remote Function Enabled function module that calls the function module 'READ_TEXT'.

The situation:

Once we call the Remote Function Enabled 'ZZZREAD_TEXT' function module directly with the necessary Record Selection data is shown in Crystal Reports. So far so good.

Now we like to be more flexible and therefore we want to get the necessary data for the 'ZZZREAD_TEXT' function module directly from database tables. In Crystal Reports we make the link as shown underneath.

We have a Record Selection on 'OBJECT_ID' for our starting point at table 'CRMD_ORDERADM_H'.

The given 'GUID' is linked with the 'GUID' of table 'CRMD_ACTIVITY_H'. This activity guid we use as link to the 'STXH' table (field 'TDNAME'). We set Record Selections on 'TDOBJECT' (crm_orderh),

'TDID' (A002) and 'TDSPRAS' (E also tried EN). These fields are linked to the 'ZZZREAD_TEXT' function module. If we use 'EN' for tdspras then we get an empty Crystal Report report. If we change to the suggested 'E' for tdspras then we get the error messages: 'Failed to retrieve data from the database' and

'Invalid Argument provided'.

Once in the debugger, the data provided to the 'ZZZREAD_TEXT' function module seems to be correct.

After the execution of the function module our text table is filled with the activity text.

Anyone a clue on why we get an empty report or the error messages?

Former Member
0 Kudos

I tried the same with a very simple BAPI (BAPI_USER_EXISTENCE_CHECK).

If we put direct a Record Selection on this BAPI outcome is good and data is shown on Crystal Reports. Now we try to get the username from the database table USR02 and link this one to the given BADI. Then again we get the error messages: 'Failed to retrieve data from the database' and

'Invalid Argument provided'?

I am lost and any suggestion in the right direction would be great.

Thanks in advance!

0 Kudos

Moved to Integration Kit forum.