on 01-19-2012 10:16 AM
Hi experts,
I try to call the remote-enabled function module SWNC_COLLECTOR_GET_SYSTEMLOAD from Excel VBA to save the workload data of the system and to create some graphs etc.
Logon to SAP works fine for now, but I have no idea how to hande the import parameter (which is an export parameter from the view of the function module).
Here is an coding excerpt:
' EXPORTS
Set oParam1 = objDisplay.exports("COMPONENT")
oParam1.Value = "TOTAL"
Set oParam2 = objDisplay.exports("PERIODTYPE")
oParam2.Value = "D"
Set oParam3 = objDisplay.exports("PERIODSTRT")
oParam3.Value = "01012012"
' IMPORTS
Set oParam4 = objDisplay.imports("T_SYSTEMLOAD")
' Call FM
objDisplay.Call
Debug.Print oParam4
The debug-print gives an error 0. I have no clue what the error means.
Could anybody help me to solve the issue?
Set trace level on the connection and review trace file output on SAP/Sap gui/ folder in your documents folder. Look for communication or authority.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Davor,
Did you get a solution for this?
The function is remote enabled, I get a error while calling the function donot know what the error is, I check the format for all variables and they are correct....
Regards
Amit Jain
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think not. The parameters are ok and are working for other function modules without problems.
I have found out - as implied by Michael - that I cannot call this function module although it is clearly remote enabled.
If I call an other SWNC* function module it works for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just remembered we have a EHP4 sandbox, checked it and I see it's remote enabled there. The start immediately option refers to the Update Module.
With this cleared, can you try the following? The date format you used if DDMMYYYY, can you change it to YYYYMMDD and retry?
This change will look like this
oParam3.Value = "20120101"
Michael
Thanks for the hint. I really have tried everything. After activating RFC-Trace I found out that there was an error calling the function module in the ECC system. After that I tried another SWNC* function module with the same date format and it worked without problems.
I think I will copy the standard function module to a Z* one and give it another try. Thanks for your help.
Davor, just tested the funtion from an Excel macro connecting it to my EHP4 sandbox. I get the same RFC conection error. As the date parameter is optional, I just passed COMPONENT and PERIODTYPE and got the error too, so it's not a date format problem.
I then tried SWNC_GET_WORKLOAD_DIRECTORY (which is remote enabled too) and the connection was successful. So, there is obviously some problem with the function module.
Alternatives: build the Z function module, or post a message on OSS with the error.
Cheers,
Michael
Hello Davor.
To me this is looking abit odd:
Set oParam3 = objDisplay.exports("PERIODSTRT")
oParam3.Value = "01012012"
When executing this function module in SAP this value is incorrect, instead SAP prompts for a valid date value i.e 2012-03-08. Could this be your problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Davor,
on ECC 6.0, this FM is not remote access enabled, so this is your first problem. A workaround to this is to create a Z function module that will call the standard FM. Copy de importing and exporting parameters from the standard to your Z version, make it remote access enabled and call it from your Excel VBA code.
Hope it helps and I'n not late
Cheers,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.