How to add a payment means to an invoice using SDK
Hi,
Im trying to make an invoice + payment by using the SDK.
This is the way im creating my invoice:
public Boolean SalesInvoiceInternalSave(string buisnesspartnerCardCode, DateTime dueDate, double discountAmount, IList<InternalItem> items)
int res = 0;
SAPbobsCOM.Documents invoice_entry = (SAPbobsCOM.Documents)Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
if (buisnesspartnerCardCode != "")
invoice_entry.CardCode = buisnesspartnerCardCode;
else
invoice_entry.CardCode = SBOSystem.GetDefaultCustomerForSale();
invoice_entry.DocDueDate = dueDate;
invoice_entry.DiscountPercent = discountAmount;
invoice_entry
foreach (InternalItem item in items)
invoice_entry.Lines.SerialNum = item.Egocode;
invoice_entry.Lines.WarehouseCode = item.Shopid;
invoice_entry.Lines.ItemCode = item.Code;
invoice_entry.Lines.ItemDescription = item.Name;
invoice_entry.Lines.Quantity = item.Quantity;
invoice_entry.Lines.UnitPrice = item.Price;
invoice_entry.Lines.Add();
res = invoice_entry.Add();
return res == 0;
Now my problem is to connect a payment of f.ex. cash or creditcard to this invoice?
And do anyone know how to add a amount discount instead of a percent discount?
Any ideas?
Regards,
Torben
Edited by: Torben Petersen on Feb 24, 2009 10:17 AM
Hi Rahul,
I am running some very similar code as listed in this posting, however, I get an error stating the Base Document Card does not match the Target Document Card.
I am creating a Reserved Invoice...Invoice adds correctly, then I create a Payment for the Invoice and get the error. I am setting the DocEntry.
All I want is to link the payment to the reserved invoice. Is there something I am missing?
Any ideas would be helpful.
Thanks,
Josh
Similar Messages
-
How can i update/Remove Items from AR Invoice using SDK?
Hi All,
I have 1 problem with update or remove item from sales order. here is the source code of mine.
If inv.GetByKey(DocumentNumber) = True Then
inv.CardCode = cardcode
Dim ercode As Integer
Dim ind As Integer = 1
For Each drow As DataGridViewRow In gv.Rows
If gv.Rows.Count = ind Then Exit For
ercode = drow.Cells("No").Value
inv.Lines.SetCurrentLine(ercode)
'inv.Lines.ItemCode = drow.Cells("itemcode").Value
'inv.Lines.ItemDescription = drow.Cells("itemname").Value
inv.Lines.Quantity = drow.Cells("qty").Value
inv.Lines.Price = drow.Cells("price").Value
ind = ind + 1
Next
errorcode = inv.Update
If errorcode <> 0 Then
PublicVariable.oCompany.GetLastError(errorcode, errorsms)
Else
errorcode = 0
End If
Else
errorsms = "Not found Invoice Document Number"
End If
After update, it error "[INV1.Quantity][line:1],'Field cannot be updated (ODBC -1029)'"
Does anybody know about this?
Thanks
TONYHi $riniva$ Rachumallu,
This is my mistake that not test manually in application.
Thanks
TONY -
Can we add new Payment means in SAP Business One Payments
Dear Experts,
Can we new Payment means in SAP Business One Payments?
Currently, I am having 4 Payment means as Cash, Cheque, Bank Transfer and Credit Card.
I need one more Payment means as Coupons.
These are the Discount coupons which will be issued to our regular customers on Purchase of amount above certain limit.
Thanks & Regards,
Amrut SabnisHi Amrut,
you can't add a payment means, but you can book the new payment means as an additional creditcard name for example "coupons"
Kind regards
Ad -
How to add interface to customlize MXML Component when use Flex Builder 3?
How to add interface to customlize MXML Component when use
Flex Builder 3?David,
I don't believe you can add the interface via the creation
dialog in FlexBuilder 3. You can always manually add the
"implements" property to your MXML Component root tag. Something
like this: <mx:VBox implements="com.mycorp.IMyInterface">
If you want autogeneration of the interface, then create an
ActionScript class with that interface and then copy the generated
functions and setter/getters into the script block of your MXML
component. -
How to add additional disks on vmware OEL4 and use it for Oracle 10gR2?
I created a virtual machine on vmware workstation 6 and installed OEL4.
during first install I created 20 GB disk but now I want to add more disks.
from vmware documentation I tried to add more 8 gb disk to the virtual host.
under devices I see two lines;
Hard Disk (SCSI 0:0) 20.0 GB
Hard Disk (SCSI 0:2) 8.0 GB
but I must be missing some step since I can not see 20 + 8 gb at df;
[root@antuhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 13G 9.7G 2.3G 82% /
none 506M 0 506M 0% /dev/shm
/dev/sda2 4.9G 851M 3.8G 19% /homeThank you.Oh the check the answer from Re: How to add additional disks on vmware OEL4 and use it for Oracle 10gR2?
-
How to create Invoice using SDK?
Hi Friends,
I m creating invoice using SDK functions..
Company comp = new Company();
comp.Server = "CSNSYS026";
comp.CompanyDB = "SBODemo_US";
comp.UserName = "manager";
comp.Password = "manager";
comp.Connect();
comp.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_NodesAsProperties;
SAPbobsCOM.SBObob oSBObob = (SBObob)comp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge);
Documents inv = (Documents)comp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
inv.ManualNumber = "20000";
inv.DocDate = DateTime.Now;
inv.DocDueDate = DateTime.Now;
inv.CardCode = "C40001";
inv.CardName = "EarthshakerCorp.";
inv.DocCurrency = "USD";
inv.Lines.ItemCode = "A00001";
inv.Lines.Quantity = 10;
inv.Lines.Price = 100;
inv.DocTotal = 1000;
int i = inv.Add();
MessageBox.Show("Invoice created "+i);
<b>While i execute the above c# code,Invoice din't created,Wht's missing in the above code</b>..
Thanks in Advance
regards
Sooriyakala.PHo Sooriya,
what is the returncode from inv.add?
If you call comp.getLastErrorDescription, you get the errordescription
you should also set handwritten to true
Regards
Ad -
How to add new payment Options in WEB SHOP
Hi all
We need to add new payment options in the B2C shop, but we don't find any customizing place to do it, we read about the BADI CRM_RISK_MGMT_BADI, but in the documentation said that we can set a Default payment option or exclude, but nothing about to add Customer Options.
Any info regarding would be very useful.
Best RegardsLook at your Payment Process Profile. THere should be a reporting subtab and within that subtab is a Separate Remittance Advice region. I believe that is where you specify the format for the remittance advice document (which is built in XML Publisher). Take a look at that.
John Dickey -
how do I add custom ringtones on new iPhone 5, using iTunes 11.04 and Mac OS 10.7.5?
Are you meaning rintones that you create from existing files?
If so - then Google and you will get lots of hits on 'how to'.
Once you have the ringtones in your iTunes library then make sure in iTunes prefs>General tab - the Tones option is selected. Once your device shows in the Devices list make sure you select from the Tones tab in the Devices window the tones you want to d/l.
MJ -
How to add a link to an interactive svg using edge commons library
Hi,
I've been playing around with this wonderful Edge Commons interactive SVG tutorial
My question is : How to add an external link "url" to an interactive svg using edge commons library ?
Edge commons example file :
http://edgedocks.com/market/interactive-svg-example-project-edge-commons
Edge commons video tutorial :
http://www.youtube.com/watch?v=4UEB6gaLKuw
I have adapted this tutorial to an interactive map, http://madudesign.com/works/france/ every thing is going fine until I couldn't figure out to link a particular url on each part of the region of the map.
I managed to figure out how to change colors on the different parts of the map on mouse over and mouse out but I'm not quite comfortable with JavaScript since I don't use it every day...
I have tryed to link to an url by passing it on the illustrator layer and via the onclick event (event.target.id) to a simple url
http://redpen.io/6svh5u
then working in Edge and publishing on the browser the link returns me a weird url line by replacing the original url slashes "//" by "_x2F_" and I must have misunderstood the proper JavaScript line to open that link from there...
for example on my actual exemple "http://madudesign.com/works/france/"
the first top region of France is normally a link to "http://www.google.com" and it returns "http:_x2F__x2F_www.google.com" plus the complete path to the file too...
I don't know how to get around this trick and have back for each region a particular clean link from the event target id of the svg...
thank-you for any help
matt
link to my edge animate file if needed :
http://madudesign.com/works/france/carte_de_france.zipI got an answer from the Edge Commons dream team and I am very grateful to them :
"The problem that you bumped into was that you hadn't included a valid URL so far. We weren't sure if you wanted to include them within the SVG file or if you wanted to implement the functionality within Edge Animate. We came up with a solution for the latter one, with a simple switch in the js code:
You have to type in the appropriate URL of course for all the cases."
I have to share the final result:
http://www.madudesign.com/works/france/france_map/
And the zipped project file:
http://www.madudesign.com/works/france/france_map.zip
Thanks to Daniel & Simon
Matt -
My question is that How to add a report into the SAP-SCRIPT .
by using PERFORM ......ENDPERFORM
I don't know how to used it .Hi Sandeep,
Please check this link
http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm
http://www.allinterview.com/showanswers/37425.html
Calling ABAP Subroutines: PERFORM
You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
Syntax in a form window:
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM
INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
FORM <form> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
ENDFORM.
The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.
From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (u2018First pageu2019, u2018Next pageu2019, u2018Last pageu2019) is printed as local variable symbol.
Definition in the SAPscript form:
/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/ &BARCODE&
Coding of the calling ABAP program:
REPORT QCJPERFO.
FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA: PAGNUM LIKE SY-TABIX, "page number
NEXTPAGE LIKE SY-TABIX. "number of next page
READ TABLE IN_PAR WITH KEY u2018PAGEu2019.
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = u2018|u2019. "First page
ELSE.
OUT_PAR-VALUE = u2018||u2019. "Next page
ENDIF.
IF NEXTPAGE = 0.
OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page
ENDIF.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
Best regards,
raam -
How to add hash table values to SQL Table using Powershell
Hi,
I have sharepoint list with four(column1, column2, column3,column4)columns.I am reading the list column values and adding to hashtable. Now I want to add values from hastable to SQL table with four(column1, column2, colum3,column4)columns using powershell.
I have written the following script for single column but I would like to know how to add values for multiple columns.
if(($key -eq "Column1") )
$SqlQuery = "INSERT INTO [TableName] ([Column1]) VALUES ('" + $HashTable.Item($key) +"')"
#Set new object to connect to sql database
$connection = new-object system.data.sqlclient.sqlconnection
$Connection.ConnectionString ="server=SQLServerName;database=SQLDBName;Integrated Security = True;"
$connection #List connection information
$connection.open() #Open Connection
$Cmd = New-Object System.Data.SqlClient.SqlCommand
$Cmd.CommandText = $SqlQuery
$Cmd.Connection = $connection
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet
$SqlAdapter.Fill($DataSet)
$DataSet.Tables[0]
$connection.Close()
Can anybody please help me out to accomplish the task? Any help would be greatly appreciated.
AA.Hi AOk2013,
Not knowledgable on PowercShell, based on my understanding on HashTable in Java, Some modification you can make in your code to achieve your requirement.
If the Keys in HashTable are "Column1","Column2","Column3","Column4", you can reference below.
if(($key -eq "Column1") ) #what is the purposed of this if ?
#$SqlQuery = "INSERT INTO [TableName] ([Term]) VALUES ('" + $HashTable.Item($key) +"')"
#specify the real column names in the table
$SqlQuery = "INSERT INTO [TableName] ([ColumnA],[ColumnB],[ColumnC],[ColumnD]) VALUES ('" + $HashTable.Item("Column1") +"','"+ $HashTable.Item("Column2") +"','"+$HashTable.Item("Column3") +"','"+$HashTable.Item("Column4") +"')"
#Set new object to connect to sql database
$connection = new-object system.data.sqlclient.sqlconnection
$Connection.ConnectionString ="server=SQLServerName;database=SQLDBName;Integrated Security = True;"
$connection #List connection information
$connection.open() #Open Connection
$Cmd = New-Object System.Data.SqlClient.SqlCommand
$Cmd.CommandText = $SqlQuery
$Cmd.Connection = $connection
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet
$SqlAdapter.Fill($DataSet)
$DataSet.Tables[0]
$connection.Close()
Since your question is regarding PowerShell, I would suggest you post it in a dedicated
PowerShell Forum. It is more appropriate and more experts will assist you.
If you have any feedback on our support, you can click
here.
Eric Zhang
TechNet Community Support -
How to add new group entry in Cisco Vpn using powershell
I am working on a powershell script to connect cisco vpn using powershell, I am able to connect to vpn but not sure how to add new group to vpn. I am using the following script$vpn_profile = 'Test'
$username = 'TestUser'
$userPassword = ConvertTo-SecureString -String "Password" -AsPlainText -Force
$credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist
$username,$userPassword
$password = $credentials.GetNetworkCredential().Password
Set-Location 'c:\Program Files (x86)\Cisco Systems\VPN Client'
.\vpnclient.exe connect $vpn_profile user $username pwd $password
Write-Host "You Are Connected"
cd "C:\"Have you entered .\vpnclient.exe /? to see if it will return information about other switches you can use with this executable? Other than connect, I was able to track down a few without actually having the executable (http://www.scribd.com/doc/40108893/Cisco-VPN-Client-Command-Line).
That said, I do not believe that there is a switch that will help you create a connection. These are either done manually through the GUI, or can be likely be added by supplying a properly formatted file in the proper place.
If you're using the version of the Cisco VPN client I think you are, then your connection settings, or profiles, are stored in individual .pcf files somewhere on your computer (likely in the Cisco directory). These are simple, text-based files. Find one
on your computer, save it with another name, and then modify it manually. If you really want to use PowerShell, then use this opportunity to learn how to create and edit basic text files using PowerShell. If you have a standard connection file, then you can
put that file onto remote computers any number of ways. If a .pcf file exists in the proper place when the VPN client is opened, then it likely will not prompt for a new connection.
Update: Added more info; clarified -
SRM POWL - How to add/update longtext (internal note) of invoice
created powl for mass approval/rejection of invoice
For Rejection 'm adding 'reason for rejection' & 'internal note' fields
Which i need to update in invoice --> notes & attachment --> 'reason for rejection' & 'internal note'
I am doing it as --
TRY.
CALL METHOD lo_pdo_notes->add_longtext
EXPORTING
iv_p_guid = i_guid
iv_tdid = 'NOTE'
iv_tdspras = sy-langu
iv_tdformat = 'X'
iv_text_preview = 'Internal Note'
CHANGING
co_message_handler = lr_message.
CATCH /sapsrm/cx_pdo_abort .
ENDTRY.
TRY.
DATA text_id TYPE tdid VALUE 'RREJ'.
CALL METHOD lo_pdo_notes->add_longtext
EXPORTING
iv_p_guid = i_guid
iv_tdid = text_id
iv_tdspras = sy-langu
iv_tdformat = 'X'
iv_text_preview = 'Price Difference' " drop down value
CHANGING
co_message_handler = lr_message.
CATCH /sapsrm/cx_pdo_abort INTO lx_abort .
* mo_cll_message_handler->set_a1bort( io_pdo_abort_exception = lx_abort ).
ENDTRY.
But message handler is returning Initial value - & 'm unable to update it in invoice...
Can you help ??Thanks Pedro & Pradeep. I understand now how to add fields to SRM. Appreciate all your support. I have another question. I have to add fields to the following structures. Some structures have include structures and some does not. How to add fields which does not have include structures. Do I have to create my own Z include structure or any other way?
Table include structure
1) BBP_PDIGP CI_BBP_ITEM
2) BBP_PDHGP CI_BBP_HDV
3) BBP_PDHSB <NONE>
4) CRMD_ORDERADM_H INCL_EEW_ORDERADM_H
5) CRMD_ORDERADM_I INCL_EEW_ORDERADM_I
6) BUT000 INCL_EEW_BUT000
7) BBP_PDPSET <NONE>
8) ADDR3_DATA <NONE>
9) BBP_PDISS INCL_EEW_PD_ITEM_SSF
Look forward to hear from you.
Thanks,
GS -
How to Add a Miscellaneous expenses On an Invoice With Match ?
hi,
I Want To Add a Miscellaneous expenses On an Invoice With Match By a Different currency ,
an example :- When Enter An Invoice With Match " 100$ " and Pay It Then I Want To Add a Miscellaneous expenses On This Invoice By Different currency " 100 eur "
How to Process This Case ??
Thanks,
Mohamed Gamalone line is 100 us
the other is 100cu
is it ok ? -
How to add a textline to an xml structure using xslt
Hi,
I am having a requirement where i need to add a textline to an xml.
scenario: IDOC-File and output format is an xml.
Output should be like this:
&&##AOC0MB000#AD15543390#BOIFCO#Z
<?xml version="1.0" encoding="ISO-8859-1"?>
<messages>
<batch>0800062844</batch>
<message>
<type>VPR</type>
<action>A</action>
</body>
</message>
</messages>
The line that has been added to xml is the data that will be coming from IDOC. How can we append the textline to the xml using xslt.Will document() in xslt works for doing this?The required format in ur scenario is not an xml format, so u should not save the file in xml format. U may write an adapter module at receiver to achieve this.
How can we append the textline to the xml using xslt
This is not possible as the output of xsl transformation is an xml file.
Regards,
Prateek
Maybe you are looking for
-
Unable to open Camera Raw 6.7 from Bridge CS5
I am unable to view the RAW images that were taken on my D90 in Bridge CS5. They show up blank with the Camera Raw logo in the center and "NEF" in the upper left hand corner. This is the first time this problem has occured because I was (and still) a
-
Exchange 2010 SP1 Installtion failed
I tried to install exchange 2010 on one of our child domain (windows server 2003 SP2) and i succes to make a DCPROMO and the prerequest check finish succesfully after 2.5 houre then when try to install i have recieved our that setup failed to reconne
-
how do u undisable a iphone it says to connect to itunes because i forgot my password and i cant figure out what to go to on itunes please help help help #***
-
Dropdown Menu in SAP is in German
Hi SAP Experts! We just upgraded from 4.6c to ERP6. In one of our customized reports (which is a copy of ME54, which is why I posted it here), the dropdown menu (List, Edit, Goto, Views, Settings, Environment, etc) is in German even if our logon lang
-
What is wrong with wifi after iOS 6 update on the new iPad ?
Since I upgraded to iOS 6 my iPad ***** at connecting to Wi- Fi. I have been using iPads since the original launch and I currently own the 3rd gen iPad. Since the upgrade to iOS 6.0 the performance of Wi-Fi is terrible. My iPad often cannot find net