Copy from through code

Hi,
I want to do the copy from functionality from Goods receipt PO   to Purchase through code in my Addon.Can we assign  a link between these two documents?How will we copy multiple goods receipt PO to one purchase Invoice.?I have no provision to add a copy from button or matrix.All should be done through code.
Regards
MANJU

Hello,
You can do this vis the DI API. Here is an example code that copies two Goods Receipt POs to one AP Invoice:
Dim rs, errCode, errMsg
Dim oAPInvoice As SAPbobsCOM.Documents
oAPInvoice = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices)
'We will create the AR Invoice based on two Goods Receipt POs. Both have CardCode = "V10000"
'Goods Receipt PO DocNum 92 has 3 lines
'Goods Receipt PO DocNum 94 has 1 line
oAPInvoice.CardCode = "V10000"
oAPInvoice.DocDueDate = Now
'DocNum 92 line 0
oAPInvoice.Lines.BaseEntry = 92
oAPInvoice.Lines.BaseLine = 0
oAPInvoice.Lines.BaseType = CInt(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)
'DocNum 92 line 1
oAPInvoice.Lines.Add()
oAPInvoice.Lines.BaseEntry = 92
oAPInvoice.Lines.BaseLine = 1
oAPInvoice.Lines.BaseType = CInt(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)
'DocNum 92 line 2
oAPInvoice.Lines.Add()
oAPInvoice.Lines.BaseEntry = 92
oAPInvoice.Lines.BaseLine = 2
oAPInvoice.Lines.BaseType = CInt(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)
'DocNum 94 line 0
oAPInvoice.Lines.Add()
oAPInvoice.Lines.BaseEntry = 94
oAPInvoice.Lines.BaseLine = 0
oAPInvoice.Lines.BaseType = CInt(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)
rs = oAPInvoice.Add
If rs <> 0 Then
    oCompany.GetLastError(errCode, errMsg)
    MsgBox("Error: " & errCode & " - " & errMsg)
Else
    MsgBox("Done")
End If
Regards,
Paul Feeney
SAP Business One Forums Team

Similar Messages

  • Error code -51 (try to copy from win to mac)

    Hi,
    I have a problem with copying files FROM Windows to my Mac. I am connected through the VPN, I can see files on Windows server, I can copy TO server, I can create folders etc (on Win), but if I try to copy from Windows I always get "errorr code -51". I have MacBook Pro with Snow Leopard 10.6.8.
    Does anyone know what is going on? Thankx a lot, Lukas

    Thanks for your response. I have just tried Carbon Copy Cloner, I thought I would try this on the documents folderbut I am still errors. CCC gave this.
    CCC will proceed with the backup task, copying as many files as possible. Please note:
    • The first error occurred while trying to access:
    "/Volumes/System X/Users/john/Documents/Final Cut Pro Documents/Autosave Vault/1.shingaanie.fcp/1.shingaanie_01-10-12_1534"
    • CCC will make two attempts to back up damaged files
    • CCC's log file contains more specific information about the affected files or folders.
    • Physical errors may cause the backup task to take longer than normal.
    • You can stop the backup task at any time. CCC will pick up where it left off the next time you run this task.
    Please click on the "?" button below to learn more about resolving media errors.

  • In the past, I have had no problem copying from a network HDD to my Mac.  Recently, I cannot copy and get error code 8084.  Any thoughts?

    I cannot copy from my network drive to my iMac; I get error code 8084.  I can copy the same material from my network drive to my PC.  In the past, I have had no troubl copying to my iMac. What happened-going from OS 10.6.7 to 10.6.8?

    Thread bump.

  • Copying from client through se71 is getting saved as local object only?

    hi.
    i am copying the form from std to z form through se71.but after doing copy from client,it is getting saved automatically s a local objct $tmp.
    Also,there is no option enabled to save it to transportable object.
    in se80,in the object list also that object is not reflecting.

    check it
    Re: local object to transport request for a form
    just go to SE03  > object  Directory > change object directory entries

  • When trying to copy from mac HD to WD for mac i get error code -50

    when trying to copy from mac HD to WD for mac i get error code -50 Solutions?

    OS X errors are cryptic. error code -50 says error in user parameter list.
    You need to give us WAY more info if you want help.
    What is WD for Mac? If it's an external drive - did you install any software for it? (shouldn't need to)
    How much free space on the Mac HD? Size of the file(s)?
    Is it a USB drive or Firewire or Thunderbolt?

  • Problems if code copied from ecc 6.0 to ecc 4.7

    HI Experts,
        If i copy code from ecc 6.0 to ecc 4.7 any problems will arise. like function modules not exist. Please let me know the basic problems which i can face if i do this copy from 6.0 to 4.7.
    Thanks.

    why don't you just test it? Copy it over and do a syntax check.
    If there was no difference then SAP would not need to provide different releases.
    Of course there are function modules in current system which were not written when 4.7 was launched at the market. When we implemented ECC6 we upgraded as well to Unicode which forced us to change coding in old programs.
    There are ABAP commands which have not been there at 4.7 times.
    You can't get a clean bill of health for such generic question, you can just test it, and if there is trouble then you need to fix it to make it run.
    If you have read some OSS notes for new developed functionality then you could know how rarely SAP offers the option to implement such function in a lower releases. 

  • Creating Business Partner Through Code

    Hi Everyone
    I just wanted to know if any of you knew a way to create a business partner through code.
    If there is a way or a sample that anyone can provide that would greatly
    apreciated.
    What would mandatory fields be? I know CardCode would be one mandatory field but what else would be essential?

    Hi Sebastiano,
    If you only need to read the BP data from the 'source' company then you shouldn't need to log in to it. The RecordSet object should be capable of sending a SQL query that references the other database.
    For example:
    string sSQL = "select * from " + sSourceDatabase +"..OCRD where CardCode = '" + sMyBPCode +"'"
    where sSourceDatabase is the Database ID for the source company and sMyBPCode is the BP you wish to copy.
    Using this you should only need to log in to the company where the BP needs to be created. So the whole process should be something like this:
    1) Connect to second company
    2) Run the query to collect the BP data from the first company
    3) Create an instance of the BP object and use the recordset object to assign the properties
    4) Add the BP
    Hope this makes sense
    Owen
    P.S. The other option is to use XML. See this post:
    Copy items between databases

  • Service details are not copying from contract to Maint.Order

    Dear Experts,
    I was doing a service contract cycle, with the following steps.
    1. Created a Service contract, in T. Code ME31K.
    2. Given all the details in the Header data of the Contract.
    3. Mentioned the, Item category as D (Service), Account Assignment as F (Order), short text, Target Quantity, Material group, Plant and Storage Location in the Item Overview screen.
    4. Given the Service Number and Quantity, Gross Price, Cost Center and GL Account.
    5. Saved the Contract.
    6. After released the Contract in T. Code ME35K.
    7. Then created a Maintenance Order through T. Code IW31.
    8. In the Operation Overview screen of the Maintenance Order, the control key is given as PM03 and clicked on External button of the Maintenance Order.
    9. In the External Processing Operation screen the Contract Number and line Item is mentioned in the Agreement Field.
    10. System given a message Data copied from contract.
    11. All the data copied excepting the Service details of the Contract.
    Here the Service Number and its details which were mentioned in the Service specifications of the Contract are not getting copied from the Contract.
    What could be the reason for that? Did I perform the transaction properly?
    I have searched the forum earlier for the same but could not get any required information.
    Can any one help me out on this??
    Thanks and Regards,
    Praveen
    Edited by: b praveen savan on Jan 31, 2008 2:33 PM

    Select the services from the service selection button, then click on current spec, all the services which are under contract will be displayed. select your required services or copy all services.(Click on adopt services)

  • Linking to a library through code

    Is it possible to link an icon to a library through code?
    I need to make up heaps of audio libraries and I've managed
    to import the audio files into an authorware piece but now I need
    to put these into a library.
    I can do this manually by dragging and dropping each icon
    into a library, but I don't want to do that for 150 sound icons *
    about 100 files. So I want to do it through code. Is it possible?
    I had a look and I can't see how to do it.
    This would be nice:
    linkToLibrary("iconTitle","libraryID")
    Note: I need the library link name to go into the library -
    so copy and paste into the library won't work only drag and
    drop.

    thefoxinsox wrote:
    > Is it possible to link an icon to a library through
    code?
    > I need to make up heaps of audio libraries and I've
    managed to import the
    > audio files into an authorware piece but now I need to
    put these into a library.
    > I can do this manually by dragging and dropping each
    icon into a library, but
    > I don't want to do that for 150 sound icons * about 100
    files. So I want to do
    > it through code. Is it possible?
    > I had a look and I can't see how to do it.
    > This would be nice:
    > linkToLibrary("iconTitle","libraryID")
    >
    > Note: I need the library link name to go into the
    library - so copy and paste
    > into the library won't work only drag and drop.
    >
    Libraries can only have content added by dragging icons from
    the
    flowline to an open library.
    With audio there's always the opportunity to keep the audio
    external and
    to dynamically load them.
    Andrew Poulos

  • Copying Visual Studio Code into Robohelp

    Hi,
    I'm using Robohelp HTML 6 and I'm trying to transfer example
    code from visual studio into my robohelp project. However, when I
    copy/paste the code, all of the formatting is lost (mainly colors).
    The project I'm working on was done years ago by another
    individual (whom I no longer have contact with) and contains code
    examples in the format I'm going for. I can't imagine he went
    through each example, and indivdually selected a style for each
    word/line. I've tried editing pages in microsft word (which retains
    the styles of the copied code) but once I save the file....Robohelp
    never lets me edit the file in Robohelp again (complains about the
    file being edited by a third party editor and launches it in MS
    word). Can anyone tell me how to retain styles when importing the
    code? Is it possible to develop macros to search my examples and
    reformat them? Any help would be greatly appreciated.

    quote:
    Originally posted by:
    MergeThis
    Apply the different colors either by:
    - Creating character styles (p.red, p.blue, etc.) for the
    different colors
    - Creating hyperlink pseudo-classes (a.red:link,
    a.red:visited, a.red:hover)
    - Inserting image maps on the screenshots as John suggested
    Good luck,
    Leon
    I have style set up for each color/text type already. Is
    their a way to search through the text and apply a certain style to
    all occurances of a word?
    For example: make all "if" instances in this block of text
    blue?
    Applying the style to unformatted text would be a great
    solution as long as I don't have to manually go through, select a
    word, and select the style FOR EACH WORD.....I'd be
    selecting/formatting for weeks.
    Also, the replace function doesn't seem to have an option to
    select styles for replacements (or im just not using it
    right).

  • Stub out Error Cluster from Error Code.vi?

    When I profile my application, I find that the biggest consumer of CPU time is the Error Cluster from Error Code.vi, called from a number of locked NI libraries.  How can I stub out this .vi, replacing it with basically a pass-through?  I tried creating a project specific .vi with the same name, and when I open my project all the project and vi.lib .vis used link to it, but they all come up broken and have to be re-linked, which I can't do in the locked .vis (I matched the ins and outs and connector pattern).  I can't edit the Error Cluster...vi directly, getting a message about the .vi being used by another application even with a clean start of LV and going directly to that .vi in the library (and I would prefer to not mess with the vi.lib version anyway).  Any suggestions?  Thanks.  LV 2011.
    Matt

    If you have the LLB manager open it reserves your VI in a different appliation instance, therefore it is locked and no editing.  Simply close the LLB manager and you can whack away at that VI.
    I doubt that the shared clone setting plays much of a role here, there are some deeper issues.   A rather amusing VI in a few ways:
    In order to show the VI Title instead of the Name you Open a VI reference which is going to stick you into the root loop.  10 reentrent clones simply means 10 copies waiting in line for the root loop.  A non-reentrent version would simply have 10 copies waiting to run.  Minus the root loop issue, reentrency is the way to go, and on a desktop machine shared clones is typically quite effective.
    It can't be a slow VI, look Trim Whitespace was inlined manually to avoid a performance hit!  In a loop maybe, but really, shaving off the overhead of a single subVI?  That's optimization.
    But wait, all of that and much, much more is given right back by the use of Delete From Array to remove the first element of the Array.  Bad on so many levels.    Delete From Array is a data copy machine, and now you are doing one needlessly.  Array subset is your friend here, tells the compiler you are only reading, nothing to get excited about. Pull it outside the case structure, you are ditching the first element twice in the two branches.
    Concatenating strings in a loop, also a recipe for fun.  Often there are ways to leverage Array to Spreadsheet string for better performance, or build a string array and then concatenate at the end.  Probably not a big deal here, how big are call chains really, but if you are inlining subVIs by hand then you should really be frying the bigger fish.
    I find myself in your shoes fairly often.  Some clunker in vi.lib causes a bug or sluggish performance.  You either ditch the NI code and roll your own, or make it work on your machine but not others, or chalk it up to the cost of doing business.  I have tried on numerous occasions to suggest that all patches to vi.lib be made readily and freely available to all previous versions of LV that are compatible.  Let's say this VI got tweaked so it was a bit more performant for you, at least enough to be viable.  Then you could happily use the patched version in LV11, and if you went to a different machine you would simply make sure vi.lib was up-to-date.  These types of patches could roll out incrementally as needed, less need to cross your fingers that you won the CAR lottery with each new version of LV.  (I guess most lottery winners don't shell out $$$ to collect their "winnings" though).
    After all that what would I do here?  I would wrap that sucker inside a disable structure (provide minimal functionality, like pass through caller name, code and error instead).  Then I would check the performance again.  Now you have a data point as to whether or not it is worth it to proceed.

  • Copying  new company code and G/L's-how to put in Quality server?

    Hi
    We have existing system and we are creating new company code by copying from existing company code along with G/L accounts using --Copy/edit/delete company code action.
    Once this is done in Development server how do we transport this in to Quality and production servers?
    Is basis help required or as a functional consultant I can do if so how?
    regards

    Hello,
    Through STMS you can import.
    However, there should clear segregation of duties. I would expect a basis consultant should do the imports into QA or production or a centralized team.
    Regards,
    Ravi

  • Copy From Button similar to Purchase Order

    Dear Members,
    I have a user defined for named Quotation. I want to create a Copy from button  in Purchase Order through coding, similar to those present in sale order and copy the contents in quotation to  Purchase Order.
    Please send some sample coding to create a  Copy From  button  in Purchase Order  , and to list  my user defined form quotation,
    similar to present in sale order Copy to A/R Invoice.
    Help will be appreciated to solve this issue.
    Thanks and Regards,
    Venkatesh.R

    could somebody explain me why cannot text in code format and its in one line? - i cannot insert the code for few weeks. thx
    Enable email in your profile and Ill send the code to email - i cannot insert it here.
    Edited by: Petr Verner on Jul 24, 2009 10:22 AM
    If pVal.FormTypeEx = "142" And pVal.BeforeAction And pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD Then
                    Dim oform As SAPbouiCOM.Form
                    oform = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
                    oform.Items.Add("combo", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)
                    oform.Items.Add("button", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
                    Dim oitem As SAPbouiCOM.Item
                    Dim obutton As SAPbouiCOM.Button
                    Dim ocombo As SAPbouiCOM.ComboBox
                    oitem = oform.Items.Item("combo")
                    oitem.Left = -1 * oform.Items.Item("10000329").Left - 100
                    oitem.Top = 399
                    oitem.Width = 100
                    ocombo = oitem.Specific
                    ocombo.ValidValues.Add("1", "First")
                    ocombo.ValidValues.Add("2", "Seccond")
                    oitem = oform.Items.Item("button")
                    oitem.Width = 100
                    oitem.Left = oform.Items.Item("10000329").Left - 100
                    oitem.Top = 400
                    obutton = oitem.Specific
                    obutton.Caption = "Copy From"
                End If
    If pVal.ItemUID = "button" And pVal.FormTypeEx = "142" And pVal.BeforeAction = False And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK Then
                    Dim oform As SAPbouiCOM.Form
                    oform = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
                    Dim oitem As SAPbouiCOM.Item
                    Dim ocombo As SAPbouiCOM.ComboBox
                    oitem = oform.Items.Item("combo")
                    oitem.Left = oform.Items.Item("10000329").Left - 100
                    ocombo = oitem.Specific
                    oitem.Click(SAPbouiCOM.BoCellClickType.ct_Regular)
                    oitem = oform.Items.Item("button")
                    oitem.LinkTo = "combo"
                    oitem.Update()
                End If
    Edited by: Petr Verner on Jul 24, 2009 10:31 AM

  • How to create dll file from c code to use in compactrio 9004 RT controller

    Hi.
    I am using Compactrio 9004 Real time controller and i am new to this. I have a C code and i want to use this with the RT controller.I red that that can be done by creating a dll file and can be called in labview.Can any body expalin how to create a DLL from the c code and be used with this RT controlelr?
    Regards,
    Vishnu

    vishnu123 wrote:
    Hi,
    Earlier in this forum itself in cRIO 900x controllers will run Pharlap and run C/C++ code compiled into .dll files.Can you please tell how to transfer the created DLL to RT controller memory throght FTP?
    Thanks and regards,
    Vishnu
    There is another KB article about this for Pharlap based controllers. And you are right the earlier CompactRIO controllers were Pharlap based. Basically for a deployed application to work, you need to put the DLL through FTP in "/ni-rt/system". If you deploy it directly from the project everything will be loaded into memory through the project environment itself including directly dependable DLLs, (but of course won't survive a power cycle).
    I hope you are aware that while Windows DLLs can work on Pharlap OS they by no means will do so always. The Pharlap OS has not a fully featured Windows API. Also you need to be careful which version of Visual C you are going to use depending on the Pharlap OS version, since the VC runtime DLLs already present on the controller will need to be the same as the ones your Visual C environment likes to link in. Recent Pharlap OS versions use the msvcr71.dll. It's very possible that those runtime libraries can't just simply be copied from a normal Windows installation but might have been recompiled by NI specifically for their controller targets.
    So to avoid problems it's a good idea to make sure your DLL uses the same runtime library DLL or make your DLL to include the static MS runtime.
    Rolf Kalbermatter
    Message Edited by rolfk on 02-05-2008 09:51 AM
    Message Edited by rolfk on 02-05-2008 09:53 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Findout the program that is copied from Standard one

    Dear friends,
        I have a list of 300  Z programs. in that list few are copied from standard transactions. is there any way to find out those programs easily ?
    If any body knows, plz help me.
    Thanks in advance.

    Yes this can be achieved.
    First identify all the Z-objects and pass them to an Internal table.
    Looping all the Z-Reports.
    Use the Read Report(command) to read the entire source code.
    Scan the ABAP source code through
    SCAN ABAP-SOURCE itab1 ...TOKENS INTO itab2
    Each report which is copied or cloned has SAP standard report name in the Heading section.
    Eg: IF RSM04000_ALV is copied into ZRSM04000_ALV then
    verify the Repid in the Header section whether it is starting with Z or No. If No then the program is a copy.
    Hope this helps.
    Regards
    Vinayak

Maybe you are looking for

  • SD availability check

    Hi I have a material  X with availability check as 02. its having 20 ea in stock. two sales orders came in with order quantity as 15 and 10. sales order 1 with quantity 15 sales order 2 with quantity 10. the system is letting me to process sales  1 o

  • 911-PLEASE HELP! OS X Mountain Lion "Blocked Plug-Ins"anyone please?

    All Plug-ins enabled, no extensions, this is killing my ability to bid on jobs from a site. Only purchased the upgrade to expand my capabilities & software, so I could bid on more gigs & now I can't even service clients I already had with this "block

  • SOLAR_EVAL--Reporting Functionalities

    Dear Team,   I am working in Sol Man 4.0 SP13. In RMMAIN transaction, i am updating the status as "Completed" & in the "Notices" , i am entering some text. In SOLAR_EVAL t.code, i am extracting the report for only "completed" status. In the report i

  • Chart color customization for Sentinel Log Manager (and RD)

    Hi all, I am trying to customize the color of the chart provided by the SDK. I based on the top 10 Report as modification. The default severity 0 color is WHITE. I tried to change the files of color_RGB.csv or Key_color.csv of the entry to GREY4 but

  • Report based on 2 different Fact tables

    Hi all Is it possible to make a report based on 2 Fact tables wich are not linked to exactly the same dimensions? FactTable1 : linked to Time,Product,Geography FactTable2: linked to only Time The FactTable2 will contain only one measure which is a co