Dynamically creating/modifying fields

Hi there,
I'm having difficulty dynamically adding or modifying fields in a report using XML.
My sample report selects all the fields in a table (select * from TableName;), where some of the fields are mandantory for the report. The other fields are optional and selected by a user at runtime.
So, a user selects the optional fields and passes them in as parameters. I check the parameters in the "After Parameter Form" trigger and, if they're set, I try to add or modify a field in the report using some XML, such as:
<report name="Test1" author="Mark Kennedy" DTDVersion="1.0">
<layout>
<section name="main">
<field name="F_UDC1" source="LOCATION">
</field>
</section>
</layout>
</report>
The above XML tries to dynamically set the source of the field to LOCATION, which is one of the fields in the database table.
If F_UDC1 exists in the report, I get an error message: "REP-0002: Unable to retrieve a string from the Report Builder message file." If F_UDC1 doesn't exist, nothing happens. No new field is created or shows up in the report.
Any ideas on what I'm doing wrong? Thanks!
Mark Kennedy
[email protected]

Scott,
You should be able to do this with a report. You can make columns in a report into text boxes. I'm not sure exactly what I would do, but if you do something like
select null c1, null c2, null c3, null c4 from
user_objects where rownum <= :P123_NUM_ROWS
you should get for null columns. Now go edit each of those columns and make them text fields.
You can then submit the page and use the htmldb api's to get the values of those text boxes.
You might also use a collection . . . I'm just thinking as I type, but this should give you some ideas.
Anton

Similar Messages

  • How to get the co-ordinates of a dynamically created input field

    Hello Frn's
    i have created a dynamic text view . but this text view is not appearing at proper position . I want palce it infront of a dynamically created input field . how can i do this ?
    as i am thinking ...i should first of all  get info about the co-ordinates of   dynamaclly creatd input field . and with respect to these co-ordinates ...set the position of  text View .
    Please suggest  your thoughts .
    Thanks and Regards
    Priyank Dixit

    Hi,
    There is no provision in WD for getting screen coordinates and then placing the UI element.
    You to add the UI element to layout editor and based on the layout type it will add the UI element to respective position.
    I would advice not to create dynamic UI elements( instead you can create them statically and then play with visibility status through context binding ). This will be more effective way and less error prone. This is also recommended practice.
    still,For dynamic creation you can refer to following wiki:
    http://wiki.sdn.sap.com/wiki/display/WDABAP/CreatingUIElementsDynamicallyinAbapWebdynpro+Application
    regards
    Manas Dua

  • How to delete Dynamically created input field UI Element

    Hi all,
              I want to delete dynamically created input field and label.
    Is there any method please tell.
    Thanks in advance
    Hemalatha

    Hi,
    In the WDEVENT parameter of the action handler you can find the event id.
    ***Variables
      DATA:
        lv_selected  type string.          "Selected tab value
    ***Structure and internal table for the Events and messages
      DATA:
        lt_events type WDR_EVENT_PARAMETER_LIST,
        ls_events type WDR_EVENT_PARAMETER.
    ***Field symbols
      field-symbols: <fs_value> type any.   "Attribute value in events table
    ***Move the event table to lt_events
      lt_events = wdevent->parameters.
      read table  lt_events into ls_events with key name = 'SAVE'.  "Button Id
      if sy-subrc eq 0.
        assign ls_events-value->* to <fs_value>.
        if sy-subrc eq 0.
          lv_selected  = <fs_value>.
        endif.                 "IF sy-subrc eq 0.
      endif.                 "IF sy-subrc eq 0.
    Regards,
    Lekha.

  • Dynamically created text field doesn't appear when imported

    Greetings,
    I have 2 issues regarding dynamically created text fields.
    What I'm trying to do is to create a text field inside a swf file,
    then import that swf into another file. The main problem is, the
    text field is created and displayed perfectly when i execute the
    first swf, but when i try to import the whole thing into another
    file, the text is not displayed.
    I have to point out that, when I add "stage" before the
    addChildAt command, the text appears, but I don't want the
    coordinates of the text box depending on it's location on the
    stage.
    The second problem is, I want the scroll buttons to appear if
    the text is longer than the text box, however they appear no matter
    what. I trace the values and they are correct, so I can't really
    understand why they keep appearing.
    Thank you very much for your help.

    The same thing is happening to me and it is starting to get annoying. I too am using Chrome and I think that might just be part of the issue. I am running a Macbook Pro 2010 13". Any insight on this would be helpful. Sorry I don't have a solution, but know that your not alone in dealing eith this issue.

  • Is it possible to dynamically create form fields in PDF form?

    Hi all,
    I would like to dynamically create object like textbox, dropdown list from xml data. For example:
    When I receive following xml data:
    <field name="Check Box" type="selectbox"/>
    <field name="Text Field" type="textbox"/>
    I want to generate 2 form fields check box and text field with title "Check Box" and "Text Field" accordingly.
    Is it possible to do it in javascript for PDF form?
    Thank you and regards,
    Anh

    You cannot dynamically create objects on the fly like that but you can create interpret the XML and create an XDP file (which is the language of the template file) then bring that into Designer and create a PDF from that.
    Paul

  • Dynamically created Text field inside of empty Movieclip

    Hi there.
    My goal is to have a button that, when clicked, an empty
    movieclip is created and a text field is attached to it.
    I could write it easily if the newly created instance names
    where hard coded, the problem comes with the syntax to generate
    them dynamically.
    Here's the code i have so far:
    ActionScript Code:
    button.onRelease = function() {
    createText();
    var count:Number = 1;
    createText = function () {
    _root.createEmptyMovieClip("placeholder"+count,this.getNextHighestDepth());
    this["placeholder"+count].createTextField("my_txt"+count,
    this.getNextHighestDepth(), 100, 100, 100, 100); count++;
    After that's done i still need to assign a text value to the
    text field, which i have no clue on how to do it...
    In other words I want to accomplish something like:
    placeholder[count].my_txt[count].text = "my text";
    I hope it's not confusing... Any help would be greatly
    appreciated.
    Thanks in advance!

    if your createText() function isn't working the way you want
    check your use of "this" and "_root". if they're not the same,
    you're not referencing your newly created movieclip correctly. and
    your textfield depth isn't what you really want, but it should work
    ok.

  • How to dynamicly create a field name AND access it

    All,
    I am trying to build a code block that will access what amounts to a table structure inside a table. I have 38 occurances if a set of 3 fields. (Source system had an internal array/occurs clause that was converted for our ODS into individual fields) I am returning a single row as a row type and have addressability to all fields. What I am trying to avoid is coding my logic block 38 times, 1 for each occurance.
    FOR X IN 1 .. 38 LOOP
    V_CAT_CD_X := 'CAT_'||X||'_CD';
    End Loop;
    The following is the display of the correctly built field:
    --> Loop Cat CD: CAT_1_CD Rec count:1 Loop counter:1
    --> Loop Cat CD: CAT_2_CD Rec count:1 Loop counter:2
    --> Loop Cat CD: CAT_3_CD Rec count:1 Loop counter:3
    --> Loop Cat CD: CAT_4_CD Rec count:1 Loop counter:4
    My problem is that my row cursor PP1 is addressable hardcoding PP1.CAT_1_CD or PP1.CAT_2_CD ect, however I am having problems using my created string to access the field.
    What do I need to do to gain accessability via this method?
    I do have the ability to select the column names from the system tables but even then, I am lacking addressability to my ROW type using the selected field name.
    Thanks
    Greg

    Not sure if this is what you are looking for:
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2  my_cur SYS_REFCURSOR;
      3  v_rec mytest%rowtype;
      4  cursor c1 is select column_name from all_tab_cols where table_name = 'MYTEST';
      5  v_sql_stmt VARCHAR2(1000) := NULL;
      6  BEGIN
      7  v_sql_stmt := 'SELECT ';
      8  FOR I IN c1 LOOP
      9  v_sql_stmt := v_sql_stmt||I.column_name||',';
    10  end loop;
    11  v_sql_stmt := RTRIM(v_sql_stmt,',');
    12  v_sql_stmt := v_sql_stmt||' FROM mytest';
    13  open my_cur for v_sql_stmt;
    14  LOOP
    15  FETCH my_cur INTO v_rec;
    16  EXIT WHEN my_cur%NOTFOUND;
    17  dbms_output.put_line(v_rec.a);
    18  END LOOP;
    19 close my_cur;
    20* end;
    SQL> /
    1
    2
    PL/SQL procedure successfully completed.
    SQL> Edited by: AP on Nov 17, 2010 5:29 AM

  • AS3: How to get height of a dynamically created text field

    I am importing text from an XML file and want the lines of text to display in separate text fields beneath each other. How can I set the y value of each succeeding text field so that there is some space (40 pixels or so) from the above field, regardless of the length of the text? Here is my current code. Any help would be greatly appreciated.
    var textArray:Array = new Array();
    for (var i:int; i <myXML.TOPIC[0].QUERY.length(); i++) {
    var textField:TextField = new TextField();
    textField.htmlText = myXML.TOPIC[0].QUERY[i].QUESTION;
    textField.x = 100;
    //below is my problem....I want the y value to be based on the height of all the previous text fields that have been created
    textField.y = 100+(40*i);
    textField.border = true;
    textField.width = 800;
    textField.textColor = 0x000000;
    textField.multiline = true;
    textField.wordWrap = true;
    textField.selectable = false;
    addChild(textField);
    textArray.push(textField);

    There's nothing wrong with the approach you took... retain it as is.  What I was suggesting is basically the same, just a slightly different angle that doesn't need the conditional....
    var currentY:Number = 100;
    for (var j:int = 0; j <myXML.TOPIC[0].QUERY.length(); j++) {
       textArray[j].y =  currentY;
        // text gets added somewhere in here
        currentY =  currentY+textArray[j].height+5;

  • Dynamically create Text Fields

    hi,
    i hav a form which contains 2 radio buttons.
    ...If v click one radio button, a text field should be displayed and should contain information returned by view object.
    ...If v click another radio button, the previous text field should not appear and new text firld should appear and should contain information returned by another view object...
    .....can anyone say how can this b done?....

    To make a textfield programmatically you can use something like this:
        public CoreOutputText createOutputText(String text) {
            CoreOutputText label = (CoreOutputText)FacesContext.
                    getCurrentInstance().getApplication().
                    createComponent(CoreOutputText.COMPONENT_TYPE);
            label.setValue(text);
            //System.out.println("label id = " +label.getId()); //TEMP
            return label;
        }I put that method in a UIComponentFactory class. To add the created OutputText to your PanelPage for instance you do:
    CoreOutputText output = UIComponentFactory.getInstance().createOutputText();
    getPanelPage().getChildren().add(output);Like this you add the output text to the the children of the panelpage.
    To remove the output again you can use getPanelPage().getChildren().remove(output);

  • Referring to dynamically created form items

    I have a requirement where I do not know how many rows are going to be added into a table from a form. What I have done is used javascript to dynamically create form fields. This is along the same lines as a tabular form, however it should not save any of the data until the whole page is submitted.
    My problem is, how do I then refer to these form items within a PL/SQL procedure?
    Below is the piece of javascript that creates new rows on the form (the options for the select item are fed in using ajax). And following that, the pl/sql loop that I have attempted to use which doesn't work.
    NOTE: The onchange attribute on each of the form elements was to try to set a session state variable for each of the items. I got this from the following blog post.
    http://deneskubicek.blogspot.com/2009/01/ajax-setting-item-session-state.html
    Javascript
         var objectFormCount = 0
         function addObjectForm() {
              var newFormHTML = '<tr>';
              newFormHTML = newFormHTML + '';
              newFormHTML = newFormHTML + '<td><select onchange="f_setItem(this.id)" name="f01" id="f01_' + objectFormCount + '"></select></td>';
              newFormHTML = newFormHTML + '<td><input onchange="f_setItem(this.id)" type="text" name="f02" id="f02_' + objectFormCount + '"/></td>';
              newFormHTML = newFormHTML + '<td><input onchange="f_setItem(this.id)" type="text" name="f03" id="f03_' + objectFormCount + '"/></td>';
              newFormHTML = newFormHTML + '<td><input onchange="f_setItem(this.id)" type="text" name="f04" id="f04_' + objectFormCount + '"/></td>';
              newFormHTML = newFormHTML + '</tr>';
              $('#BackEndObjectTable').append(newFormHTML);
              objectFormCount++;
    PL/SQL
    FOR i IN 0..l_oracle_script_count
    LOOP
    --DEBUGGING VARS
    l_test1 := v('f01_' || i);
    l_test2 := v('f02_' || i);
    l_test3 := v('f03_' || i);
    l_test4 := v('f04_' || i);
    l_test5 := i+1;
    INSERT INTO MIGRATION_B_OBJECT (MIGRATION_B_ID,TARGET,SCHEMA,SCRIPT_LOCATION,SCRIPT_NAME,RUN_ORDER)
    VALUES (l_mig_seq,v('f01_' || i),v('f02_' || i),v('f03_' || i),v('f04_' || i),i+1);
    END LOOP;
    Edited by: Dopple on 28-Jul-2011 01:59 - text was stripped from the body of the post.

    For anyone with the same requirements. What I had to do was add the value of each form element into a temp table which was basically held key/value pair (form item/value) along with the username, the table that is to be updated and the row number.
    Once the actual page was saved, the procedure built up an insert sql string from the values in the temp table and inserted each row.
    Works a charm, although spitting the data back out into the dynamic forms is going to be a chore!!!!

  • MOSS: Cannot set "Modified", "Modified By", "Created" and "Created by" fields in the publishing pages list without changing version?

    Hello everyone,
    I've got the task to programmatically import data to a moss web by add publishing pages to the pages-library with enabled moderation and major/minor-versioning.
    This is not really difficult but the main issue is to set the values for the fields "Created", "Created by", "Modified" and "Modified by".
    Also this is not relly difficult. By setting the internal field-properties "Author" for Created by and "Editor" for Modified by there values are set.
    But the main problem now is, that I have to approve the publish page. After that, the value of the "Modified"-Field is change to the current datetime which is not acceptable.
    If I redo an updating of the listitem, the file-version is increased to 1.1 which is also not acceptable. I do this by .UpdateOverwriteVersion(), which MSDN says of that it doesn't increase the version but indeed it does.
    Following an example code of my approach:
    using (SPSite spSite = new SPSite(SiteCollectionURL))
    using (SPWeb spWeb = spSite.OpenWeb())
    PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(spWeb);
    PageLayout[] layouts = publishingWeb.GetAvailablePageLayouts(<Guid of my pageLayout>);
    if (layouts != null && layouts.Length > 0)
    PageLayout layout = layouts[0];
    PublishingPage newPage;
    // add new publishing page
    newPage = publishingWeb.GetPublishingPages(0).Add("test.aspx", layout);
    newPage.Title = "testpage";
    newPage.ListItem[SPBuiltInFieldId.Comments] = "test comment";
    newPage.Update();
    newPage.CheckIn("Checked in programmatically");
    SPListItem tmpListItem = publishingWeb.PagesList.GetItemById(newPage.ListItem.ID);
    string creationDate = "2009-11-05T22:35:10Z";
    string modifyDate = "2009-11-06T22:35:10Z";
    tmpListItem["Author"] = "1;#User 1";
    tmpListItem["Editor"] = "2;#User 2";
    tmpListItem["Created"] = creationDate;
    tmpListItem["Modified"] = modifyDate;
    tmpListItem.UpdateOverwriteVersion();
    // data is now alright set, now approve
    tmpListItem.File.Approve("Approve test");
    // publishingpage is now approved but modified-date has changed, try to reset data
    SPListItem updItem = spWeb.GetList(spWeb.Url + "/Pages").GetItemById(tmpListItem.ID);
    updItem["Author"] = "1;#User 1";
    updItem["Editor"] = "2;#User 2";
    updItem["Created"] = creationDate;
    updItem["Modified"] = modifyDate;
    tmpListItem.UpdateOverwriteVersion();
    // now all four values are correct but now version is 1.1 and approval status 'draft' again
    Also updating the listitem by ProcessBatchData doesn't do it becaue I couldn't successfully update the author/editor-fields.
    Do you have any working ideas or hints for me?
    Greetings from Germany,
    LoneSurvivor

    I think iv cracked it...
    Coppied straight from my code so the variable names dont match but the principal is there...
    $dstfile.ListItemAllFields["Author"] = ($author.ID.ToString() + ";#" + $author.LoginName)
    $dstfile.ListItemAllFields["Editor"] = ($modifier.ID.ToString() + ";#" + $modifier.LoginName)
    $dstfile.ListItemAllFields["Created"] = $srcfile.TimeCreated.ToLocalTime()
    $dstfile.ListItemAllFields["Modified"] = $last.ToLocalTime()
    # changes to editor have to be done by Update or UpdateOverwriteVersion
    $dstfile.ListItemAllFields.UpdateOverwriteVersion()
    if ($file.Level -eq "Published") {
    # publish not needed and overwrites 'Editor' so dont use
    # $dstfile.Publish($file.CheckInComment)
    # use .Approve() which updates the major minor versions too
    $dstfile.Approve($file.CheckInComment)
    # approve changes the dates so correct here
    $dstfile.ListItemAllFields["Created"] = $srcfile.TimeCreated.ToLocalTime()
    $dstfile.ListItemAllFields["Modified"] = $last.ToLocalTime()
    $dstfile.ListItemAllFields.SystemUpdate()

  • How to synch values of fields (cbo & text) in Master Pages section in dynamically created pages?

    HI folks,
    I have a requirement for a form that has a common master page with a checkbox and text field in it.   The document is basically a table that dynamically adds rows as the user adds entries.   When the first page is full, a second page is dynamically created and the Master page format (including the checkbox & text field) applied to it. 
    When the user sets the checkbox on one page and/or adds text, all of the checkboxes on all of the dynamically created pages (in the master section) and all of the text boxes need to change to show the same values.   
    However, I can't figure out how to address the fields on the other pages.   The number of pages changes from user to user, so I can't address them with a static reference.
    Does anyone know how to keep these fields in synch?
    Thanks in advance!

    It woudl be easier to show than to explain it ...can you share the file? You can send it to [email protected] Include a description of the issue with your email please.
    Paul

  • Sharepoint Site User name,created by and Modified field issue

    I am being admin of sharepoint site . I have added a user to my sharepoint site from people and groups(Site Action-->Site Settings-->Users and Permissions-->People and Groups). So Now "Created by" and "Modified by" field should
    show My login name(display name) in those fields Right ? But In those field it is showing  user name whom I have added to my sharepoint site. I have added user to my site so My display name should be their  in "created by" and "modified
    by" field. Facing this issue on PROD and UAT.

    Hi Rajshekhar,
    Actually, the users have been added to the site groups or granted with permissions in Site Permissions, then the users will be added to the User Information List of the site collection.
    I recommend to check if the users you added have already been listed in the User Information List.
    If yes, then the Created By and Modified By fields have already been filled with other values.
    Created By field will show the user name who is the first one to add the user to the site and the Modified By field will show the last one who edit the My Settings of that user.
    To access the User Information List, you can type the URL like this:
    http://server/_catalogs/users/detail.aspx.
    Best regards,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to create a field catalogue dynamically?

    Hi guys,
          I have to create a field catalogue dynamically. I am creating the internal table dynamcially. It is <fs_dyn_table>. I am passing this to the function module REUSE_ALV_FIELDCATALOG_MERGE.
    <fs_dyn_table> contains five fields kunnr, land1, name1, ort01 and telf1 which i am passing from selection screen.
    This is how my function module is
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         i_program_name               = sy-repid
       i_internal_tabname             = '<FS_DYN_TABLE>'
       i_inclname                     = sy-repid
        CHANGING
          ct_fieldcat                  = it_fcat
       EXCEPTIONS
         inconsistent_interface       = 1
         program_error                = 2
         OTHERS                       = 3.
    I am not getting any values in the internal table it_fcat.
    I would like to know if there is any other way to create field catalogue?
    Help will be appreciated.
    Thanks,
    Ibrahim

    Hi,
    Kindly refer wiki links:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/complete%252bcode%252bfor%252bdynamic%252bfield%252bcatalog%252bcreation
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/create%252ban%252balv%252b(%252bUsing%252bOOABAP%252b)with%252bdynamic%252bField-Catalog
    Hope they help you.
    Regards,
    Tarun

  • How we create dynamic add form field in web form

    How we create dynamic add form field in web form?

    Hi,
    Thanks for reply.
    I need to create a form in which "add more" input field dynamically. For
    example sometime we need field on or more. Please look at the demo, I need
    to create form as per demo in business catalyst:
    http://www.openjs.com/scripts/examples/addfield.php

Maybe you are looking for

  • Trying to connect to a L2TP over IPSec VPN

    There are quite a few threads on here about VPN's and Lion, and clearly quite a number of questions. However, I haven't found one that quite addresses the problem I've got and I've now exhausted all my ideas and am looking for help... I have a hardwa

  • How do i sync icloud calendar with outlook on macbook air

    i have a new macbook air and my calendar is on iCloud for all my other devices. i would like to be able to see the calendar in outlook (office 365)

  • Asset master history indicator - what is it for ?

    From the field documentation, it's mentioned :- 1) the asset is displayed in asset chart (which program / report is this?) 2) the asset and values/transactions belonging to it cannot be reorganized until the asset is deactivated - what does this mean

  • DataTime type shows as Timestamp(6) in BAM Database Table

    Hi, I am new in BAM, Am facing an issue with BAM Data Object. I have two DateTime fields in DataObject. But when I look in BAM database Table,the field data type is stored as TIMESTAMP(6). I want both the elements in DateTime format. Is there any rea

  • Problem while displaying all the table names from a MS Access Data Source.

    I started preparing a small Database application. I want to display all the Table Names which are in the 'MS Access' Data Source. I started to executing by "Select * from Tab" as if in SQL. But i got an error saying that "Not able to resolve Symbol '