‎2007 Jan 02 9:47 AM
Hi, anyone has a sample code to call a custom RFC that returns table structure?
The RFC expect parameters to pinpoint the record and return it in a structure.
*----
*Local Interface:
IMPORTING
VALUE(CUSTOMER) LIKE KNA1-KUNNR
VALUE(MATERIAL) LIKE MARA-MATNR
VALUE(POSTING_DATEFR) LIKE BKPF-BUDAT
VALUE(POSTING_DATETO) LIKE BKPF-BUDAT
TABLES
SALES_VOLUME STRUCTURE ZRRPS_SALES
*----
Here's my vb code, but it return zero entries (I'm sure it should return records).
-
***Login Process Here***
Set objFunc = objSAPLogon.Add("Z_CUSTOM_SALES_DATA")
Set objSALES = objFunc.Tables("SALES_VOLUME")
With objFunc
.Exports("CUSTOMER") = "1234567"
.Exports("MATERIAL") = "1234"
.Exports("POSTING_DATEFR") = "10012005"
.Exports("POSTING_DATETO") = "10312005"
End With
If Not objFunc.Call Then
Debug.Print objFunc.Exception
Exit Sub
End If
Debug.Print objSALES.RowCount ==> 0
-
From here, I dont know what to do next. Am I missing something? Please help.
Thanks in advance!
/Noel
‎2007 Jan 02 10:06 AM
are you sure that your date format mmddyyyy is correct.
must'nt it be yyyymmdd?
A.
‎2007 Jan 02 10:16 AM
Yes, the RFC developer told me to use this format mmddyyyy.
I think the Exports portion is not working, and I dont know why. I tried remarking the Exports portion and it gives the same result, zero entries.
Thanks!
‎2007 Jan 03 8:53 AM
Hi,
the field Customer has 10 Characters and Material has 18 Characters.
Try your call with according leading zeros.
Regards Gerd
‎2007 Jan 03 8:58 AM
Yes you're correct! I already resolved this by supplying the leading zeros and separators for the two date fields.
Thanks!
‎2007 Jan 03 8:59 AM
I just supplied the leading zeros and separators for the date fields and it works!