Returning VB collections through OLE

We are creating a Forte OLE automation server which must interface
with a VB Collection.
We have successfully passed a collection from VB to Forte. Forte
receives this parameter as type CDispatch (determined using
GetClassType().Name).
We want to add items of type ValueItem to this collection.
ValueItem was generated from another VB component using olegen,
so it has a CDispatch interface.
We don't seem to be able to use the CDispatch.InvokeMethodWithResult
to execute the method Collection.Add. This is due to the fact that
ValueItem is a subclass of CDispatch and we must pass an array of
variant to InvokeMethodWithResult.
Has anybody done something similar to this?
Thank you,
Keith

I'm not sure why do you need a REMOTE interface for your Entity bean...
Anyway you never return a collection of entities from a finder, but coleection of primary keys (BMP).
public Collection ejbFindBySurname(String Apellido1) throws FinderException
ArrayList list = null;
try
Connection con = getConnection();
try
PreparedStatement pstmt = con.prepareStatement("select IDAbonado from Abonado where Apellido1 like ?");
try
pstmt.setString(1, Apellido1 + '%');
ResultSet rs = pstmt.executeQuery();
list = new ArrayList();
while(rs.next())
int index = rs.getInt(1);
list.add(new Integer(index));
finally { pstmt.close(); }
finally { con.close(); }
catch (Exception ex) { throw new FinderException(ex.getMessage()); }
return list;
ArrayList is Serializable
But I prefer to use a local interface to enty in pair with SlSB
public ArrayList findBySurname(String surname)
ArrayList list = null;
try
Collection c = abonadoHome.findBySurname(surname);
list = new ArrayList(c.size());
Iterator i = c.iterator();
while(i.hasNext())
list.add(((LocalAbonado)i.next()).getMyInformationMethod();
catch(Exception ex)
ex.printStackTrace(System.err);
throw new EJBException(ex);
return list;
Note, I do not use narrow, coz I do not use remote call.
Cheers

Similar Messages

  • Problem while opening Excel through OLE

    Hi Friends
    I am facing a problem while opening an excel file through OLE. it is working fine in SAP ECC 5.0, but the problem is in ECC 6.0.
    I am adjusting the cells for auto fit. I have written the code like below.
    CALL METHOD OF e_appl 'CELLS' = e_cell.
      CALL METHOD OF e_cell 'EntireColumn' = ole_columns .
      CALL METHOD OF ole_columns 'AutoFit'.
      set property of e_appl 'VISIBLE' = 1.
    if I take out the adjustment part it is working fine for this program, rest other programs even if I have this code, they working fine.
    When I am executing the statement set property of e_appl 'VISIBLE' = 1. the return code is coming as 2.
    Could anybody please help me to overcome this problem.
    Thanks
    Praveen

    In ECC 6.0, if the worksheet is portedcted SAP unable to open that sheet, now we have taken out this option so it is working.

  • Call OpenOffice through OLE Automation

    Hello everybody,
    I am trying to open an OpenOffice Calc window (similar to Excel)
    from ABAP through OLE automation. My problem with this: it
    is necessary to call an automation method of OpenOffice that
    has a SAFEARRAY (OLE data type) as one of its parameters.
    How do I create a data type that maps to SAFEARRAY in ABAP?
    I have found no example for this.
    My program looks like this, the missing line is the one that
    starts with #4:
    REPORT ZCALC2 NO STANDARD PAGE HEADING.
    INCLUDE OLE2INCL.
    DATA: SERVICE_MANAGER TYPE OLE2_OBJECT,
    DESKTOP TYPE OLE2_OBJECT,
    DOCUMENT TYPE OLE2_OBJECT.
    CREATE OBJECT SERVICE_MANAGER 'com.sun.star.ServiceManager'.
    CALL METHOD OF SERVICE_MANAGER 'createInstance' = DESKTOP
    EXPORTING #1 = 'com.sun.star.frame.Desktop'.
    CALL METHOD OF DESKTOP 'loadComponentFromURL' = DOCUMENT
    EXPORTING #1 = 'private:factory/scalc'
              #2 = '_blank'
              #3 = 0
              #4 = ''.
    FREE OBJECT SERVICE_MANAGER.
    When I run the program, the CALL METHOD returns SY-SUBRC code 2 and I see the following in the trace file:
    <1950=(Error): CALL METHOD "loadComponentFromURL" OF [#13/0x00229C9C/402]
                        #0: STRING "private:factory/scalc"
                        #1: STRING "_blank"
                        #2: LONG "0"
                        #3: STRING ""
    IDispatch::Invoke raised exceptionTypkonflikt.
    <1950=(Error):                                                 Exception fire by :[automation bridge]
    <1950=(Error):                                                 Exception info:conversion not possible!
    <1950=(Error):                                                 Exception code:1001
    <1950=(Error):                  Error occured at Verb  : loadComponentFromURL
    <1950=(Error):                                   Object: 13
    <1950=(Error): SAPAWRFC leaving RfcFlushOle with RfcRaise(CALL_METHOD_FAILED)
    See the <a href="http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html">loadComponentFromURL</a> documentation for information on the parameters. Unfortunately it is in UNO IDL, which is specific to OpenOffice. However, a <a href="http://udk.openoffice.org/common/man/spec/ole_bridge.html">mapping</a> to OLE types is available.
    There are many examples how to do this in other programming languages, for example <a href="http://www.oooforum.org/forum/viewtopic.phtml?t=9815">here</a>, but I could not find it in ABAP.
    Thanks for your help,
    Frederic.

    Here is another interesting thing: it's possible to let OpenOffice open a multi selection file dialog from ABAP. It works like this:
    CALL METHOD OF SERVICE_MANAGER 'createInstance' = DIALOG
    EXPORTING #1 = 'com.sun.star.ui.dialogs.FilePicker'.
    CALL METHOD OF DIALOG 'setTitle'
    EXPORTING #1 = 'Hello from ABAP'.
    CALL METHOD OF DIALOG 'setDisplayDirectory'
    EXPORTING #1 = 'file:///C:'.
    CALL METHOD OF DIALOG 'setMultiSelectionMode'
    EXPORTING #1 = 1.
    CALL METHOD OF DIALOG 'Execute'.
    CALL METHOD OF DIALOG 'getFiles' = FILE_ARRAY.
    According to the documentation, last line returns an empty array if no file has been selected. My hope was that I could use this as the 4th parameter of loadComponentFromURL, but I still get "conversion not possible".
    I also wonder what should be the type of FILE_ARRAY - I expected OLE2_OBJECT, but if I try that, I can see in the debugger that the object is not properly initialized (HEADER and TYPE are not 'OBJH' and 'OLE2').

  • A few days ago i bought the macbook pro in a Providence. In late Summer i will come back to my Country - Ukraine. I would like to know about a tax for my laptop. Can i return tax? Through the TAX FREE or return in airport? What should i do?

    A few days ago i bought the macbook pro in a Providence. In late Summer i will come back to my Country - Ukraine. I would like to know about a tax for my
    laptop. Can i return tax? Through the TAX FREE or return in airport? What should i do?

    You need to talk with the tax authorities in the countries to which you traveled and that of your home country. We are all end-users liek you and not Apple agents.

  • Question about personal hotspot. I know I can share GSM / 3G but I would like to know if my iPhone is connected to a wifi can I also share that wifi collection, through personal hotspot?

    Question about personal hotspot. I know I can share GSM / 3G but I would like to know if my iPhone is connected to a wifi can I also share that wifi collection, through personal hotspot? And if so can it be through wifi or does it have to be Bluetooth or USB?
    Sounds like an odd question but my phone will connect to BT Openzone so I want to share that with my iPad via personal hotspot. I could use 3G but then it comes off my data allowance and I don't want to have to buy a separate SIM for my iPad if I can avoid it. I can swap my sim from my phone, but that's a pain!
    Thanks
    Luke

    No, unfortunately Personal Hotspot will only use your 3G plan.

  • Vendor return Excise Invoice through J1IS in foreign currency

    Hello Experts.
    Scenario is like:
    We have two group company which are 100% EOU . and we have inter company process.
    Plant  A used to invoice  to Plant B in Foreign current e.g. in EUR.
    In case of any rejection, Plant B need to raise return Excise invoice through J1IS.. but the problem is that , In J1IS we can raise invoice in INR only. But the requirement is like Plant B also need to raise Excise invoice in same currency i.e EUR.
    Is there any method or process through which we can raise return excise invoice in Foreign currency.
    Ashwani

    Hi Amit:
    As we have two EOU unit . one EOU unit use to sale material to another unit as export sale. and do billing in EUR.
    Suppose i have to return few material back to first EOU unit, than  vendor return Excise invoice should be in EUR as it was billed to me in EUR.
    Ashwani

  • Table in which system updates data collected through KKRV

    Hi,
    Can any one tell me the table in which system updates data collected through KKRV?
    and the correct procedure to collect the data for product drilldown.
    can i run KKRC alogwith KKRV to get summerized reports?
    Thanks in advance
    Regards,

    You could probably trace them at COSP or COSS tables where the object starts with VD (summarization object).
    Summarization transaction are better if run separately. First KKRV for summarising plant level information and then KKRC for hierarchy summarization.

  • When I create Return Sales Order through BDC sales order doesnu2019t create.

    Deal Guru,
    When I create Return Sales Order through BDC sales order doesnu2019t create.
    It shows created sales document number but when I display this document I am getting message Document is not in database.
    After executing my BDC, message received in SAP in box : SAPSQL_ARRAY_INSERT_DUPREC
    I am receiving following message in SAP inbox for following issue.
    But when I create Return Sales Order through VA01, it is working. Please give me some idea.
    Detail Message
    Update was terminated
    System ID....   PRO
    Client.......   900
    User.....   DEVELOPER2
    Transaction..   VA01
    Update key...   4961DBF46A6B09D2E10080020A02281C
    Generated....   05.01.2009, 16:03:40
    Completed....   05.01.2009, 16:03:40
    Error Info...   00 671: ABAP/4 processor: SAPSQL_ARRAY_INSERT_DUPREC
    Regards
    Makarand

    Hi Rory
      Try this link:
       BAPI can't to create SO,But used bapi data with manual can?
    Regards
    Neha

  • DB SCHEMA INFO error when connecting to AZURE SQL through OLE DB

    Created a virtual machine in Azure and connected to Azure SQL server. I have been able to access the Azure SQL server through 2014 SQL Server Management Studio. 
    I have connected my program to the Azure SQL through a OLE DB connection. I am able to connect and create a new database through this connection, however when I try to connect to the newly created database, i get the following error: 
     Error creating connection: Not a Market(our product) database: Invalid object name 'db_schema_info'.
    I am not sure what is going on and why this error is showing up. Is it because of the OLE DB connection? The fact that the login mysql.database.windows.net has periods and a login login@mysql? I have had issues with punctuation in the past when connecting
    through OLE DB. Please help me to either find the right code or another work around option. 
    I can connect my program to a local SQL server hosted on the VM the same process as above without any issues. This is not a viable option as I need to connect multiple VMs to the same SQL server. 

    Hi,
    Thanks for posting here.
    Connecting to Microsoft Azure SQL Database by using OLE DB or ADO is not supported on SQL Azure.
    Ref: http://www.connectionstrings.com/sql-azure/
    Microsoft does not announce support for OLE DB connections to Azure and there are limitations. Some required OLE DB schema rowsets are not available from an Azure connection, and some properties that identify features in SQL Server are not adjusted to represent
    SQL Azure limitations. For most common connect/query/update tasks it seems to work fine.
    Provider=SQLNCLI11;Password=myPassword;User ID=[username]@[servername];
    Initial Catalog=databasename;Data Source=tcp:[servername].database.windows.net;
    Ref: http://msdn.microsoft.com/en-us/library/azure/ee336245.aspx
    You can also check
    Connectivity Considerations for SQL Server in Azure Virtual Machines
    Hope this helps you.
    Girish Prajwal

  • PCP&S Data Collection through Payroll Results

    Hiya folks,
    Ive set the value for HCP00/VERSN Provide Payroll Results to 2. As it says, while doing the posting the payroll result to cost planning), the results should be written to PCL5 cluster CB. But it is writing the results to cluster PY. Which is why i believe im not able to do the data collection through PAYR. Thus, it does not fetch any results in RHHCP_DC_PAYROLL_DATA_DISPLAY. Any ideas what could be the reason or the way around it?
    Thanks,
    Shahzad

    Hi Shahzad NASEEM
    I have the same problma
    Could you tell me how fixed the error?
    Thanks and regards

  • Force Garbage Collection through scripting

    Hi ,
    I am using weblogic server 8.1.5 on windows 2003 server.
    can we do force garbage collection through a script? If so can i have a sample script for the same?
    OS:windows 2003 server
    thanks in advance.
    Madan Mohan

    And the key here is "any length of time". I used to have WLDF notification on for all errors in the log file, but I specifically disabled it for the "almost out of memory" error, because it happened constantly, even when we didn't really have a memory problem. It's a little harder to determine the "any length of time" constraint. I'm not aware of an interface to "gc()" through WLST, which would be the most practical way to do this.
    I think it's possible the "shape" of your free/used memory patterns would change if you changed your GC algorithm. If you're currently using a "stop the world" collector, the free memory percentage will probably decrease almost to zero before it collects. However, if you use a generational collector, it's possible in normal operation that you won't get down so close to zero before it collects. In that case, the "almost out of memory" error might be more meaningful.

  • Question: about accessing Nik collection through Lightroom

    I have recently purchased and installed Nik collection. I have no problem reaching the plug-ins in Photoshopbut can't in Lightroom (except for HDR)

    Thanks!  Technology senses my fear and always makes it difficult for me! Ha! I can use the Nik programs so if I have to, I'll work on them there.
    Date: Sat, 13 Apr 2013 16:27:45 -0700
    From: [email protected]
    To: [email protected]
    Subject: question: about accessing Nik collection through Lightroom
        Re: question: about accessing Nik collection through Lightroom
        created by trihelm2 in Photoshop Lightroom - View the full discussion
    I suspect there are potential issues on some systems with the Google "combined" version, when I installed it I had recieved a copy of the Google complete version free because of my purchase history. I was advised that I could install over the Individual Plugins I had. I never got as far as trying it with Lightroom, only in Elements. The plugins appeared but the load times were abysmal and I mean realy bad , far longer than the Nik individual Installs, so I dumped it and reverted to the originals. Pity cos I wanted the Sharpen Plugin that I have'nt got. After reverting all was back to normal The Nik individual Plugins load very quickly. It was this that convinced me there is a difference in the Google setup.There are people on here with far more knowledge than me, hopefully one of them can help you, alternatively you might try asking Google for help with this.
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5232723#5232723
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5232723#5232723
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5232723#5232723. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Photoshop Lightroom by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Is there any way to insert a sharp into excel through OLE?

    Dear Expert,
    Is there any way to insert a sharp into excel through OLE ?If have , Would you please give a sample code?
    BR Edward

    Hi,
    Check this link..[OLE2, Excel, WinWord |http://translate.google.com/translate?hl=en&sl=ru&u=http://www.sapnet.ru/] you can find the code snippets.

  • How to set border of excel cell through ole ?

    How to set border either of left / right / top / bottom of excel cell through ole ?

    Click on the outside the line above header and select all the columns and rows and set the border horz and vert this will solve your problem. if you select current data alone then it will select the current data alone borders. if you runa diff criteria then for the new values borders wont be there. so better always try selecting the column top i.e above the column header and set the border.

  • Returning (bulk collect) clause with execute immediate

    db version 11.1.0.7
    trying to do a returning bulk collect but it is not working:
    -- my test table
    create table t as
    with f as (select rownum rn from dual connect by rownum <= 10)
    select
    rn,
    lpad('x',10,'x') pad
    from f;
    -- works as expected
    declare
    type aat is table of t%rowtype;
    aay aat;
    begin
    delete from t returning rn,pad bulk collect into aay;
    rollback;
    end;
    -- but the table I really want to do has many columns so I want to dynamically build list of columns for the
    -- returning clause. This way if the table changes the stored proc will not have to be modified
    -- fails PLS-00429: unsupported feature with RETURNING clause
    declare
    type aat is table of t%rowtype;
    aay aat;
    s varchar2(4000);
    begin
    s := 'delete from t returning rn,pad into :1';
    execute immediate s returning bulk collect into aay;
    rollback;
    end;
    -- tried a few other things:
    create or replace type t_obj as object (rn number,pad varchar2(10));
    -- PLS-00497: cannot mix between single row and multi-row (BULK) in INTO list
    declare
    nt t_obj;
    s varchar2(4000);
    begin
    s := 'delete from t returning t_obj(rn,pad) into :1';
    execute immediate s returning bulk collect into nt;
    rollback;
    end;
    -- works, but would require store proc changes if the table changes
    declare
    type t is table of number;
    type v is table of varchar2(10);
    vt v;
    nt t;
    s varchar2(4000);
    begin
    s := 'update t set rn = 10 returning rn,pad into :1,:2';
    execute immediate s returning bulk collect into nt,vt;
    rollback;
    end;
    /basically I want to dynamically build the list of columns with all_tab_cols and put the list into the returning clause
    but seems like I will have to hard code the column lists. This means whenever the table changes I will have to
    modify the store proc .. Any way around this?
    Thanks

    And with object type you were almost there. You forgot to create table of objects type:
    SQL> create or replace type t_obj as object (rn number,pad varchar2(10));
      2  /
    Type created.
    SQL> declare
      2      type aat is table of nt;
      3   aay aat;
      4   s varchar2(4000);
      5  begin
      6   s := 'delete from t returning
    SQL> declare
      2      type aat is table of t_obj;
      3   aay aat;
      4   s varchar2(4000);
      5  begin
      6   s := 'delete from t returning t_obj(rn,pad) into :1';
      7   execute immediate s returning bulk collect into aay;
      8   rollback;
      9  end;
    10  /
    PL/SQL procedure successfully completed.
    SQL> SY.

Maybe you are looking for

  • Printing problem with HP deskjet 3050 all in one J610 series

    I have a HP deskjet 3050 all in one J610 series which I am using with Windows Vista Version 6.0 (Build 6006: Service pack 2).  Connecting is by USB port.  I have not used the printer for some time, but have done all the maintence checks & it is good

  • Can't see Jam Pack Loops in Logic Studio Browser

    I have searched many other forums but can't find the same problem. Usually it relates to a separate disk for loops. I have Garageband and 4 Jam packs installed on my computer (Dual G5 latest OSX up to date). Jam pack 1, Rhythm Section, Symphony Orche

  • Calling stored procedure from DRM export

    Hi All, I am new to drm .I have a question.Is it possible to run stored procedure automatically when drm export ran. I Have a DRM HUb where i am actually downloading all the tables.I have a requirement to run stored procedure when drm exports ran. Is

  • Link Subtitles To a Transition video first ?

    Hello, (sorry for my bad english) I'm on Adobe CS5.1 (seven 64) DVD project. I have 4 videos with each 2 subtitles english/ french. I have 1 main menu with 5 buttons : - video1 menu - video2 menu - video3 menu - video4 menu - subtitle menu => en - fr

  • Invalid URL Pattern exception when deploying ear file

    Hi, I encountered some problem during deploying an ear file into SJSAS PE. This ear file has successfully been deployed into WebLogic Server and works fine. The error message is as follows: Deploying application in domain failed; Error loading deploy