Help for dynamic class name

In actionscript 2.0, the following codes dynamically attach a
symbol
in the library to the stage:
var i:Number=Math.floor(Math.random*10);
this.attachMovie("symbol"+i,this.getNextHighestDepth());
where symbol0 ~ symbol9 are linkage id of 10 symbols in the
library.
While in ActionScript 3.0, I have a difficulty doing similar
thing.
If I want to attach a symbol to the stage, the code may look
like
var a_mc:MovieClip=new Symbol0();
this.addChild(a_mc);
but I don't know how I can attach randomly
1 var i:int=Math.floor(Math.random()*10);
2 var a_mc:MovieClip=new [Symbol+i]();
3 this.addChild(a_mc);
I found I need script like line 2, but it doesn't work
obviously.
Is the convenient way to do this?
thanks very much for help!

import flash.utils.*;
var i:int=Math.floor(Math.random()*10);
var classDef:Class = getDefinitionByName("Symbol"+i) as
Class;
this.addChild(new classDef() as DisplayObject);

Similar Messages

  • [svn] 1062: Adding support to DataGridColumn for multiple class names.

    Revision: 1062
    Author: [email protected]
    Date: 2008-04-01 16:27:42 -0700 (Tue, 01 Apr 2008)
    Log Message:
    Adding support to DataGridColumn for multiple class names.
    Bugs: SDK-15124
    Reviewer: Glenn Ruehle
    QA: Yes
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-15124
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridColu mn.as

    That's all well and good, but I've had more times that not where
    people want the entire program, not bits and pieces.Then you missed the whole point of that link.
    We don't want to see bits and pieces of code. We want to see an executable program, but we want an executable program the demonstrates the incorrect behaviour without all the unnecessary code. 90% of the code you posted was not related to your problem. That is we what you do to some basic debugging and remove the parts of code that are not related to the problem so we can concentrate on the code that is related to the problem.

  • AS3 - dynamic class names with *new* operator

    I'm using AcrtionScript 3 and Adobe Flash 9 Public Alpha.
    I have 50 movie clips in the Library that use Linkage to set
    the Class name to: Img1, Img2, Img3, ..., Img50.
    I have a parent class named RandImg. I want the constructor
    for RandImg to randomly select one of the 50 movie clips from the
    Library and display it. I could get this working by generating a
    random number, and then writing a really huge switch statement to
    associate each possible random number with its respective Library
    Movie Clip Class name, but I would much rather do this with a
    dynamic/variable class name based on the random number, such as:
    var nImgChoice:Number = Math.floor( Math.random( ) * 50 ) +
    1;
    var mcImg:MovieClip = new [ "Img"+String(nImgChoice) ] ( );
    addChild( mcImg );
    Note that this used to be possible in AS 2 by doing the
    following:
    this.attachMovie( "Img"+String(nImgChoice) , "mcImg",
    this.getNextHighestDepth());
    Suggestions?
    Thanks,
    ~JC

    import flash.display.DisplayObject;
    import flash.display.Sprite;
    import flash.utils.getDefinitionByName;
    var nImgChoice:Number = Math.floor( Math.random( ) * 50 ) +
    1;
    var ClassReference:Class =
    getDefinitionByName("Img"+String(nImgChoice) ) as
    Class;
    var instance:Object = new ClassReference();
    addChild(DisplayObject(instance));

  • Help on Dynamic queue name in JMS Adapter

    Hi Experts,
      Could you please explain how to configure dynamic queue name in JMS Adapter.
    My requirement is i would have to add the date and time to JMS Queue Name in receiver JMS Adapter.
    Thanks in Advance
    Chilla

    hi,
    as it's not in Adapter-Specific Message Properties
    http://help.sap.com/saphelp_nw04/helpdata/en/10/b1b4c8575a6e47954ad63438d303e4/content.htm
    looks like you cannot do it with jms adapter in standard
    use proxy or your own adapter instead
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Building a data flow task, within a foreach loop for dynamic table name, but ole db source not allowing variable

    In my control flow, I set up a variable for the table name, enumerated by SMO, following the instructions from the link here:
    http://www.bidn.com/blogs/mikedavis/ssis/156/using-a-for-each-loop-on-tables-ssis
    Now, I put a data flow task inside the foreach. I selected the OLE DB connection manger for my database, set the Data access mode to "Table name or view name variable", and selected my variable name from the drop down. So far so good. When I click on OK,
    it gives me an error 0x80040E37, basically saying it can't open the rowset for "my variable", Check that the object exists in the database.
    So, I assume I won't be able to do this "that' easily, and I will need to build a "SQL command from variable" or some such thing. Any advice on how to build this Source editor to dynamically name my columns from the variable?
    Thanks in advance!
    mpleaf

    Hi mpleaf,
    Please try to set "ValidateExternalData" to False in your OLE DB Source Properties and "DelayValidation" property to TRUE, please refer to similar threads:
    http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/620557d9-41bc-4a40-86d5-0a8d2f910d8c/
    http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/456f2201-447c-41b3-bf27-b3ba47e6b737
    Thanks,
    Eileen
    Eileen Zhao
    TechNet Community Support

  • Search help for Asset Class in LDB ADA

    Hi,
    I have a requirement to restrict values in certain search help.
    It is Z transaction for Z SAP Query which has logical database ADA under itself.
    The field which search help I should restrict is Asset Class.
    As I found in LDB ADA, it is select option SO_ANLKL with type ANLAV-ANLKL. It leads me to search help SH_ANLKA which is defined for domain ANLKL.
    But actually, another search help is called. It looks like SH_ANKA, but I don't know if it is right one.
    I have two problems:
    1. How to identify what search help is called?
    2. How to restrict values in search help or maybe how to attach Z search help in this case (should I attach in query or is there a way to enhance LDB)?
    As I am new both to SAP Query and LDB's I am not sure where to start.
    Tnx in advance,
    Natasa

    Solved.
    For those who face the same problem, here is the solution.
    LDB ADA creates basic search help for select options Asset Class by reading ANKA-ANLKL and ANKT-TXK20.
    Output list can be restricted by adding an enhancement at the end of FM DD_SHLP_GET_HELPVALUES and changing the internal table OUTPUT_VALUES.
    If necessary, it can be conditioned by TCODE and for this purpose parameter can be set in the enhancement of FM DD_SHLP_CALL_FROM_DYNP by reading content of the field HELP_INFOS-TCODE.
    Regards,
    Natasa

  • Re: search help for distribution field name

    hi to all,
    i had written like this
    select-options: s_manif for sood-objnam no intervals.i want a search help for this so that i want to select a distibution list names.
    how i can go head.
    please help me in this regard
    thanks
    sun
    Message was edited by: sun deep

    Hi,
    Get the distribution list names(OBJNAM) from table SOOD with OBJTP = 'DLI' and then call your own F4 help based on selected values.
    code :
    select-options: s_OBJNAM for sood-OBJNAM no intervals.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_OBJNAM-low.
    DATA: BEGIN OF li_OBJNAM OCCURS 0,
             OBJNAM like sood-OBJNAM,
            END OF li_OBJNAM.
      DATA: li_ret_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.
      DATA: lt_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE.
    select objnam from sood
           into table li_OBJNAM
                  where objtp = 'DLI'.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'OBJNAM'
          dynpnr          = sy-dynnr
          dynpprog        = sy-repid
          dynprofield     = text-044
          value_org       = 'S'
        TABLES
          value_tab       = li_OBJNAM
          return_tab      = li_ret_tab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Regards
    Appana

  • Help! dynamic class loading.

    Heya. I'm trying to write a server type app that will be able to load up new objects without having to stop the main program and recompile. Its going to read the names of the objects from a text file and then if there is a new object it will create an instance of it and then run its .start() method.
    here is what I tried:
    public static Server factoryMtd(String serverName) throws Exception {
         Class cl = Class.forName(serverName );
         Constructor co = cl.getConstructor();
         Object ob = co.newInstance();
         return (Server)ob;
    shouldnt that work ? I am doing a
    import java.lang.reflect.*; aswell.
    the error I am getting is this:
    getConstructer(java.Lang.Class[]) in java.lang.Class cannot be applied to ()
    and
    newInstance(java.lang.Object[]) in java.lang.refelct.Constructor cannot be applied to ()
    any ideas what I should do here people or what I'm doing wrong or even where I can find more info on doing this kind of thing ? maybe some examples ? thanks very very much!

    I'm not aware of a zero argument method for newInstance() in class Constructor. If you only want to instantiate an Object from a class name, you should probably do some thing like,
    return Class.forName("name").newInstance();

  • Class.forName() doesn't take dynamic class name

    String name="";
    String country="";
    String className = name + "_" + language + "_" + country;
    Class thisClass = Dynamicclassload.classLoad(className);
    System.out.println(className);
    Class class1 = Class.forName(className);
    child = (ResourceBundle) class1.newInstance();
    child.setParent( bundle );
    bundle = child;
    System.out.println("I am here");
    As i am passing classname as variable it throws an exception class not found exception.but if we write class name as the parameter of class.forName().it works.i am implementing in j2me
    why this happen? give me solution.

    The following classpackage test;
    public class TestLoad {
        String aString = "This is a Test";
        Integer anInteger = new Integer(42);
        public TestLoad() {
            System.out.println("aString = " + aString + ", anInteger = " + anInteger);
    }works correctly when loaded and instantiated by this class:package test;
    import java.util.logging.Logger;
    public class ExecuteTest {
        public static final Logger log = Logger.getAnonymousLogger();
        public static void main(String[] args) {
            try {
                Class clazz = Class.forName("test.TestLoad");
                TestLoad test = (TestLoad) clazz.newInstance();
            } catch (Exception ex) {
                log.severe(ex.toString());
    }and produces the string "aString = This is a Test, anInteger = 42"
    I used the following version of Java on Windows 2000
    java version "1.4.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
    Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

  • Help for dynamic selection

    Hello guy,
    I want to dynamically search for the occurrence of certain words in each data record(each field) in each table. Below is my code
    Parameters: p_tabname like dd02l-tabname.
    SELECT * FROM dd02l
      INTO  TABLE itab
      WHERE as4local = 'A'
       AND tabname = p_tabname
    LOOP AT itab INTO w_tab.
    CREATE DATA ref_itab TYPE STANDARD TABLE OF (w_tab-tabname).
        ASSIGN ref_itab->* TO <fs_itab>.
    CREATE DATA ref_wa TYPE (w_tab-tabname).
        ASSIGN ref_wa->* TO <fs_wa>.
    SELECT * FROM (w_tab-tabname)
        INTO CORRESPONDING FIELDS OF TABLE <fs_itab>.
       DESCRIBE TABLE  itab. "check if the table contains entries.
       IF sy-tfill > 0.
    LOOP AT <fs_itab> INTO <fs_wa>. " loop at each table that contains entries and search for the strings or characters
    SEARCH <fs_wa> for 'bbbb_' and '3456*' and '8970*' and '2980*'  "this is not working
    * If any of the entries exist in a table, I would like to give out the table name, the field which contains this entry and the dataelement
    * of the field that contain the entry
          ENDLOOP.
    ENDIF.
    ENDLOOP.
    Can some one please show me how to move forward to achieve this?
    Thank you
    Nadin

    Thank you so much Micky. It works perfectly. I really much appreciate your help. I will award points.
    Now I want to do some thing more. I want to output the data element and description,fieldname  tabledescription for example. I know that the dataelement of a field and the description can be found in the TABLE dd04t OR FM: DDIF_FIELDINFO_GET but you need to know the exact position of the field element dynamically. My problem now is I want to get the table description of SPFLI from dd02t, all the dataelements and the descriptions of the field 'TOKYO' and perhaps AIRPTO 'KIX'. Have adjusted my code as follows but still have trouble: Could you please Micky or any body show me how to achieve this?
    It is kind of tricky because the sy-tabix can be 2 but the TOKYO is at the 5th field. Thank you.
    Parameters: p_tabname like dd02l-tabname default 'spfli'.
    DATA: t_dd02l   TYPE STANDARD TABLE OF dd02l.
    DATA: t_dd03l   TYPE STANDARD TABLE OF dd03l.
    DATA: t_dfies   TYPE STANDARD TABLE OF dfies.
    DATA: ref_itab   TYPE REF TO data.
    DATA: ref_wa    TYPE REF TO data.
    DATA: ref_itab_temp TYPE REF TO data.
    DATA: ref_wa_temp   TYPE REF TO data.
    DATA: w_dd02l  TYPE dd02l.
    DATA: w_dd03l  TYPE dd03l.
    DATA: w_dfies   TYPE  dfies.
    DATA: w_string  TYPE string.
    DATA: w_fieldname   TYPE string.
    DATA: w_fieldnamestring  TYPE string.
    DATA: w_tabix TYPE sy-tabix.
    DATA: w_dd02t  TYPE dd02t.
    DATA: w_dd04t     TYPE dd04t.
    DATA: w_datenelement TYPE rollname.
    DATA: w_dfies_tmp TYPE dfies.
    FIELD-SYMBOLS:
    <fs_itab>          TYPE ANY TABLE,
    <fs_itab_temp> TYPE ANY TABLE,
    <fs_wa_temp>  TYPE ANY,
    <fs_wa>           TYPE ANY,
    <component>  TYPE ANY.
      CLEAR t_dd02l.
      SELECT * FROM dd02l
      INTO  TABLE t_dd02l
      WHERE as4local = 'A'
      AND tabclass   = 'TRANSP'
        AND tabname IN so_tab.
      LOOP AT t_dd02l INTO w_dd02l.
        CREATE DATA ref_itab TYPE STANDARD TABLE OF (w_dd02l-tabname).
        ASSIGN ref_itab->* TO <fs_itab>.
        ASSIGN ref_itab->* TO <fs_itab_temp>.
        CREATE DATA ref_wa TYPE (w_dd02l-tabname).
        ASSIGN ref_wa->* TO <fs_wa>.
        ASSIGN ref_wa->* TO <fs_wa_temp>.
        SELECT * FROM dd03l
        INTO  TABLE t_dd03l
       WHERE tabname = w_dd02l-tabname
       AND  as4local      = 'A'
       AND   datatype    = 'CHAR'.
        CLEAR: w_dd03l, w_fieldnamestring.
        LOOP AT t_dd03l INTO w_dd03l.
          CLEAR w_fieldname.
          w_fieldname = w_dd03l-fieldname.
          CONCATENATE w_fieldname w_fieldnamestring INTO
        w_fieldnamestring SEPARATED BY space IN CHARACTER MODE.
        ENDLOOP.
        CREATE DATA ref_itab_temp TYPE STANDARD TABLE OF (w_dd03l-tabname).
        ASSIGN ref_itab_temp->* TO <fs_itab_temp>.
        CREATE DATA ref_wa_temp TYPE (w_dd03l-tabname).
        ASSIGN ref_wa_temp->* TO <fs_wa_temp>.
        SELECT (w_fieldnamestring) FROM (w_dd03l-tabname)
        INTO CORRESPONDING FIELDS OF TABLE <fs_itab_temp>.
        DESCRIBE TABLE <fs_itab_temp>.
        IF sy-tfill > 0.
          CLEAR w_tabix.
          CLEAR w_nut.
          LOOP AT <fs_itab_temp> INTO <fs_wa_temp>.
            CLEAR w_longstring.
            w_tabix = w_tabix + 1.
            IF <fs_wa_temp> IS NOT INITIAL.
              DO.
                ASSIGN COMPONENT sy-index OF STRUCTURE <fs_wa_temp> TO <component>.
                CLEAR w_string.
                IF sy-subrc <> 0.
                  EXIT.
                ENDIF.
                CLEAR: w_string.
                IF NOT <component> IS INITIAL.
                  MOVE <component> TO w_string.
                  CONCATENATE w_string w_longstring INTO w_longstring
                  SEPARATED BY ';'.
                  IF w_string CS 'TOKYO'.
                    CLEAR w_dd02t.
                    SELECT SINGLE * FROM dd02t INTO w_dd02t
                    WHERE tabname    =  w_dd03l-tabname
                      AND ddlanguage = 'DE'.
                    CLEAR t_dfies.
                    CALL FUNCTION 'DDIF_FIELDINFO_GET'
                      EXPORTING
                        tabname        = w_dd03l-tabname
                      TABLES
                        dfies_tab      = t_dfies
                      EXCEPTIONS
                        not_found      = 1
                        internal_error = 2
                        OTHERS         = 3.
                    IF sy-subrc = 0.
                      CLEAR w_dfies.
                      READ TABLE t_dfies INTO w_dfies
                      WITH KEY tabname = w_dd03l-tabname.
                      READ TABLE t_dfies INDEX  w_tabix INTO w_dfies_tmp.
                      SELECT SINGLE * FROM dd04t INTO w_dd04t
                      WHERE rollname    = w_dfies_tmp-rollname
                      AND   ddlanguage  = 'EN'
                      AND    as4local   = 'A'.
                      WRITE:/ w_dfies-tabname, w_dd02t-ddtext, w_string, w_dd04t-rollname, w_dd04t-ddtext, w_longstring.
                    ENDIF.
                  ENDIF.
                ENDIF.
              ENDDO.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
    Edited by: nadin ram on Apr 11, 2008 7:06 PM

  • Design patterns for Dynamic Class Loading

    Hi,
    I have to develop a program for uni that dynamically loads classes based on names in a text file. All the classes subclass an abstract class with a constructor that takes one argument. This means I can't use the Class.forName(className).newInstance() method of class loading. I have researched some design patterns I could use and have come up with the following 3:
    Factory pattern; "Robocode" pattern (not it's real name, but Robocode uses it); and, the "one I made up myself" pattern.
    The robocode pattern instantiates a class using the default no-argument constructor then immediately sets all properties that shoud have been provided in the constructor:
    Object o = Class.forName(myClass).newInstance();
    o.setProperty(property);Personally I think this is ugly and a cheap fix instead of doing it properly.
    My own pattern finds the constructor that takes the arguments I need then calls it to create the object:
    Class c = Class.forName(myClass);
    Constructor cons = c.getConstructor(new Class[]{Class.forName("java.lang.String")});
    Object o = cons.newInstance(new Object[]{"hello"});What's the best to use? Are there any other patterns I should consider?

    My own pattern finds the constructor that takes the
    arguments I need then calls it to create the object:
    Class c = Class.forName(myClass);
    Constructor cons = c.getConstructor(new
    Class[]{Class.forName("java.lang.String")});
    Object o = cons.newInstance(new Object[]{"hello"});
    I have followed this basic 'pattern' several times though I would use
    Constructor cons = c.getConstructor(new Class[]{String.class});
    It works great.

  • Need help for creating class

    i m designing a class named Fan to represent a fan. the class contains:
    Three constants name slow, medium, and fast with values 1, 2 and 3 to denote the fan speed.
    an int data field named speed that specifies the speed of fan(default slow)
    an boolean data field named on that specifies whether the fan is on(default false)
    a double data field named radius that specifies the radius of the fan(default 5)
    a string data field named color that specifies the color of the fan(default blue)
    so here is what i want, a method named toString(that returns the fan speed, color and radius in one combined string.if the fan is not on. the method returns fa n color and radius along with string "fan is off" in one combined string.
    and a test program creates two fan objects assign maximum speed, radius 10, color yellow, and turn it on to the first object. assign medium speed, radius 5, color blue, and tun it off to the second object.
    after i created my two objects this is my output
    speed1 is slow, the fan is off, the radius is5.0Blue
    speed2 is slow, the fan is off, the radius is5.0Blue
    its not the result i want, i know there r somethin wrong with the if statement and the method..but i cannot fix it.
    Thank everyone who can give me some tips or help.
    here is my class
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package javaapplication1;
    * @author Administrator
    public class Fan {
        private int speed;
        private boolean on;
        private double radius;
        private String color;
        Fan(int speen, boolean on, double raidus, String color)
            this.speed = 1;
            this.on = false;
            this.radius = 5.0;
            this.color = "Blue";
        public int getSpeed()
            return speed;
        public void setSpeed(int speed)
            this.speed = speed;
        public boolean isOn()
            return on;
        public void setIsOn(boolean on)
            this.on = on;
        public double getRadius()
            return radius;
        public void setRadius(double radius)
            this.radius = radius;
        public String getColor()
            return color;
        public void setColor(String color)
            this.color = color;
        public String fanSpeed()
            String output = "";
           if(speed == 1)
               return output = "slow";
           else if(speed == 2)
               return output = "Medium";
           else
               return output = "Fast";
        public String IsFanon()
            String output = "";
            if(on == false)
                return output = "the fan is off";
            else
                return output = "the fan is on";
    }Here is my main class
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package javaapplication1;
    * @author Administrator
    import javax.swing.JOptionPane;
    public class testFan {
         * @param args the command line arguments
        public static void main(String[] args) {
            Fan fan1 = new Fan(3, true, 10.0, "yellow");
            Fan fan2 = new Fan(2, false, 5.0, "blue");
            System.out.println("speed1 is" + "  " +fan1.fanSpeed() + ",  " + fan1.IsFanon() + ", " + "the radius is" +fan1.getRadius() + fan1.getColor());
            System.out.println("speed2 is" + "  " + fan2.fanSpeed() + ",  " + fan2.IsFanon() + ", " + "the radius is" + fan2.getRadius() + fan2.getColor());
    }

    Peter__Lawrey wrote:
    I would not suggest using a variable like "onoff". What would true mean, is it on or off or onoff (alternating)? e.g. an on-off relationship is one which is not clearly on or off for long.
    You could just use an IDE to generate the constructor which would be simpler, however if there is no good reason to have two names for parameters and fields I would make them the same.I was wondering what a "speen" is.

  • Java mapping for Dynamic File name: stuctures?

    Hi,
    Scenario:  Sender AS2 adapter --> PI --> Receiver File (NFS) Adapter. Just a file pass through, no mapping
    Requirement: Want to have the receiver file name as C1.yymmdd.C2 where C1 and C2 are contants and yymmdd is current date.
    I was told in sdn forum that I have to write java mapping and provided the sample code also. However, I am not sure how and where to use that sample code. Could you please help on following questions:
    1) What is the source and target data type structures for mapping?
    2) Where do I develop java mapping? How do I import to PI?
    3) How do I get access to SAP Netweaver Developer Studio? Can I download it to my laptop? or if I dont have access, can I use any other tool to develop? ( NetBeans, Eclipse ??) and how?
    4) what are the files and libraries that we need to import to java mapping? (e.g.,  Import aii_map_api.jar library)
    5) How to generate .jar file?
    If someone has already developed java mapping (.jar file) ready to import into PI, please provide the same.
    Thanks in advance
    - Riya Patil

    Hi Sarvesh,
    Is this UDF work if I dont select ASMP on sender side? (We tested selecting ASMP on both sender & receiver file adapters, it works fine and it works without UDF also).
    In my requirement I have to use sender AS2 adpter, please confirm if I can use this UDF without selecting ASMP on sender side.
    I have done the following tests:
    Test-1) Select ASMP with 'File Name' on both sender and receiver file adapters without any mapping (UDF)
    It works great. No UDF or mapping required. It is just pass through of file having the receiver file name same as in sender channel.
    Test-2) Select ASMP with 'File Name', only on receiver file adapter without any mapping (UDF)
    It is obvious, it doesn't work. I am getting the following error:
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
    Test-3) Select ASMP with 'File Name', only on receiver file adapter with mapping (using DynamicConfiguratio UDF)
    We are getting the following error message in SXMB_MONI:
    Fatal Error: com.sap.engine.lib.xml.parser.Parser~
    <SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_Filename_: Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:Stack>
    Here is the code we have in UDF:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String SourceFileName = "C1." + a + ".C2";
    conf.put(key, SourceFileName);
    return " ";
    So looks like UDF is not working and it is failing in mapping. If I could make it work, I think there is good chance that I can see DynamicConfiguration under SOAP Header, which what required for the error we see in out test-2.
    Can someone please help me to straighten this UDF and make it work.
    Thanks in advance.
    - Riya Patil

  • Cannot use alias for dynamic column name in SELECT statement

    Hi,
    I want to retrieve values from several tables by using dynamic column & table name as below:
    DATA: tbl_name(30) TYPE c VALUE '/bic/tbi_srcsys',  " staticly initialized for this example
               col_name(30) TYPE c VALUE '/bic/bi_srcsys'.  " staticly initialized for this example
    SELECT (col_name) INTO CORRESPONDING FIELDS OF TABLE it_values FROM (tbl_name).
    The internal table "it_values" does not contain a field named "/bic/bi_srcsys", instead it has another generic field "value" so that the above code can be applied to other tables. I tried to use alias (AS) as below:
    SELECT (col_name) AS value INTO CORRESPONDING FIELDS OF TABLE it_values FROM (tbl_name).
    But this cannot work. I know that there are other ways to solve this problem, such as by using a single field in SELECT .. ENDSELECT and subsequently appending it to the work area and internal table as below:
    SELECT (col_name)  INTO (lv_value) FROM (tbl_name).
      wa_value-value = lv_value.
      APPEND wa_value TO it_values.
    ENDSELECT.
    Just wonder if there is any other more elegant workaround, because I might have several other fields instead of only one?
    Thanks.
    Regards,
    Joon Meng

    Hi Suhas,
    thanks for the quick reply.
    Sorry that I have not well described the structure of the internal table "it_values". This internal table contains several other fields (key, type, value, etc.).
    I guess that the following code
    SELECT (col_name) INTO TABLE it_values FROM (tbl_name).
    works if the internal table only has one field (value) or the field "value" is in the first position, right?
    In this case, I need to fill the "value" field of internal table it_values (ignore the other fields like type, key) with values retrieved from (col_name) of the DDIC table.
    Looking forward to your reply.
    BR,
    Joon Meng

  • Search help for usrid, first name , last name

    Hi Experts,
    Requirement:
    An input field with search help where user can search an employee based on his last name, first name (PA0002 u2013 NACHN and VORNA )  or user id(PA0105-USRID). (Wild card entries should be allowed)
    It should always return the user id (PA0105-USRID) of the searched employee.
    How should I go about it?
    Is there any way I can use the search help 'PREM' already existing in the system?
    Inputs are highly appreciated.
    Thanks,
    Regards,
    Kumud

    Hi Rob,
    Thanks for the input. The search help is created now.
    Before I close this thread, would you be able to provide me with the below input:
    1. I want that only valid records with ennda greater then current date should appear as output.(both for infotype 2 and 105)
    2. The userid should correspond to usrtype '0001'.
    currently I have placed below conditions in Selection condition of database view:
    PA0002     ENDDA     EQ     '99991231'     AND
    PA0105     USRTY     EQ     '0001'     AND
    PA0105     ENDDA     EQ     '99991231'
    Is there a better way is this is ok?
    Thanks,
    Kumud

Maybe you are looking for

  • Null and no data in field value

    I transferring sql from MS Access to Oracle 9i. In Access I have this select * from tableOne where firstname <> '' and firstname & '' = ''The firstname field can be edited where it could have data and the data could be deleted so I am trying to selec

  • HP Laserjet 1018 issue

    i'm trying to install the driver for the printer but when I get to the point where i shall plug in the printer, I connect it and get the familiar sound from the computer when detecting a new device, but the installation program just continues to say

  • G4 updated to 10.4.7, now will not boot up

    I didn't realize all of the updating issues with 10.4.7 or I would not have updated. Now my computer won't start up. This is what I did: 1. Ran Software Update for 10.4.7 2. Rebooted computer. 3. HP error message appeared about "shared Library" probl

  • [Smartfroms] Problems in fetching text edit control text

    Hi gurus, I made an application using Screen programming (or dialog programming you must say). I used 3 tab strips. In last tab strip I used a text edit control to write remarks in multiple lines. I save those remarks (data element: TEXT255) in a cus

  • How can I get rid of the VIP mailbox in Yosemite?

    I don't want to use the VIP mailbox, didn't set it up and don't want to see it. How can I get rid of it?