on 04-03-2006 11:42 AM
I seen in some sites that we can query the SAP database using doQuery()..
If i use the tablename eg.OCRD used by SAP for my application.. Is there any chance of changing the table name in SAP..
If anybody having exposure in SAP SDK please give me some ideas about that
Hey Sooriya,
Where possible you should use the business objects in the API such for objects that are avaiable such as OCRD (business partners), OITM (items) etc.. This ensures compatibility with the Business one system. Unfortunately not all of the objects you need are available and you have to use the query method to get the information you need. When doing this you must be aware that the database structure may change in patches, upgrades etc.. You will need to test your application for each release when you upgrade the client.
Usually table names do not change a whole lot. But field names can change with major releases.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Curtis..
Thanks for ur immediate reply..
I m in ETL project to access data from SAP to Access and vise versa.
I want to know some more details..
1.We usually retrieve the Business Partners List by using GetBPList() method and we traverse record by record and save it as a XML.(XML contains a single recordset)
Is there a way to retrieve full Business Partner Records in a single XML?
Please reply immediately
Thanks in Advance
Sooriyakala.P
Hi Curtis,
i used GetBPList(),it saves only a single record in a XML if we store as SaveXML().
I want to get all records of a table using BusinessObject of any SAP module without specifying any keys.If i access using GetByKey(1) ,like that i can access a single record as resultset.But my requirement is getting the whole records <b>without using keys</b>.Is it possible by ur experience..
If u give ur official id,i can get more details regarding SAP SDK.
Thanks and regards
Sooriyakala
Following code works for me (in VB):
Dim rs As SAPbobsCOM.Recordset
Dim query As String
Try
query = "SELECT * FROM OCRD"
rs = oCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
rs.DoQuery(query)
Console.WriteLine("aantal regels ", rs.RecordCount) If rs.RecordCount > 0 Then Dim file As String = "c:\temp\bp.xml" Console.WriteLine("file: ", file)
rs.SaveXML(file)
End If
Catch e As Exception
Dim message As String = _
e.[GetType].ToString + ":" + vbCrLf + _
e.Message + vbCrLf + _
e.StackTrace
Console.Error.WriteLine(message)
MsgBox(message, MsgBoxStyle.Critical)
End Try
Regards,
Jacco.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Maybe you can do something like this (example is in JAVA):
IRecordset rs = null;
try
{
String selectQry = "select * from OCRD";
rs = SBOCOMUtil.runRecordsetQuery(oCmp, selectQry);
if (rs.getRecordCount() > 0)
{
rs.saveXML("c:\temp\bp.xml");
rs.release();
}
}
catch (SBOCOMException e)
{
e.printStackTrace();
}
Hope it helps.
Kind regards,
Jacco.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.