Establishing a socket connection between a .swf file and a socket-test program (TCP/IP builder - Windows), in AS3.

I have an issue with a college project I'm working on.
Using Actionscript 3, I made a simple .swf program, an animated, interactive smiley, that 'reacts' to number inputs in a input-box.
For the sake of the project, I now need to make the framework for establishing a socket connection with the smiley .swf, and another program.
This is where I encounter issues. I have very little knowledge of AS3 programming, so I'm not certain how to establish the connection - what's required code-wise for it, that is.
To test the connection, I'm attempting to use the "TCP/IP builder" program from windows, which lets me set up a server socket. I need to program the .swf file into a client - to recognize it, connect to it, then be able to receive data (so that the data can then be used to have the smiley 'react' to it - like how it does now with the input-box, only 'automatically' as it gets the data rather than by manual input).
My attempts at coding it are as follows, using a tutorial (linked HERE):
//SOCKET STUFF GOES HERE
    var socket:XMLSocket;        
    stage.addEventListener(MouseEvent.CLICK, doConnect); 
// This one connects to local, port 9001, and applies event listeners
    function doConnect(evt:MouseEvent):void 
    stage.removeEventListener(MouseEvent.CLICK, doConnect); 
    socket = new XMLSocket("127.0.0.1", 9001);   
    socket.addEventListener(Event.CONNECT, onConnect); 
    socket.addEventListener(IOErrorEvent.IO_ERROR, onError); 
// This traces the connection (lets us see it happened, or failed)
    function onConnect(evt:Event):void 
        trace("Connected"); 
        socket.removeEventListener(Event.CONNECT, onConnect); 
        socket.removeEventListener(IOErrorEvent.IO_ERROR, onError); 
        socket.addEventListener(DataEvent.DATA, onDataReceived); 
        socket.addEventListener(Event.CLOSE, onSocketClose);             
        stage.addEventListener(KeyboardEvent.KEY_UP, keyUp); 
    function onError(evt:IOErrorEvent):void 
        trace("Connect failed"); 
        socket.removeEventListener(Event.CONNECT, onConnect); 
        socket.removeEventListener(IOErrorEvent.IO_ERROR, onError); 
        stage.addEventListener(MouseEvent.CLICK, doConnect); 
// Here, the flash tracks what keyboard button is pressed.
// If 'q' is pressed, the connection ends.
        function keyUp(evt:KeyboardEvent):void 
        if (evt.keyCode == 81) // the key code for q is 81 
            socket.send("exit"); 
        else 
            socket.send(evt.keyCode); 
// This one should handle the data we get from the server.
        function onDataReceived(evt:DataEvent):void 
        try { 
            trace("From Server:",  evt.data ); 
        catch (e:Error) { 
            trace('error'); 
    function onSocketClose(evt:Event):void 
        trace("Connection Closed"); 
        stage.removeEventListener(KeyboardEvent.KEY_UP, keyUp); 
        socket.removeEventListener(Event.CLOSE, onSocketClose); 
        socket.removeEventListener(DataEvent.DATA, onDataReceived);
Trying to connect to the socket gives me either no result (other than a 'connection failed' message when I click the .swf), or the following error:
Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: file:///C|/Users/Marko/Desktop/Završni/Flash%20documents/Smiley%5FTCP%5FIP%5Fv4.swf cannot load data from 127.0.0.1:9001.
    at Smiley_TCP_IP_v4_fla::MainTimeline/doConnect()[Smiley_TCP_IP_v4_fla.MainTimeline::frame1:12] 

Tried adding that particular integer code, ended up with either errors ("use of unspecified variable" and "implicit coercion") , or no effect whatsoever (despite tracing it).
Noticed as well that the earlier socket code had the following for byte reading:
"sock.bytesAvailable > 0" (reads any positive number)
...rather than your new:
"sock.bytesAvailable != 0" (reads any negative/positive number)
Any difference as far as stability/avoiding bugs goes?
So then, I tried something different: Have the program turn the "msg" string variable, into a "sentnumber" number variable. This seemed to work nicely, tracing a NaN for text (expected), or tracing the number of an actual number.
I also did a few alterations to the input box - it now no longer needs the 'enter' key to do the calculation, it updates the animation after any key release.
With all this considered and the requirements of the project, I now have a few goals I want to achieve for the client, in the following order of priority:
1) Have the "sentnumber" number variable be recognized by the inputbox layer, so that it puts it into the input box. So in effect, it goes: Connect -> Send data that is number (NaN's ignored) -> number put into input box -> key press on client makes animation react. I optionally might need a way to limit the number of digits that the animation reacts to (right now it uses 1-3 digit numbers, so if I get sent a huge number, it might cause issues).
- If the NaN can't be ignored (breaks the math/calculus code or some other crash), I need some way of 'restricting' the data it reads to not include NaN's that might be sent.
- Or for simplicity, should I just detect the traced "NaN" output, reacting by setting the number variable to be "0" in such cases?
2) After achieving 1), I'll need to have the process be automatic - not requiring a keyboard presses from the client, but happening instantly once the data is sent during a working connection.
- Can this be done by copying the huge amounts of math/calculus code from the inputbox layer, into the socket layer, right under where I create the "sentnumber" variable, and modifying it delicately?
3) The connection still has some usability and user issues - since the connection happens only once, on frame 1, it only connects if I already have a listening server when I run the client, and client can't re-connect if the server socket doesn't restart itself.
I believe to do this, I need to make the connection happen on demand, rather than once at the start.
For the project's requirement, I also need to allow client users to define the IP / port it's going to connect to (since the only alternative so far is editing the client in flash pro).
In other words, I need to make a "Connect" button and two textboxes (for IP and port, respectively), which do the following:
- On pressing "Connect", the button sets whatever is in the text boxes as the address of the IP and port the socket will connect to, then connects to that address without issues (or with a error message if it can't due to wrong IP/port).
- The connection needs to work for non-local addresses. Not sure if it can yet.
- On re-pressing connect, the previous socket is closed, then creates a new socket (with new IP/port, if that was altered)
It seems like making the button should be as simple as putting the existing socket code under the function of a button, but it also seems like it's going to cause issues similar to the 'looping frames' error.
4) Optional addition: Have a scrolling textbox like the AIR server has, to track what the connection is doing on-the-fly.
The end result would be a client that allows user to input IP/Port, connects on button press (optionally tracking/display what the socket is doing via scrollbox), automatically alters the smiley based on what numbers are sent whilst the connection lasts, and on subsequent button presses, makes a new connection after closing off the previous one.
Dropbox link to new client version:
https://www.dropbox.com/s/ybaa8zi4i6d7u6a/Smiley_TCP_IP_v7.fla?dl=0
So, starting from 1), can I, and how can I, get the number variable recognized by "inputbox" layer's code? It keeps giving me 'unrecognized variable' errors.

Similar Messages

  • Trying to Hot Sync Visor Pro with Windows 7 (64 bit OS) - getting error: "The connection between your handheld computer and the destktop could not be establishe​d. Please check your setup and try again."

    Hi.
    I read the posting regarding the options on Hotsyncing for Windows 7; however, I have some questions as I have a 64-bit system.
    I have a Visor Pro that I'm trying to Sync up with my new laptop which is running Windows 7.
    Steps I have taken:
    * installed the Visor Palm Desktop 3.0.1 that came with the Visor (which the installation went well)
    * The issue arises when I push the "Sync" button on the cradle and the following error message appears "The connection between your handheld computer and the destktop could not be established.  Please check your setup and try again."
    Since I have a 64-bit OS it appears that I have 2 options: 1) bluetooth or 2) Infrared.
    I have to admit I don't know know how to do either of these (how can I tell if this Handspring Visor Pro has bluetooth (which I don't it does)?). 
    Then how about the Infrared option?  I see on the PDA it has a red area that one can "beam" info.  Is this the same as Infrared or my 2nd option?
    I love my Visor and want to continue using it, but need to backup the valuable info!
    Any help with this would be greatly appreciated!
    THANKS!!!!!
    Post relates to: Visor Pro

    Hello lwalbring and welcome to the Palm forums.
    Your Visor, as you suspect, does not have Bluetooth, so you must use the IR HotSync option.  Since you are using Windows 7 64-bit, I believe that you are going to have to upgrade to Palm Desktop 6.2.2 to make things work from an OS/Driver perspective.
    Since you are using such an old device, you are also going to have to download and install the PalmHotSyncSetup Utility from Pimlico.  This update turns on support for old Palm OS PDAs in Palm Desktop 6.2.2.  Without the update, you won't be able to sync your Visor with Palm Desktop 6.2.2.  The software is free and the link is all the way at the bottom of the screen.
    Lastly, if your PC doesn't have an IR port on it, you will need to purchase a USB to IR adapter.  Some laptops still have IR ports and most desktops don't.
    Once you have all the pieces, you'll want to go back to the Windows 7 and Vista HotSync thread again, and follow the directions for setting up and configuring IR HotSyncs.
    Alan G

  • Help Needed in establishing connection between Kepware OPC server and UDS 4

    Hi All,
    I am in the process of establishing connection between Kepware OPC server and UDS 4.0,
    Can anyone guide me through the process of configuring UDS 4.0 to establish conection with the Kepware.
    Any standard documentation on UDS 4.0 will be of great help.
    Thanks in advance,
    Shyam

    HI Rajesh,
    I am creating OPC DA instance and when i try to browse for the OPC servers available in the machine, the list is blank. i am not able to view any OPC servers.
    Actuallt the Kepware OPC server and UDS are installed in the same machine.
    Can you plz through some ligh on this
    Regards,
    SHyam

  • How to establish an Oracle connection between server1 and server2

    I am trying to establish an Oracle connection between server1 and server2 specifically, while logged into server2 launch OEM on server1. Can anyone help me out here on establishing this connections between the 2 servers. thank you inadvance

    I am assuming this is 10g.
    Same way you connect from your desktop to the server using the URL (e.g http://server1:1158/em).
    But you have to ensure that server2 can see server1. They cannot see each other, then it is not OEM problem.
    if it is not 10g, then let me know

  • Connection between CRM back end and ASP front end website for Ecommerce

    Hi All,
    I want to establish the connection between a ASP website and CRM back end server(we are replacing th existing ERP back end system with SAP CRM ).
    I want to know whether I have to go with XI or any other connectors provided by SAP to establsih the communication between the existing ASP website and CRM back end server..
    Can anyone please help me out.
    Thank you,

    Okay here is the general concept for your scenario:
    -You will call standard/custom RFC's(could be BAPI's) in the CRM system from the existing application. 
    -You will need to write a new model layer in your ASP application that calls the RFC layer in CRM
    -You decide what data you want to use from CRM in your application
    Let's assume at minimum you will want to use the product master, business partner master, and business transactions.  You will need RFC's/BAPI's for every interaction point where you will consume/publish data to CRM.
    So when an user creates an order from your e-commerce site, you will need to support saving an order in CRM.  This is example of how you need to map out each function in your existing site to a part of the CRM system.  Since we don't know what your site currently does, this is something you would have to do.
    Once you have mapped out the business level data to the CRM system, then you can evaluate where you will need a BAPI and/or RFC call.  Once that is done, then you can look at the CRM system and see what standard pieces can be called.  Then everything else is custom development.  Your ASP application will call CRM via RFC. 
    It is possible to do what you want to do, but it is going to require a lot mapping work and a fair amount of development effort to integrate the two pieces.  I don't know if you might be better off looking at the SAP Internet Sales Solution instead so you could focus only customizing that application, instead of worrying about an integration problem.  It just depends on how much special functionality your existing e-commerce site has today.
    My general recommendation would be for you to hire a consultant that has done an SAP e-commerce project using SAP CRM in the past and let them guide you on the implementation issues.  An on-site resource could better answer your "high-level" questions.
    However if you have more questions please ask and I will try to answer to the best of my knowledge.
    Good luck,
    Stephen

  • Regarding connection between front end HTML and back end SQL 7.0

    Hi!!
    I am working on the project 'ERM'. I have designed 12 forms using HTML. Can u please give me brief idea how to establish the connection between a back end and front end i.e. between HTML and SQL 7.0. If possible can u provide me the source code for the same.
    I will be very thankful to you.
    Thanks,
    Jigar.

    Read up about multi-tier applications.
    You need servlet and JSPs for the server-side presentation layer, some classes for the business logic, and some mor for the persistence layer either using JDBC or some framework like Hibernate.

  • Problem to connect between Oracle 10g xe and VB2010 at Vista sp2

    Introduction
    Hi guys, good day... NEED RESCUE!! SOS!! Hmm.. i have trouble been 1 weeks trying connect between Oracle 10g xe and VB2010 on window vista sp2. Actaully im very new at Oracle 10g xe and VB2010 but i got a project is going to build up system database and i figure out Oracle 10g xe and VB2010 can use free so i just chows these appication to be my project. I been search around internet and there is several things i was found about the connection but i has try and tried still it wont work out.
    Things i found and learned
    Oracle
    1. I have download Oracle 10g XE and installed in my windows vista sp2.
    2. I notice the Oracle Developer Tools is needed for VB2010 (To add reference 'Oracle.DataAccess'). So i was downloaded ODT11beta and installed
    3. I also edit TNSNAMES to following below:
    OraDb =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = shin-PC)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    4. My sqlnet like following below:
    SQLNET.AUTHENTICATION_SERVICES = (NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    5.I have try tnsping OraDB and its works.
    6. I monitoring task manager and OracleServicesXE is running.
    7. ora_dba is added in Group.
    Problem in SQLPLUS
    When i try connect SQLPLUS in cmd i get ERROR: ORA-12560: TNS:protocol adapter error.
    i . In cmd i type sqlplus and enter then i been ask for username and password.
    ii. After i insert my username and password and enter then i get the error of ORA-12560.
    Visual Basic 2010
    1. First i created my project, drawing label and button for test connection.
    2. Then, i add reference Oracle.DataAccess into my project.
    3. I type following script into my vb form:
    Imports System.Data
    Imports Oracle.DataAccess.Client
    Imports Oracle.DataAccess.Types
    Public Class Logon
    Private Sub cmdLogon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogon.Click
    Dim oradb As String = "Data Source = OraDb; User Id = system; Password = shin;"
    Dim conn As New OracleConnection(oradb)
    conn.Open()
    Dim cmd As New OracleCommand
    cmd.Connection = conn
    cmd.CommandText = "select SName from Staff where SName = shin"
    cmd.CommandType = CommandType.Text
    Dim dr As OracleDataReader = cmd.ExecuteReader()
    dr.Read()
    lblOra.Text = dr.Item("SName")
    conn.Dispose()
    End Sub
    End Class
    Problem in VB2010
    When i run my project and press the button i get error message ORA-12514: TNS:could not resolve the connect identifier specified at conn.Open()
    Extra Question*
    1. Im notice in my netbook xp home sp2, before i install ODT11beta my sqlplus look fine thought cmd but after i installed ODT11beta its same problem with my Vista sp2 now. Get error ORA-12560: TNS:protocol adapter error :( I tried uninstall ODT11beta again and restart its work fine again. Which i really dun understand. Izzit the version ODT11 is not suitable for 10g xe? And i dunno this problem is related with my connection between oracle 10g xe and vb2010 or not. So confuse@@
    2. I wish to know more about connect between Oracle and VB, is there still a things i miss?(I mean steps or configuration that should i done)
    3. Or i just lower my VB version could make more easy? If yes, what version VB should i use that could work out with oracle 10g xe?
    4. Sorry for too bad my english but i really wish somebody could help me. Please try to understand my written or you could ask me mean if dont understand. Im stuck!! Stuck feel not really that good.....
    Edited by: user9173084 on Jul 19, 2010 3:34 AM

    Huhu..
    Yo, henry
    I thought the OraDb is just a name for entry but im not sure it is a service. I was refer http://www.oracle.com/technology/pub/articles/cook-vs08.html at topic Connection Strings and Objects.
    Here is my lsnrctl service
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
    Services Summary...
    Service "CLRExtProc" has 1 instance(s).
    Instance "CLRExtProc", status UNKNOW has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0
    LOCAL SERVER
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOW has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0
    LOCAL SERVER
    Service "XEXDB" has 1 instance(s).
    Instance "xe", status READY has 1 handler(s) for this service...
    Handler(s):
    "D000" established:0 refused:0 state:ready
    DISPATCHER <machine: SHIN-PC, pid: 1932>
    (ADDRESS=(PROTOCOL=tcp)(HOST=shin-pc)(PORT=49158))
    Service "XE_XPT" has 1 instance(s).
    Instance "xe", status READY has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0 state:ready
    LOCAL SERVER
    Service "xe" has 1 instance(s).
    Instance "xe", status READY has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0 state:ready
    LOCAL SERVER
    The command completed successfully
    Izzit ok? I notice there is no listed OraDb. but tnsping OraDb seem fine.
    Actually there is somethings as a newbie i wondering long time alreadly ><
    1. The origin of tnsname.ora is no OraDb or ORCL but i just simple add it by open tnsname.ora with notepad. Im just not sure it is function or not.
    Also please check at my TNSNAME.ORA:
    XE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = shin-PC)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    ORACLR_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    (CONNECT_DATA =
    (SID = CLRExtProc)
    (PRESENTATION = RO)
    OraDb =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = shin-PC)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    I got the feeling there is so close~~~!!!

  • Connectivity between SAP ECC system and SAP BI

    Connectivity between SAP ECC system and SAP BI
    Hi BI-experts!
    I would like to load e.g. transaction data from SAP ECC system into SAP BI system.
    The Loading process is hanging in processing step u201CSERVICE APIu201D.
    The process  in hanging in status "yellow" and then changed after a while to status u201Credu201D.
    [0FI_AR_4 |http://www.file-upload.net/view-1447743/0FI_AR_4.jpg.html ]
    The following steps within Load process are yellow and then red:
    Extraction (messages): Missing messages
    Missing message: Request received
    Missing message: Number of sent records
    Missing message: Selection completed
    Transfer (IDocs and TRFC): Missing messages or warnings
    Request IDoc : Application document posted (is green)
    Data Package 1 : arrived in BW ; Processing : 2nd processing step not yet finished
    Info IDoc 1 : sent, not arrived ; Data passed to port OK
    Info IDoc 2 : sent, not arrived ; Data passed to port OK
    Info IDoc 3 : sent, not arrived ; Data passed to port OK
    Info IDoc 4 : sent, not arrived ; Data passed to port OK
    Subseq. processing (messages) : Missing messages
    Missing message: Subseq. processing completed
    DataStore Activation (Change Log) : not yet activated
    Question:
    Can some one tell me whether my distribution model or other settings are wrong?
    I created 2 distribution model (BD64), one from SAP BW system and other from SAP BI system with message types RSRQST, RSINFO, RSSEND
    Thank you very much!

    Hi Holger.
    this issue is related to the RFC but not the one which is communicating from BI to R/3 rather the one which is communicating from R/3 to BI follow these steps.
    1. check your BI system logical name from the myself source system.
    2. go the ECC and run the transaction sm59
    3. go the ABAP Connection folder and search for your RFC which name would be by default as per your BI logical system name.
    4. double click it and edit it now check whether the Target hostname or ip is OK.
    5. In the logon tab check the client number User and password settings.
    Save it and test it with both Connection Test and Remote Logon.
    if every thing work fine i hope your problem will be solved.
    kind regards,
    Zeeshan

  • Connection between portal (KM system) and external server.

    Hello All,
    I need to establish connection between portal (KM system) and external server. At external server, IIS and WebDAV are configured.
    So for this reason, I have created an HTTP system and a webDAV repository manager at portal, but not able to connect to the external system.
    I have created a webDAV template, but not able see it under KM systems to create a webDAV system, I have even restarted the portal, still no use
    Please suggest, any prerequisites need to be done?
    Thanks
    sk

    Hello Supraja.
    Yes, ofcourse i already followed the doc.... In the 20th page of the doc, it is said the portal needs to be started, for the WebDAV template to be seen. to go head and creat a WebDAV system under KM systems.
    But even after restarting the portal, I cant find the already created WebDAV template. Any guess to reslove it...
    A quick response it appreciated.
    regards-
    sk

  • Connection between BO Mobile Server and BOE

    Hi All,
    I have installed BO Mobile on the same machine which as Business Objects Enterprise.
    Have the following questions
    1. How the mobile server connect to the enterprise server? Let me know what are the steps needs to be done for the connection between the mobile server and enterprise.
    2. How the connection between mobile server and proxy server
    I gone through the installation and deployment guide of businessobjects mobile but it not clearer to me.
    Kindly, help me out.
    Thanks and Regards,
    Yuvaraj.

    Hello,
    I have a similar scenario to that you have described, in order to test;
    BOE and BO Mobi deployed on the same machine, no proxy.  I am also using a BB simulator in order to test connecting.
    I have installed the client s/w to the simulator device, but am unable to connect to BOE from the device.
    Below is the info from each of the config files and device.
    Can you tell me if there is a needed change?
    1.  VMS
    $Id: server.config 28982 2008-01-03 21:52:21Z hmak $
    config for VMS Server instance
    VERSION = 6.0
    [server]
    SERVER_ID=VMS_SERVER
    [comm]
    BINDTO_PORT=11711
    MANAGEMENT_PORT=11712
    EXTERNAL_HOSTNAME=<BOE machine Name>
    common across all VMS servers
    INCLUDE_CONFIG_FILE = config/cluster.config
    vim:noet
    2.  VAS:
    $Id: server.config 27498 2007-10-01 19:12:19Z hmak $
    config for Authentication Server (VAS) instance
    VERSION = 6.0
    [server]
    SERVER_ID=AUTH_SERVER
    [comm]
    BINDTO_PORT = 11011
    MANAGEMENT_PORT = 11012
    EXTERNAL_HOSTNAME=<BOE machine Name>
    common across all auth servers
    INCLUDE_CONFIG_FILE = config/cluster.config
    vim:noet
    3.  Handheld Connection Settings:
    Mobile Server:  <server IP Address>
    Port Number:  11011
    CMS Name:  <BOE machine Name>
    Auth Method:  Enterprise

  • I have forgotten my Password to be able to connect between my desktop Mac and Mac Book on my home network. How can I recover the password or change it?

    I have forgotten my Password to be able to connect between my desktop Mac and Mac Book on my home network. How can I recover the password or change it?

    The password used to log in to a user account remotely is the same as you would use to log into it locally. You can also use your Apple ID, so try that.
    To change your login password read OS X Mavericks: Reset a login password
    also OS X Mavericks: If you forget your login password

  • How to make the connection between a sale order and an invoice in SDK

    Hi,
    Im trying to make the connection between a sales order and an invoice using the SDK.
    Here is how i create each of them:
    Invoice:
    public int SalesInvoiceInternalSave(string buisnesspartnerCardCode, DateTime dueDate, double discountPercent, string id, IList<InternalItem> items, ref int invoiceId)
          int res = 0;
          SAPbobsCOM.Documents invoice_entry = (SAPbobsCOM.Documents)Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);     
          invoice_entry.CardCode = buisnesspartnerCardCode;
          invoice_entry.DocDueDate = dueDate;
          invoice_entry.DiscountPercent = discountPercent;
          invoice_entry.Reference2 = id;
          foreach (InternalItem item in items)
            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;
    Sales order:
        public Boolean SalesOrderInternalSave(string orderId, string buisnesspartnerCardCode, DateTime dueDate, IList<InternalItem> items)
          SAPbobsCOM.Documents order_entry = (SAPbobsCOM.Documents)Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);
          order_entry.CardCode = buisnesspartnerCardCode;
          order_entry.DocDueDate = dueDate;
          foreach (InternalItem item in items)
            order_entry.Lines.WarehouseCode = item.Shopid;
            order_entry.Lines.ItemCode = item.Code;
            order_entry.Lines.ItemDescription = item.Name;
            order_entry.Lines.Quantity = item.Quantity;
            order_entry.Lines.UnitPrice = item.Price;
            order_entry.Lines.Add();      
          int res = order_entry.Add();
          return res == 0;
    What do i need to change to get the connection between the two of them?
    And how do you insert a amount (not percent) discount into an invoice?
    Regards,
    Torben

    Hi,
    Add the sale order, then add the invoice. and while adding the invoice please add the following details to the invoce documen
    invoice_entry.Lines.BaseEntry = 'Doc entry of the newly created SO
    invoice_entry.Lines.BaseLine = 'Line No of the SO
    invoice_entry.Lines.BaseType = 17 'For sales order document type.
    Hope it helps,
    Vasu Natari.

  • Connection between SAP R/3 and SAP XI with RFC

    Hi Experts,
    I am beginner in SAP XI.
    We are using SAP XI 3.0 SP 9 and SAP R/3 4.6 C
    I am trying to validate a connection between SAP R/3 and SAP XI with RFC.
    I followed all the weblogs ,and i did exactly the same way, but I am unsucessful...
    Schema not available Exception
    com.sap.aii.af.service.cpa.CPAException: Schema not available for RFC|3b787a8035c111d6bbe0efe50a1145a5|http://sap.com/xi/XI/System.
    at com.sap.aii.af.service.cpa.impl.cache.directory.DirectoryDataSAXHandler.endElement(DirectoryDataSAXHandler.java:262)
    at com.sap.engine.lib.xml.parser.handlers.SAXDocHandler.endElement(SAXDocHandler.java:154)
    at com.sap.engine.lib.xml.parser.XMLParser.scanEndTag(XMLParser.java:1826)
    at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1722)
    at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2298)
    at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1719)
    at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2701)
    at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:162)
    at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:126)
    at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:136)
    at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:209)
    at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:270)
    at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:331)
    at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:143)
    at com.sap.aii.af.service.cpa.impl.cache.directory.DirectoryDataParser.updateCentralCache(DirectoryDataParser.java:54)
    at com.sap.aii.af.service.cpa.impl.cache.CacheManager.updateCacheWithDirectoryData(CacheManager.java:713)
    at com.sap.aii.af.service.cpa.impl.cache.CacheManager.performCacheUpdate(CacheManager.java:595)
    at com.sap.aii.af.service.cpa.impl.cache.CacheManager$CacheUpdateRunnable.run(CacheManager.java:440)
    at com.sap.engine.frame.core.thread.Task.run(Task.java:60)
    at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:73)
    at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:145)
    Please help me out on this
    Thanks in advance
    Raju

    hi,
    try refreshing you CAP cache:
    741214 (check this note)
    and check if the refresh was successful
    (CPA history)
    Regards,
    michal

  • Using a container to load several swf files and play them

    I need some help. I want to use several swf files and have them be called upon in a container file and play them in sequence. It's a presentation that needs to play thru but still have the ability to stop, click on items, open a popup and then continue on in the presentation. I am building all the individual "chapters" and their "sub-chapters" as swf files, with the hope that I can load them in order. I am relatively new to AS3. Help?

    If you will be loading swf files into a container then you will use the Loader class to accomplish that, so give that a looking over in the help documents and see what you can do.  If you have a problem getting it to work, post your code and describe what you have done.

  • Ports to open to enable connection between TVN staged env and SAP

    Hi,
    What the ports to be opened to enable connection between SAP TVN stage environment and SAP ECC...

    Hi Abi,
    I have implemented STVN products in 10 or 11 clients and have never had to do this. The SAP .NET connector (or SAP JCo for Java version) handles the connection between the STVN apps and the SAP system and no port is usually opened. The default port for the application, if you have not changed the IIS website, will be port 80.
    I hope that helps.
    Kind regards,
    Luke

Maybe you are looking for

  • When i walk away for 5 min the browser goes offline how do i keep it online all the time?

    when i step away form the computer firefox goes offline after a few minutes how do i stop this i need firefox to stay online

  • Node crashing on quitting

    Hi Folks Every time I quit Logic then quit the Node app on my Macbook Pro it crashes and I have to force quit anybody with the same problem? TTFN arrgh-let-me-login

  • HELP!  Need help linking Nano to existing Nike+ account

    Hope someone can help as I'm going out of my mind. I searched but couldn't find another topic like this. I had to restore my nano (2nd gen) to its original factory settings in itunes, which erased all songs and data. My Nano is working great now, but

  • Safari unexpectedly shutting down.

    4 times in the last week or i have been browsing on yahoo, when safari unexpectedly closes. i then get a message saying "safari has closed and this has not affected other programs, would i like to get more info and send a report to apple?" so i do th

  • How often comes a new software upgrade?

    in the last update I'm blue screen upon reboot and had to leave as a tube direct button to turn it off. and stayed in version 10.6.8 and I can not do much for not having updated the software the problem is said to stay updated but no, he stayed in th