Loading table data in a form with a custom query

Hi everyone. I have this challenge with oracle forms. At the top of my form is an LOV text field. And at the bottom is a table (looks just like a master detail form). What I want to do is to select a value from the LOV, and then populate the detail block with information based on a query. The information is not linked to the table assigned to the master block or the table assigned to the detail block.
Let's say the master block contains an LOV which contains dates like AUG-09, DEC-09. After selecting a value, I want to be able to run a query say something like:
select full_name, job_title from per_all_boolys_f where period_name = 'AUG-09' (from master block)
Then this quer will then be used to populate the rows and columns in my detail block.
Is it possible to do this and how would I go about this.
Thank you

Igwe,
Based on your query example, you are only selecting from a single table. If this is the case, why not base your Detail Block on this table and then set the DEFAULT_WHERE clause property of the block to: ':MASTER_BLOCK.DATE' and then call Go_Block('DETAIL_BLOCK') and Execute_Query to populate your detail block?
If you truly have a dynamic query, then I would suggest using a From-Clause query based Detail Block? This would allow you to change your query anyway you want so long as it returns the same number of columns and column names don't change. Here is the setup:
1. Set the appropriate properties on your DETAIL BLOCK (as follows)
     a. Database Data Block = "Yes"
     b. Query Data Source Type = 'FROM clause query'
     c. Query Data Source Name = 'Leave blank or enter basics of your SQL query here'
     d. ORDER BY Clause = 'Enter any ordering requirements here or set them as needed in your code.'
     e. Set Insert Allowed, Update Allowed, and Delete Allowed = 'No'
2. Write the code to define your SQL query and assign it to the QUERY_DATA_SOURCE_NAME property of your Detail Block. This code can be in any trigger that allows execution of Restricted Built-ins (When-New-Block-Instance, When-New-Item-Instance, When-List-Changed, etc) because you will need to call the Go_Block and Execute_Query built-ins. In your situation, you may want to set a flag variable (parameter or global) in your Key-Next-Item and Post-Text-Item triggers and then test this flag variable in a When-New-Item-Instance trigger. For example:
/* Example Key-Next-Item trigger (duplicate this logic in your Post-Text-Item trigger */
/* or replace both triggers with a When-Validate-Item trigger) */
/* My example will use a Parameter object as a variable so you will need to create the */
/* QUERY_DETAIL_BLOCK parameter and set it to a CHAR(1) */
/* data type and set the DEFAULT VALUE to 'N' */
DECLARE
     /* Declare any variables you need here */
BEGIN
     -- Your trigger specific code here....
     :Parameter.QUERY_DETAIL_BLOCK := 'Y';
END;
/* Master Block When-New-Item-Instance trigger sample */
DECLARE
     v_SQL     VARCHAR2(2000);
BEGIN
     -- Any preexisting W-N-I-I trigger code you may have here already
     -- New code...
     IF ( :Parameter.QUERY_DETAIL_BLOCK = 'Y' ) THEN
          -- Reset the parameter first
          :Parameter.QUERY_DETAIL_BLOCK := 'N');
          -- Build the Dynamic Query
          v_SQL := 'select full_name, job_title from per_all_boolys_f where period_name = '' '||:MASTER_BLOCK.DATE|| ' '';
          Set_Block_Property('DETAIL_BLOCK', QUERY_DATA_SOURCE_NAME, v_SQL);
          Go_Block('DETAIL_BLOCK');
          Execute_Query;
          Go_Block('MASTER_BLOCK');
     END IF;
END;Please note, the above code is an example only - you will need to modify this example to work in your Form. Also, if your query really only selects from a single table, I really encourage you to use the first option of basing the detail block on the table and setting the Default Where clause property.
Hope this helps.
Craig...
If a response is helpful or correct, please mark it accordingly

Similar Messages

  • OMW hangs when loading table data?

    Hello - I've got the OMW to read the xml version of my access database. However when I tell it to migrate to Oracle, it get through creating all the table users, tablespaces, etc and then it dies when it gets to "loading table data". Any ideas?
    Thanks
    Richard

    If it is an MS Access database you are migrating from, then we create a schema with the same name as the mdb filename. So for file northwind.mwb we would create a schema called northwind. The default password is oracle unless you change it in the Oracle Model UI of the Workbench. In the Oracle Model looks under users to see what users exist.
    Once the user is created you should simply be able to connect to that user via sqlplus and see all the schema objects/data migrated
    Donal

  • Pdf form for data from another form with data, xml or pdf, tables not expanding

    Sir,
    I am using Adobe Acrobat 9 Pro and LifeCylce to do these forms. I have made several subforms for a Risk Assessment for the mission they fly. I have also made up another form with tables that would connect with each subform data. This form also will give me and others a % of the values received from the data to help us with seeing problem area towards Safety.
    I am able to connect the data to the form from the Risk Forms but when I go and add another group of data it over writes the data that was already in the data collection form. The tables are dynamic and able to expand with the generated data but when I compile several Risk Forms, xml. data into one single data group, the receiving tables will not except this data. To compile the data I am in Acrobat and using the form-manage form data-merge data to spreadsheet than enter as a report that is xml. Still not working. I also tried to save the form, with data already in the tables, and then opened it again and add data to it, it will over write the existing data in the form. This form does work great with the generated data in LiveCycle.
    Any suggestions???

    Thanks Paul
    Did as you said and for each subform binding tab made sure I have "Repeat subform for each data item" checkbox and still no change when I add the data.
    I even tried to combine the xml data and that file just has the main page and not the data pages. just another problem that is happening.
    Any other suggestions on this expanding tables and receive single forms one at a time.
    Bill

  • Read table data from Adobe Form in WD method

    Hello,
       Context is like this :
       ADOBE_DATA        --- Node
             POS                  -
    Node   which has Dict. Stru : TABLE  card : o..n
                   POSNR       --- Attribute
                   MATNR       -
    Attribute
    Created Adobe Interactive Form through the template source of view layout.So xml schema generated automatically
    and is all ok.
    Method on action Submit :
    DATA :
    Node_zatodv_pos       type ref to If_Wd_Context_Node,
    it_zatodv_pos TYPE STANDARD TABLE OF zatodv_tab_pos.
    Node_pos =
                 Node_Adobe_data->get_Child_Node( Name = If_MAIN=>wdctx_POS ).
      Node_pos->get_static_attributes_table( importing table = it_zatodv_pos ).
    When I test the application,this method returns SY-SUBRC is 0 but internal table is "always empty".
    I have also individual attributes in the context which are read correctly.Only get_static_attribute_table doesn't read the table content.Please could any one help me where would be the problem.
    Thank you

    Hi peter,
    If you are trying to add data to a standard SAP table then you should use a FM or BAPI for that but if the table is not standard then you can use following steps but it would be better to do it using FM or BAPI.
    Do the following(without FM/BAPI):
    1. Crate a context in your view mapped to the fields of the database table.
    2. Now use this context as the data source for the form.
    3. Map the fields of the form with the attributes of the context.
    4. Now create a button on the form or on your view which has a action event handler method.
    5. In the method use code wizard to read the context attached to adobe form. By default it will create a structure containing data, which will be sufficient for adding one record at a time.
    6. Now use this structure to add data to table using SQL queries.
    Do the following for FM/BAPI integration:
    1. Create a FM/BAPI which has the functionality to add data to your SAP table.
    2. Now use service call to add the FM/BAPI fields as a context to your web dynpro component's context.
    3. Now map it with the view where the adobe form is created.
    4. Follow steps 2nd, 3rd and 4th as above.
    5. Now in your Action method use code wizard to call the method created by service call to FM/BAPI.
    This will work as required.
    Please reward points if useful.
    Regards,
    Vaibhav Tiwari.

  • TABLE DATA in PDF FORM  Through ABAP WEBDYNPRO

    Hi Friends,
    I have to Populate  SAP TABLE like MARA,VBRK table into PDF form throught ABAP Webdynpro.
    Can you send STEP by STEP Example Doc.
    Thanks In Advance.
    Gautam.

    Hi,
    To display the Table in the Adobe Form you must create a WebDynpro Context.
    In WebDynpro Context, in the main node create another node like A1 with cardinality 0..n and in this node create attributes FIELD1 and FIELD2 and so on.
    Now goto method and in that method using code wizard read the node A1.
    And use the below code snippet sample in your program, i.e. code this under respective method of the webdynpro.
    *Declare the TYPES
    TYPES : BEGIN OF TY_TABLE,
    FIELD1 TYPE SOMETYPE,
    FIELD2 TYPE SOMETYPE,
    END OF TY_TABLE.
    *Define Internal Table and work area.
    DATA : IT_TABLE TYPE STANDARD TABLE OF TY_TABLE INITIAL SIZE 0.
    SELECT FIELD1 FIELD2 FROM TABLENAME INTO TABLE IT_TABLE.
    lr_node_info->bind_table( IT_TABLE ).
    And now goto Layout and give the TemplateSource and after that it asks for the interface name fill on that and select the relevant context. Now the LiveCycle Designer opens. There goto DataView pallette, there you can see the context of the webdynpro, now you simply drag and drop that table, a table is being created in the Layout Designer.
    Regards
    Pradeep Goli

  • Load Table Data into Excel Specific range

    Hi,
    I am working with Excel Destination in SSIS, where i have to insert table data into multiple excel sheets with specific range, sheet name same as table name and i should load each table into that particular sheet name in excel.
    So Sheet name will decide at run time and i have created one variable to pass complete sheet name (like [DimAge$A16:R1000]) in excel destination, but it is throwing error Here i am facing two complexities
    1)Getting error while passing excel sheet name as variable
    2) How to insert into excel in specific range of values shown as above.
    Ur help in solving this would be appreciated

    Hi Naveen,
    Based on my research, a worksheet or range is the equivalent of a table or view in Excel. The lists of available tables in the Excel Source and Destination editors display only existing worksheets (identified by the $ sign appended to the worksheet name,
    such as Sheet1$) and named ranges (identified by the absence of the $ sign, such as MyRange).
    So when you use a variable with [DimAge$A16:R1000] or [Select * from DimAge!A$16:R$1000] value in the Excel Destination, the value acts as a worksheet or range name. But there is no such worksheet or range in the excel file, so the error message occurs.
    To fix this issue, please select the cell range in your excel sheet, then right-click the range to define a name for the range to create some ranges with the specific ranges in excel file, then in the "Name of the Excel Sheet" drop down box of
    "Excel Destination Editor" you can see that Named range. Then simply select the range from the drop-down list or use a variable with the range name as the Excel Destination.
    For more information about how to import data to Excel sheet's specific region, please refer to the following blog:
    http://getsetsql.blogspot.in/2012/01/using-ssis-load-data-to-excel-sheet-at.html
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Loading Table Data

    Using OMW I succesfully managed to capture my access database and migrate it to Oracle. When is time to load the "table data" I get multiple errors one of them being: Integrity constraint violated-parent key not found.
    What is the best way to go about loading data into my Oracle schema?
    Thank you
    Pilton

    If it is an MS Access database you are migrating from, then we create a schema with the same name as the mdb filename. So for file northwind.mwb we would create a schema called northwind. The default password is oracle unless you change it in the Oracle Model UI of the Workbench. In the Oracle Model looks under users to see what users exist.
    Once the user is created you should simply be able to connect to that user via sqlplus and see all the schema objects/data migrated
    Donal

  • How to loop and read repeating table data of infoPath form in Visual studio workflow.

    Hi,
    I am trying to read info Path form repeating table data in Visual studio workflow.
    could anyone elaborate me in brief how to loop through repeating table and read all rows value one by one in workflow.
    any help would be more then welcome. 
    Thanks...

    Hi Rohan,
    According to your description, my understanding is that you want to create a Visual Studio workflow to get data from info path repeating table.
    I suggest you can submit Repeating Table to a SharePoint List and then you can create a .NET workflow to read data from the SharePoint List.
    Here are some detailed articles for your reference:
    Codeless submitting InfoPath repeating table to a SharePoint list
    Create a Workflow using Visual Studio 2010
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • Download internal table data into excel sheet with column heading and data

    Hi,
      I am having one internal table with column headings and other table with data.
    i want to download the data with these tables into an excel sheet.
    It should ask the user for file name to save it on their own name. They should give the file name in runtime and it should be downloaded into an excel sheet.
    Can anyone tell what is the right function module for downloading these two internal table data with column heading and data.
    what we have to do for storing the file name in runtime.
    Can anyone help me on this.
    Thanks,
    Rose.

    Hi Camila,
        Try this
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = PATH2
       FILETYPE                        = 'XLS'
      TABLES
        DATA_TAB                        = IT_DATA
       FIELDNAMES                      = IT_HEADINGS
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22

  • Clear the table data in PDF form

    Hi all,
    I am workin gon WD ABAP, where i  have a Interactive UI elelemt, and i am calling a PDF in to it.
    The PDF has a table, of which i am able to display , read  and save the data to Database.
    But after clicking on the save button , i want the table data to be cleared, which is not happening.
    I tried with binding with an empty internal table, but that gives an error "SOM Expression....."..!!
    Can any one let me know how to clear the PDF table data after clicking on some button.?
    All replies will be appreciated...

    Hi Runal,
    I am not sure about PDF as never worked on it but we can clear the table on view by simply invalidating the node by which you have binded your table. try to invalidate if it helps...
    this is the code to invalidate....
    lo_nd_nodename->invalidate( ).
    regards
    Pranav

  • How to populate dynamic table in Adobe Livecycle form with cfpdfform?

    Hello all,
    after two days search on the above topic without results I hope someone here can help me.
    The problem:
    I have an Adobe PDF form created with Adobe Livecycle Designer that has a dynamic table inside it. The table Table1 consists of a Header Row with 4 cells of text and a data row Row1 with four cells each one having a Textfield Cell1, Cell2,Cell3 and Cell4.
    Table1 sits inside a subform mytable. The subform is made to flow and the Row1 has the Binding Repeat Row for Each Data Item checked.
    Everything is enclosed within the standard subform form1.
    Whe I use the following code, I supposed that the table should have two rows..because it is said it will be dynamic:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <cfpdfform action="populate" source="test.pdf" destination="testout.pdf" overwrite="yes" >
    <cfpdfsubform name="form1">
      <cfpdfsubform name="mytable">
        <cfpdfsubform name="Table1">
          <cfpdfsubform name="Row1">
            <cfpdfformparam name="Cell1" value="1">
            <cfpdfformparam name="Cell2" value="2">
            <cfpdfformparam name="Cell3" value="3">
            <cfpdfformparam name="Cell4" value="4">
          </cfpdfsubform>
          <cfpdfsubform name="Row2">
            <cfpdfformparam name="Cell1" value="5">
            <cfpdfformparam name="Cell2" value="6">
            <cfpdfformparam name="Cell3" value="7">
            <cfpdfformparam name="Cell4" value="8">
          </cfpdfsubform>
        </cfpdfsubform>
      </cfpdfsubform>
    </cfpdfsubform>
    </cfpdfform>
    <cfpdfform action="read" source="testout.pdf" result="testout" />
    <cfdump var="#testout#">
    </body>
    </html>
    What happes is:
    The testout.pdf displays just one row,with the values 1,2,3,4 the second row is only visible when I export the data as xml but not within the PDF.
    Please can someone enlighten me?
    Thanks and regards
    Gilbert

    When populating your pdf fields, you can loop through all the records in a query like so...
       <cfloop from="1" to="#query1.recordCount#" index="i">
                <cfpdfformparam name="txtField1_#i#" value="#query1.Field1[i]#">
                <cfpdfformparam name="txtField2_#i#" value="#query1.Field2[i]#">
      </cfloop>
    This will handle two rows or thirty rows just the same.  In this case my fields in the pdf have the row # as a suffix.

  • Load table data to any server-client

    Hi...
    I have a requirement to load Cost Centre data from CSKS and CSKT tables to any Server u2013 Client. What is the best way to accomplish the same? Do i have to use RFC or just put the cost center into a file and load to another system?
    Regards,
    Aruna Nivetha.R

    Hi,
    Actually, it's a task more to your ABAP or BASIS team, but you can do it yourself as well. You can read more here:
    http://help.sap.com/saphelp_47x200/helpdata/en/94/e2d63b8ad9c01ce10000000a11402f/frameset.htm
    Another way, is to put this master data in a change request and transport it. You can do it via OKE6.
    Regards,
    Eli

  • Edit table data through multiple forms

    Hi everyone,
    I have a report page with records from a table. I want to edit the records through multiple forms: one form holds half of the columns to edit, another form holds the rest.
    I'm not sure how to create the connections between the pages with the forms and the report page with the record to edit.
    Any help would be greatly appreciated!
    Thank you!

    Ways you could go about this:
    1. Manually create the items on each page, then on the final page have your own process with the code: insert into <table> (1,2,3,4,5) values (:p1_item, :p1_item2, :p1_item3, :p2_item1, :p2_item2);
    2. Have a DML process on each page, only with the columns you want to insert - of course, the items on the pages after the first form page would have to be nullable (which isn't really a good idea imo, unless of course it follows the business rules), otherwise you wouldn't be able to do the initial insert on the first form page - then after create have a branch to the next form page, passing in the primary key to the next page, so its just updating the row when you hit apply changes.
    3. APEX_COLLECTION?
    Trent

  • How can I load a data in multiple period with a rule files?

    Hi!
    I need to create a rule file the permit me to load a record with multiple period.
    How can I do it?
    Thanks in advance.
    Bye

    As Glenn said, these two types are the typical input files.
    two ways that I can easily think of, but there are more.
    1. Have a row memberwith the period so for sample basic, the row would look lik
    cola,ny,actual,sales,Jan,100
    First case in the rule file you have to map all the member fileds with the dimension name and the data column with the data field.
    2. Have the data for each month as as the column members
    Here is the header followed by a data sample(again for sample basic)
    Product,Market,Scenario,Measure,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec
    1oo-10,NY,Actual,Sales,100,100,100,100,100,100,100,010,122,111,222,333
    Second case in the rule file you have to map all the member fileds with the corresponding dimension name and the multiple data columns with the corresponding member names for that dimension.

  • Query regarding passing of an internal table data to a form

    Hi All,
    Please help me out regardingmy query.
    I have a standard driver program and a Z form(SAPSCRIPT). Suppose i have an RFQ and it has number of line items in it, I need to fetch them all for a RFQ and then pass to the form and as this functionality is not available in the driver program, i want to  achieve via a subroutine pool. Passing of the data via the itcsy structure and all or by calling a write_form and passing the element to it.
    Can u all let me know whether i can pass the data ie., multipe records of data to form from a program otehr than the driver program?
    Regards
    Priya

    Hi Priya,
                  Why you need separate subroutine, you will find all the required data in the driver program itself.
    Just identify the Standard Subroutine in NACE tcode,
    For all Standard Driver program is SAPFM06P
    For RFQ
    Application type is 'EA'
    Output types are
    1) New
    2) Reminder
    3) Quotation rejection
    Further standard subroutines used for each output type are
    1)ENTRY_NEU  -  New
    2)ENTRY_MAHN - Reminder
    3)ENTRY_ABSA - Quotation rejection
    and the above mentioned subroutines get the data required for the corresponding sapscript
    RFQ Docno :- ekpo-ebeln
    RFQ Item   :- ekpo-ebelp
    Regards
    Bala Krishna

Maybe you are looking for

  • My ITunes wont open. It bounces once and then stops.

    It started when I tried to download the new ITunes. I had read that it would fix when i updated my whole computer. Now when I try to run updates, i hit update and it immediately says that my computer needs to restart to apply the updates. I restart a

  • ActiveX to open and close application

    I am new to LV (have 6.1).  What I want to do is open up an external application when a certain LV action is performed (like a boolean button, or something similar), minimize the LV application (will use Application Builder here), and close it when a

  • How can i remove contacts from my devices

    I have installed the new Mountain Lion OSX on my mac and open the Cloud with my apple ID, this ID is also linked to 3 of our families iPhone 4's, and since we have done this, my wife's iphone has all my work contacts on it. also, I have started using

  • I have a query concerning the Creation of Businees Partner

    Hi Group, I tried to create a Business Partner using the Function  Module "BAPI_BUPA_FS_CREATE_FROM_DATA" and I got the return value of the Business Partner also. And this FM I was using to create BP for the Organization. But the thing is that, I got

  • Will not recognise my old email address

    Is it possible to speak to a real person?