Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing SAP
Message
 
To
30/06/2003 12:56:08
Jason Lanier
Ofs Brightwave Carrollton
Carrollton, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00805260
Message ID:
00805391
Views:
19
VB supports something called "default" properties (I believe that's the name but I am not 100% sure.)

Anyway, the idea is that sometimes when you reference an object in VB, for example a texbox, you can say txtName = "Joe" and VB will automatically assign the value to the "default" property of the textbox, for example to txtName.value = "Joe"

VFP does not support these "default" properties. What you need to do is find out what is the "default" property for the object that you are trying to use and reference that property explicitly.



\
>When I tried that, I got the error "Invalid subscript reference."
>
>I was able to find some other code since I posted the original message that seems to work. Instead of:
>
>toptions = rfc.Tables("OPTIONS")
>toptions(1,"TEXT") = "test string"
>
>I used
>
>oRow = rfc.Tables("OPTIONS").Rows.Add
>oRow.Value(1) = "test string"
>
>and it worked. It updates the same object in Visual Basic, but in VFP this seems to be the only way to reference the object.
>
>Jason
>
>>>I have the code for accessing SAP with Visual Basic, but I am having difficulty doing the same thing with VFP.
>>>
>>>I am able to successfully do the connection, but executing one of the "SAP.Functions" functions is not working.
>>>
>>>After running:
>>>fns = CreateObject("SAP.Functions")
>>>rfc = fns.Add("READ_TABLE")
>>>toptions = rfc.Tables("OPTIONS")
>>>
>>>I get an error when trying to assign something to toptions:
>>>toptions(1,"TEXT") = "test string"
>>
>>It seems to be saying that there is a problem with the "TEXT". What happens when:
>>toptions(1,1)="test string" ?
>>
>>Does it fail the same way?
>>
>>>
>>>The error is: "Function argument value, type, or count is invalid."
>>>
>>>Does anyone have any experience with using "SAP.Functions" in VFP?
>>>
>>>Thanks,
>>>Jason
Hector Correa
Previous
Reply
Map
View

Click here to load this message in the networking platform