Currency and Linked documents problem.

Hello all,
I am using the sdk to import documents form one database to another. I have a currency problem when I try to create an AR Invoice based on a Sales Order already in the target database.
We are running SBO 2005 sp1 pl45
The Sales order document currency set up like this:
Header : CAD
Line 0 : USD
Line 1 : USD
Line 5 : USD
When I create an AR Invoices using the SDK based, I set the currency the same way as for the sales orders. The SDK add the document without errors.
However, there are always one or more lines that switch to CAD currency.
Header : CAD
Line 0 : USD
Line 1 : CAD
Line 5 : USD
I have check the database to make sure the currency field and DocCur field where set to the proper value in the order table.
This is a simplified version of my code. I am having the same behavior as my application. I also tried to remove the itemcode and currency info without success.
I have also checked that:
- The currency exists in the database and the exchange rate is up do date.
- The Customer, Series and Tax Code are correct.
               oDoc = oComp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
                oDoc.CardCode = "C10003"
                oDoc.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items
                oDoc.Series = 2
                oDoc.DocCurrency = "CAD"
                oDoc.Lines.ItemCode = "GC0001"
                oDoc.Lines.BaseEntry = 3
                oDoc.Lines.BaseLine = 0
                oDoc.Lines.BaseType = 17
                oDoc.Lines.UnitPrice = 580
                oDoc.Lines.Currency = "USD"
                oDoc.Lines.Quantity = 9
                oDoc.Lines.TaxCode = "TAXNO"
                oDoc.Lines.Add()
                oDoc.Lines.BaseEntry = 3
                oDoc.Lines.BaseLine = 1
                oDoc.Lines.BaseType = 17
                oDoc.Lines.ItemCode = "GC0002"
                oDoc.Lines.UnitPrice = 1233.58
                oDoc.Lines.Currency = "USD"
                oDoc.Lines.Quantity = 9
                oDoc.Lines.TaxCode = "TAXNO"
                oDoc.Lines.Add()
                oDoc.Lines.BaseEntry = 3
                oDoc.Lines.BaseLine = 2
                oDoc.Lines.BaseType = 17
                oDoc.Lines.ItemCode = "WH0001"
                oDoc.Lines.UnitPrice = 447.01
                oDoc.Lines.Currency = "USD"
                oDoc.Lines.Quantity = 9
                oDoc.Lines.TaxCode = "TAXNO"
                oDoc.Lines.Add()
                oDoc.Lines.BaseEntry = 3
                oDoc.Lines.BaseLine = 3
                oDoc.Lines.BaseType = 17
                oDoc.Lines.ItemCode = "WH0001"
                oDoc.Lines.UnitPrice = 997.5
                oDoc.Lines.Currency = "USD"
                oDoc.Lines.Quantity = 9
                oDoc.Lines.TaxCode = "TAXNO"
                oDoc.Lines.Add()
                oDoc.Lines.BaseEntry = 3
                oDoc.Lines.BaseLine = 4
                oDoc.Lines.BaseType = 17
                oDoc.Lines.ItemCode = "WH0001"
                oDoc.Lines.UnitPrice = 276.15
                oDoc.Lines.Currency = "USD"
                oDoc.Lines.Quantity = 9
                oDoc.Lines.TaxCode = "TAXNO"
                oDoc.Lines.Add()
                oDoc.Lines.BaseEntry = 3
                oDoc.Lines.BaseLine = 5
                oDoc.Lines.BaseType = 17
                oDoc.Lines.ItemCode = "TM9999"
                oDoc.Lines.UnitPrice = 205
                oDoc.Lines.Currency = "USD"
                oDoc.Lines.Quantity = 9
                oDoc.Lines.TaxCode = "TAXNO"
                If oDoc.Add <> 0 Then
                    MessageBox.Show("Error " + oComp.GetLastErrorDescription())
                Else
                    MessageBox.Show("Good")
                End If
Thank you for your help.
Simon
Edited by: Simon Lizotte on Jul 29, 2008 10:35 PM

HI Simon,
For me it is works perfect.
I do not know about the taxno tax group, and your localization, but on my 2007APL38 works fine.
I have used the demo database  SBODEMO_HU, and added an order and invoice from order, and it is works (without TaxCode).
generally if you inherit a document, you need you the quantity (less or equal then basic) have to be check and the price modified.
here is my, i have a BP in multi currency = C20007, and items from A00002 to A00005 in the code at the
If oDoc.Add <> 0 Then there is less than and more than sign, but here is not visible...
Sub addSalesOrder()
        Dim oDoc As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
        oDoc.CardCode = "C20007"
        oDoc.DocType = BoDocumentTypes.dDocument_Items
        oDoc.DocDueDate = Today
        oDoc.DocCurrency = "CAD"
        oDoc.Lines.ItemCode = "A00002"
        oDoc.Lines.Quantity = 9
        oDoc.Lines.UnitPrice = 100
        oDoc.Lines.Currency = "USD"
        oDoc.Lines.Add()
        oDoc.Lines.ItemCode = "A00003"
        oDoc.Lines.Quantity = 9
        oDoc.Lines.UnitPrice = 100
        oDoc.Lines.Currency = "USD"
        oDoc.Lines.Add()
        oDoc.Lines.ItemCode = "A00004"
        oDoc.Lines.Quantity = 9
        oDoc.Lines.UnitPrice = 100
        oDoc.Lines.Currency = "USD"
        oDoc.Lines.Add()
        oDoc.Lines.ItemCode = "A00005"
        oDoc.Lines.Quantity = 9
        oDoc.Lines.UnitPrice = 100
        oDoc.Lines.Currency = "USD"
        If oDoc.Add <> 0 Then
            MsgBox("Erreur " + oCompany.GetLastErrorDescription())
        Else
            Dim newCode As String = oCompany.GetNewObjectKey()
            MsgBox(newCode)
            AddInvoice(newCode)
        End If
    End Sub
    Private Sub AddInvoice(ByVal e As Integer)
        Dim oDoc As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
        oDoc.CardCode = "C20007"
        oDoc.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items
        oDoc.DocDate = Today
        oDoc.DocDueDate = Today
        oDoc.DocCurrency = "CAD"
        oDoc.Lines.BaseEntry = e
        oDoc.Lines.BaseLine = 0
        oDoc.Lines.BaseType = 17
        oDoc.Lines.Quantity = 9
        oDoc.Lines.UnitPrice = 580
        oDoc.Lines.Currency = "USD"
        oDoc.Lines.Add()
        oDoc.Lines.BaseEntry = e
        oDoc.Lines.BaseLine = 1
        oDoc.Lines.BaseType = 17
        oDoc.Lines.Quantity = 9
        oDoc.Lines.UnitPrice = 1233.58
        oDoc.Lines.Currency = "USD"
        oDoc.Lines.Add()
        oDoc.Lines.BaseEntry = e
        oDoc.Lines.BaseLine = 2
        oDoc.Lines.BaseType = 17
        oDoc.Lines.Quantity = 9
        oDoc.Lines.UnitPrice = 447.01
        oDoc.Lines.Currency = "USD"
        oDoc.Lines.Add()
        oDoc.Lines.BaseEntry = e
        oDoc.Lines.BaseLine = 3
        oDoc.Lines.BaseType = 17
        oDoc.Lines.Quantity = 9
        oDoc.Lines.UnitPrice = 997.5
        oDoc.Lines.Currency = "USD"
        If oDoc.Add <> 0 Then
            MsgBox("Erreur " + oCompany.GetLastErrorDescription())
        Else
            MsgBox("Good")
        End If
    End Sub
Regards,
J.
Edited by: Janos  Nagy on Jul 30, 2008 5:02 PM

Similar Messages

  • Mail with PO doc and link document iwhile using output type 7 - Urgent

    Hi all,
    I'm facing a problem for my customer.
    I need to send a mail with the PO forms and all link document of each item .
    This mail have to be send to several user maintain with transaction MN05 and user want to change the recipient of the mail in MESSAGE Screen of PO so we try to use output type 7 which allow this modification .
    Unfortunatly, with this output type i can't add by abap code document in the mail .
    Does somebody face the same problem or add a solution to retrieve all recipient define by the user ?
    Best regards.

    Requirement Cancel

  • Currency and Quantity fields problem in FM

    Hi ALL
    <b>Can anyone help me on this. Very Urgent</b>
    I created a FM, in that i used NETPR,MENGE,WEMNG.(CURRENCY , QUANTITY )  fields.
    When i am trying to activate, it is asking for reference fields.
    I don't know how to resolve it...
    Regards
    Prabhakar

    hi,
    pls refer to this thread for use...
    how can create a function module for currency and quantity fields
    Message was edited by: Ganesh Sundarakrishnan

  • CSS SSL and link modification problem

    Hi all
    We have a problem using our CSS to offload SSL for a site. The offload works for the first connection, but the web application seems to be rewriting relative links as absolute links.
    For example, a user hits the site at https://www.mydomain.com. The CSS is configured to terminate the SSL traffic, and then send HTTP to the internal web server on TCP/81.
    What we're seeing in the client's browser is that all links are being returned as http://www.mydomain.com:81/... instead of https://www.mydomain.com/...
    Any idea of how we can do this without messing around with the web server too much? I.e. is there a way on the CSS to do link translation?
    Thanks

    If the link are indeed hardcoded like this, there is nothing the CSS can do.
    Bad server design.
    If the server is returning a redirect to http://... the CSS can intercept it and rewrite it to https.
    Please verify if there is a redirect.
    Gilles.

  • URL adapter/OraMobile and links/servicePath problem

    i have an application running on Oracle Mobile which uses the oramobile URL adapter(i think) - i just point a URL which generates simpleResult mobile xml.
    however, using the URL adapter on P2G and pointing to the same URL does NOT work. all my menuitem or anchor links are broken!
    for example:
    <SimpleMenuItem target="login.cfm?did=9">
    this works on oramobile and it connects to the next deck (on webphone). generated code looks like:
    <SimpleMenuItem target="?PAservicepath=%2FUser+Home%2FN%2FNP%2FNpang%2FApplications%2FeRegistry+Mobile&#38;OMPMobileRef=login.cfm&#38;did=9">login</SimpleMenuItem>
    with P2G, the path is unchanged, with just login.cfm... i have set the PAservicepath, forced absolute URLs, etc. but nothing seem to qualify the path.
    help...

    Hello,
    In NWA, check if the 'SLDAccess' property of the CPA service is set to "false". If yes, set it to "true".
    Ensure you use FQHN and that in your SLD you have all the six components registered:
    Domain
    Integration Server
    Integration Repository
    Integration Directory
    RWB
    Adapter Engine
    If one of them are missing, please apply note #764176.
    As a last resource, you may check MANUALLY the steps from link:
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/45/2e4c1b16bb4aa8e10000000a11466f/frameset.htm
    (This is for 7.1, you may find at help.com the link for your version, if it's not 7.1)
    Regards,
    Caio Cagnani

  • Mixed RTL and LTR document problem

    Hi there,
    I have a Word 2013 file in Arabic and I have to copy it in an InDesign document. When I copy and paste the phrase in InDesign the text is displayed incorrectly (example: 2006/95/EC -> EC/2006/95).
    I'm using InDesign CC2014 ME on a Mac with Yosemite. The paragraph is automatically set to Adobe World-Ready Paragraph Composer and in Right-to-Left direction.
    Any idea?
    Thanks in advance =)

    If the language is set to Arabic and the character direction is set to Default then numerals will display LTR as is default in Arabic. If you set the whole para to RTL, then everything including numerals and Latin script will display RTL.
    If you need to do so, it's not hard to write a GREP style for special number handling. However, it doesn't sound like you need to. You should be able to do it with correct paragraph style.

  • Preview and Printing Document Problems

    I am new to Adobe Livecycle and have been askedto create some forms to be placed on the internet.  Please note that I am a user and not a programmer. I am in version 8.2.  I have created a form and believe I have it in the correct format. I created master pages, and subforms. Everything looks correct on the screen, but I cannot view anything in the preview pdf and cannot print anything.  My presence is set to visible on the subforms and the view interactive forms is set.
    Any help you could give would be greatly appreciated. 

    Change File Associations in Mac OS X

  • Linking document info record and purchase order

    Hi all,
    I hope that someone can help me because I'm having a problem with creating links between document info records and purchase orders.
    By default in SAP I can create links between document info record and purchase order ITEMS! When I create that link, I can see it in document info record under Object links tab, but when I double click on the number of purchase order nothing happens (I expected that this purchase order will open).
    Why is that so?
    Why can't I access purchase order from document info record even though the link exists?
    The other question is about creating object links to purchase orders, not purchase order items! Is it possible to link document info record with purchase order?
    I would appreciate quick answer because we're in the middle of a project and we're stuck with that problem.
    Thanks!

    Hi Karlo,
             As you mentioned, object links could be linked to Purchase order items. In customisation you maintain these entries under the node SPRO > Cross Application Components> Document Management--> Control Data --> Define Document Types --> Define Object Links.
    There are many links in the standard system (possible entries).
    The system automatically determines the screen number (dialog box) where the key data for the object is maintained for document maintenance.
    You can check the screens when the screen entry is missing or contains errors by doing the following:
    Start the Object Navigator and display the objects for the development class  CV.
    Expand the function group 130. The structure nodescreens lista all screens that can be used for object links.
    You can make an object link to SAP objects that are not shown in the possible entries list. To do this, proceed as follows:
    In the standard system, there are already two special screens for the module pools SAPLCV130 and SAPLCV140 for the linked SAP object.
    You must create two new screens with the same number for the module pools SAPLCV130 and SAPLCV140 .
    The processing logic must follow that of screen 1204 in program SAPLVC130.
    Create function module OBJECT_CHECK_XXXX (XXXX = object name)
    If the object can be classified, this function module already exists .
    Otherwise copy the function module for linking equipment DOCUMENT_CHECK_EQUI and change it as required for the new object.
    Hope the above instruction helps in solving your problem,
    Sojan
    Note : Award points if you find the information useful

  • Link between Service Entry Sheet and Material Document

    Hi
    I am busy with developing a report where i am required to find the link between the Material Document and Service Entry Sheet. 
    I am aware that on the Purchase Order Data tab of the Material Document has the service entry sheet number and line item.  However the problem I have picked up here is in the event I create a Service Entry Sheet  with a service in line 1 and for some reason Delete that Line and then capture the service again, it is saved in table ESLL as line 2.  This is correct.  However when I have a look at the material document, it references it as line 1 of the service entry.  Is there any way to get this in sync?
    Thanks
    Vinesh

    Thanks
    This table does show the service entry sheet number and line item however the line item does not correspond with the line item on the service entry sheet.
    Eg.
    I create a service entry sheet where I capture a service in line 1.
    I delete Line 1
    I recapture on line 2.
    Post Service Entry
    The Material Doc reference document is the service entry however the line item for the reference is 1.
    I need to try and link the line items
    Thanks
    Vinesh

  • Link between table EKKO-EBELN and DMS - Document Management System

    Hi to all,
    I wanted to know the form to connect or link the Document Info Record (inside "Define Object Link") to object DRAW (DMS) with table EKKO-EBELN (order head). In standard form it is possible to do it with EKPO (Purchase order item) This is in transaction DC10 Define Object Link.
    Thanks!
    Greetings
    Martin

    Hi Martin,
    Within table DRAD you can see all linked objects to a specific document info record (DIR).
    To be able to link objects to DIRs you have to maintain the correct objects in customizing.
    First of it is necessary to maintain the correct screen numbers for all needed objects within the customizing. Therefore go to transaction SPRO and select
    Cross-Application Components
    > Document Management
    > Control Data
    > Maintain Screen for Object Link
    Here you can enter all needed SAP objects with the name and
    the related screen number. If you do not know the object or the screen number you can display a list of all SAP standard objects in transaction SE80 under function group CV130 ("Screens").
    So for material master you maintain the following entry:
    SAP object Screen Description Auth.
    MARA 201 material master 1
    Please note that the system automatically adds the leading "1" which is displayed in function group CV130 under
    "Screens". So for object MARA you just have to enter 201 instead of 1201.
    The value "1" in the column "Auth." is necessary to grant that always the latest dynpros and authorizations were used when linking this object to an document info record. This will avoid different problems by displaying linked documents from the object side.
    The next step is to decide which objects should be used in the different document types. Therefore please go to transaction DC10 and choose the relevant document type. Afterwards please select "Define object links". Here you can
    add all needed objects only by entering the object. The correct screen number is taken automatically. Also note the blue information buttons in the upper right corner which contain further necessary information about the possible settings of the current screen.
    After doing these settings in customizing you should be able to link the maintained objects to document info records and oppositely by using the DMS transaction CV02N (tab "object links") or the object related transactions.
    Important notes regarding the object link functionalities are:
    Note 880077: Performance problem using object links
    Note 885977: Extension to note 867241 on object links
    Note 926060: Extension of note 885977 for object link Purchase Order
    Note 960202: Object Links Deleted While Adding New Objects
    Note 1002648: Wrong behavior while using RFC_CHANGE_DOCUMENT_MASTER

  • Font problem in import and link

    I'm using RH8 and have a problem with a Word doc I linked.In a numbered list, NumberList2, the font reverts to Times New Roman from Arial 10pt. I attach a pic. I've tried reapplying the style, linking again and again and it's very stubborn. Is there a fix?

    Hi
    If this is a Linked Word Document, Try going to File>Project Settings >Next and Click on Edit for Word Document conversion Settings, and
    Select Edit and it would prompt you with all avauilable tags along with their Appearance, Example in Word and Robohelp.
    Check your tag in the List and Select "Source " in Drop Down of RoboHelp Style.
    And try to Select that and observe if the Appearnace or Style is imporved.
    Alternately, if you want you can import the Word Doccument and its assocaiated CSS file would be imported too and you can make changes directly to CSS and reapply them.
    Thanks,
    Anjaneai Srivastava

  • Problems with RH 9Printed Documentation not displaying some popups, drop-downs, and links

    I generate a Word document for reviewers. PrintedDoc properties include: Retain hyperlinks; Include drop-down text; Include expanding text.
    Sometimes the Word 2010 document includes hyperlinks, sometimes it doesn't.
    Popups typically don't work in the Word document.
    Drop-down and expanding text appear intermittently in the Word document.
    Has anyone experienced this and have a solution?
    Thanks.
    Carol

    I have never known hyperlinks to fail except in two situations.
    The target topic is not in the printed document. Obviously it cannot link to something that is not there.
    The hyperlink is a popup.
    Not sure what you mean by popups not working in a printed document. If you mean the links to them break, then see above. Known issue.
    I'm not sure why you are having the dropdown and expanding text problem as I have not known that to be an issue either. Is it always the same dropdowns that fail? Have you compared a good dropdown and a bad dropdown?
    Take a look at Printed Documentation on my site.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • CR, Documents and Links, delete file from room

    Dear collegues,
    I'm using Collaboration Room template, which uses standard page "Documents and Links", extention "Documents".
    My problem:
    We can add files or folders to room, but we cannot delete them (even with admin role) in the same interface. The only way to delete them - use standard KM "repository explorer".
    Version KMC-COLL 7.02 SP09
    Can somebody help me to configure template, or choose another page to work with attachments.
    Will be grateful for any help.
    Regards,
    Dmitriy.

    Hello Dmitriy,
    Are you using a SAP delivered template or one of your own? You could try using "SAP Team Room" as an example, you could create something similar if you wanted. There when you select Documents and Links there is an edit option which opens a new window to allow you to delete content. See the screenshot attached:
    Kind regards,
    Lorcan.

  • Difference in currency  between customer order and accounting document

    Dear gurus,
    While I am cretaing customer order SAP calculates currency from Exchange Rate="B" at OB08 screen. This situation results because of Currency type in customer master data. But in the accounting document SAP calculates currency from Exchange Rate="M" at OB08 screen. As a result; this is causes problems.
    I want SAP to calculate currency which is  entered in customer master data. It might be M,B  etc.. According to the CUSTOMER.
    How can I fix this issue?
    Thnks regards,

    Hi,
    This is a complicated scenario.
    There are 3 currencies involved in any transaction
    Document currency (from customer master)
    Condition type currency (from condition record)
    Local currency (Currency of company code )
    During account posting in FI, the document currency will be converted into local currency and posting in local currency will be made. Also there is a posting in document currency also. For the conversion between document currency and local currency, by default M is used. For other exchange rate types, it should be enabled by means of user exits in sales order or invoice. The exchange rate which is available in invoice for this conversion (doc currency to local currency) is copied to acctg documnent. It is not freshly calculated in accounting document.
    Conversion from customer currency to document currency happens either through M or through the customer master exrate type.
    Now you decide how you want to handle the scenario. Customer currency to document currency can be done as  per the customer master you maintain. But if you want to convert document currency to local currency (provided customer currency and doc currency are same), then only M will be used in standard.
    If you are in a scenario where all the 3 currencies are different, then the way by which the system calculates the exchange rate is through an indirect triangulation process, which is little complex. In this case, it will use only one exchange rate type. Hence this scenario in your case will have problem. If you test all these scenarios, you will come to know.
    We faced this problem an year ago and then finally realised that it is not possible to use two xng rate type in one SD cycle. This is because the exchange rate type is stored in VBAK, VBRK and so on and hence it is not possible to use two xnge rates or the rate maintained in customer master throughout the cycle. The sales transaction is controlled by Cust master and FI transactions are controlled by M

  • Hyper link of public image(hyperlink or image) can not be saved on windows server 2012 and sharepoint 2010 problem

    hyper link of public image(hyperlink or image) can not be saved on windows server 2012 and sharepoint 2010 problem, is this a bug?
    thanks for any reply.
    Rosone

    It is not a bug, you might be using IE in Windows server 2012 and and browser might be restricting your site actions to respond properly.
    Check this in a different browser or access site in a differ OS.
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

Maybe you are looking for