Connect To Company Code

Hi...
What will be the code in C Sharp with which i can connect to the SAP B1 company both in UI API and
DI API ? where no hard coding will be there for company details or server details. Please help

You should check the samples and SDK help before coming to the forums - normally you can solve your issue much more quickly! But you are lucky this time, I was just checking when you posted
C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI DI\CSharp\New UI DI Connection
SAPbouiCOM.SboGuiApi SboGuiApi;
string sConnectionString;               
SboGuiApi = new SAPbouiCOM.SboGuiApi();          
//InDebug mode use this:
sConnectionString = "0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056";
//In Release mode use this:
//sConnectionString = Environment.GetCommandLineArgs().GetValue(1).ToString();                              
SboGuiApi.Connect(sConnectionString);               
SBO_Application = SboGuiApi.GetApplication(1);
oCompany = new SAPbobsCOM.Company();
oCompany = (SAPbobsCOM.Company)SBO_Application.Company.GetDICompany();

Similar Messages

  • Exchange Rate Type per Company Code

    HI Experts,
    In our system the conversion rates for EURX are maintained since there are several European companies working with the system.
    Now we would like to use the same SAP-system for companies in China & Taiwan. In both countries there is an individual "official" exchange rate which does not equal the exchange rates stated from the German banks and thus fed into the system.
    Is there any possibility to connect a company (code) with one particular exchange rate type? Since we are dealing with countries outside of the EU.
    Thanks in Advance
    Siva

    Hi,
    as you may have recognized, the assignment cannot be made on company code (or country) level, but only on currency level. In particular, this is table TCURF.
    When (almost) all possible currency combinations (from-to) are redirected to rate type EURX, then this looks like standard SAP delivery settings that you can freely change according to your needs.
    If you are not familiar with TCURF maintenance, however, you should be very careful here and test every change before importing it to the productive environment.
    The basic idea that I have always followed for the same or similar requirements is that local rules for a particular rate type are always control the rates to be applied when converting from any foreign currency to the currency of the particular country.
    If you are a China company and your local company code currency (curr.type 10) is CNY, then you have to make the following changes to table TCURF:
    First, find out all the foreign (non-CNY) currencies that you are dealing with. This may include EUR, USD, and any other currency of the world.
    Then, determine (or create) a new exchange rate type in table TCURV. This should be the rate type for your "own" rates. Let's name it rate type "L" (for Local rates). Note: you can use the standard M rate type as well, but it is more transparent if you define a separate one.
    Then have a look into table TCURF and find the entries as follows:
    Rate type: M
    From-currency: all that you are using in your business (all non-CNY that you use)
    To-Currency: CNY
    Valid-from: find the recent entry for each combination
    With all of these entries displayed, you will find that the alternate exchange rate type field (ABWCT) in these entries is set to EURX.
    Now you want to create a new TCURF entry as follows:
    Rate type: M
    From: the same foreign currencies as above
    To: CNY
    Valid-from: a newer date than the last current entry
    Alternate exchange rate type: L (your new rate type) - in case you want to use just M, then leave ABWCT empty.
    If you are using the L type (which I recommend), then you have to add 2 new entries to TCURF for each foreign currency:
    1.
    Rate type:  L
    From: foreign curr
    To: CNY
    Valid-from: 1.1.1800 (yes!)
    Ratio from and to: as you want, it should be the same as in the corresponding M entry, usually 1:1, but it depends
    Alternate exchange rate type: leave it blank.
    2.
    Rate type:  L
    From: CNY
    To: foreign curr.
    Valid-from: 1.1.1800 (yes!)
    Ratio from and to: as you want, it should be the same as in the corresponding M entry, usually 1:1, but it depends
    Alternate exchange rate type: leave it blank.
    Finally, in OB08, you have to maintain rates like
    type L,  foreign curr to CNY
    You are done
    What is happening is the following (example you post a document in USD in your China company code)
    Doc.currency USD --> must be converted to your local currency CNY
    First, the system looks the current ratios for the M entry:
    M, USD to CNY, valid from: recent, 1:1 and ABWCT = L !!!! (the entry you have added before)
    Then it checks the ratios for L:
    L, USD to CNY, valid from 1.1.1800, 1:1, ABWCT = blank
    Based on TCURF, the system will look for the current rate entered under rate type L, your local rate )
    Now what if a USD-based company has to post something in CNY? No changes there as the TCURF settings were not touched. They should look like this:
    M  CNY to USD, alt.exch.rate type EURX (or blank)
    If it is EURX, then the rates enterd under EURX rate type (once USd to EUR and then CNY toi EUR) are read and the cross-rate CNY to USD is calculated.
    If it is blank, then the rate entered under rate type M is used.
    In both cases, no change to your current process.
    It works similar if the company code is EUR based.
    The main idea is: redirect all M entries in TCURF where <anycurr> to CNY to the new rate type L, but leave all other TCURF entries untouched. Direction <any> to CNY are only relevant for the China company code, the rest of the world does not care about that conversion. They might be interested in conversions like CNY to <any>, like in the above example, CNY to USD, or CNY to EUR, but that could be their German or ECB rate, you do not have to care about.
    <removed_by_moderator>
    Csaba

  • Company code and Account code does not exist in SKB1 while entering GL Tran

    I have created chart of accounts in the co code but getting error msg while posting entry in <Company Code>and<GL Account> transaction that entry does not exist in table SKB1. I have copied COA from existing SAP COA.
    I was able to find the solution for the following messages
    1.     Fiscal Variant not connected to company code
    2.     Open Posting Period u2013 period 032009 not open (June-3)
    3.     The number range 01 is missing for year 2009
    4.     Document Number not defined
    5.     No amount tolerance range entered for this company
    6.     Entry Company code no does not exist in SKB! (G/L account company master)
    7.     Company coode ZR02 is not attached to field status variant

    Hello,
    There is no such automatic copy function from Chart of Account Segment to Company Code Segment.
    You need to write LSMW by recording and upload the GL accounts into company code segment.
    Use the following guide for your guidance.
    ttp://www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc
    Regards,
    Ravi

  • Check table 169P connected to chart of acts /company code

    Dear friends,
    I have configured Act determination.
    we have 1000company code and 1000 chart of acts.
    when iam doing GR-MIGo,iam getting the meassage like--"Check table 169P: entry 1000   does not exist"
    please suggest what to do,
    regards,
    Canand

    hi ,
    this error comes while u have not tick the item amount check for company code.
    path
    spro > MM > log inv verification > invoice block > set item amount check >
    here tick in front of company code
    that will solve ur prob
    regards,
    snb

  • Entry Channel setup for multiple company codes

    Hello,
    I have a question regarding the entry channel setup (for external requirements in the Plan-Driven Procurement scenario)
    In previous implementations, I 've created an entry channel below each company code (as the documentation says it should be). Now, for each entry channel, there was a EBP user assigned, which corresponded to an RFC entry in the backend system (I was connecting EBP to multiple backend systems)
    Now, what should I do in the following scenario?:
    1. SRM is only connected to one backend system
    2. There are 50 company codes
    Does that mean I have to create 50 users (for each channel) plus 50 RFC connections in the R/3 system (each with a different user in the backend system), pointing to the same SRM system?
    I was thinking of creating an Org iD in the SRM structure at the top (which would be the entry channel), assign only ONE user to it and then fill attribute BUK with all the company codes. However, I don't know if this will work, because the external requirement process might need the company code defined in the "Function" tab... =/
    Any help would be greatly appreciated.
    Regards,
    Gilberto.

    Hi Proyecto Genesis,
    I am also configuring the Entry channel (org unit) for multiple company codes.
    I tried your logic of defining the entry channel outside company code level. Assigned the BUK attribute and extended attribute for plants and storage locations.
    Also in my case the local Pur org and Pur group is defined outside the company code. Is it correct?
    However the system fails to transfer the external requisition to SRM.
    SLG1 displays following error message.
    "No address found for partner function type Ship-To Address"
    So if I move the Entry channel (org unit) under any one company code level then the external requisitions are transferred correctly to SRM.
    But then the issue is the requirements are not transferred with the backend Pur Org and Pur grp. Instead they are transferred to the Pur Org and Pur grp of the company code under which the entry channel is defined.
    Can you please share how do we need to define the entry channel, local pur org and pur grp for multiple company codes scenario, so that the ECC requisitions are transferred with the correct company code, pur org and pur grp to SRM?
    Or do we need to define Entry channel for each company code and RFC user actually mapping the same backend system?
    Please guide.
    Regards,
    Sandeep

  • Company code restriction for dashboard and webi reports in BOBJ

    Hi Friends,
    We have a requirment where we need to restrict user on company code level in bobj.
    we have some dashborads and webi reports which need to be restricted at company code level, hence i have created a  role in BI and restricted the queries (bex queries) on company code level and same role and user i have imported in BOBJ.
    Now i can see the role and user in BOBJ and also i can login to BILAUNCH PAD with authentication as SAP  But unable to run the webi reports and dashboard hence i have added those reports to this user in bobj and now i can run the reports, but restriction is not working.
    In BI I am able to restrict user  but in bobj its  not restricting. kindly let me know if i am missing anything?
    We are having BO 4.0 SP6.
    Thanks
    Basis

    Hi Saurabh,
    In BI its wokring perfectly fine.
    I can run the query for specific company code and data is being populated as the respective compay code.
    I have also configure SSO between BI & BO using below link
    http://wiki.scn.sap.com/wiki/display/BOBJ/How+to+setup+SSO+against+SAP+BW+with+SAP+BO+BI4.0+Common+Semantic+Layer+%28UNX%29+or+BICS
    but when i am trying to create a olap connection in IDT with SSO connection test is getting failed with belwo error.
    com.businessobjects.mds.olap.OlapException: [Internal] SSO token or User password is empty.
    I checked STS is already there in APS .
    Thanks
    Basis

  • G/L account determination in SRM by company code

    Hi,
    We have a requirement to default G/L account not only by product category but also by company code. I can see the field company on the BBP_DET_ACCOUNT table but in configuration this field is not there. I know the field company is not directly the company code field in ECC but is the BP in the org plan that has the company code flag on the function tab.
    We also know that we can use the BADI BBP_DETERMINE_ACCT to accomplish what we want but I am trying to find a way of doing it without any development.
    We are in SRM 5.5 connected to ECC 6.0.
    Thanks and regards, Jose Oyon.

    Dear Olyn,
    if it is showing in Account Determination analysis that "G/L account has been determined", but still in the incompletion log it shows "G/L account was not determined", then the most possible chance is that after creating the Sales Order the G/L account was determined for Customer or Material.
    You can be able to save the order even it is incomplete.
    Solution: you can delete the line item from the sales order & again add it
    Please let me know if this solution helps you or not.
    Thanks
    Bidhu

  • Company code problem in Controlling area Tcodes

    Hi All,
    We are following role based authorisation for creating roles for FI/CO module and we are seggregating roles as per the company codes.We are assigning Tcodes like KO01,KO02,KO03(Internal order) and KS01,KS02,KS03(cost center) which are connected with Controlling area in one role.We have 5 company codes and we are trying to create 5 roles with the above Tcodes for 5 different company codes.
    The problem we encountered is when we entered the Tcodes in the role, and we get to the 'Change authrisation data' option in the 'Authorisation' tab in PFCG, the system is not prompting for the Company code organisational level. Hence in this case, a user will be able to access the above mentined Tcodes for all the company codes. But we need to create a role in such a way that a user who is assigned this role is only able to access Tcode like KO01,02,03 etc for his company code only and should not be authorized to access these Tcodes for remaining 4 company codes.
    Can anybody please help me with a way to restrict these Tcodes to a particular company code in our scenario.
    Thanks and Regards,
    Abdul Khyoom A.

    Hi Ashok,
    Thanks for the response.
    Here in my case, when I insert the Tcodes related to conrolling like(KO01,KO02,KO03 etc) in a role, then I dont find any authorization objects(bukrs) which is related to the company code in the authorization genaration area in PFCG. So there is no way I can maintain values in them.
    Please suggest any alternate solution.
    Thanks and Regards,
    Abdul Khyoom A

  • Cross-company code postings - FI validation

    Hi,
    We start using the cross-company code postings (transaction OBYA) between company code A and company code B and have to give authorizations both company codes to the Finance users. The idea is to have a set of G/L accounts which are allowed to be used when company code A and B are posted via cross-company code posting.
    SAP recommends to implement a validation in FI to restrict the Intercompany scenatios. I attempted to create a FI validation for complete document (call-point 3) with no success:
    1)
    IC Rule: BSEG-BUKRS = A and BSEG-BUKRS = B and BSEG-HKONT IN ACCOUNTSET
    Prerequisite: TRUE
    Check: IC rule
    Message: E-  Account & not allowed for cross-company postings
    When I test it, the Intercompany clearing account configured in OBYA, and which is in ACCOUNTSET, shows up in the error message, which unwanted.
    2)
    IC Rule 1: BKPF-BUKRS = '0017' AND BKPF-BUKRS = '0005'
    IC Rule 2: BSEG-HKONT IN ACCOUNTSET
    Prerequisite: TRUE
    Check: IC Rule 1 --> IC Rule 2
    Message: E-  Account & not allowed for cross-company postings
    No error message is issued at all, even if the G/L account is not in ACCOUNTSET.
    Please advise what I am missing.

    Hi Nitin,
    Thank you for your feeback.
    I just wanted to clarify that the cross-company code posting is when company code A can intitiate a posting to company code B simultaneously (for example Intercompany re-charge, cash concentration, etc.). The trigger for cross-company code posting is the company code field on the line item. If company code A is in the header (BKPF-BUKRS) and at least one document line item filled up as company code B, the system created two documents for each company code, offsetting the Intercompany clearing account, configured in OBYA.
    For example:
    Posting via FB50: Leading company code = company code A (BKPF-BUKRS)
    Item 1: Debit; G/L account 1; Cost Center 1; Amount 200; Company code A (as a default)
    Item 2: Debit; G/L account 1; Cost Center 2; Amount 100; Company code B (manually changed)
    Item 2: Credit; G/L account 2;                        Amount 300; Company code A (as a default)
    The systen creates two postings:
    Posting 1: company code A
    Item 1: Debit; G/L account 1; Cost Center 1; Amount 200;
    Item 2: Credit; G/L account 2;                        Amount 300;
    Item 2: Debit ; I/C Clearing Account;              Amount 100;
    Posting 2: company code B
    Item 1: Debit; G/L account 1; Cost Center 2; Amount 100;
    Item 2: Credit;I/C Clearing Account;              Amount 100;
    The only connection between the two is the cross-company code number (BKPF-BVORG), which assigned by the system once posted, as a logical connection.
    I guess we could use a dedicated document type. If that's the case, how would the validation work then?
    Coudl you please share more details on the BTE option?
    Thank you,
    Inna

  • Company Code and Vendor Account

    Hi all,
    i have a simple question. we defined Vendor numbers as followed: external starting with 1 internal with 3. i.e. below:
    At time we have one vendor 107701 and a customer attached to it 100653 in 9100 company code. This vendor was an external.
    After some time the vendor has changed and now it bellongs to internal. with number 300035 in same comp.code.
    Now when we generate a Bank Statement throught F110 and import it, it assigns the imported ammount to 100653 customer.
    The question is :
    are there any assign problems, concerning comp.code and vendor number.
    or
    those old vendor and customer accounts must be blocked to loose the connection.
    as far as i understand the when you generate the F110 document it puts the vendor and comp.code data in it and thereafter import it to same place.
    Points as always for a helpful answer
    Laurynas Prickockis

    whenever  you change the linkage between teh customer and vendor,  you need to make sure that the balance in one of the account is Zero. Then delink the relation ship in Vendor and customer master data.
    After this again you create the link between teh customer and vendor.

  • Can't connect to company using B1DE

    Hi
    I have just installed B1DE for SAP 2005 SP1.
    The problem I have is that when I run the addon wizard and the connection screen comes up, I get an error - 'connection to database failed - connection to sbo-common has failed '
    I get this with the sdk if I don't have a valid period set up. The periods are set fine.
    Can anyone suggest anything please ?
    Thanks
    Regards Andy

    Hi,
    Can you please take a simple addon and replace the DI connection by the following code?
    You only have to replace all strings with the corresponding datas you want to use:
    diCompany.Server = "localhost";
    diCompany.CompanyDB = "YourCompany";
    diCompany.UserName = "manager";
    diCompany.Password = "manager";
    diCompany.DbUserName = "dbusername";
    diCompany.DbPassword = "dbpassword";
    int ret = diCompany.Connect();
    if (ret != 0)
            int errcode;
            string errmsg;
            Globals.diCompany.GetLastError(out errcode,out errmsg);
            Cursor.Current = Cursors.Default;
            MessageBox.Show("ERROR - Connection to company failed: " + errmsg);
    Please let me know if it works or not
    Regards
    Trinidad.

  • Unable to connect to Company.

    Dear All,
         I have created AddOn and trying to Install it in SAP B1 2004. But it gives me error 'Not connected to Company' while running AddOn.
         Can you pls. let me know how to salve this problem?

    Archana,
    There are a few different reasons for this.  The typical is that you do not have the login properties set correctly in your add-on code.  You may want to review the SAP SDK Help Center and specifically look at "Connecting to SAP Business One Database" for the DI API and/or "Single Sign-on".
    HTH,
    Eddy

  • Company code not showing in the shopping cart list

    Hello,
    Can anyone please help me with this?
    Currently we are on SRM 5.0 with extended and connected to one backend system. Everything works good. Now we are trying to connect another backend system to SRM. The situation is that we have made the same copy of our backend and using it as another backend system. Both backends will have the same product categories, purchasing organization. We are using BADI to determine the backend system based on company code. When I change the company code backend system for the user in org strcuture, the same company code do not show up in the shopping cart list while creating.
    We have made most of the org structure changes, but still I am not able to find the exact reason why the company code is not coming in the list. Can anyone please help?
    Thank you
    Kishore

    Hi Kishore
    Whaever you have inherited in the Attribute  BUK or Function tab , you can receive that comapany code in the shopping cart.
    all sc value comes from Org structure.
    run bbp_check_consitency for your user SC.
    however now your landacape is equivalent to two ECC and one SRM systems.
    Muthu

  • Creating a central DC for plants that have mutliple company codes

    Hi,
    We are looking to consolidate all of our distribution from 5 manufacturing plants (which all have different company codes) to one central distribution center in a single company code.   Has anyone had any experience with this scenario?  We will need to turn on warehouse management at the central DC and have been told that any plants connected to a warehouse in WM, have to be all in the same company code.

    Karen,
    We are looking to consolidate all of our distribution from 5 manufacturing plants (which all have different company codes) to one central distribution center in a single company code. Has anyone had any experience with this scenario?
    Yes
    We will need to turn on warehouse management at the central DC
    Presumably this is for reasons other than the consolidation.  Using or not using WM will have no impact on company codes.  From what little I know about your business model change, there is no reason for you to use WM (other than the additional functionality, which will intrinsically improve warehouse efficiency).
    and have been told that any plants connected to a warehouse in WM, have to be all in the same company code.
    This is not a SAP limitation!  There may, however, be business reasons why you need to do this.
    A Distribution Center is not the same as a Warehouse in SAP.  A DC is a special kind of plant.  Plants are assigned to company codes, and the ownership of the goods in this plant are generally held by that one company code.
    As Jurgen mentioned, a SAP Warehouse can encompass many plants, with many storage locations, each of which may belong to several company codes.  WM doesn't care. 
    Storage locations are members (subsets) of plants.  A given storage location will always be connected to a single plant, and the inventory of all storage locations in a given plant will be owned by the company that owns the plant.
    From your short list of requirements, I believe that your logistics model should be to ship the product from your originating plant(s) to the DC (plant).  The traditional way to do this is via Stock Transport orders.  STOs can be intercompany or intracompany, required financial documents and postings can be configured to meet your company's needs.  Other methods are also possible.
    You mentioned that your DC would be one company code.  Therefore, the sales orders will be placed against one plant (the DC).  Delivery splitting would not be an issue.
    Now, I notice in subsequent responses you seem to be thinking that you will ship from multiple company codes (plants).  This is contrary to your original requirement list.   As asked by Jurgen, where do you wish to consolidate your stock and where do you wish to consolidate your shipments?
    Best Regards,
    DB49

  • Same warehouse for different company codes

    Hello Guru's
                     is there a possibility in WM , considering decentralized WMS to create a warehouse which can be managed by two different company codes.
    thanks a lot for ur suggestions

    yeah i do understand that warehouse is connected to plant and we can also have one warehouse to two plants and manage the inventory but in my company case, we manage the inventory of two different company codes in one warehouse by their legacy systems, so i was wondering how to map that in SAP.
    In the centralized warehouse as far as i know i dont think we can assign the warehouse to 2 different company codes but i was wondering can we do that in decentralized warehouse.
    thanks for the reply

Maybe you are looking for

  • Cd dvd-r drive, wont burn cds anymore

    i have been using my sony dvd rw dw-u10a drive, i have not changed the type of disks i am using but now when i try to burn any type of disk, audio or data, i get an error 3, any ideas? also any ideas where i can find the driver for this, i cant find

  • Problem in Delivery Creation

    Hi All, I have a requirement to create a delivery from sale order. Iam using BAPI_DELIVERYPROCESSING_EXEC bapi to create sale order. I have passed the data as below. The below code is creating delivery in my ECC 6.0(Sand Box) but my client system is

  • Advanco sftp adapter

    HI experts, how to work with advanco sftp adapter at sender and receiver in pi environment? <Read Rules of Engagement> Regards sachin Edited by: Prateek Raj Srivastava on Feb 20, 2012 10:27 AM

  • A few more FCP X Bugs/Annoyances

    Hello all, I cannot thank the help and expertise from some of the members in the FCP X support community.  Luis Sequeira and Tom Wolsky you guys are part of the reason why I am persevering with FCP X and am finding it to be the future of editing desp

  • Adobe Reader XI - Poster printing settings

    I am struggling to adjust the settings correctly in Adobe Reader XI in order to use four A3 pages to create an A1 to scale. The PDFs are saved as A1 from AutoCAD. I am aware I am to use the Poster option for printing this way, but I am unaware of the