Invoice create from DeliveryNote
Good Day
Experts:
I have SalesOrders that were "Copied To" a DeliveryOrder using the Copy To button on the lower right portion of
the SalesOrder screen. I then use the DeliveryNote object via the DocEntry value to get information to build an
Invoice. My code works fine. However, I am a bit concerned that I am sending "enough" information for all the "behind the scenes" things that go on with the Invoice. This after I found the amount of fields available on oDeliveryNote. How can I know if I am sending all the information that is needed? Here is my code:
oDeliveryNote.GetByKey(sDocEntry)
'Set DeliveryOrder header info to Invoice object
oInvoice.CardCode = oDeliveryNote.CardCode
oInvoice.CardName = oDeliveryNote.CardName
oInvoice.Address = oDeliveryNote.Address
oInvoice.DocDate = oDeliveryNote.DocDate
oInvoice.DocDueDate = oDeliveryNote.DocDate
For i = 0 To oDeliveryNote.Lines.Count - 1
oDeliveryNote.Lines.SetCurrentLine(i)
If i > 0 Then
oInvoice.Lines.Add()
End If
'Set DeliveryOrder line info to Invoice object
oInvoice.Lines.BaseEntry = oDeliveryNote.DocEntry
oInvoice.Lines.BaseLine = oDeliveryNote.Lines.LineNum
oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oDeliveryNotes
oInvoice.Lines.ItemCode = oDeliveryNote.Lines.ItemCode
oInvoice.Lines.Quantity = oDeliveryNote.Lines.Quantity
oInvoice.Lines.Price = oDeliveryNote.Lines.Price
Next
retVal = oInvoice.Add()
Next
Thanks for helping,
Ed
Hi Ed,
actually you set the important things in your code.
you might also set the Project, Discount and Freight in the Invoice.
the important "scene" that happens is that the invoice create journal entries.
lg David
Similar Messages
-
Payment of Expense Report invoice created from credit card transactions
We are implementing corporate credit cards into iExpenses using the company pay method. When expense reports are created from aquitting credit card transactions and exported into Payables does anyone know if it is possible to pay the expense report invoice that has been created without needing to run the Create Credit Card Issuer Invoice program? The reason for this question is that I want to avoid running this program as our credit card provider direct debits our account from our bank account rather than us transmitting the funds to them and don't need to create an invoice for the credit card provider. Any assistance would be gretly appreciated. Thanks
Hi Harry
You can use the badi TRIP_POST_FI .you can create custom table & mention the different symbolic account number & change your symbolic account based on your expense type by using the above badi. While you do FI posting your expense types will get posted in two hit two different G/L account
It will surely solve your problem.. I had same issue in my earlier project which i have done the above solution.
Thanks
Anwar Hossain -
A/P Invoice created from Approved Drafts, through DIAPI
Please I need help with this error.
I need create A/P Invoice from approved drafts with DIAPI.
There are no errors if the "A/P Invoice" is copy of "Purchase Order" or without base document. In this case the Invoice is created without problems.
But, if the invoice is copy of "Goods Receipt PO", it is not created and DIAPI retrieve an error:
"Field cannot be updated (ODBC -1029)"
is a bug in sdk?
Thanks a lot.
Please help.Hello Norman,
This sounds really like a bug which you should report to SAP Support... - sorry!
...but let me (and others) give you some advice how to be more sure in such conclusions:
In such cases you should check:
a) Does it work in the B1 GUI application?
If yes, it's a bug (or limitation?) which you should raise to SAP Support.
...and of course it works...
b) If you are not sure about a) - or if there are problems too, but you still think it should work... you should check the DB documentation.
In your case the information is more-or-less obvious (could surely be easier to find...) available as the "Constraints" for the field PCH1.BaseType...
The DB documentation says that Purchase Orders + Goods Receipts POs (GRPO) as base types - and thus your problem is certainly a bug (but Support will do the final judgement).
But you should make sure that the GRPO is OK - i.e. the lines you need are not closed etc., but I assume you checked all that a couple of times already.
Regards,
Frank -
Incoming Invoice Create from data without posting the GR details
Hi Experts,
I am trying to create a MM invoice (MIRO) using the BAPI BAPI_INCOMINGINVOICE_CREATE and I do not want to post GR details in this invoice. But I have not been able to see the face of success yet.
Following are the parameters that I pass to the structures of this BAPI:
BAPI_INCINV_CREATE_ADDRESSDATA Addressdata = new BAPI_INCINV_CREATE_ADDRESSDATA();
BAPI_INCINV_CREATE_HEADER Headerdata=new BAPI_INCINV_CREATE_HEADER();
BAPI_INCINV_CREATE_ACCOUNTTable Accountingdata = new BAPI_INCINV_CREATE_ACCOUNTTable();
BAPI_INCINV_CREATE_ACCOUNT Account = new BAPI_INCINV_CREATE_ACCOUNT();
BAPI_INCINV_CREATE_ITEMTable Itemdata = new BAPI_INCINV_CREATE_ITEMTable();
BAPI_INCINV_CREATE_ITEM Item = new BAPI_INCINV_CREATE_ITEM();
BAPI_INCINV_CREATE_GL_ACCOUNTTable Glaccountdata=new BAPI_INCINV_CREATE_GL_ACCOUNTTable();
BAPI_INCINV_CREATE_GL_ACCOUNT Glaccount = new BAPI_INCINV_CREATE_GL_ACCOUNT();
BAPI_INCINV_CREATE_MATERIALTable Materialdata = new BAPI_INCINV_CREATE_MATERIALTable();
BAPIRET2Table Return=new BAPIRET2Table();
BAPI_INCINV_CREATE_TAXTable Taxdata = new BAPI_INCINV_CREATE_TAXTable();
BAPI_INCINV_CREATE_VENDORSPLITTable Vendoritemsplitdata = new BAPI_INCINV_CREATE_VENDORSPLITTable();
BAPI_INCINV_CREATE_WITHTAXTable Withtaxdata = new BAPI_INCINV_CREATE_WITHTAXTable();
string Fiscalyear="", Invoicedocnumber="";
Headerdata.Invoice_Ind = "X";
Headerdata.Bus_Area = "ED";
Headerdata.Comp_Code = "GAMB";
Headerdata.Doc_Date = "20110505";
Headerdata.Bline_Date = "20110505";
Headerdata.Doc_Type = "RE";
Headerdata.Diff_Inv = "0001736123";
Headerdata.Currency = "USD";
Headerdata.Exch_Rate = 7.33M;
Headerdata.Po_Ref_No = "4510146624";
Headerdata.Gross_Amount = 87500.00M;
Headerdata.Header_Txt = "";
Headerdata.Inv_Rec_Date = "20110505";
Headerdata.Pmnttrms = "G001";
Headerdata.Pmnt_Block = "A";
Headerdata.Ref_Doc_No = "Inv01";
Headerdata.Pstng_Date = "20110505";
Headerdata.Calc_Tax_Ind = "X";
Headerdata.Person_Ext = "extsuro";
BAPI_INCINV_CREATE_MATERIAL Material = new BAPI_INCINV_CREATE_MATERIAL();
Material.Invoice_Doc_Item = "0001";
Material.Material = "W900000664";
Material.Val_Area = "PL01"; // plant
Material.Db_Cr_Ind = "S";
Material.Item_Amount = 70000.00M;
Material.Quantity = 200.00M;
Material.Base_Uom = "EA";
Material.Tax_Code = "I1";
Materialdata.Add(Material);
Item = new BAPI_INCINV_CREATE_ITEM();
Item.Invoice_Doc_Item = "0001";
Item.Po_Number = "4510146624";
Item.Po_Item = "00010";
Item.De_Cre_Ind = "X";
Item.Freight_Ven = "0000010149";
Item.Tax_Code = "I1";
Item.Item_Amount = 70000.00M;
Item.Quantity = 200.00M;
Item.Po_Unit = "EA";
Item.Po_Unit_Iso = "EA";
Itemdata.Add(Item);
proxyPOInvoice.Bapi_Incominginvoice_Create(Addressdata, Headerdata, out Fiscalyear, out Invoicedocnumber,
ref Accountingdata, ref Glaccountdata, ref Itemdata, ref Materialdata, ref Return, ref Taxdata, ref Vendoritemsplitdata, ref Withtaxdata);
This is resulting in the below error message:
u2022 Enter goods receipt data only when working with GR-based IV
For the first error messages, after some good amount of googling and also searching in this forum I could reach to this conclusion that, if PO is marked with GR-based IV flag then invoice cannot be booked without GR. Also while booking such as invoice for every GR Item we need to pass:
Ref_Doc = goods recript number,
Ref_Doc_Year = year for good receipt number
and Ref_Doc_It = item number in the goods receipt.
I have created a PO which is not GR-based IV flagged, i.e. GR is not mandatory for creating invoice. Still I get the same message every time. I went through the documentation of the BAPI and also through many sites that gave sample codes to create an MM invoice but without any success.
The same entry when I enter through SAP screens I am able to post the invoice without GR. Please help me identify where I am going wrong.
Thanks in Advance
Best Regards
RoyI found out the cause to this whole thing. It seems that even though if you don't need to pass a parameter you need to fill it with default value. e.g.
my invoice was not GR-based IV invoice. Therefore, I don't actually need to pass values for:
REF_DOC
REF_DOC_IT &
REF_DOC_YEAR.
Well i was wrong here. Even then I need to pass these values as:
REF_DOC = ""
REF_DOC_IT = "0000"
REF_DOC_YEAR = "0000"
I guess this is how SAP .Net Connector works.
Thanks to all anyway
Roy -
Changing an Invoice Created From MIRO
What transaction can I use to change an invoice which was created via transaction MIRO? Is it possible to do a change on the invoice? I can display the invoice using MIR4 but couldn't find the transaction for changing it.
Thanks,
BethHi Liz,
to change an invoice depends on invoice-status:
you can change it (MIR4-edit- display/change resp.
with TA MIR6 )
only if invoice is'nt booked (so only stati:
parked,incorrect,held)
regards Andreas -
A JE created from the AP Invoice does not include the project # on all trx
A JE created from the AP Invoice does not
include the project # for the amounts entered in the freight box. To
duplicate, do the following:
1. Open an AP Invoice
2. Enter BP Code
3. Select Service type
4. Enter a Project Code in drop down box on Accounting tab
5. Enter a line in the Contents; specify GL Account, amount and Tax
Code Open Freight box
6. Enter an amount in one of the lines
7. Click ADD
8. Go back to the invoice and go to the Accounting tab Click on the GL
journal note and you can see that the line corresponding to the
contents line has a project, but the line corresponding to the Freight
box item does not.
My customer users these projects when printing GL agings and the
information is very important. Shouldn't this information be carried
forward on all transactions on the Journal entry? Is there a way to get this information to post?Hi Pat,
the project code (PC) on the marketing document may only be applied to the business partner (BP), hence the only row in the associated journal entry (JE) with this project code is that of the BP.
You can link project codes to specific accounts (CoA -> select account -> account details -> project code) & this project code will then be assigned every time the account is found in a JE.
If you require the project code to be applied to the freight, you may assign this project code to the account you have defined for this freight. The drawback is naturally that the project code will then be pulled every time this freight is used, regardless of whether or not the PC is associated with the BP or not.
It is possible to manually assign project codes to every row in a journal entry, hence this should also be possible with SDK. You might explore the possibility whether it might be possible to automatically assign the BP PC to all rows in the JE using a script.
All the best,
Kerstin -
Error in creating invoice list from VF21 transaction
Hi,
i am craetin a sales order fro VA01 transaction and for the perticular sales order number I am generating the billing document number.when I take this number and try to create a invoice list from vf21 transaction,it gives an error message as no invoice list can be created.and the processing status of the document becomes invalid.
what can be the reasons?plz sugges....Hello all,
We are facing the same issue. While creating ZMHF (custom Urgent Change) users "sometime" receive error "There is no active task list in the associated project"
Hi Mateus , the document is you mentioned is currently expired / unavailable. Can you kindly upload the same again please?
Thanks in advance,
Shaji Narayanan -
Create draft invoice document from a sales order
When i create an invoice document from a draft invoice document from a sales order, this invoce is linked to the order sales.
Sorry for my english, i hope you can understandIt would be difficult to know what question do you have. Try to ask question. Your English is not bad at all.
Thanks,
Gordon -
Query to get number of invoice created by user between from and to date
Dear All
I need Query to get number of invoice created by user on day and his orgainization between from and to date.
thanksselect count(*) from ap_invoices_all where created_by = :p_User_id
and trunc(creation_date) between :p_from_date and :P_to_date;
Thanks/SRK -
Single excise invoice J1IJ from two outbound deliveries
Hi Experts,
Can we do single Excise Invoice (J1IJ) from two or multiple outbound deliveries in depo sales.
Please Confirm.
Thanks & Regards
NareshWhen you are returning the material, you get a material document.
You create an Excise invoice by using J1IS transaction with reference to the material document.
This excise invoice will come for monthly utilization
regards
prasad -
Get customer invoice address from one time vendor
Hi All,
I am working on cheque printing.
I have a question with in that.Customer wants if Vendor is one time vendor.
I can identify the one time vendor using 'LFA1-XCPDK is 'X' then the customer invoice assress priting in screen
How can identify the custome invoice address from one time vendor
Please any suggestions are helpfulHi Tarangini,
I hope it is a third party scenario. Get the sales order number from the purchase order created with that vendor. EKPO table contains PO line item with sales order as the reference document.
From the sales order , get the invoice from VBFA table. Pass this Invoice number to get the customer from (VBRK). Pass this customer to (KNA1) to get the address number. Pass this Address number to ADRC to get the customer address.
Regards,
Sai -
Hello folks!:
I have made a query and created a new field related to the invoice qty. All at item level and referenced to the sales order.
This new field is configured to pull the invoice qty from the document flow:
FACPOS = ' '.
select RFMNG into FACPOS
from vbfa
where vbelv = vbap-vbeln
and posnn = vbap-posnr
and vbtyp_n = 'M'.
endselect.
Then the report shows the sales order qty and the invoice qty per item. Everything looks perfect at this time. The problem starts when the invoice is partially created from partial deliveries (which is very often) and then a partially invoice is made. Due to the fact that the data is generated from the VBFA table, it will always going to bring the latest invoice qty and not the sum of all the invoices.
Example:
Order for 6 pcs of product A
Delivery for 4 pcs and Invoice for 4 pcs
Pending 2 pcs
Report shows: Invoice qty 4 pcs
Then another invoice is created for 2 pcs
Nothing left from the sales order
Report shows: Invoice qty 2 pcs <----
PROBLEM
PROBLEM: The report only shows as a total of the invoice qty just the 2 pcs from the last invoice. I actually want to add up all the invoice qty's generated per line item in the document flow.
1. Any idea on how to configure the code so that I can have the sum of all the invoices in the document flow per item?
2. Is there a special function that can do this?
Pls let me know
RegardsHi,
Pass the sales order number in VBFA for the field "VBELV".
Execute.
Here there is a chance of two cases.
1)If the billing document is created w.r.t. order:In this case,you will get the invoice number from VBELN field.
Pass the same to VBRP table as VBELN and then fetch "FKIMG".
This will give you the quantity.
2)If the billing document is created w.r.t. a delivery:In this case,take VBELN and again pass it to VBELN into VBFA table as VBELV and then fetch VBELN
Pass the same to VBRP table as VBELN and then fetch "FKIMG".
Regards,
Krishna. -
Change FI document items created from MIRO
Hi All
I'm creating invoices with MIRO transaction.
I want to change some document items of FI document related to one invoice, assigning the vendor number of header invoice to the field bseg-lifnr created in FI document.
I have tried with BTEs, substitutions, exit LMR1M001, BADI Invoice_Update and Enhancement in MRM_INVOICE_PREPARE_AND_POST.
I can't find the way to change this field of the FI document during posting with any of these techniques.
Thank you in advanceHi niraj and Rob
I have made a substitution at line level that calls a user exit created in report ZRGGBS000.
This works fine in FI documents created from FI transactions like FB01 but the MIRO execution doesn't pass for it.
Our users are responsible of some profit centers.
They want to know in profit center analysis all invoices that refer to their own profit centers, and who are their respective vendors.
In those analysis, they see GL line items of incomes and expenses and need to know the vendor that origins them. -
Create Return Order copy from Billing created from DBM Order Processing
Hi SAP Gurus
I have scenario where the user requested to create return order based on Billing created from DBM Order Processing.
I know that, we can create return order from DBM. but the function copy based on order. the user is requested to do return
by billing document ( function as SD )
is this requirement can be done in SD VA01 where the user can copy the billing created from DBM and create return order using SD functionHi,
in DBM you regulary have mulitiple invoices per order (due to split).
You either can cancel an certain invoice and adapt the order or create a returns order based on an given order where you can select certain (e.g. invoiced) items.
BR -
Invoices created using VF04 need to be saved again using VF02 for geting ap
Hello,
We have a business condition to create & print 200-250 invoices in a shortest time. For this I find option VF04 where I can create invoice as per delivery. But in using this option I just get the invoice numbers & to get the printout, I need ot use transaction VF02 & save individual document. After VF04 I can see that the output message for printing is attached but does not execute until I save the same using VF02.
Do you have a solution for this or else any one knows FM/BAPI for create & print the invoic. In program I have all delivery nos (which are to be converted in invoice).
Regards
RajeevHi Lakshmipathi,
VF31 works only when the output messages in billing doc are "Successfully processed" during billing creation. In VF31 there are options 1. First Processing, 2. Repeat Processing, 3. Error Processing (All), 4. Error Processing (Only New Messages) however there is no option to process the message.
When we create the invoices using VF04 all the messages shows the sts as "not processed". For processing these messages, I need to save each individual billing doc using VF02. Which is time consuming job (when we talk about volume of 200 to 250 invoices within 30 min)
VF06 is a background jobs for billing creation. First of all it doesn't show the list of deliveries & option to choose for invoicing (inshort from user prespective it is not user friendly/interactive). Secondly with this option also output message doesn't get processed. I need to save billing doc individually.
Regards
Rajeev
Edited by: Rajeev Rane on Jul 6, 2010 4:40 AM
Maybe you are looking for
-
Is there a way to auto sync playlists while manually managing your music?
I used to use WMP11 before I bought an iPod and used iTunes, and in that I was able to auto sync playlists to my Samsung dap, as well as being able to manually drag tracks/albums to it. Since using iTunes, I have found it is not as accessible in this
-
Hello! I am using an old but perfectly happy Powermac G4 with OS X 10.3.9 and iTunes 7.2 (the latest that will run on my machine). I have also installed a Pioneer DVD DVR-112D internal optical drive and Patchburn, which works brilliantly with Finder
-
USE of Function module-- urgent
hi, can any one explain the use of "OPEN_FI_PERFORM_00002050_P " thnx
-
Is iMovie '06 compatible with 10.6.8 ?
Is iMovie '06 compatible with OS X 10.6.8? If so, is there any trick or problem to installing it on the same machine w/ iMovie '08? Thanks, Wm
-
hi, i am running windows 8.1 on a Surface Pro 3, when i connect to VPN (microsoft) all apps on the desktop work as expected, when in modern UI, apps do not detect an intenet connection. i belive this is fixed in windows 8 using this hotfix: https://s