Forcing user to enter values at table level

Hi,
I have created a table ztest. How to force user to enter the values for certain fields in the table which are not keys, similar to not null in RDBMS. selecting the initial values filed in SE11 populates with some default value, but it doesnt force the user to enter the value.
Regards,
Raghu

Hi,
Just check out transaction code SE54 for events.
Go in SE54.
Give your table name.
Go in Environment --> Events.
Here add the Event '01' i.e. Before saving the data.
Give the name for event eg 'BEFORE_SAVE'.
Click on Editor to create an include program.
In the include program write
form before_save.
  data: f_index like sy-tabix. "Index to note the lines
  loop at total.
    if <action> = 'N' or <action> = 'U'.
      read table extract with key <vim_xtotal_key>.
      if sy-subrc eq 0.
        f_index = sy-tabix.
      else.
        clear f_index.
      endif.
      "(make desired changes to the line TOTAL)
      "End of Modification.
      modify total.
      check f_index gt 0.
      extract = total.
      modify extract index f_index.
    endif.
  endloop.
  sy-subrc = 0.
endform.
Note here in field symbol 'Total' your workarea will be their. You can make necessary checks here.
Or else you can go for making a custom transaction for your requirement.
Regards,
Nitin
*Mark all helpful answers

Similar Messages

  • How to ask user to enter value in select statement

    Hi,
    Can anyone tell me syntax of select statement where i can ask user to enter value .
    for example i am trying to use belowthing but it displaying error
    select * from emp where empname=:empname
    SP2-0552: Bind variable "empname" not declared.
    2.Is there any data dictionary table to see all pl/sql procedures and corresponding code?
    Thanks,
    sri

    user632733 wrote:
    Can anyone tell me syntax of select statement where i can ask user to enter value .None. The SQL engine resides on the server. It is incapable of prompting for data entry on the client.
    The client interacts with the user. The client is suppose to:
    a) prompt for variable values
    b) send a SQL statement to Oracle
    c) bind values to bind variables in the SQL statement
    for example i am trying to use belowthing but it displaying error
    select * from emp where empname=:empnameIn SQL*Plus, you need to create a bind variable:
    SQL> var empname varchar2(200)
    And then assign a value to it:
    SQL> exec :empname := 'John Doe';
    Note that this is still not ideal - as the assignment is also done via the server and sends a PL block to the server. This block contains non-sharable code and this can lead to fragmentation of the server's Shared Pool.
    But it does illustrate the basic principle.

  • How to force user to enter supplier/customer name in captial letters in R12

    Dear all,
    Could anyone pls advise how to force user to enter supplier/customer name in captial letters in R12? Can I do it using OA framework personalization?
    HY

    Pl post exact versions of OS and EBS.
    The ability to do this exists in forms (professional user interface) using forms personalization, but does not exist in the OAF (self-service) interface, AFAIK. See related MOS Doc 399892.1 (Is It Possible To Restrict Employee Name Entry To All Upper Case in the PUI And SSHR ?) for some details.
    Pl confirm by opening an SR with Support.
    HTH
    Srini

  • Force user to enter text if checks YES check box

    I have created a form with YES and NO check boxes.  If user checks YES, they need to provide written reason.  Is there a way to "force" user to enter text into text box if they check the YES check box?
    Thanks,
    Toyro

    Hi Jodi,
    Yes, it has to be saved as a dynamic PDF.
    Additionally, there are some name mismatches in your form so the script was failing. My script defined page 1 as 'page1' while your form defined page 1 as 'Page1'. I renamed your form page 1 to 'page1' and the script worked fine.
    I would recommend enabling the debugger in Acrobat for form developement. See Edit > Preferences and enable the following:
    I added an additional button with some script on the button 'click' event.
    The purpose is to intervene in the submission process, in your case submitting by email. With a single submit button the email dialogue fires regardless of failed form validation. By introducing a second button you can do form validation before enabling submission. The attached form has a visible button called 'submitBtn' and your original 'Submit By Email' button which is declared as 'invisible'. My 'submitBtn' is labelled 'Submit By Email'. When the button is clicked is does form validation. If validation succeeds, I call form1.page1.Button1.execEvent("click"); to submit to the email address attached to 'Button1'.
    Take a look and see if it fits your requirements.
    Steve

  • How to force users to enter their ID and password ?

    I am considering installing AirPort Extreme at our office. We don't want guests connecting to our network. is there any option/software that will force the guest to enter an ID and password to connect to our network ? This is similar to what happens at the hotels when we try to connect to hotel's network.

    How to force users to enter their ID and password?
    is there any option/software that will force the guest to enter an ID and password to connect to our network ? This is similar to what happens at the hotels when we try to connect to hotel's network.
    The AirPort Extreme does not have the features necessary to create a "splash page" that provides basic information about the company and asks users for their identity and password....like you see at most hotels.
    Basically, with an AirPort Extreme, users would have to scan to look for the name of the wireless network to join, and then enter the password to connect.
    The best that you might be able to achieve with the AirPort Extreme is create a "hidden" network, which would require that users know both the name of the wireless network and password to connect.  However, based on experience, this might be more of a hassle than anything else.
    The bottom line.....Apple really designed the AirPort routers for home use, so that might be the best place for them in most cases.

  • Force User to enter new password

    Hi all,
    I would like to know if there is a way to force some of our users to enter a new password when they logon to SAP the next time?
    The only way I would know is to give them a new password in SU01 and email it to them. But this would be a lot of work. We do not want to change the password settings in general, as most of our users should not be affected by this.
    Does anyone know a differerent way? Maybe to set a flag in the user or a table?
    Thanks for any help.
    Tobi

    you could change parameter
    login/password_expiration_time
    to - let's say 1 and restart all of the instances of that special system. after one day all users would have to change their passwort.
    you could then reset the parameter to 0 (or to whatever value you think adequate) on all instances of the system and restart them ...
    thus having forced all your users to change the password at least once.
    Edited by: Mylene Euridice Dorias on Mar 11, 2008 4:23 PM
    for some users you have to use SU01 ...

  • Popup screen with two check box and a text area for the user to enter value

    hi,
    i have a requirement when a button is clicked a popup screen should appear with two check box and a text box where the user can enter a value.
    is there any function module which has that functionality

    Hello,
    You can create a new screen and select the screen type as <b>model dialog box</b>.This will give you a<b> pop-up screen</b> and you can call this model dialog box screen in the PAI of the screen where the button is present.(At user-command).
    <b>case ok_code.
    when 'BUTTON'.
    call screen 200 starting at 10 10.</b>
    You can design the PBO of this pop-up screen as per your needs.
    Regards,
    Beejal
    **Reward if this helps.

  • Force user to enter a social security number

    How do I force a user to enter their social security number. The form I'm working on is connected to a system that won't allow the SS# to be left blank. I need to add something that will not allow a blank SS# field on my from. Any help is greatly appreciated.

    In the Object palette, make your field required:

  • Error while entering values in table.

    Hi All,
    I have a quantity field in table having data type as dec and length as 13 and decimal places as 5.
    But when i enter 255 in table,it automatically changes to .255 but it should be 255.
    Thanks and Regards,
    Amanpreet Sehgal

    hi
    check this one
    For calculations in business applications, use packed numbers. The program attribute Fixed point arithmetic affects calculations using packed numbers.
    If the program attribute Fixed point arithmetic is not set, type P fields are interpreted as integers without decimal places. The decimal places that you specify in the DECIMALS addition of the TYPES or DATA statement only affect how the field is formatted in the WRITE statement.
    DATA: PACK TYPE P DECIMALS 2.
    PACK = '12345'.
    WRITE PACK.
    If the program attribute Fixed point arithmetic is not set, the output is as follows:
    123.45
    If the program attribute Fixed point arithmetic is set, the output is as follows:
    12,345.00
    If the Fixed point arithmetic attribute is set, the decimal places are also taken into account in arithmetic operations. Calculations with packed numbers in ABAP use the same arithmetic as a pocket calculator. Intermediate results are calculated using up to 31 digits (before and after the decimal point). You should therefore always set the Fixed point arithmetic attribute when you use type P fields.
    DATA: PACK TYPE P.
    PACK = 1 / 3 * 3.
    WRITE PACK.
    If you have not set the Fixed point arithmetic attribute, the result is 0, since the calculation is performed using integer accuracy, and the result is therefore rounded internally to 0.
    If the program attribute Fixed point arithmetic is set, the result is 1 because the result of the division is stored internally as 0.333333333333333333333333333333 with an accuracy of up to 31 digits.

  • How to trace a user who entered/dropped a table in a shared DataBase

    Hai, I have a doubt plz help me
    when working in a shared DataBase environment, different users will create or drop
    tables from the DataBase. Is it possible to trace who has created/altered a particular table in the DB. If yes plz tell me the procedure.
    Thanks in advance.
    SrihariKrishna

    Maybe this link provides some help?
    http://asktom.oracle.com/pls/ask/f?p=4950:8:5395923770553724381::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:6399608034075
    C.

  • How to "force" user to enter a valid value in a TextBox

    How can one create a TextBox in which the user is not able to leave (commit the value, change focus, or perform the action of another control) unless a valid value (the value to be committed) is displayed?
    The following is the best I've come up with so far.
    Good: It doesn't permit a value to be committed unless it is valid.
    Good: It doesn't permit the focus to be changed when TAB is pressed unless it is valid.
    Bad: It permits the user to perform the action associated with a button at any time.
    In the following code pressing on the button prints "I've been pushed", no matter the value of the TextBoxes. Can I stop this (in general, not for specific buttons)?
    class ValidTextBox extends TextBox {
      public-init var validValue:String = "";
      function isValid():Boolean {
        return (rawText == validValue);
      var isFocused = bind focused on replace {
        if (not focused and not isValid()) {
          requestFocus();
      override function commit():Void {
        if (isValid()) { super.commit(); }
        else {};
    var string1:String = "" on replace { println ("String1 = '{string1}'") };
    var string2:String = "" on replace { println ("String2 = '{string2}'") };
    def textbox1 = ValidTextBox { text: bind string1 with inverse; promptText: "String1: enter abc"; columns: 20; validValue: "abc"; }
    def textbox2 = ValidTextBox { text: bind string2 with inverse; promptText: "String2: enter def"; columns: 20; validValue: "def"; }
    def aButton = Button {
      text: "Push me";
      action: function():Void { println("I've been pushed!"); }
    Stage {
      scene: Scene {
        width: 250
        height: 300
        content: [ VBox { spacing: 10; content: [ textbox1, textbox2, aButton ] } ]
    }

    It sounds like you are looking for a concept of validation that groups items together. In days long gone Oracle used to have a product called Oracle Forms - that had field validation, record validation and block validation. So in your example if string1 and string2 were in the same persistable data object then the equivalent concept would be 'record validation'. The code in your button would say "if the record is valid print". A record is only valid if all its fields are valid.
    JavaFX really provides a 'GUI toolkit'. I think you are looking for a fairly advanced binding framework - a framework that builds on the concept of field level validation. You can approximate such a thing by creating a 'validation group' class. This class would be able to have nodes added to it and have an 'isValid()' function which only returns true if all the node items are valid.

  • How to get the value a user  just enter into a table???

    hi
    i have a table that adds a new row when a user clicks ADD button. i was able to implement this part, now the user needs to enter some data into this row, i need this data to save into file. how can i get this data from the row?????? thank you.

    is there some kind of even that is fired when user enters data into a cell? you are saying that the data is already in the table model after user enters data. then i need to get a tableModel by calling
    TableModel tm = JTable.getModel();
    and then use this tm to get value? using what? getValueAt?

  • Force user to enter positive/negative values on certain GL Accounts

    Hi
    If I want to force the user to be only able to enter positive values for certain GL Accounts and only negative values for other accounts, how can I do this?
    Thanks
    Johan

    Hello Johan,
    I think you have posted your question to the wrong forum.
    This forum is specifically regarding the OnDemand applications like https://bi.ondemand.com
    Cheers
    Steve

  • Problem entering values in table after creating it in Word using OLE2

    Hi,
    I want to create a Word document from a Oracle Forms 6i application. The document will have standard text followed by a table. The cells of this table are to be populated from fields in the Forms application.
    I have created a sample code below. When executed from within the Forms application, it creates a document fine. It writes the text "Hello World". It then creates a table as expected. But when I try to enter a value "Cell Value" in the table, the value does not get written to the cell of the table. Instead it writes the value outside the table.
    Can someone please tell me what I am doing wrong here and what I need to do so that after writing the text on the document I can write values into the table also.
    Any help will be much appreciated.
    Here is the code(it works but then it doesn't ):
    PROCEDURE TEST_PROC IS
    hApplication OLE2.OBJ_TYPE;
    hDocuments OLE2.OBJ_TYPE;
    hDocument OLE2.OBJ_TYPE;
    hSelection OLE2.OBJ_TYPE;
    hParagraphFormat OLE2.OBJ_TYPE;
    hRange OLE2.OBJ_TYPE;
    hFont OLE2.OBJ_TYPE;
    hTables OLE2.OBJ_TYPE;
    hTable OLE2.OBJ_TYPE;
    args OLE2.LIST_TYPE;
    wdAlignParagraphLeft CONSTANT number(3) := 0; --Default
    wdword9tablebehavior CONSTANT NUMBER (5) := 1;
    wdautofitfixed CONSTANT NUMBER (5) := 0;
    ---- wdUnits Class members
    wdcharacter CONSTANT NUMBER (5) := 1;
    wdmove CONSTANT NUMBER (5) := 0; --Default
    --wdBorderType Class members
    wdborderleft CONSTANT NUMBER := -2;
    wdborderright CONSTANT NUMBER := -4;
    wdbordertop CONSTANT NUMBER := -1;
    wdborderbottom CONSTANT NUMBER := -3;
    --WdLineStyle Class member
    wdlinestylenone CONSTANT NUMBER := 0;
    BEGIN
    hApplication:=OLE2.CREATE_OBJ('Word.Application');
    OLE2.SET_PROPERTY(hApplication, 'Visible', 1);
    hDocuments := OLE2.GET_OBJ_PROPERTY(hApplication, 'Documents');
    hDocument := OLE2.INVOKE_OBJ(hDocuments, 'Add');
    hSelection := OLE2.GET_OBJ_PROPERTY(hApplication, 'Selection');
    hFont := OLE2.GET_OBJ_PROPERTY(hSelection, 'Font');
    OLE2.SET_PROPERTY(hFont, 'Name', 'Calibri');
    OLE2.SET_PROPERTY(hFont, 'Size', 11);
    OLE2.SET_PROPERTY(hFont, 'Bold', FALSE );
    OLE2.INVOKE(hSelection, 'TypeParagraph');
    hParagraphFormat := OLE2.GET_OBJ_PROPERTY(hSelection, 'ParagraphFormat');
    OLE2.SET_PROPERTY(hParagraphFormat, 'Alignment', wdAlignParagraphLeft);
    OLE2.RELEASE_OBJ(hParagraphFormat);
    args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args, 'Hello World');
    OLE2.INVOKE(hSelection, 'TypeText', args);
    OLE2.DESTROY_ARGLIST(args);
    OLE2.INVOKE(hSelection, 'TypeParagraph');
    htables := ole2.get_obj_property (hdocument, 'Tables');
    hrange := ole2.get_obj_property (hselection, 'Range');
    args := ole2.create_arglist;
    ole2.add_arg_obj (args, hrange); --Range
    ole2.add_arg (args, 1); --NumRows
    ole2.add_arg (args, 6); --NumColumns
    ole2.add_arg (args, wdword9tablebehavior); --DefaultTableBehavior
    ole2.add_arg (args, wdautofitfixed); --FitBehavior
    htable := ole2.invoke_obj (htables
    ,'Add'
    ,args
    args := ole2.create_arglist;
    ole2.add_arg (args, wdcharacter);
    ole2.add_arg (args, 1);
    ole2.add_arg (args, wdmove);
    ole2.invoke (hselection
    ,'MoveLeft'
    ,args
    ole2.destroy_arglist (args);
    args := ole2.create_arglist;
    ole2.add_arg (args, 'CellValue');
    ole2.invoke (hselection
    ,'TypeText'
    ,args
    ole2.destroy_arglist (args);
    ole2.RELEASE_OBJ (happlication);
    ole2.RELEASE_OBJ (hdocuments);
    ole2.RELEASE_OBJ (hdocument);
    ole2.RELEASE_OBJ (hfont);
    ole2.RELEASE_OBJ (hparagraphformat);
    ole2.RELEASE_OBJ (htables);
    ole2.RELEASE_OBJ (hrange);
    END;

    Once again thanks for the help John. Unfortunately I cannot use only bookmarks, because the text to be entered from the application is of undetermined length and therefore since the possibility of wrapping exists, it would not be able to give me the same formatting abilty as using a table.
    However, the good news is that I have been able to find the solution. I am posting my code here so that it is available to anyone else who might have the same issue. Thanks again.
    Here is my code and my comments in it explain what it does.
    PROCEDURE extract_to_word
    IS
    /* First of all I would like to acknowledge the help I have got from experts who have posted a lot of this code on the web which I have used here. Special thanks go to someone by the name of sfvb
    found here http://www.tek-tips.com/userinfo.cfm?member=sfvbsfvb
    This procedure does the following:
    1. Opens a word document.
    2. Creates a header and pastes a picture in the header e.g your company logo with address. Please note that the image should have both the address and the logo in it. It can be created using paint where you can write your address at one end and paste a bmp or jpg picture of your logo at the other end.
    3. Writes text with specified font and size. It calls a separate procedure PRINT_LINE to do this.
    4. Creates a table on the document with specified number of columns with fixed width.
    5. Populates the cells of the table-
    first with headers written by calls to WRITE_HEADINGS procedure.
    next with data from a block of the Forms application by calls to WRITE_DATA procedure
    6. Comes out of the table and continues to write text.
    The three procedures that are repeatedly called are described after the end of this procedure.
    Note: While I have made every attempt to ensure that the code does not generate error on account of my writing the explanatory notes, I cannot be sure of having made some typos. If the code does not compile, it is most probably be on account of something I have missed in entering the comments and explanation.
    Disclaimer:
    I am not the sole author of this code. I have taken help from other open sources and copyright infringement if any is entirely unintentional.
    happlication ole2.obj_type;
    hwindow ole2.obj_type;
    hpane ole2.obj_type;
    hview ole2.obj_type;
    hdocuments ole2.obj_type;
    hdocument ole2.obj_type;
    hselection ole2.obj_type;
    hparagraphformat ole2.obj_type;
    hrange ole2.obj_type;
    hfields ole2.obj_type;
    hfont ole2.obj_type;
    hinlineshapes ole2.obj_type;
    hpars ole2.obj_type;
    hpar ole2.obj_type;
    htabstops ole2.obj_type;
    hactivedocument ole2.obj_type;
    htables ole2.obj_type;
    htable ole2.obj_type;
    hcolumns ole2.obj_type;
    hcells ole2.obj_type;
    hrows ole2.obj_type;
    hshading ole2.obj_type;
    hinsertrow ole2.obj_type;
    hborders ole2.obj_type;
    hshading ole2.obj_type;
    args ole2.list_type;
    wdalignparagraphleft CONSTANT NUMBER (3) := 0;
    wdalignparagraphcenter CONSTANT NUMBER (3) := 1;
    wdalignparagraphright CONSTANT NUMBER (3) := 2;
    wdseekcurrentpageheader CONSTANT NUMBER (3) := 9;
    wdseekcurrentpagefooter CONSTANT NUMBER (3) := 10;
    wdseekmaindocument CONSTANT NUMBER (3) := 0;
    wdfieldpage CONSTANT NUMBER (3) := 33;
    wdfieldnumpages CONSTANT NUMBER (3) := 26;
    wdpagebreak CONSTANT NUMBER (3) := 7;
    wdstory CONSTANT NUMBER (3) := 6;
    wdword CONSTANT NUMBER (5) := 2;
    wdsentence CONSTANT NUMBER (5) := 3;
    wdword8tablebehavior CONSTANT NUMBER (5) := 0;
    wdword9tablebehavior CONSTANT NUMBER (5) := 1;
    wdautofitcontent CONSTANT NUMBER (5) := 1;
    wdautofitfixed CONSTANT NUMBER (5) := 0;
    wdautofitwindow CONSTANT NUMBER (5) := 2;
    wdunderlinesingle CONSTANT NUMBER (5) := 1;
    ---- wdUnits Class members
    wdcell CONSTANT NUMBER (5) := 12;
    wdcharacter CONSTANT NUMBER (5) := 1;
    wdword CONSTANT NUMBER (5) := 2;
    wdsentence CONSTANT NUMBER (5) := 3;
    wdline CONSTANT NUMBER (5) := 5;
    ---- wdMovementType Class members
    wdextend CONSTANT NUMBER (5) := 1;
    wdmove CONSTANT NUMBER (5) := 0;
    --wdBorderType Class members
    wdborderleft CONSTANT NUMBER := -2;
    wdborderright CONSTANT NUMBER := -4;
    wdbordertop CONSTANT NUMBER := -1;
    wdborderbottom CONSTANT NUMBER := -3;
    --WdLineStyle Class member
    wdlinestylenone CONSTANT NUMBER := 0;
    mytab CONSTANT VARCHAR2 (1) := CHR (9);
    myblue CONSTANT NUMBER (8) := 16711680; --FF0000
    mygreen CONSTANT NUMBER (8) := 65280; --00FF00
    myred CONSTANT NUMBER (8) := 255; --0000FF
    mydkgreen CONSTANT NUMBER (8) := 32768; --008000
    myblack CONSTANT NUMBER (8) := 0; --000000
    mytext VARCHAR2 (2000);
    BEGIN
    happlication := ole2.create_obj ('Word.Application');
    ole2.set_property (happlication
    ,'Visible'
    ,1
    hdocuments :=
    ole2.get_obj_property (happlication, 'Documents');
    hdocument := ole2.invoke_obj (hdocuments, 'Add');
    -------- Create Header and Footer --------
    hwindow :=
    ole2.get_obj_property (happlication, 'ActiveWindow');
    hpane := ole2.get_obj_property (hwindow, 'ActivePane');
    hview := ole2.get_obj_property (hpane, 'View');
    ---- Header Section ---
    ole2.set_property (hview
    ,'SeekView'
    ,wdseekcurrentpageheader
    hselection :=
    ole2.get_obj_property (happlication, 'Selection');
    hfont := ole2.get_obj_property (hselection, 'Font');
    ole2.set_property (hfont
    ,'Name'
    ,'Calibri'
    ole2.set_property (hfont
    ,'Size'
    ,10
    ole2.set_property (hfont
    ,'Bold'
    ,FALSE
    ole2.set_property (hfont
    ,'Color'
    ,myblack
    ole2.RELEASE_OBJ (hfont);
    args := ole2.create_arglist;
    --Below is the location of your jpg file that contains the logo and address
    ole2.add_arg (args, 'C:\temp\AMHeader2.jpg');
    hinlineshapes :=
    ole2.get_obj_property (hselection, 'InlineShapes');
    ole2.invoke (hinlineshapes
    ,'AddPicture'
    ,args
    ole2.destroy_arglist (args);
    ole2.RELEASE_OBJ (hinlineshapes);
    ole2.set_property (hview
    ,'SeekView'
    ,wdseekmaindocument
    ole2.RELEASE_OBJ (hview);
    ole2.RELEASE_OBJ (hpane);
    ole2.RELEASE_OBJ (hwindow);
    -------- Insert Text --------
    hfont := ole2.get_obj_property (hselection, 'Font');
    ole2.set_property (hfont
    ,'Name'
    ,'Calibri'
    ole2.set_property (hfont
    ,'Size'
    ,9
    ole2.set_property (hfont
    ,'Bold'
    ,FALSE
    ole2.set_property (hfont
    ,'Color'
    ,myblack
    ole2.invoke (hselection, 'TypeParagraph');
    hparagraphformat :=
    ole2.get_obj_property (hselection, 'ParagraphFormat');
    ole2.set_property (hparagraphformat
    ,'Alignment'
    ,wdalignparagraphleft
    ole2.RELEASE_OBJ (hparagraphformat);
    print_line (hselection
    , 'Date ' || TO_CHAR (TRUNC (SYSDATE), 'MM/DD/YYYY')
    ,NULL
    print_line (hselection
    ,NULL
    --The following prints the address of the recipient of the letter.
    print_line (hselection
    ,addr_line1
    ,NULL
    print_line (hselection
    ,addr_line2
    ,NULL
    print_line (hselection
    ,addr_line3
    ,NULL
    print_line (hselection
    ,addr_line4
    ,NULL
    print_line (hselection
    ,addr_line5
    ,NULL
    --Call like the one below are to insert blank lines
    hselection :=
    ole2.get_obj_property (happlication, 'Selection');
    print_line (hselection
    ,NULL
    ,NULL
    print_line (hselection
    ,'Your salutation'
    ,NULL
    print_line (hselection
    ,NULL
    ,'NULL
    print_line (hselection
    ,'Ref: '
    ,NULL
    print_line (hselection
    ,NULL
    ,NULL
    print_line
    (hselection
    ,'Whatever text you want to appear on this line.'
    ,NULL
    print_line (hselection
    ,NULL
    ,NULL
    -------- Create Table --------
    htables := ole2.get_obj_property (hdocument, 'Tables');
    hrange := ole2.get_obj_property (hselection, 'Range');
    args := ole2.create_arglist;
    ole2.add_arg_obj (args, hrange); --Range 
    ole2.add_arg (args, 1); --NumRows    The rest of the rows are created later as and when required
    ole2.add_arg (args, 6); --NumColumns This creates a table of 6 columns.
    ole2.add_arg (args, wdword9tablebehavior); --DefaultTableBehavior
    ole2.add_arg (args, wdautofitfixed); --FitBehavior
    htable := ole2.invoke_obj (htables
    ,'Add'
    ,args
    ole2.destroy_arglist (args);
    -- [Borders removal start]The following piece of code removes all the borders. Use of this is optional.
    hborders := ole2.get_obj_property (htable, 'Borders');          
    ole2.set_property (hborders                                        
    ,'OutsideLineStyle'
    ,wdlinestylenone
    ole2.set_property (hborders
    ,'InsideLineStyle'
    ,wdlinestylenone
    ole2.RELEASE_OBJ (hborders);
    --[Borders removal end]
    --The following code makes the cursor enter the table. I took quite some time
    --figuring this out.
    hselection := ole2.get_obj_property (hdocument, 'Tables');
    hselection := ole2.get_obj_property (happlication, 'Selection');
    --WRITE_HEADINGS is the procedure called each time only to write headings.
    write_headings (hselection
    ,'Heading 1 on cell at row 1 column 1'
    ,8
    --The following moves the cursor to the next cell on the right.
    args := ole2.create_arglist;
    ole2.add_arg (args, wdcell);
    ole2.add_arg (args, 1);
    ole2.add_arg (args, wdmove);
    ole2.invoke (hselection
    ,'MoveRight'
    ,args
    ole2.destroy_arglist (args);
    write_headings (hselection
    ,'Heading 1 on cell at row 1 column 2'
    ,7
    args := ole2.create_arglist;
    ole2.add_arg (args, wdcell);
    ole2.add_arg (args, 1);
    ole2.add_arg (args, wdmove);
    ole2.invoke (hselection
    ,'MoveRight'
    ,args
    ole2.destroy_arglist (args);
    write_headings (hselection
    ,'Heading 1 on cell at row 1 column 3'
    ,7
    args := ole2.create_arglist;
    ole2.add_arg (args, wdcell);
    ole2.add_arg (args, 1);
    ole2.add_arg (args, wdmove);
    ole2.invoke (hselection
    ,'MoveRight'
    ,args
    ole2.destroy_arglist (args);
    write_headings (hselection
    ,'Heading 1 on cell at row 1 column 4'
    ,8
    args := ole2.create_arglist;
    ole2.add_arg (args, wdcell);
    ole2.add_arg (args, 1);
    ole2.add_arg (args, wdmove);
    ole2.invoke (hselection
    ,'MoveRight'
    ,args
    ole2.destroy_arglist (args);
    write_headings (hselection
    ,'Heading 1 on cell at row 1 column 5'
    ,5
    args := ole2.create_arglist;
    ole2.add_arg (args, wdcell);
    ole2.add_arg (args, 1);
    ole2.add_arg (args, wdmove);
    ole2.invoke (hselection
    ,'MoveRight'
    ,args
    ole2.destroy_arglist (args);
    write_headings (hselection
    ,'Heading 1 on cell at row 1 column 6'
    ,8
    --The following moves the cursor back to the first cell on row 1 column 1
    args := ole2.create_arglist;
    ole2.add_arg (args, wdcell);
    ole2.add_arg (args, 6);
    ole2.add_arg (args, wdmove);
    ole2.invoke (hselection
    ,'MoveLeft'
    ,args
    ole2.destroy_arglist (args);
    --Now we need to write data sourced from a multi record block in Oracle Forms
    GO_BLOCK ('your_block');
    FIRST_RECORD;
    record_cnt := 0;
    LOOP
    record_cnt := record_cnt + 1;
    ---In my application I gave the choice to the user to put a check mark on those records that he would want to print ------on the document and so the following.
    IF :your_block.cb_print = 'Y'          
    THEN               
    --This creates a new row below the first row that contains the column headers.
    args := ole2.create_arglist; ole2.add_arg (args, 1);
    ole2.invoke (hselection
    ,'InsertRowsBelow'
    ,args
    ole2.destroy_arglist (args);
    --WRITE_DATA is called each time to write the data in the cells.
    write_data (hselection
    , :your_block.item);
    args := ole2.create_arglist;
    ole2.add_arg (args, wdcell);
    ole2.add_arg (args, 1);
    ole2.add_arg (args, wdmove);
    ole2.invoke (hselection
    ,'MoveRight'
    ,args
    ole2.destroy_arglist (args);
    write_data (hselection
                   , :your_block.item);
    args := ole2.create_arglist;
    ole2.add_arg (args, wdcell);
    ole2.add_arg (args, 1);
    ole2.add_arg (args, wdmove);
    ole2.invoke (hselection
    ,'MoveRight'
    ,args
    ole2.destroy_arglist (args);
    write_data (hselection
                   ,:your_block.item);
    args := ole2.create_arglist;
    ole2.add_arg (args, wdcell);
    ole2.add_arg (args, 1);
    ole2.add_arg (args, wdmove);
    ole2.invoke (hselection
    ,'MoveRight'
    ,args
    ole2.destroy_arglist (args);
    write_data (hselection
         ,:your_block.item);
    args := ole2.create_arglist;
    ole2.add_arg (args, wdcell);
    ole2.add_arg (args, 1);
    ole2.add_arg (args, wdmove);
    ole2.invoke (hselection
    ,'MoveRight'
    ,args
    ole2.destroy_arglist (args);
    write_data (hselection
         ,:your_block.item);
    args := ole2.create_arglist;
    ole2.add_arg (args, wdcell);
    ole2.add_arg (args, 1);
    ole2.add_arg (args, wdmove);
    ole2.invoke (hselection
    ,'MoveRight'
    ,args
    ole2.destroy_arglist (args);
    write_data (hselection
    ,:your_block.item);
    END IF;
    EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
    NEXT_RECORD;
    END LOOP;
    --The following makes the cursor exit the table and back on document for any further
    --writing of text.
    args := ole2.create_arglist;
    ole2.add_arg (args, wdline);
    ole2.add_arg (args, 1);
    ole2.add_arg (args, wdmove);
    ole2.invoke (hselection
    ,'MoveDown'
    ,args
    print_line (hselection           --As mentioned earlier, this enters a blank line.
    ,NULL
    ,NULL
    print_line (hselection
    ,'Boilerplate text: '
    ,your_variable
    print_line (hselection
    ,'Boilerplate text: '
    ,your_variable
    --You can print as many lines as required by making call to the PRINT_LINE procedure.
    ole2.RELEASE_OBJ (htables);
    ole2.RELEASE_OBJ (hfont);
    ole2.RELEASE_OBJ (hselection);
    ole2.RELEASE_OBJ (hdocument);
    ole2.RELEASE_OBJ (hdocuments);
    ole2.RELEASE_OBJ (happlication);
    END;
    PROCEDURE PRINT_LINE
    ( v_sel OLE2.OBJ_TYPE
    , v_text VARCHAR2
    , v_field varchar2)
    IS
    /* This procedure takes in three arguments.
    The first v_sel is the VB selection object.
    v_text is the static or boilerplate text that needs to be printed on the document.
    v_field is the value of the item or variable from the program.
    v_args      OLE2.LIST_TYPE;
    hTab     CONSTANT varchar2(1) := chr(9); --This is the vb constant for tabstop
    BEGIN
    v_args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(v_args, v_text);
    OLE2.INVOKE(v_sel, 'TypeText', v_args);
    OLE2.DESTROY_ARGLIST(v_args);
    --The following replicates tabbing. This was used so that the field values are aligned at a tabstop.
    --When printing a blank line NULL is passed in as the argument
    v_args := OLE2.CREATE_ARGLIST;
         OLE2.ADD_ARG(v_args, hTab);
         OLE2.INVOKE(v_sel, 'TypeText', v_args);
         OLE2.DESTROY_ARGLIST(v_args);
    --The following writes the value of the variable at the tabstop.      
         v_args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(v_args, v_field);
    OLE2.INVOKE(v_sel, 'TypeText', v_args);
    OLE2.DESTROY_ARGLIST(v_args);
    OLE2.INVOKE(v_sel, 'TypeParagraph');
    END;
    PROCEDURE WRITE_HEADINGS (SELIN OLE2.OBJ_TYPE, TEXTIN VARCHAR2, COUNTIN NUMBER)
    IS
    /* This procedure is used to write headings in the first row of the table.
    SELIN is the Selection object
    TEXTIN is the boilerplate text to be written as the header of a column.
    COUNTIN is the number of characters in the header text. This is required
    to replicate the action bolding the font of the header.
    hFont          OLE2.OBJ_TYPE;
    v_args OLE2.LIST_TYPE;
    wdCharacter CONSTANT number(5) := 1; --Default
    --wdUnderline Class members
    wdUnderlineSingle                     CONSTANT NUMBER(5) := 1;
    ---- wdMovementType Class members
    wdExtend CONSTANT number(5) := 1;
    wdMove CONSTANT number(5) := 0; --Default
    ---- WdParagraphAlignment Class members
    wdAlignParagraphCenter CONSTANT number(5) := 1;
    wdAlignParagraphLeft CONSTANT number(5) := 0;
    wdAlignParagraphRight CONSTANT number(5) := 2;
    ---- HexColor = BBGGRR
    myLightBlue CONSTANT number(8) := 16755370; --FFAAAA
    BEGIN
    hFont := OLE2.GET_OBJ_PROPERTY(selin, 'Font');
    OLE2.SET_PROPERTY(hFont, 'Name', 'Calibri');
    OLE2.SET_PROPERTY(hFont, 'Size', 10);
    OLE2.SET_PROPERTY(hFont, 'Bold', True);
    OLE2.RELEASE_OBJ(hFont);
    v_args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(v_args, textin);
    OLE2.INVOKE(selin, 'TypeText', v_args);
    OLE2.DESTROY_ARGLIST(v_args);
    v_args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(v_args, wdCharacter);
    OLE2.ADD_ARG(v_args, countin);
    OLE2.ADD_ARG(v_args, wdMove);
    OLE2.INVOKE(selin, 'MoveLeft', v_args);
    OLE2.DESTROY_ARGLIST(v_args);
    v_args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(v_args, wdCharacter); --Unit
    OLE2.ADD_ARG(v_args, countin); --Count
    OLE2.ADD_ARG(v_args, wdExtend); --Extend
    OLE2.INVOKE(selin, 'MoveRight', v_args);
    OLE2.DESTROY_ARGLIST(v_args);
    hFont := OLE2.GET_OBJ_PROPERTY(selin, 'Font');
    OLE2.SET_PROPERTY(hFont, 'Underline', wdUnderlineSingle);
    OLE2.RELEASE_OBJ(hFont);
    END;
    PROCEDURE WRITE_DATA (SELIN OLE2.OBJ_TYPE, TEXTIN VARCHAR2)
    IS
    /*This procedure writes data in the cells of the table
    hFont     OLE2.OBJ_TYPE;
    v_args OLE2.LIST_TYPE;
    wdCharacter CONSTANT number(5) := 1; --Default
    --wdUnderline Class members
    wdUnderlineSingle                     CONSTANT NUMBER(5) := 0;
    ---- wdMovementType Class members
    wdExtend CONSTANT number(5) := 1;
    wdMove CONSTANT number(5) := 0; --Default
    ---- WdParagraphAlignment Class members
    wdAlignParagraphCenter CONSTANT number(5) := 1;
    wdAlignParagraphLeft CONSTANT number(5) := 0;
    wdAlignParagraphRight CONSTANT number(5) := 2;
    ---- HexColor = BBGGRR
    myLightBlue CONSTANT number(8) := 16755370; --FFAAAA
    BEGIN
    hFont := OLE2.GET_OBJ_PROPERTY(selin, 'Font');
    OLE2.SET_PROPERTY(hFont, 'Name', 'Calibri');
    OLE2.SET_PROPERTY(hFont, 'Size', 10);
    OLE2.SET_PROPERTY(hFont, 'Bold', False);
    OLE2.SET_PROPERTY(hFont, 'Underline', wdUnderlineSingle);
    OLE2.RELEASE_OBJ(hFont);
    v_args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(v_args, textin);
    OLE2.INVOKE(selin, 'TypeText', v_args);
    OLE2.DESTROY_ARGLIST(v_args);
    END;
    Edited by: smilingbandit on 31-Mar-2010 7:05 PM
    Edited by: smilingbandit on 31-Mar-2010 8:23 PM
    Edited by: smilingbandit on Apr 1, 2010 6:14 AM: Reason - Fixed formatting of comments.

  • User to enter values and stored as array

    Hi,
    I have some problem with my labs that I would like to clear by doubt.
    I need a user to keyed in a list of age so to calculate the average age. The values entered is stored in into an Array (not arrayList) I have been using ArrayList rather than array. =(
    So I have used a bufferedReader to capture the input the user keyed in. unlike arraylist, I could not create an array without knowing the size of it.
    Also,
    My following code has some proble, when I run the program and enter 99 as the first value input. The system would terminate. However, when I enter other values than 99, the system would not terminate. Do point out my brainless mistake. Thanks alot.
      public static void main(String[] args) {
             // TODO, add your application code
            int num =0;
             int j = 0;
      boolean stop = false;
              int[] arr = new int[200];
               BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                  while(stop == false){
               try {
             num =  Integer.parseInt(br.readLine());
          } catch (IOException ioe) {}
          if(num == 99){
          stop = true;
        arr[j] = num;
        j++;
        }

    seah_ly wrote:
    I need a user to keyed in a list of age so to calculate the average age. The values entered is stored in into an Array (not arrayList) I have been using ArrayList rather than array. =(Yes you are correct in using an ArrayList, however if arrays are required you could mimic the actions of a growing ArrayList by using an array and initializing a new array with double the size of the old array and copying the old elements to the new array. Note this is exactly what an ArrayList does.
    My following code has some proble, when I run the program and enter 99 as the first value input. The system would terminate. However, when I enter other values than 99, the system would not terminate. Do point out my brainless mistake. Thanks alot.
    if(num == 99){
      stop = true;
    }What do you think this does to the while loop?
    Mel

Maybe you are looking for

  • Crystal Report Error Failed to load Database logon Information

    Hi Experts, We developed a Crystal reports fetching data from a BI Query. When we run the report from Crystal Report Desginer it runs perfectly.  When I schedule the report in the CMC / Infoview, I am getting a error message saying: "<REPORT NAME> Fa

  • Any way to give iTunes feedback?

    I've been having some problems with iTunes (specifically regarding the inability to manually mark items as podcasts -- see http://discussions.apple.com/thread.jspa?threadID=444099 ) and I wanted to send some feedback to Apple. However the feedback si

  • Placeholder in properties bundle

    I'm using the <f:loadBundle> and <h:outputText> tags to reference a property message with two placeholders - {0} {1}. How do I make substitutions (backing bean properties) for the placeholders at run time? I tried adding two <attribute> tags as body

  • SAP ME 5.2.4 Deployment fails

    Hi, During deployment of SAP ME 5.2.4 I get an error. The details of the error are: Details message(s): Software component ME deployment messages: Deployment of archive seva106\sapmnt\trans\EPS\in\SAPME.sca for component sap.com/ME aborted Detailed m

  • Where do thumbnails come from?

    wondering how thumbnails are generated. I assume the thumbnails I view in windows explorer or adobe browser are generated by the browser and are not imbedded in the original images right out of the camera, or am I wrong about this. This also brings m