Q
Problem solve Get help with specific problems with your technologies, process and projects.

Troubleshooting error: "BapiGetOpenItems"

Learn how to solve the error "BapiGetOpenItems" when working with SAP BAPIs.

I'm a beginner in using BAPI's... The first BAPI I used is the
"BapiCreateFromDat1" and it's now running. Now, I am using the
"BapiGetOpenItems" but I always prompted for error. 
The error is... "Company code does not exist". 
This is how I implemented the Bapi:

<%
Set OpenI = Server.CreateObject("SMB.ARAccount.1") 

call OpenI.DimAs("BapiGetOpenItems", "KEYDATE", Key_date)

call OpenI.DimAs("BapiGetOpenItems", "LineItems", OpenILineItems)

call OpenI.DimAs("BapiGetOpenItems", "Return", BapiReturn)
  
Key_date = "09/25/2000"
  
OpenILineItems.Addnew
OpenILineItems.Fields("Comp_Code") = "0010"
OpenILineItems.Fields("CUSTOMER") = "0000100429"
OpenILineItems.Update 
  
OpenI.Destination = "BEER"

%>

<%
on Error Resume Next
call OpenI.BapiGetOpenItems( Key_date, OpenILineItems, , BapiReturn)
%>

Are my codes correct? Please help me. 


a) "Keydate" is not a structure or table parameter so it makes no
sense to call DimAs for this parameter.

b) There is no reason to fill the "Lineitems" table parameter, 
it is filled by the BAPI.

c) You need to set the "CompanyCode" and "Customer" key fields by using
the InitKeys method of the proxy class. 
This was last published in July 2001

Dig Deeper on SAP ABAP

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close