Creating lines in a form during runtime

I need to create some lines in a form canvas during runtime. How can i do that?
Thanks for attemption.

You can create the line on a stacked canvas at design time.
Then you can show or hide the stacked canvas at runtime.
Good luck
Bang Dinh

Similar Messages

  • Object Referenced Error When calling the Windows Form during Runtime

    Hi,
    I am getting  Object reference errors when running windows form during runtime. In debugging mode in MS Visual studio 2005, I am not getting this error. I'm calling the window form from menu and called the window in a thread as suggested in one of forums . I don't see anyone in the forum mentioned this problem I have. Any help would be deeply appreciated. Below are the error and code samples.
    ERROR Message
    Exception Text **************
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Project1.Loadxml.Loadxml_Load(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    Edited by: Albert Tio on Feb 16, 2011 9:55 AM

    Here is the code.
    Option Strict Off
    Option Explicit On
    Friend Class GetEvents
        Public WithEvents SBO_Application As SAPbouiCOM.Application
        Public SboGuiApi As SAPbouiCOM.SboGuiApi
        Public oForm As SAPbouiCOM.Form
        Public oDBDataSource As SAPbouiCOM.DBDataSource
        Public oCompany As SAPbobsCOM.Company
        Public RS As SAPbobsCOM.Recordset
        Public oPrev_Bank As String, oPrev_AcctType As String
        Public oLoadXml As Loadxml
        Public Sub SetApplication()
                 'Dim SboGuiApi As SAPbouiCOM.SboGuiApi
            Dim sConnectionString As String
            SboGuiApi = New SAPbouiCOM.SboGuiApi
            ' by following the steps specified above, the following
            ' statment should be suficient for either development or run mode
            sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
            ' connect to a running SBO Application
            SboGuiApi.Connect(sConnectionString)
            ' get an initialized application object
            SBO_Application = SboGuiApi.GetApplication()
        End Sub
        Public Sub SetCompany()
            Dim ret As Long
            Dim MsgStr As String
            Dim Cookie As String
            Dim ConnStr As String
            Try
                oCompany = New SAPbobsCOM.Company
                Cookie = oCompany.GetContextCookie
                ConnStr = SBO_Application.Company.GetConnectionContext(Cookie)
                '//before setting the SBO login context make sure the company is not connected
                If oCompany.Connected = True Then
                    oCompany.Disconnect()
                End If
                ret = oCompany.SetSboLoginContext(ConnStr)
                If Not ret = 0 Then
                    Exit Sub
                End If
                ret = oCompany.Connect
            Catch ex As Exception
                SBO_Application.MessageBox(ex.Message)
            End Try
            MsgStr = ""
            If Not ret = 0 Then
                oCompany.GetLastError(ret, MsgStr)
                SBO_Application.MessageBox(MsgStr)
            Else
            End If
        End Sub
        Public Sub New()
            MyBase.New()
            ' set SBO_Application with an initialized application object
            SetApplication()
            SetCompany()
            AddMenuItems()
        End Sub
        Private Sub SBO_Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent
            Dim myThread As New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf LoadXmlMainThread))
            Try
                If (pVal.MenuUID = "MySubMenu") And (pVal.BeforeAction = False) Then
                    'SBO_Application.MessageBox("My sub menu item was clicked")
                    '// Create a form to be launched in response to a click on the
                    '// new sub menu item
                    myThread.SetApartmentState(System.Threading.ApartmentState.STA)
                    myThread.Start()
                    'Loadxml.ShowDialog()
                                End If
            Catch ex As Exception
                SBO_Application.MessageBox("1." & ex.Message)
            End Try
            'If (pVal.MenuUID = "MyGoToMenu") And (pVal.BeforeAction = False) Then
            '    SBO_Application.MessageBox("My GoTo Menu was clicked")
            'End If
            'If (pVal.MenuUID = "MySecondGoToMenu") And (pVal.BeforeAction = False) Then
            '    SBO_Application.MessageBox("My Second GoTo Menu was clicked")
            'End If
        End Sub
        Private Sub LoadXmlMainThread()
            'Dim lLoadxml As New Loadxml
            Try
                oLoadXml = New Loadxml
                oLoadXml.WindowState = FormWindowState.Maximized
                oLoadXml.ShowInTaskbar = True
                oLoadXml.TopMost = True
                oLoadXml.Activate()
                Application.Run(oLoadXml)
            Catch ex As Exception
                SBO_Application.MessageBox("2." & ex.Message)
            End Try
        End Sub
        Private Sub AddMenuItems()
            '// Let's add a separator, a pop-up menu item and a string menu item
            Dim oMenus As SAPbouiCOM.Menus
            Dim oMenuItem As SAPbouiCOM.MenuItem
            Dim i As Integer '// to be used as counter
            Dim lAddAfter As Integer
            Dim sXML As String
            '// Get the menus collection from the application
            oMenus = SBO_Application.Menus
            'Save an XML file containing the menus...
            'sXML = SBO_Application.Menus.GetAsXML
            'Dim xmlD As System.Xml.XmlDocument
            'xmlD = New System.Xml.XmlDocument
            'xmlD.LoadXml(sXML)
            'xmlD.Save("c:
    mnu.xml")
            Dim oCreationPackage As SAPbouiCOM.MenuCreationParams
            oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
            oMenuItem = SBO_Application.Menus.Item("43520") 'moudles'
            Dim sPath As String
            sPath = Application.StartupPath
            'sPath = sPath.Remove(sPath.Length - 3, 3)
            If sPath.EndsWith("\") = False Then
                sPath = sPath & "\"
            End If
            '// find the place in wich you want to add your menu item
            '// in this example I chose to add my menu item under
            '// SAP Business One.
            oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP
            oCreationPackage.UniqueID = "MyMenu01"
            oCreationPackage.String = "Unbridle Menu"
            oCreationPackage.Enabled = True
            oCreationPackage.Image = sPath & "unbridle.bmp"
            oCreationPackage.Position = 15
            oMenus = oMenuItem.SubMenus
            Try ' If the manu already exists this code will fail
                oMenus.AddEx(oCreationPackage)
                '// Get the menu collection of the newly added pop-up item
                oMenuItem = SBO_Application.Menus.Item("MyMenu01")
                oMenus = oMenuItem.SubMenus
                '// Create s sub menu
                oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
                oCreationPackage.UniqueID = "MySubMenu"
                oCreationPackage.String = "Unbridle Monitoring"
                oMenus.AddEx(oCreationPackage)
            Catch er As Exception ' Menu already exists
                'SBO_Application.MessageBox("Menu Already Exists")
            End Try
        End Sub
    End Class
    Public Class Loadxml
        'Inherits System.Windows.Forms.Form
        Public sBPpath As String
        Public sGLpath As String
        Public sBillpath As String
        Public bRun As Boolean
        Private Sub Loadxml_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Me.TextGL.Text = System.Configuration.ConfigurationSettings.AppSettings("GLAcctDownloadPath").ToString()
            Me.TextBP.Text = System.Configuration.ConfigurationSettings.AppSettings("BPAcctUPloadPath").ToString()
            Me.TextBill.Text = System.Configuration.ConfigurationSettings.AppSettings("BillUPloadPath").ToString()
            Me.NotifyIcon1.Visible = False
        End Sub
    End Class

  • How to create editbox in a dialog during runtime in c++

    how to create editbox in a dialog during runtime in c++,so that when ever dialog is intialized different number of edit box are displayed

    how to create editbox in a dialog during runtime in c++,so that when ever dialog is intialized different number of edit box are displayed

  • How to create line in smart form

    dear all,
            i hv to create lines in smartform.
    BOX XPOS '0' MM YPOS '6' MM HEIGHT '0' MM WIDTH '190' MM FRAME 1 PT
    by using above statement i can create line in SAPSCRIPT.
    is there any similar statement in smartform to create lines
    if So plz send me a code.
    regards
    Vinod.

    create window and provide these parameters  in the output options to get the line. and  in  line  select check box line with                                                                               
    Left margin          0.00      CH    Width           80.00       CH   
      Upper margin     12.50      LN    Height             0.05       LN                                                                               
    line
       check the box  line with                                                                               
    Gray value       0   %     
       Width                     1.00       TW                       (0% = not filled)          
       vertical spacing       0.00       CM                                
       horizontal spacing   0.00       CM

  • How to create a radio button in dynpro during runtime?

    Hi guys!
    How can i create radio buttons in dynpro during runtime??
    any ideas?
    thanks!!

    Hi Thomas,
    I think as of now there is no possibility to create a Radio Button Dynamically during runtime. But of course, there is a work around which I feel you can evaluate.
    If your business requirement demands that you need to have a Radiobutton, you can use the subscreen to place the Radiobutton and later based on your need you can call that screen to enable that button to the user and to make it available.
    Hope this will help.
    Thanks,
    Samantak.

  • Change Form Size during runtime

    Could someone tell me how to change the size of my VI form during runtime?
    I want the ability to click a button and have the height increase by 50 points or so, then go back to the original value after I click the button again.
    Thanks for the help!
    Angus Cattle from Pool Ranch and Steel Repairs via Joe's Welding.

    Ok, that got me on the right track.
    For some reason, though, my VI still does not change whenever I click the button.
    I have attached my VI, saved in 8.2 format.
    Does anyone see why my form doesn't grow by "98" whenever I click the "More >>" button?
    Angus Cattle from Pool Ranch and Steel Repairs via Joe's Welding.
    Attachments:
    Event Notifications.vi ‏44 KB

  • How to create Confirmation Item QUANTITY during Runtime

    Hi Experts,
    I am trying to create Confirmation ITEM with QUANTITY during runtime.
    I have successfully created item using CRM_ORDERADM_I_MAINTAIN_OW however it doesnot have scheduling_i structure which hold QUANTITY. I tried with CRM_ORDER_MAINTAIN_MULTI_OW. getting following error, I tried with CRM_SCHEDLIN_I_READ_OW it creating quantity on CRM Confirmation screen.
    Can you pls tell me how to get quantity. 
    Thanks
    Anee
    The current application program detected a situation which really
    should not occur. Therefore, a termination with a short dump was
    triggered on purpose by the key word MESSAGE (type X)
    ls_fund_h         TYPE  crmt_fund_h_com,
            ls_cla_h          TYPE  crmt_cla_h_com,
            ls_lawref_h       TYPE  crmt_lawref_h_com,
            lt_lawref_h       TYPE  crmt_lawref_h_comt,
            ls_orderadm_i     TYPE  crmt_orderadm_i_com,
            lt_orderadm_h     TYPE  crmt_orderadm_h_comt,
            lt_chngproc_i     TYPE  crmt_chngproc_i_comt,
            ls_chngproc_i     TYPE  crmt_chngproc_i_com.
      DATA:
            ls_entry            TYPE  crmt_guid_handle,
            lv_dummy            TYPE  crmt_msgtext,
            lv_vona_kind_copy   TYPE  crmt_boolean,
            lv_count            TYPE  i,
            ls_msg_handle       TYPE  balmsghndl,
            ls_exception        TYPE  crmt_exception_logical_ke
            lv_subrc            TYPE  sy-subrc.
      FIELD-SYMBOLS:
            <ls_order_item>   TYPE  crmt_order_items.
    * check correct call
      ADD 1 TO gv_recursive_call.
      ADD 1 TO gv_maintain_active.
      CALL FUNCTION 'CRM_ORDER_CHECK_RECURSIVE_OW'
        EXCEPTIONS
          recursive_call              = 1
          call_without_order_maintain = 2
          OTHERS                      = 0.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.

    Did you solve the problem?

  • Oracle Forms 10g runtime handling during RAC node failover.

    Hi,
    Forms version 10g R2 (10.1.2.0.2)
    Oracle DB version 10g R2 RAC with 3 nodes.
    If the RAC DB node that the user is connected to goes down, the user gets FRM-40733 and ORA-03114 error messages and the client forms application gets locked down/ goes in a loop with the error messages. The user has to close the browser to get out of the loop. I understand that this is the expected behaviour, but I'm wondering whether we can trap the error ORA-03114 and fire the "key-exit" trigger to get out of the application.
    Have any one implemented a clean way to exit the Forms application when the RAC DB node goes down..?
    I'm looking for some suggestions or an elegant way to handle the above failure.
    Thank you in advance.
    Sudhakar

    Glen,
    I haven't solve this one yet.I have been playing around with the following:
    In my environment, I am still using 6i (not web) forms/reports.
    My clients are XP, NT, 2000.
    I have the forms/report runtime installed on their PCs.
    Their TNSNAMES.ORA will be pointing to PRIMARY ( PDB)
    If a SWITCHOVER or FAILOVER happens to the physical standby (SDB), I want a trigger to kick a batch file that will manipulate the TNSNAME.ORA on each clients stations.
    On the standby
    CREATE OR REPLACE TRIGGER change_tns
    AFTER DB_ROLE_CHANGE ON DATABASE
    DECLARE
    role VARCHAR2(30);
    dbname varchar2(100);
    BEGIN
    SELECT
    DATABASE_ROLE,
    DB_UNIQUE_NAME
    INTO
    role,
    dbname
    FROM
    V$DATABASE;
    IF role = 'PRIMARY' and dbname='SDB' THEN
    dbms_scheduler.create_job(
    job_name=>'move_sqlnet',
    job_type=>'executable',
    job_action=>'c:\temp\movetns.cmd',
    enabled=TRUE
    ELSE
    -- if the standby >was< PRIMARY,
    -- but the primary comes BACK on line,
    -- need to reverse the step above.
    END IF;
    END;
    As for the movetns.cmd
    something like
    rem -- attach to the workstation,
    net use m: \\station name\share name
    rem -- stdb_tnsname.ora would be pointing to STANDBY
    copy stdb_tnsname.ora m:\orant\net80\tnsname.ora
    net use m: /delete
    rem -- need to do that for all workstations..
    As you can see, there could be lots of problems with this procedure.
    Client doesn't know about the failover, starts a RE-BOOT on the pc, therefore, the new tnsnames.ora will not get to client.. what to do for that client? Do i re-run the batch ...every hour?
    tell me if you come up with an answer..
    p-

  • Can I create a dynamic number of inputs during runtime?

    Can I create a dynamic number of inputs during runtime?
    Oracle 11g
    Application Express 4.0.2.00.06
    Here is my problem:
    We have a table that holds metadata about files (hardcopy or softcopy files).
    We expect we may need more columns in the table at some point and don't want to modify the table or the application.
    So in order to do this I would like to create:
    A table called TBL_FILE with the columns:
    TBL_FILE_ID               NUMBER                (This will be the primary key)
    TBL_FILE_NAME          VARCHAR2(1000) (This will be the name of the file)
    A second table will be called TBL_FILE_META with the columns:
    TBL_META_ID               NUMBER               (This will be the primary key)
    TBL_FILE_ID               NUMBER                (This will be the forign key to the file table)
    TBL_META_COLUMN     VARCHAR2(30)     (This is what the column name would be if it existed in TBL_FILE)
    TBL_META_VALUE          VARCHAR2(1000) (This is the value that record and the 'would be' column)
    So a person can have as much meta data on the file with out having to add columns to the table.
    The problem is how can I allow users to add as much data as they like with out having to re develop the page.
    Other things to note is that we would like this to be on a single page.
    I know how to add we can create multi-row inserts by using a SQL Query (updateable report),
    however the TBL_META_VALUE column in the TBL_FILE_META will sometimes be a select list and other times a text box or number field.
    So I don't see now a SQL Query (updateable report) would work for this and I can't create an array of page items at run time can I?
    Any idea's how I could accomplish this? Is there a better way of doing this?
    Also is there a term or a name for what I am doing by creating these 'virtual' columns in another table?
    I found this method when looking at Oracles Workflow tables.

    Welcome to the Oracle Forums !
    >
    Can I create a dynamic number of inputs during runtime?
    Oracle 11g
    Application Express 4.0.2.00.06
    Here is my problem:
    We have a table that holds metadata about files (hardcopy or softcopy files).
    We expect we may need more columns in the table at some point and don't want to modify the table or the application.
    So in order to do this I would like to create:
    A table called TBL_FILE with the columns:
    TBL_FILE_ID NUMBER (This will be the primary key)
    TBL_FILE_NAME VARCHAR2(1000) (This will be the name of the file)
    A second table will be called TBL_FILE_META with the columns:
    TBL_META_ID NUMBER (This will be the primary key)
    TBL_FILE_ID NUMBER (This will be the forign key to the file table)
    TBL_META_COLUMN VARCHAR2(30) (This is what the column name would be if it existed in TBL_FILE)
    TBL_META_VALUE VARCHAR2(1000) (This is the value that record and the 'would be' column)
    So a person can have as much meta data on the file with out having to add columns to the table.
    The problem is how can I allow users to add as much data as they like with out having to re develop the page.
    >
    Creating Page Items dynamically is not available. You will have to create excess items and hide/show , etc. But you cannot change the Item Type. All in all, too many limitations in this approach.
    >
    Other things to note is that we would like this to be on a single page.
    >
    The 100 item limit will hit you if you go with extra item on page. With Tabular Form that should not be a limitation, unless you are exceeding the 50 item limit of APEX_APPLICATION.G_Fnn items, and the 60 column limitation of Report region with "Use Generic Column Names (parse query at runtime only)" of Dynamic region.
    >
    I know how to add we can create multi-row inserts by using a SQL Query (updateable report),
    however the TBL_META_VALUE column in the TBL_FILE_META will sometimes be a select list and other times a text box or number field.
    >
    If the type if item is variable it only means you need a way to store the item type. Meta Data of the Meta Data.
    >
    So I don't see now a SQL Query (updateable report) would work for this and I can't create an array of page items at run time can I?
    >
    Yes, you can do it. Updatable report/ Tabular Form query can be constructed from the Meta Data using PL/SQL Function Returning SQL Query . It will be a bit of coding in PL/SQL where you use the Meta Data and the Meta Data of the Meta Data to piece together your SELECT with the right APEX_ITEMs. It might have a performance penalty associated with it, but will not be a serious degradation.
    >
    Any idea's how I could accomplish this? Is there a better way of doing this?
    Also is there a term or a name for what I am doing by creating these 'virtual' columns in another table?
    I found this method when looking at Oracles Workflow tables.
    >
    I guess that is just a good TNF. It is the Master-Detail Design Pattern, that sound more modern ? ;)
    Regards,

  • How to set a line of table as read only during runtime?

    How to set a line (or a cell) of table as read only during runtime?

    hi wei
          when you create a table keep the readonly property of table as false
    you create the columns of table as inputfield.you bind the readonly property of
    the inputfield to two context variables
    say one for all the columnfields you to want always have as readonly and let this contextattribute of type boolean and let this be attr1
    and another for all the columnfields you donot want to be readonly and let this contextattribute of type boolean and let this be attr2
    initially set the context attributes attr1 and attr2 as true so the entire table is readonly.
    based on the condition you want to check change the attr2 to be false.
    if(your condition)
    wdcontext.currentcontextelement.setattr2(false);
    hope this helps.
    regards
    saravana

  • How to create a report in Form line Style and can display Image field?

    Hi,
    In Report builder 10g, I would like to create a Report with Form Line Style and this report included a Image field.
    I can choose this Style only when Select Report type is Paper Layout. Because, If I choose Create both Web & Paper Layout or Create Web Layout only then in the next Style tab 03 option Form, Form letter and Mailing Label be Disabled.
    But in Paper Layout, my report can not display Image field.
    I tried with Web layout and all the other Styles (Except 03 mentioned be Disabled) then all Styles are displayed Imager field OK.
    How to create a report in Form line Style and can display Image field?
    I was change File Format property of my Image field from text to Image already in Property Inspector. But report only showed MM for my Image field.
    Thanks & regards,
    BACH
    Message was edited by:
    bachnp

    Here you go..Just follow these steps blindly and you are done.
    1) Create a year prompt with presentation variable as pv_year
    2) Create a report say Mid report with year column selected 3 times
    - Put a filter of pv_year presentation variable on first year column with a default value say @{pv_year}{2008}
    - Rename the second time column say YEAR+1 and change the fx to CAST(TIME_DIM."YEAR" AS INT)+1
    - Rename the second time column say YEAR-1 and change the fx to CAST(TIME_DIM."YEAR" AS INT)-1
    Now when you will run Mid Report, this will give you a records with value as 2008 2009 2007
    3) Create your main report with criteria as Year and Measure col
    - Change the fx for year column as CAST(TIME_DIM."YEAR" AS INT)
    - Now put a filter on year column with Filter based on results of another request and select these:
    Relationship = greater than or equal to any
    Saved Request = Browse Mid Report
    Use values in Column = YEAR-1
    - Again,put a filter on year column with Filter based on results of another request and select these:
    Relationship = less than or equal to any
    Saved Request = Browse Mid Report (incase it doesn't allow you to select then select any other request first and then select Mid Report)
    Use values in Column = YEAR+1
    This will select Year > = 2007 AND Year < = 2009. Hence the results will be for year 2007,2008,2009
    This will 100% work...
    http://i56.tinypic.com/wqosgw.jpg
    Cheers

  • How do I create multiple objects during runtime?

    I don't know how to create multiple objects during runtime, here's my problem:
    I get a String as input. Then I create an object called newobject. I put the object in a hashtable with the above string as key.
    Then comes the problem, in order to create a new object, I have to rerun the same class, which uses the same name (newobject) to create a 2nd object. Now my hashtable doesn't reference to my 1st object anymore...
    Is there anyway I can fill up the hashtable with different objects, and make each key point to each object it was supposed to?
    For those who want to see a bit of the program:
    public class PlayBalloon{
    public Hashtable ht = new Hashtable();
    for(){
    Balloon pB = newBalloon;
    newBalloon=new Balloon(pB);
    ht.put("Some input from user", newBalloon);
    for(){
    ht.get(s).draw;<= s=string, draw=own meth. in Balloon
    }

    I think i can see the problem that you are having. You have, in effect, duplicate keys in your hashtable - ie, two strings used as keys with the same name.
    The way that a hashtable works is as follows...
    When you ask for a value that is mapped to a key it will go through the table and return the first occurence it finds of the key you asked for. It does this by using the equals() method of whatever object the key is (in your case it is a String).
    If you cant use different Strings for your keys in your hashtable then i would consider writing an ObjectNameKey class which contains the String value that you are trying to put in the hashtable and an occurrence number/index or something to make it unique. Remember to override the equals method in your ObjectNameKey object or else the hash lookup will not work. For example
    class ObjectNameKey {
        private String name;
        private int occurence;
        public ObjectNameKey(String name, int occ) {
            this.name = name;
            this.occurence = occ;
        public String getName() {
            return name;
        public String getOccur() {
            return occurence;
        public boolean equals(Object o) {
            if (!(o instanceof ObjectNameKey)) {
                return false;
            ObjectNameKey onk = (ObjectNameKey)o;
            if (onk.getName().equals(name) && onk.getOccur() == occurence) return true;
            return false;

  • Creating a new line in tabular form

    Hi all,
    I designed a form which displays employee information like empno,ename,job,sal.
    I created a control item as "create newline" and lov is attached to this item,lov contains values as YES,No. If I select create newline value as YES then a new line is inserted immediately next to the first line and the data corresponding to that empno is automatically populated into the fields. i.e empno,ename,job fields.But "sal" field is displayed as empty and it is able to insert new sal by user.After entering data into sal field the entire row is stored into emp table.I created a when-create-record trigger in
    "create newline" item,but it is not working.
    Could anyone please give me an idea to do this.
    Thanks in Advance.

    Hi Francois,
    I have developed one form which contains emp block.which is a database block.I have taken Empno,Ename,Job and sal as database items and i have created one control item[Create Line] under this block.And Created Lov for that control item(that lov contains YES or No Values).All these fields displayed on the Canvas.
    when I press CTRL+F11 it will display emp details,now my requirement is Suppose For the first record i have selected Create Line as YES from LOV Under this record new line has to be created and Empno,Ename,Job values to be populated in the new line from the above line but sal field is displayed as blank and then we enter the salary and update the record in the database.
    Note:Here I am displaying the fields in the tabular format.
    I have written code in when-create-record trigger in block level as:
    declare
         cursor c1 is select empno,ename,job,sal from emp where empno=:emp.empno;
    begin
         if :emp.CREATE_LINE='YES' then
    for i in c1
              loop     
                        create_record;
                   fnd_message.debug('new line');
                   :EMP.EMPNO:=i.empno;
                   :EMP.ENAME:=i.ename;
                   :EMP.JOB:=i.job;
              end loop;
              end if;
         end;
    Could u please help me.
    Thanks in advance.

  • Trigger a job based on a job that will be created during runtime

    I searched sdn and I did not find any threads addressing my issue(Trigger JOB B after a JOB A which will not be available untill runtime).
    My Req:
    I have a where in, a JOB 'A' will trigger to execute a BDC session in program A using a SUBMIT ...RETURN statement.
    I will have to trigger a different job 'B' using program B, the moment the 1st job runs completed.
    I thought this would be possible, by handling the events and trigger the FM in program A after the SUBMIT statement. But the problem is SUBMIT statement would just create the job and return the control back to the program A and immediately call the FM to raise the EVENT. In this case, my job B will trigger and even complete before JOB A could complete successfully.
    I tried using AFTER JOB option in SM36 instead of AFTER EVENT. The problem with this option is, JOB A will be available ONLY during runtime and hence cannot schedule program B with the option AFTER JOB.
    Any thoughts are highly appreciated.
    Thanks for your help.
    Best Regards,
    Kiran

    Hi Thomas,
    I programmed the way you mentioned and this triggers both the jobs at the same time.
    DATA: number  TYPE tbtcjob-jobcount,
          jobname LIKE tbtcjob-jobname.
    jobname  = 'JOB1'.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = jobname
      IMPORTING
        jobcount         = number
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
      SUBMIT zhbn_life_premium_summary_rpt
      VIA JOB    jobname
          NUMBER number
          AND    RETURN.
      IF sy-subrc EQ 0.
        CLEAR: jobname.
        jobname = 'JOB2'.
        CALL FUNCTION 'JOB_OPEN'
          EXPORTING
            jobname          = jobname
          IMPORTING
            jobcount         = number
          EXCEPTIONS
            cant_create_job  = 1
            invalid_job_data = 2
            jobname_missing  = 3
            OTHERS           = 4.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ELSE.
          SUBMIT zhbn_life_premium_summary_rpt
          VIA JOB    jobname
              NUMBER number
              AND    RETURN.
          IF sy-subrc EQ 0.
            WRITE: 'job 2 success'.
            jobname = 'JOB2'.
            CALL FUNCTION 'JOB_CLOSE'
              EXPORTING
                jobcount             = number
                jobname              = jobname
                strtimmed            = 'X'
              EXCEPTIONS
                cant_start_immediate = 1
                invalid_startdate    = 2
                jobname_missing      = 3
                job_close_failed     = 4
                job_nosteps          = 5
                job_notex            = 6
                lock_failed          = 7
                invalid_target       = 8
                OTHERS               = 9.
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
      jobname = 'JOB1'.
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount             = number
          jobname              = jobname
          strtimmed            = 'X'
        EXCEPTIONS
          cant_start_immediate = 1
          invalid_startdate    = 2
          jobname_missing      = 3
          job_close_failed     = 4
          job_nosteps          = 5
          job_notex            = 6
          lock_failed          = 7
          invalid_target       = 8
          OTHERS               = 9.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDIF.
    Am I missing anything?
    Thanks
    Kiran

  • Create a object in form of circle, line, triangle or other shapes

    i am trying to make a program that creates simple objects, its just a hobby. the problem is i am trying to make an object that is only a line(for now). i mean i want to have an object that can be in a shape of anything in any angle. i like to be able to create a straight line from top left corner to bottom right corner, but i do not want to draw it, i want it to be an object like JButton but in different shapes. how ever i cannot do that. i have already wrote a little test program to show every one what i have, it s not my actual code just a sample.
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JLayeredPane;
    import java.awt.BorderLayout;
    import javax.swing.JLabel;
    import java.awt.Color;
    import javax.swing.event.MouseInputListener;
    import java.awt.event.MouseEvent;
    import javax.swing.JComponent;
    import javax.swing.AbstractButton;
    import java.awt.Graphics;
    import java.awt.Dimension;
    import java.awt.Polygon;
    import java.awt.Graphics2D;
    import java.awt.BasicStroke;
    import java.awt.RenderingHints;
    import java.awt.geom.Area;
    public class FractalTest extends JFrame
         public static final int H=600;
         public static final int W=600;
         public static final Dimension dim = new Dimension(H,W);
         private int[] joinInt = new int[]{BasicStroke.JOIN_MITER,BasicStroke.JOIN_ROUND,BasicStroke.JOIN_BEVEL};
         private int[] capInt = new int[]{BasicStroke.CAP_BUTT,BasicStroke.CAP_ROUND,BasicStroke.CAP_SQUARE};
         public FractalTest(){
              super("Test");
                    //two test lines
              Polygon p = new Polygon();
              p.addPoint(150,150);
              p.addPoint(450,450);
              Polygon s = new Polygon();
              s.addPoint(450,150);
              s.addPoint(150,450);
              setBackground(Color.YELLOW);
              setLayout(new BorderLayout());
                    //status bar at buttom
              JLabel info = new JLabel("info");
                    //creating JPanel holder of lines
              JPanelCanvas test = new JPanelCanvas();
              test.setBackground(Color.BLACK);
              test.setSize(dim);
              test.setLayout(new BorderLayout());
                    //creating lines
              TestComponent t1 = new TestComponent(p,2f,"Polygon P");
              TestComponent t2 = new TestComponent(s,5f,"Polygon S");
                    //setting JLables for status info
              t1.setInfoDisplay(info);
              t2.setInfoDisplay(info);
              test.setInfoDisplay(info);
              test.add(t1,BorderLayout.CENTER);
              test.add(t2,BorderLayout.CENTER);
              add(test,BorderLayout.CENTER);
              add(info,BorderLayout.SOUTH);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              setSize(dim);
              setVisible(true);
              repaint();
         public static void main(String[] args){new FractalTest();}
         private class TestComponent extends AbstractButton implements MouseInputListener
              private float thickness;
              private Polygon polygon;
              private String name=null;
              private JLabel jl=null;
              public TestComponent(Polygon p,float t,String name){
                   super();
                   thickness=t;
                   polygon=p;
                   setContentAreaFilled(false);
                   this.name=name;
                   setSize(FractalTest.dim);
                   setVisible(true);
                   addMouseListener(this);
              public void paint(Graphics g){
                   super.paintComponent(g);
                   Graphics2D g2 = (Graphics2D)g;
                   g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
                   g2.setStroke(new BasicStroke(thickness,capInt[0],joinInt[0]));
                   g2.setPaint(Color.GREEN);
                   g2.drawPolygon(polygon);
              public boolean contains(int x, int y){
                   int Ax=polygon.xpoints[0];
                   int Ay=polygon.ypoints[0];
                   int Bx=polygon.xpoints[1];
                   int By=polygon.ypoints[1];
                   int m=(By-Ay)/(Bx-Ax);
                   int s1=(m<=0)?+1:-1;
                   int s2=(m<=0)?-1:+1;
                   Polygon p = new Polygon();
                   p.addPoint(Ax+1,Ay+(int)(s1*thickness));
                   p.addPoint(Bx+1,By+(int)(s1*thickness));
                   p.addPoint(Bx-1,By+(int)(s2*thickness));
                   p.addPoint(Ax-1,Ay+(int)(s2*thickness));
                   return p.contains(x,y);
              public void setInfoDisplay(JLabel jl){this.jl=jl;}
              public void mouseEntered(MouseEvent e){jl.setText(name);}
              public void mouseExited(MouseEvent e){jl.setText("Polygon");}
              public void mouseDragged(MouseEvent e){}
              public void mouseMoved(MouseEvent e){}
              public void mouseClicked(MouseEvent e){}
              public void mousePressed(MouseEvent e){}
              public void mouseReleased(MouseEvent e){}
         private class JPanelCanvas extends JPanel implements MouseInputListener
              private JLabel jl;
              public JPanelCanvas(){}
              public void setInfoDisplay(JLabel jl){this.jl=jl;}
              public void mouseEntered(MouseEvent e){jl.setText("Canvas");}
              public void mouseExited(MouseEvent e){jl.setText("info");}
              public void mouseDragged(MouseEvent e){}
              public void mouseMoved(MouseEvent e){}
              public void mouseClicked(MouseEvent e){}
              public void mousePressed(MouseEvent e){}
              public void mouseReleased(MouseEvent e){}
    }if u see the code, the problem is each of the lines are covering the hole frame not just the green line, and i have to use the contains() method to limit the function but i do not want to do that. i just want it to be an object with out need of drawing any lines. just creating and object with the background color. so for example a JPanel in circular form that is only a circle no extra area around it.
    if u run the application and run it u will see the JPanel behind the green lines is not accessible by the mouse, the status JLabel shows the name of object can be reached by mouse at the moment and canvas(JPanel) will never be invoked. if the mouse is still on line objects the status name will stay on Polygon and it never changes to canvas.
    thanks everyone in advance

    Hi,
    try searching [www.java2s.com].plenty of sample programs are available.I have a faint memory of seeing a code that loads image files in desired placehoders like polygons n stuff. I guess you could replace the image component by some other component. Hope this helps

Maybe you are looking for

  • DVD drive stopped writting DVD's on my Satellite 5200-801

    Quick question that I hope someone knows the answer to. My DVD drive stopped writting DVD's a while ago (several system reinstalls have proved that it is the drive and not a driver error/conflict) So I got hold of another drive. Fitting was easy howe

  • Nokia x proximity sensor functionality issues?

    I'm using nokia x and found a setting (Turn on Proximity sensor) in it that states it will dim the display when attending a call . It works as like a light sensor (automatic brightness reduction) and it seems proximity sensor is not present. CPU z ap

  • Null character in text file

    I am trying to read text file in stored procedure. The file in text editor looks like some of the lines have funny character looked like sqare. That character is a null character. When I run my procedure I gives me read error. So I tried to oepn that

  • How to import Bridge Labels into Lightroom 3.4

    I have  close to 500,000  images all neatly labeled in Bridge.  They have the color labels for: (red) select,  (yellow)second, review, to do (the basic standard adobe created labels)  nothing customized. After importing my entire collection into ligh

  • BSP Dump

    Hi all, we had created an web application in bps.than Bsp will be created correspondingly.i had made some changes in the view of page 1 of the bsp application.i had added a button,in that view.in the oninputprocessing i wrote the below code it is giv