Using DDE with Oracle Forms for uploading Excel data

Hi There,
I have used DDE in Forms to upload data from Excel.
The code which I have implemented is as follows:
DECLARE
iApplication pls_integer;
iConv pls_integer;
v2Buffer varchar2(100);
v2text varchar2(100);
nLength number;
nTransactionId number;
/* these varrays are defined in a package specification*/
vExcelProduct p_upload_functions.prd_no:=p_upload_functions.prd_no('1');
vExcelVpc p_upload_functions.vpc:=p_upload_functions.vpc('1');
BEGIN
/*Open an DDE Server application*/
iApplication:= DDE.App_Begin('C:/excel.exe ‘||v2fileName,DDE.App_Mode_Minimized);
iConv:=DDE.Initiate('EXCEL',v2filename);
BEGIN
/* first row of the sheet used for title . So loop is started from 2*/
/* Reading a row*/
FOR I IN 2..10000
LOOP
/* Reading columns of a particular row*/
     FOR J IN 1..n / * n be the number of columns in excel sheet */
     LOOP
/* generate the cell no of excel sheet from where data will
be fetched- R is used for row no and C is foe column no*/
     v2text:='R'||I||'C'||J||':'||'R'||I||'C'||J;
/* Store the value in variable */
dde.request(iConv,v2text,v2Buffer,dde.cf_text,1000);
/*Stores values in the varrays for a row*/
IF j=1 THEN
/* for first column*/
nLength:=length(v2Buffer);
vExcelOrg(I-1):=To_Number(substr(v2Buffer,1,nLength-2));
     /* for second column */
ELSIF j=2 THEN
nLength:=length(v2Buffer);
vExcelProduct(I-1):=substr(v2Buffer,1,nLength-2);
END IF;
END LOOP;
/*Exit the loop when it encounters an empty row*/
IF vExcelProduct(I-1) IS NULL AND vExcelOrg(I-1) IS NULL THEN
EXIT;
END IF;
/* Otherwise extending the varray*/
vExcelProduct.extend;
vExcelOrg.extend;
/* Reading the next row*/
END LOOP;
/* Now close the DDE application */
DDE.app_end(iApplication);
DDE.terminate(iConv);
EXCEPTION
     WHEN Others THEN
     DDE.app_end(iApplication);
DDE.terminate(iConv);
RAISE Form_Trigger_Failure;
END;
I am facing a problem, I will appreciate if you can give some insights to help.
We have been having problem logging in to application when there are a number of EXCEL processes running (17-18) on the server. Users that have already logged in have no problem, but new login will get "FRM-92101 There was a failure in the Forms Server during startup". The Forms Server itself is running fine. After we killed a few EXCEL processes, new users will be able to login.
Thanks and regards,
Mandeep

this is a trial method and right now i am trying to read only the first cell of the excel sheet and return that value and show it in the UI when the user presses the button but this code is not returning any value.
METHOD read_excel.
  INCLUDE ole2incl.
  DATA: filename(128) TYPE c,
            excel TYPE ole2_object,
            cell TYPE ole2_object,
            workbook TYPE ole2_object,
           pfile TYPE localfile VALUE
           'C:\Documents and Settings\I047323\Desktop\new.xls',
            name TYPE string.
  CREATE OBJECT excel 'EXCEL.APPLICATION'.
  SET PROPERTY OF excel 'VISIBLE' = 0.
  CALL METHOD OF excel 'WORKBOOKS' = workbook.
  CALL METHOD OF workbook 'OPEN'
    EXPORTING  #1       = pfile.
    CALL METHOD OF excel  'CELLS' = cell
      EXPORTING
        #1      = 1
        #2      = 1
    GET PROPERTY OF cell 'VALUE' = value.
  CALL METHOD OF workbook 'SAVE'.
  CALL METHOD OF workbook 'CLOSE'.
  CALL METHOD OF excel 'QUIT'.
  FREE OBJECT excel.
ENDMETHOD.
Edited by: neelima v on Jan 14, 2008 4:06 PM

Similar Messages

  • Using jfreechart with oracle forms 11g

    Hi everybody,
    I'm using jfreechart with oracle forms 11g to continue having graphs in my application since i'm migrating from forms 6i. I've already got it working and it's great. Just have one problem left. I don't know how to change the axis labels. In Bar charts, it comes with "Values" in y axis and "Category" in x axis by default. I wanted to change that or make it dissapear. Anyone knows how to?

    I've never used the jFreeChart, but according to their website you can use the "setLabel" method to set the label for an axis. Check out Axis (JFreeChart Class Library) for more information.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Can we use WebUtil with Oracle Forms 6i

    Can any one tell me if we can use WebUtil with Oracle Forms 6i..I have 11.5.9 instance of oracle apps and i want to use some features of WebUtil to customize one of seeded Oracle Form.
    Any pointers in this regard are quiet welcome.
    Thanks,

    Strictly speaking no...however you could "backport" the webutil code and in theory you could get some of the functionality to work - this is not supported in the context of oracleForms although Oracle Applications may have their own specific solution/certification of this.
    Regards
    Grant Ronald

  • Where to find and how to use JDAPI with oracle forms

    Hi All
    I want to use JDAPI for oracle forms, plz can any one suggest that where i can find the required jar for JDAPI, provide me if any links r there for downloading JDAPI.
    Thanks in Advance

    Hi Torsten Kleiber
    I am interested in changing forms buttons in our existing forms .I was trying to find if it was possible.Going thru your post I realised it is possible to change properties in existing forms .
    i have specific questions with JDAPI will i be able to change my buttons in a form to Iconic buttons.
    Could you kindly send me the code of your class in the abovementioned post (I have created a simple class to modify some forms properties.)
    I would like to have alook at it i am a Novice in java but looking at your source code may be able to give myself a head start .(I am well versed pl/sql forms and reports NO JAVA idea)
    Two while trying out the oracle demo to create a form by jdapi I was able to create a class and was unable to execute it .What do i need to install to execute it. I have forms 10 installtion with Jinitiator 1.3 installed
    DO i need to install Jdeveloper or JDK i think either of this is required. I shall be highly be obliged if u can clear my queries or any one else in the forum may wish to add to 2cents to my infinetly minimal knowledge of java

  • How to use LDAP with Oracle forms 10g on Oracle application server

    Hi,
    I need some help on this. I have developed oracle forms 10g on application server 9iAS. The client want to use the existing LDAP authentication to the software we wrote. I do not know how I could configure to use the existing LDAP authentication . If anyone know how would I use the existing LDAP on different server to use when they logon to our menu in 10g to validate the user. Do I need to add any varibales in formweb.cfg or any other method. Please help.
    Thanks
    Luksh

    I am not quite sure if this works out of the box. According to an Oracle FAQ:
    4.2 Can I use LDAP to authenticate Forms Services?
    Not directly. However, Oracle Login Server is able to authenticate against a LDAP directory and thus a Forms application can take advantage of this in a SSO environment. But you cannot use access control information stored in a LDAP directory with Forms.

  • Is it possible to use DVT with Oracle Forms 11g?

    Hi,
    I have posted my question on Oracle Forms forum but I didn't get answere regarding dvt usage in Oracle Forms.
    Now I try it here.
    Oracle Forms 11g and charts / graphs
    ====
    one of our customers has a forms 6i applications including oracle graphics and is thinking about upgrade to forms 11g.
    Oracle graphics has been desupported with 6i and with 9i Oracle BI beans has been recommended.
    Forms 10g is the terminal version for Oracle BI beans too (http://www.oracle.com/technetwork/middleware/bbi-beans/overview/oraclebibeanssod2008-129560.pdf).
    What's the recommended technology for graphs/charts in Forms 11g?
    Is it ADF DVT?
    If yes, are there examples how to call them from Forms 11g?
    =====
    regards
    Peter

    Hello Shay,
    thank you very much for the link.
    I wonder if there any plans from Oracle to provide and support a DVT wrapper in next versions of Oracle Forms 11g
    As the customer project is planned for Q2/2011 we still have some time and hope for this :-)
    regards
    Peter

  • How to use DDE package in form 10g module

    Hi All,
    I am using DDE.package in form 10g for uploading excels data in oracle database at windows platform but it is showing non-oracle exception.
    Thanks

    hi
    mehwish............just do for attachment.......
    u can also use something like this...
    Execute send_mail;and also.
    try something like this..
    example:
    begin
    mahi.mail('email address','subject','message','attachment');
    end;Edited by: Sarah on Apr 18, 2011 10:25 AM

  • FM for uploading the data in infotype

    Dear Friends,
                           I need a example how i can use the FM(HR_MAINTAIN_MASTERDATA,HR_INFOTYPE_OPERATION) for uploading the data in multiple infotypes at a time.
    I have a data in internal table now how i should pass the infotype no in the FM am not aware of that kindly help meee.
    And also my personnal no is internal ,how i pass in the FM.
    How i pass the remaning values .....
    my code ......
    Loop at it_employee into wa_employee.
      CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
    EXPORTING
       PERNR                     = '00000000'
       MASSN                     =  wa_employee-MASSN
       ACTIO                     = 'INS'
       TCLAS                     = 'A'
       BEGDA                     = SY-DATUM
       ENDDA                     = '99991231'
      OBJPS                    =
      SEQNR                    =
      SPRPS                    =
      SUBTY                    =
       WERKS                     = wa_employee-WERKS
       PERSG                     = wa_employee-PERSG
       PERSK                     = wa_employee-PERSK
      PLANS                     = wa_employee-PLANS
       DIALOG_MODE              = '1'
       LUW_MODE                 = '1'
       NO_EXISTENCE_CHECK       = 'X '
       NO_ENQUEUE               = 'X'
    IMPORTING
       RETURN                   = t_return
      RETURN1                  =
      HR_RETURN                =
      TABLES
        proposed_values          = it_employee.
      MODIFIED_KEYS            =
    write : / t_return.
    thanks
    sandeep

    Hi
    you have to open one more gl account for intial upload.
    E.g. If you have the debit balance of Gl alc 50000 in legacy system, then the entry should be:
    Dr 50000alc               $100
    Cr initial Upload alc     $100.
    if you want futher explaination let me know, i will explain in detail.
    Thanks & Regards,
    Reva naik.

  • Unifiers for drag & relate with oracle forms application

    Hi All,
      Is it possible to do drag & relate functionality in the portal with oracle forms application?? Is there any unifiers already available for drag & relate functionality with oracle forms application ?? If yes, then can anyone share the information.
    Regards
    Moses

    Hi Moses, you can use D&R with querys in Oracle using query iviews.
    You can find a lot of information in:https://www.sdn.sap.com/sdn/ep.sdn?page=unification_welcome.htm
    Regards.

  • Use of Times ten database with Oracle Forms 11g

    Hi,
    We need to use some caching / pre-fetching solution with Oracle Forms 11g.  Is there a possibility that Oracle Forms 11g can be used with Times ten database.
    Regards,

    We have never tested TimesTen with Forms 11g but we suspect there are issues that may prevent if from being used.
    Sorry.
    Chris

  • How to show the result of query in oracle forms 10g to Excel Sheet File

    Dear All,
    I have query and i want the result to be show in excel sheet file in oracle forms
    for example if i have a form with search criteria and when pressed the button of ( export to excel ) the result is
    excel file contains the result of the query .

    The only method to achieve this is with the help of Webutil. Please go through documentation for more help.
    Regards,
    Manoj Chakravarthy

  • How to define the tab space in the PL/SQL editor with Oracle Forms 4.5?

    When I use the PL/SQL editor with Oracle Form Builder, I found the tab space is very long that affects my programs readability quite a lot. Then, I tried to use Textpad to type my program. It looks fine with Textpad. However, when i tried to 'cut and paste' my code back to the PL/SQL editor, all tab spaces (approx. 8-character) are detected and the program looks awful again ~~ Would any one help me to solve my mentioned problem?
    Thanks for any advices!

    In 4.5 you cannot change this. In Forms 5.0 and above there is a registry value DE_PREFS_TABSIZE which allows you to set a value for the tabsize.

  • How to use Javascript in oracle forms

    Hello Experts,               I am new in Oracle forms using weblogic 10.3.5 with oracle forms 11g at windows 7.I have need to run a javascript code block inside my oracle form.Please suggest me that how can i do this.Actually I have need to validate my item field alike for email address for this I have to use Java script code. thank You regrads aaditya.

    Hi
    As Francois pointed out Oracle forms has nothing to do with html based technology. The way you can get the equivalent effect of creating consistancy in the way your objects are displayed is by creating a set of items you want and alter their apperance and behaviour and place them into object libraries (one library should do the trick).  From there you subclass all of you forms items off these libraries.
    Regards
    Quintin

  • How to connect to SQL server 2000 with Oracle Form

    Hi,
    I'm looking for the document of how to connect "SQL Server 2000" with Oracle Form 6i. Anyone knows that?

    Shay or other knowledgeable folks,
    Is there a way to utilize the wizard for "Business Tier > ADF Business Components > Business Components from Tables" for SQL Server 2000, 2005 or 2008. I can successfully execute sql via java programmatically or import a table from SQL Server with "Business Tier > ADF Business Components > Entity Object" wizard, but the Business Components from Tables simply doesn't see any tables under any schema. Without the "Business Components from Tables", i don't get the referential constraints imported into the application and to code all those from scratch is just not as elegant. So far i have only utilized the sql server jdbc driver from Microsoft (versions, 1.1, 1.2 and 2.0). Is there an alternative client that i need to use to enable selecting tables from that "Business Components from Tables" wizard. Is this a limitation of SQL Server, the jdbc driver or the wizard itself? Did anybody else experience the same issues? I am using Jdeveloper 11.1.1.0.1 against SQL Server 2005 (currently)
    Thanks,
    Andy

  • Enterprise portal integration with Oracle forms

    Hi
    Can anyone help me on this .
    "Enterprise portal integration with Oracle forms".
    I want to integrate oracle forms to EP .I am trying to work with app Integrator but I am not able to make any headway.Do you have any documents pertaining to this or any place where I can look for details.
    Thanks
    Alok

    Hi,
    i'm not aware of special integration feature with Oracle forms, but if as you said we are talking about a web application available via url then i see no problem doing so. the way you can implement the SSO is using something called Application Integrator which helps you build smart URL iView's that can use the portal framework (like systems, user profile , etc) , so you can build your oracle forms integration iView that will take the user password data from the portal (via system) using user mapping or sap logon tickets.
    for more details on Application Integrator see
    http://help.sap.com/saphelp_nw04/helpdata/en/70/5a3842134bad04e10000000a1550b0/frameset.htm
    regarding to the java applet, i don't really know what you mean by "jinitiator" but if your regular browser can do it then i see no reason for problems.
    i hope it helps

Maybe you are looking for

  • Restrict the values in the Query Designer

    Hi Guru’s, I want to Restrict PLANT or  SALES ORG  values in the Query Designer, in the Query, PLANT has selected in the rows and having variable and SALES ORG is display attribute of the PLANT. In this scenario How can we Restrict the values? Thanks

  • How do you take a imovie that got deleted and is in the trash back into imovie

    Please help

  • Changing Upstream DNS settings

    I have an Xserve running OS X Server 10.4.11 and want to change the upstream DNS setting form my ISP's to OpenDNS. The DNS settings in Server Admin don't seem to provide this option and from what I've read, the system Network DNS setting must point t

  • Groups Not Sorting Correctly

    I have a simple report.  It has a requested ship date in it.  When I create a group to sort by that date, the sort isn't working correctly.  I thought this might be a single report problem, but I am also getting another report where I am sorting by c

  • Changing print font in mac mail

    How do I change the print font in mac mail? Changing it on the screen makes no difference at all