|
I'm new in BAPI Programming,
I'm trying to call GetList method from GeneralLedgerAccount Business Object,
and got this error message 'The persistent key for an business object instance
of type GeneralLedgerAccount has not been set. Cannot invoke method GetList'.
How can I set the persistent key, and what is the persistent key exactly ? How can I check the persistent key in the BOR ? I'm using SAP R/3 version 3.1g and VB version 6.0 Answer: Although we are currently using SAP 4.0B, the GeneralLedgerAccount BAPI has not changed significantly (if at all). I have had this error message many times working with HR BAPI's and it took a lot of research to finally puzzle out what SAP actually wants in these situations. On the other hand, I took a look at the GetList method for this BAPI and I cannot see why you would be getting this error! There are three kinds of BAPI's I have encountered so far - those that return actual tables of data based on key fields you fill in (i.e.. Employee.GetList), those that return tables of keys that point to the actual data within SAP (think of C pointers! ie.EmployeePersonalData.GetList), and BAPI's that have no input parameters at all but can retrieve extra information directly related to a particular 'instance' of a business object that you have previously 'instantiated' (translation - the last 'record' you 'read' from the table! i.e.. EmployeePersonalData.GetDetail). GeneralLedgerAccount is of the first type, while the error you get is related to BAPI's of the third type. It is usually caused by calling a GetDetail method without calling GetSAPObject with a complete, unique key value first. The following code fragment shows how I read Employee.GetList - this may shed some light on what you might be missing. The second fragment shows how to 'instantiate' a 'persistant' object (don't we just love this terminology?) before calling a GetDetail BAPI. Hope this helps you out! ===================================================
oBapiControl = CreateObject("SAP.BAPI.1")
- Substitute the word 'GeneralLedgerAccount' for 'Employee' and this should work for you! ===================================================
cSep = Chr(9)
' RETRIEVE ALL FAMILY MEMBERS FOR A GIVEN PERSONNEL
NUMBER.
*-- End of Program |
|
See Also
ABAP Books
More ABAP Tips
SAP ERP Modules, Basis, ABAP and Other IMG Stuff All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|