Lookup an AP Invoice using BP Reference No. through SDK
Hi,
I am trying to write an addon using DI API to upload AP Invoices from Excel to SAP. I need to validate that the same vendor invoice has not already been uploaded. How can I find if any AP Invoice exists based on the BP Reference No.?
Which method of which object should I use? A simple code fragment will be helpful.
Thanks.
Hi Rajesh,
There is a way to query for a key of an object. Then you can use that with GetByKey(). However it requires to calls instead of one. In simple cases its better to just query the database.
Public Function GetObjectKeyBySingleValue( _
ByVal ObjNum As BoObjectTypes, _
ByVal PropName As String, _
ByVal Value As String, _
ByVal Condition As BoQueryConditions _
) As Recordset
This function belong to the SBObob object.
There is also a sample that shows how to use it in the SDK Samples:
Best regards,
Pedro Magueija
Similar Messages
-
How to clear Documents using XBLNR(Reference field) through Manual BRS-FF67
I want to clear GL line items in clearing account using Manual BRS(FF67) with reference to "XBLNR" field(Reference). IS there any standard Algorithm which SAP provided for reference field or if we want to develop ne algorithm then how to create.
Thank in advance.
Best Regards
RajHello Raj,
It is not possible to clear an open item on a g/l account via the
reference document number. The automatic clearing with interpretation
algorithm 021/001 only takes place, if the item, which should be cleared
is on a customer/vendor account. So it could never find open G/L items.
The reason is that the reference number is usually not unique
so it could lead to wrong clearings.
A workaround therefore would be to use:
a) another interpretation algorithm depending on the note to payee
data are available.
b) the user exit 1 (described in note 494777, point 1) if there are
no other information available as the reference number.
c) the report SAPF124/E to clear these items afterwards. Then the bank
statement should only post FB01 without clearing. The requirements
are criteria to assign and clear the suitable items.
Regards,
Renan -
Hi
I am just a starter on WLPortal.
I have created a barebone Application from scratch. I have synchronized it properly
from EBCC to WLP. But When I am trying to access the home page of my application,
I am getting from stack trace -
<Nov 6, 2002 5:37:59 PM IST> <Error> <PortalAppflow> <Could not lookup PortalManagerHome
in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager.
javax.naming.NameNotFoundException: Unable to resolve comp/env/ejb/PortalManager
Resolved: 'comp/env' Unresolved:'ejb' ; remaining name 'PortalManager'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:802)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:209)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:173)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:181)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:181)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:36)
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:124)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.bea.p13n.util.JndiHelper.lookupNarrow(JndiHelper.java:96)
at com.bea.portal.appflow.PortalAppflowHelper.<clinit>(PortalAppflowHelper.java:64)
at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.init(PortalWebflowServlet.java:78)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:700)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:643)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:588)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:368)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:215)
at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:112)
at jsp_servlet.__index._jspService(__index.java:92)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:304)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2459)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
<Nov 6, 2002 5:37:59 PM IST> <Error> <HTTP> <[WebAppServletContext(19695286,FirstWebApp,/FirstWebApp)]
Servlet failed with Exception
java.lang.NullPointerException:
at com.bea.portal.appflow.PortalAppflowHelper.createPortalManager(PortalAppflowHelper.java:82)
at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.setupPortalRequest(PortalWebflowServlet.java:187)
at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.doGet(PortalWebflowServlet.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:215)
at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:112)
at jsp_servlet.__index._jspService(__index.java:92)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:304)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2459)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
When I decompiled the class PortalAppflowHelper, I found a static block in it,
which was as under-
static
debug = Debug.getInstance(com.bea.portal.appflow.PortalAppflowHelper.class);
try
if(debug.ON)
debug.out("Looking up PortalManagerHome using EJB reference java:comp/env/ejb/PortalManager");
portalManagerHome = (PortalManagerHome)JndiHelper.lookupNarrow("java:comp/env/ejb/PortalManager",
com.bea.portal.manager.ejb.PortalManagerHome.class);
if(debug.ON)
debug.out("Successfully retrieved PortalManagerHome " + portalManagerHome);
catch(Exception e)
PortalAppflowLogger.errorFindingPortalManagerHome("java:comp/env/ejb/PortalManager",
e);
I have checked the PortalManager's JNDI name on WLConsole. Its ${APPNAME}.BEA_portal.PortalManager.
Should I change it?
When I tried to change it, I started getting other weird errors.
Thanks
Neeraj HansNeeraj -
The Portal framework code (including PortalAppflowHelper) uses ejb
references to find the PortalManager (and other EJBs) from servlets and
taglibs; that is what is signified by the java:comp/env/... name.
Since you built your webapp from scratch (instead of using the portal
wizard), you will need to make sure the you have the appropriate
<ejb-ref> entries in your web.xml, and the corresponding
<ejb-reference-description> entries in your weblogic.xml. By default,
you will need at least mappings for:
- ejb/PortalManager
- ejb/UserManager
- ejb/GroupManager
- ejb/PipelineExecutor
- ejb/EventService
See either the resulting webapp from using the portal wizard or
BEA_HOME/weblogic700/samples/portal/sampleportalDomain/beaApps/sampleportal/sampleportal/WEB-INF
for example syntax.
Greg
Neeraj Hans wrote:
Hi
I am just a starter on WLPortal.
I have created a barebone Application from scratch. I have
synchronized it properly
from EBCC to WLP. But When I am trying to access the home page of my
application,
I am getting from stack trace -
<Nov 6, 2002 5:37:59 PM IST> <Error> <PortalAppflow> <Could not lookup
PortalManagerHome
in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager.
javax.naming.NameNotFoundException: Unable to resolve
comp/env/ejb/PortalManager
Resolved: 'comp/env' Unresolved:'ejb' ; remaining name 'PortalManager'
at <stack trace lines snipped>
When I decompiled the class PortalAppflowHelper, I found a static
block in it,
which was as under-
static
debug =
Debug.getInstance(com.bea.portal.appflow.PortalAppflowHelper.class);
try
if(debug.ON)
debug.out("Looking up PortalManagerHome using EJB
reference java:comp/env/ejb/PortalManager");
portalManagerHome =
(PortalManagerHome)JndiHelper.lookupNarrow("java:comp/env/ejb/PortalManager",
com.bea.portal.manager.ejb.PortalManagerHome.class);
if(debug.ON)
debug.out("Successfully retrieved PortalManagerHome "
+ portalManagerHome);
catch(Exception e)
PortalAppflowLogger.errorFindingPortalManagerHome("java:comp/env/ejb/PortalManager",
e);
I have checked the PortalManager's JNDI name on WLConsole. Its
${APPNAME}.BEA_portal.PortalManager.
Should I change it?
When I tried to change it, I started getting other weird errors.
Thanks
Neeraj Hans -
CREATE SALES ORDER WITH REFERENCE TO INVOICE USING RECORDING
Hi,
I wanted to know if it was possible to create a sales order with reference to an invoice using recording(SHDB transaction).If there is some other method please explain the method in detail(Its very urgent)Hi,
You should be able to use BAPI_SALESORDER_CREATEFROMDAT2 instead of doing a BDC and you can populate the reference document in the relevant header field.
Gareth. -
Invoice VF01 with reference to the sales order
Dear Experts,
Our business requirement is to book the invoice with reference to the sales order without posting delivery and PGI. Provide me the step by step process to complete this configuration.
Is that suggestible to change the existing document type which the business is using by creating delivery PGI and Invoice to the document type where invoice booking with reference to sales order or I have to go with the new document type only.
With Regards
Uday
Message was edited by: G Lakshmipathi
Please dont add such text in your post which is not encouraged in SCN.TW Typewriter
can you help, by creating the entire process in Sandbox and informing uday about the configuration steps?
At the outset, please refrain posting like this which, being a senior member of SCN, you should be aware of rules where spoon feeding is definitely not encouraged. Those sort of efforts have to be taken by OP. This forum is only to guide the people wherever they get stucked.
cc: Phanikumar V
You should also be knowing the forum rules and I thought, you would have expressed like what I said above.
G. Lakshmipathi -
Clearing an Invoice using the DI
Hello
I am experiencing a problem when I generate a Journal Credit that is matched to a invoice using the DI but the balance on the invoice does not reduce or clear. I am using the following code:
' Generate the Excess Invoice/Document
oJournal = oDICompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)
oJournal.TaxDate = Now
oJournal.Memo = "Excess-" & oCustName.Value
oJournal.Reference = lDocNum
oJournal.Lines.AccountCode = sGLTradeAcc
oJournal.Lines.ContraAccount = oCustAcc.Value
oJournal.Lines.ShortName = oCustAcc.Value
oJournal.Lines.Debit = rExcAmt
oJournal.Lines.Credit = 0
oJournal.Lines.ReferenceDate1 = Now
oJournal.Lines.LineMemo = "Excess-" & oCustName.Value
oJournal.Lines.Reference1 = lDocNum
oJournal.Lines.Add()
oJournal.Lines.AccountCode = sGLTradeAcc
oJournal.Lines.TaxDate = Now
oJournal.Lines.ContraAccount = oInvParty.Value
oJournal.Lines.ShortName = oInvParty.Value
oJournal.Lines.Credit = rExcAmt
oJournal.Lines.Debit = 0
oJournal.Lines.ReferenceDate1 = Now
oJournal.Lines.LineMemo = "Excess-" & oCustName.Value
oJournal.Lines.Reference1 = lDocNum
oJournal.Lines.Add()
If (0 <> oJournal.Add()) Then
MsgBox("failed to add a journal entry")
Call oDICompany.GetLastError(nErr, ErrMsg)
If (0 <> nErr) Then
MsgBox("Found error:" + Str(nErr) + "," + ErrMsg)
End If
End If
oJournal = Nothing
Please help !
Regards
JohnHi John,
You can only "clear" (= "Close"?!) an Invoice by posting a Payment or a Credit Memo, if I am not totally wrong!
A Journal entry only has a connection to a document (through the Origin / Origin No. fields) when it is generated in the background of the document creation!
Sorry, Frank -
hi all,
when i have an enterprise application with a session bean and a webapp,
i can access the session bean either over an ejb-reference in the webapp or directly access the jndi entry. what is the advantage of using ejb references? here an example of what i mean (both from within a webapp):
ctx.lookup("myBean"); // without ejb ref
ctx.lookup("java:comp/env/ejb/myRef"); // with ejb ref
I get back the same, so whats the difference?
rgdsWith ejb-reference a container optimizes access to collocated beans. For example, say you have a deployment where beans A and B are both replicated in two different containers, for performance and/or availability reasons. For optimal use every instance of A in container would use instances of B also in container one. Likewise for container two. An EJB container can enforce this locality constraint using ejb-links, but not always using direct JNDI names.
-
Ejb-link is still required when using local references?
Hi!
In BEA's link (http://e-docs.bea.com/wls/docs81/ejb/DDreference-ejb-jar.html#1114738) there is the following comment for weblogic-ejb-jar.xml element 'jndi-name':
"Assigning a JNDI name to a bean is not recommended. Global JNDI names generate heavy multicast traffic during clustered server startup. See Using EJB Links for the better practice."
Since we're using local references (local-jndi-name) to access our ejbs instead of remote references, is this still recommendation still pertinent?
Thanks
ChristianneIt is enough if you add the ejb-ref & ejb-link in the session bean. The
session will look up relative to java:comp/env
The following doc shows an example of accessing an ejb from a web app using
ejb-link.
http://e-docs.bea.com/wls/docs81/webapp/components.html#146848
--Sathish
<Christianne Carvalho> wrote in message news:[email protected]..
I'm not getting very well how the ejb-link is used. In my case I have
entity beans that are referenced in session beans.
In my entity beans I have the following XDoclet tag.
* @ejb.bean
* name="ProductDescription"
* display-name="ProductDescription"
* jndi-name="ejb/ProductDescription"
* local-jndi-name="ejb/ProductDescriptionLocal"
* view-type="local"
* type="CMP"
In my session bean I'm currently getting the reference for the entity bean
using the following code:
productDescriptionLocalHome=(ProductDescriptionLocalHome)
lookupLocalHome(ProductDescriptionLocalHome.JNDI_NAME);
If I add the following XDoclet tag to my session bean, in ejb-jar.xml a
<ejb-link> is created inside <ejb-local_ref> tag.
* @ejb.ejb-ref ejb-name="ProductDescription" view-type="local"
Considering the info above:
1) In the entity bean, is there any extra tag to define the ejb-link or is
the ejb-link only defined in the session bean?
2) Re session bean, only adding the @ejb-ref xdoclet tag is enough for
using the ejb-link or do I also have to change my lookup? If I do, what do
I have to search for in the lookup?
Thanks! -
Invoice verification with reference to billing document in cross company
Hi Gurus,
We need to do "Invoice verification with reference to billing document in cross company code scenarios".
At present I am processing through MIRO by calling the PO.
What is the alternative for this and how to do it?
ThnxHi
It is not possible to do the invoice with reference to billing document.
You can create the Invoice referncing the PO used for STO or the delivery note (as mentioned in the Material document) or directly on the vendor.
Thanks & Regards
Kishore -
Invoice w/o reference to PO
Hi,
What is thr difference if we create Invoice with and without ref to PO.
Is der any diff in config.
Also, what is the rational/use behind creating invoice w/o reference to PO
Thanks,
ManuHi. An invoice without reference to a PO posts directly into finance, there is no impact in MM.
There is no posting to the GR/IR account, so there is no automatic accrual created by the goods receipt, as there is no goods receipt.
From an audit and finance point of view it is always better to have a PO, as this gives you authorisation up front, if there is no PO you do not get a chance to authorise anything until the invoice arrives, by which time it is probably too late to refuse it.
A PO also gives you an accrual and a commitment.
The basic rule is always use a PO if possible. There are some purchases where it is not possible, or adds no value, an example is perhaps for utility bills (electric, gas etc), where you have to pay it and are not sure how much it will be before the invoice arrives.
Regards,
Dave. -
Hi All,
I have a senario:
I have Posted A/P Invoice With Vendor XXX, Vendor Reference number is 111. I should be able to post another A/P Invoice using the same Vendor Reference number-111 but Vendor is YYY.
But I should not be able to post same vendor reference number - 111 in two A/P invoices where the vendor is same. (Say Vendor is XXX).
How do I satisfy these two conditions??????
Regards,
Sree.Hi Sree,
SAP Business one will not allow you to to have the same reference number even if it is for another supplier.
This is known SAP validation.
Regards,
Rakesh -
Forwarder Invoice details with reference to Shipment Number
Hi All,
Currently i am working on shipment and new to shipment.
I would like to find the invoice details of the forwarder with reference to Shipment number. Currently we have flow like shipment document>shipment cost document to the forwarder>PO (created in background and entry sheet)-->Invoice of the forwarder.
Could you please provide the exact table where can I find the invoice w.r.t. shipment number or forwarder of the shipment.
If we require any otehr changes, pls provide BADI.
It will be appriciated for quick and right solution.
THank you
Regards
KishoreIf you create the invoice using MIRO transaction, then the table for the invoice is RBKP (header data) and RSEG (item data).
Outbound process - To link invoice to shipment/shipment cost, you will need entry sheet which will be created when service acceptance document is created
Inbound process - use the PO number then from PO go to delivery -> shipment -> shipment cost.
VTTP-VBELN contains delivery docnument (shipment item table)
VFKP-REBEL contains shipment number (VFKP is shipment cost item table) -
Entire Invoices without PO reference in the standalone scenario
Can we entire Invoices without PO reference, if we use the standalone scenario?
We tried to entire Invoice without PO reference by user with role «Accountant», but we cant did it. System massage: «Vendor number 111 not maintained in backend system» - but we have no backend system, we use the standalone scenario.
Maybe, we cant do it at all in our case?
Thanks in advance.Hi Marina,
You must maintain a purchasing view for this vendor, via "Maintain business partner", for your local purch org.
You must have ACS & SYS = local SRM system
You must have BUK =local SRM system/company code
Rgds
Christophe -
Create an invoice witout any reference of sales order
Hello
We have to create an invoice without sales order. If we try to use the BAPI BAPI_BILLINGDOC_CREATEMULTIPLE. We must give a Reference document.
How can we create the invoice without any sales orders and any reference. We have to do it by this way because the sales order is create into production and sales system and it's not SAP
Thanks for your help
Philippe
Helpful will award.so why in the SAP help for the 4.7) they wrote:
<a href="http://help.sap.com/saphelp_46c/helpdata/en/dd/5615db545a11d1a7020000e829fd11/frameset.htm">SAP Help</a>
[quote]Until now, you could only use standard interfaces to bill orders and deliveries in the SAP system. With the general billing interface, you can now bill external business transactions.
Data from an external system to be used in your billing process must first be prepared in a sequential file of specified format.
All data necessary for billing can either be made available to you in this way or can be taken from existing master data. Material master data and pricing elements are not necessarily required in the system.
You may decide to work with a CpD customer master record instead of taking data (such as an address) from a customer master.
Pricing elements and/or VAT amounts can be transferred. Alternatively, you can carry out new pricing in billing, entirely or only for taxes.
You can also enter external reference numbers in the interface such as an external delivery or order number. When you create a billing document, the system records document flow using these reference numbers. This allows you to find a relevant billing document by entering an external reference number. Additionally, the system ensures that this number is billed only once. [/quote]
Thank for your help
Philippe -
Error while raising a invoice using VF01
Hi,
I am getting an error while raising a invoice using VF01.
Error as follows
RV_MESSAGE_UPDATE
Update was terminated
System ID.... TIP
Client....... 300
User..... user1
Transaction.. VF01
Update key... E66E6454075548D8922BAC091E81F0CB
Generated.... 18.07.2007, 18:57:38
Completed.... 18.07.2007, 18:57:38
Error info... TD 443: WRITE_FORM
Pls help
Points will be rewarded.
ThanksHi,
This is an ABAP short dump. If you go through the error log, there will be a section where in you can see > What caused the problem.
Try to analyze this log and you can find a solution. Probably, you can also check whether there is any OSS note with this error message.
Thanks
Murali.
Maybe you are looking for
-
Is there an equivalent statement in Java for this PL/SQL stmt?
Hi, I want to know if there is an equivalent statement in java for this PL/SQL statement: IF strTok IN('COM-1','COM-2','COM-3') Then /* Do Something */ End If; I tried using : // This is giving me errors.. if (strTok.equals(("COM-1") || ("COM-2") ||
-
How can I get Firefox 8 to open new tabs at the end?
Hi, I know there's a way to make Firefox open new tabs at the end instead of this really annoying forced 'open new tabs next to open tab behaviour'. Can anyone help me find it? Thanks! Evan
-
Error 6 can not reinstall CS5 illustrator or indesign
This is what has happened the last dozen attempts. Support advisor was no help. Running OSX Lion Appreciate any assistance. Exit Code: 6 -------------------------------------- Summary -------------------------------------- - 0 fatal error(s), 37
-
Hello. I have deeloper 10g and i am working on my client machine XP SP2. My problem is when i run a form it works correctly for a while but after i ran some reports on it, it becomes something like locked and i have to close the application from the
-
BC4j/JSP Application not responding after some time - when deployed on 9ias BC4j/JSP
Hi, We are using BC4j/jsp application on 9ias. The application is not responding after some time. We have installed 9ias on PIII(384MB RAM). We tried to accesses with 10 users, and server is not responding to BC4J/JSP application. However the server