Firing a Class based on a loaded variable

Basically what I'm trying to do is something like this:
(from server)
className=AwesomeClass&foo=good&bar=blah
On the ActionScript side I want to take the parameter
"className" and actually use that to fire a new instance of that
class:
var serverVars:URLVariables = new URLVariables(event.data);
//gets me my server vars
What I'd like to do is something like:
var InstanceClass:Class =
getDefinitionByName(serverVars.className) as Class;
var classHolder:Object = new InstanceClass();
Now that "sort of" works. Theproblem is that I haven't set
that class up in Flash ( even though I've done a import
projectfolder.* )
Am I SOL if I need to make these new classes without first
going through and defining each and every one?
Thanks
edit: this is the error that I'm getting:
ReferenceError: Error #1065: Variable
(name from className URLVariable) is not defined.

how do you hope to create a class instance when its class
does not exist?

Similar Messages

  • Please help me understand making and loading variable classes

    Hi guys ,
    I know that I am stupid but I just can't get this!  AS3 says you need to load variables into a class?  Please please give me a simple example
    my variables look like this... (the whole point of playing around with variables was that if I had to make a change I could access one place and change them...
    but now I realse that I can't access or call them outside the movie clip they are in:(
    please hlep me!
    var ans1="";
    var ans2="";
    var w1="ABN";
    var def1="An ABN (Australian Business Number), is a personal number for your business that makes it easier and quicker to deal with  government and other businesses.";
    var w2="ACN";
    var def2="An ACN is an Australian Company Number, which is a special number that each company gets to identify it.  No two companies can have the same ACN";
    var w3="Action Plan";
    var def3="A business Action Plan will show What needs to be done and When it needs to be done by."
    var w4="Advertising";
    var def4="Advertising is producing information to let people know about your business and try to increase sales."
    var w5="Promotions";
    var def5="Promotions are where your business tries to increase the sales of a particular item through offering a good deal, advertising or a special display.";
    var w6="Benefit";
    var def6="A benefit is something good that you get.  One benefit of doing exercise is getting fit, another benefit is losing weight.";
    var w7="Business Mentor";
    var def7="A business mentor is a trusted guide. Someone who has experience and has been successful in business and can help and advise you.";
    var w8="Business Name";
    var def8="A Business name is the name a business uses to do its work.  It lets customers know who you are.";
    var w9="Business Registration";
    var def9="When you start a business you need to register your ABN, you may need to register your business name.";
    var w10="Cash flow";
    var def10="Cash Flow for a business is having enough cash saved to be able to pay your bills when they are due.";
    var w11="Characteristic";
    var def11="The characteristics of something are describing words about that thing.";
    var w12="Charges";
    var def12="A charge is something you have to pay, an expense.";
    var w13="Company";
    var def13="Is the same as a corporation. A company is a type of business that needs to be registered (either State or Federal) and has special legal status.  A company can put Pty. Ltd after it’s business name.";
    var w14="Competitor";
    var def14="A competitor is another business that is challenging you for customers.";
    var w15="Constitution";
    var def15="A constitution in business is a list of rules and principles that a company has agreed to follow.";
    var w16="Corporations Aboriginal and Torres Strait Islander Act";
    var def16="In the 1960s and 1970s, various reviews advised the Australian Government of the need for legislation to make it easier for Indigenous communities and organisations to form corporations. As a result, the ACA Act was passed, allowing Aboriginal and Torres Strait Islander groups to form corporations for any social or economic purpose.";
    var w17="Corporations Act";
    var def17="The Australian Securities and Investments Commission (ASIC) have laws that apply to corporations and these are found in the Corporations Act.";
    var w18="Cultural knowledge";
    var def18="Cultural knowledge is special information that is held by a particular cultural group, this could include technologies (e.g. special ways of using materials, making and using tools), stories, language and song, cultural rules, taboos, regulations and oral history.";
    var w19="Customer";
    var def19="The customer is someone who is buying something from a business.";
    var w20="Debt";
    var def20="Is something that you have to pay back. If you borrow 20 dollars you have a $20 debt.";
    var w21="Direct competitor";
    var def21="Is selling exactly the same thing as your business and competing for your customers.";
    var w22="Dividend";
    var def22="A dividend is money that is paid to shareholders regularly out of the company’s profits.";
    var w23="(Microsoft) Excel";
    var def23="Microsoft Excel is a computer program that lets you keep lists of numbers and also add up totals and do other sums to those numbers.";
    var w24="Fees";
    var def24="A fee is something that you have to pay, an expense.";
    var w25="Financial Management";
    var def25="Financial Management is the planning, organising, checking  and controlling of the income, expenses and Tax for a business.";
    var w26="Franchise";
    var def26="A franchise is a type of business you can buy. When you buy a franchise you set up the same type of business that has been successful somewhere else.";
    var w27="General ledger";
    var def27="A general ledger for a business is where all of the income and expenses for that business are kept in a document.";
    var w28="Goal";
    var def28="A goal is a target that you set yourself or your business.  Something that you want to achieve.";
    var w29="Growth opportunity";
    var def29="A growth opportunity is a chance for a business to get bigger.";
    var w30="GST";
    var def30="The Goods and Services Tax is paid when you buy things. Some items like food and medicine do not have the Goods and Services tax charged to them.";
    var w31="ICN";
    var def31="Indigenous Corporations Number is a special number given each indigenous corporation to identify it. No two indigenous corporations can have the same ICN.";
    var w32="Incorporate";
    var def32="Incorporate is what people do when they create a company or corporation.";
    var w33="Indirect competitor";
    var def33="An indirect competitor is selling a similar product or service to your business.  E.g. If you had a pizza shop, a fried chicken shop is an indirect competitor because it sells food and your customers might want to eat chicken instead of pizza.";
    var w34="Labour";
    var def34="Labour is all the work done by people (including you) in your business.";
    var w35="Legal name";
    var def35="Your Legal Name is the name that is on your Birth Certificate.";
    var w36="Legal protection";
    var def36="Legal protection means you are protected under the law from certain things happening.";
    var w37="Legal structure (business)";
    var def37="Legal structure is the type of business, sole trader, company, partnership.";
    var w38="Liability";
    var def38="A liability is something you are responsible for.";
    var w39="Licence";
    var def39="A license is proof that you have permission to do something.  For example, if you have a driving license you can drive a car.";
    var w40="Lodge";
    var def40="To lodge a form means to send it to where it has to go.";
    var w41="Manufacturing";
    var def41="A manufacturing business makes things.";
    var w42="Marketing budget";
    var def42="A marketing budget is the amount of money you have set aside for advertising and promotion for your business.";
    var w43="Minor criminal convictions";
    var def43="A minor criminal conviction is something small you have been in trouble over with the police.  Shop lifting is an example of a minor criminal conviction. ";
    var w44="MYOB";
    var def44="MYOB is financial management software for business.";
    var w45="Networks";
    var def45="A network for business is all of your contacts, customers and the people you know through doing business. ";
    var w46="Obligations";
    var def46="Obligations are things you are responsible for.";
    var w47="One off";
    var def47="A “one off” cost is something that only needs to be paid for once.";
    var w48="Operating budget";
    var def48="The Operating Budget is a record of the income and expenses of a business.";
    var w49="Overheads";
    var def49="Overheads are the expenses or costs in running your business, the things you have to pay for.";
    var w50="Partnership";
    var def50="A partnership is where two or more people own and run a business.";
    var w51="Permission";
    var def51="Permission is where you ask if you can do something.  If you ask and the person, group or council and they say yes, you have permission.";
    var w52="Permit";
    var def52="A permit is a special license or permission to do something";
    var w53="Personal assets";
    var def53="Personal assets are things that you own, like your car, house and furniture.";
    var w54="Personal protection";
    var def54="Being part of a company offers the shareholders some personal protection from legal and debt liabilities. This means that they have less responsibility than a Sole trader.";
    var w55="Photo identification";
    var def55="Photo Identification is a document that shows who you are and has your photo on it, like a Driver’s License, 18+ card or a passport.";
    var w56="Postal address";
    var def56="Your postal address is the address where you get your mail sent.  It might be different to the address where you live.";
    var w57="Pricing structure";
    var def57="Pricing structure is where prices for something can change depending on how much the customer orders.  The bigger the order the cheaper the price becomes.";
    var w58="Private";
    var def58="Private means not part of government.";
    var w59="Profitable";
    var def59="Profitable means that there is money left over after a business pays for all of its expenses out of the money it has made.";
    var w60="Promote";
    var def60="When you promote something you try to advertise or increase the amount of people who know about it.";
    var w61="Public liability insurance";
    var def61="Public Liability Insurance gives legal protection to the business owner against getting sued by a member of the public for things like injury or property damage. ";
    var w62="Quickbooks";
    var def62="Quickbooks is financial management software for business. ";
    var w63="Registered";
    var def63="Registered means that you have recorded your information on an official list.  You register your car to be able to drive it on the road.";
    var w64="Regulations";
    var def64="Regulations are rules or laws that control what you can and can’t do.";
    var w65="Retail";
    var def65="Retail is where things get sold in small amounts to customers.  Retail usually happens in a shop and the prices are higher.";
    var w66="Service";
    var def66="A Service business provides a service, like lawn mowing or accounting services.";
    var w67="Shareholders";
    var def67="Shareholders are people that own part of a company.";
    var w68="Sole trader";
    var def68="A sole trader is where one person owns and runs a business.";
    var w69="Start up budget";
    var def69="A Start Up Budget is the first Budget that gets done for a starting business and includes all of the costs involved in setting up the business.";
    var w70="strategy";
    var def70="A strategy in business is a plan of attack, or a plan of how to get something done.";
    var w71="system";
    var def71="A system is business is a set of detailed plans and rules for how to do something in your business.";
    var w72="Vision";
    var def72="Vision in business is being able to imagine and see something in the future.  To set up a new business you need to be able to see something new that wasn’t there before.";
    var w73="Wholesale";
    var def73="Wholesale is where things get sold in large amounts, usually for a cheaper price. The Wholesale price. A wholesaler is usually a big shed where goods are stored. Wholesale is not usually available to just anyone.";

    no, that's not a reason you would use a class file.
    anyway, your document class variables are defined on the main timeline so to reference them from any timeline you can use:
    MovieClip(root).w36;  // for example  (but it's really undesirable to have coding in more than one timeline)

  • Loading Variables in a Class Function

    I am having problems loading variables from an external text
    file inside of a class function. The text file has been created
    properly, and the code that I use in the class is as follows:
    _root.createEmptyMovieClip("texRules", -100);
    loadVariables("texRules.txt", _root.texRules);
    m_Rules = _root.texRules.rules;
    I create an empty movie clip on the root frame named
    texRules, load the variables into that movie clip with the next
    line and then set my member string value equal to the text file
    variable named rules. When I run the program, I get an undefined
    for my m_Rules.
    Here is my texRules.txt:
    rules=THESE ARE THE TEXAS HOLD'EM RULES.
    Any ideas as to what I am doing incorrectly?

    I've opted to use the LoadVars instead of creating an empty
    movie clip and loading the variables there. Here is my new code.
    public function setRules():Void
    var rulesLoader:LoadVars = new LoadVars();
    rulesLoader.onLoad = function (success:Boolean):Void
    if (success)
    trace(rulesLoader.rules);
    this.m_Rules = rulesLoader.rules;
    else
    trace( "Unable to load external file.");
    rulesLoader.load("texRules.txt");
    Here is where I define my properties of my class:
    class TexHoldem extends Game
    //Class member properties
    //Private Properties
    private var m_Rules:String;
    private var m_Target:MovieClip;
    Here is my constructor:
    public function TexHoldem(target)
    this.m_Target = target;
    super("Texas No Limit Hold'Em", 0, 1);
    setRules();
    The setRules function works fine, the only problem now is
    that I can't save the variables once the onLoad function goes out
    of scope. I've thought of modifying it so that it returns a type,
    but that seems difficult. The two easiest solutions I see is to
    create an empty text field that holds the string or find a way to
    get the rulesLoader.rules outside of the onLoad scope. Any
    suggestions now? Sorry to change the problem on you.

  • Select One Choice attribute' LoV based on two bind variables, best practice

    Hello there,
    I am in the process of learning the ADF 11g, I have following requirement,
    A page must contain a list of school names which is needed to be fetched based on two parameters, the parameters are student information been inserted in the previous page.
    I have defined a read only view "SchoolNamesViewRO", it's query depends on two bind variables :stdDegree and stdCateg.
    added that RO View as a view accessor to the entity to which the name attribute belongs, and then add LoV for the name attribute using the ReadOnly view,
    added the name attribute as Select One Choice to page2,
    and now I need to pass the values of the bind variables of the ReadOnly view,
    the information needed to be passed as the bind variables is inserted in the previous page, I could have the data as bindings attribute values in the page2 definition
    I have implemented the next two appraoches but both resulted in an empty list :
    * added ExecuteWithParams Action to the bindings of the page and then defined an Invoke Action (set refresh condition) in the executable s, set the default values of the parameters to be the attributes values' input value,
    in the trace I code see that the binding fetches correct values as supposed , but the select list appears empty, does the this execution for the query considered to be connected to the list ?
    * added a method to the ReadOnly view Imp java class to set the bind variables, then I define it as a MethodAction in the bindings , and then create an Invoke action for it , also the select is empty,
    if the query been executed with the passed variables, then why the list is empty? is it reading data from another place than the page!
    and what is the best practice to implement that requirement?
    would the solution be : by setting the default value of the bind variables to be some kind of Expression!
    please notice that query execution had the bound variables ( I see in the trace) are set to the correct values.
    would you give some hints or redirect me to a useful link,
    Thanks in advance
    Regards,

    please give me any example using backing bean .for example
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:selectOneChoice label="Label 1" id="soc1" binding="#{Af.l1}"
    autoSubmit="true">
    <af:selectItem label="A" value="1" id="si1"/>
    <af:selectItem label="B" value="2" id="si2"/>
    </af:selectOneChoice>
    <af:selectOneChoice label="Label 2" id="soc2" disabled="#{Af.l1=='2'}"
    partialTriggers="soc1">
    <af:selectItem label="C" value="3" id="si3"/>
    <af:selectItem label="D" value="4" id="si4"/>
    </af:selectOneChoice>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    package a;
    import oracle.adf.view.rich.component.rich.input.RichSelectOneChoice;
    public class A {
    private RichSelectOneChoice l1;
    public A() {
    public void setL1(RichSelectOneChoice l1) {
    this.l1 = l1;
    public RichSelectOneChoice getL1() {
    return l1;
    is there any mistake

  • Issue with Java Class based DataControls.

    Hi,
    I'm actually working with JDev 11.1.1.3.0.
    And we got a requirement to build a search page which should create a dynamic query. And we are not using ADF BC in this project.
    Instead, writing some ServiceDelegates(Java Classes) which internally calls EJB services to do CRUD operations.
    Finally, created DataControls using these Service Delegates to design UI.
    Now one thing is clear that .... we are using java class based service delegates.
    *Issues
    =======
    1. I have a table with 4 columns, in which 2 columns are of type selectOneChoice.
    2. Now, based on first selectOneChoice selection ... second selectOneChoice should display corresponding values. It is something like this. First select one choice contains all KEYS. Based on the KEY selection second select OneChoice should display VALUES corresponding to the KEY.
    3. I have around 20 KEYS in the first selectOneChoice.
    4. User can add rows to the table as many as they want.
    5. For each row, the first selectOneChoice is same(contains same keys).
    The issue is, For the first time(when user logs into the screen ....) the table will be displayed with one row which contains 2 selectOnechoices and 2 inputText boxes and a ADD button at the end of each row.
    1. User selected a KEY from first selectOneChoice. Hence, second selectOneChoice populates values corressponding to KEY. And user clicked on ADD button.
    2. Now the first row was like that only. And a new Row got added to the table.
    3. In the second row ... Now user selected a different KEY in first selectOneChoice. And the second selctOneChoice displayed values corresponding to KEY selected.
    4. This is also fine. But now, when user tried to click on ADD button to add THIRD ROW ... the table got added with a new row.
    5. Here is the problem.... From here onwards, whenever any new row get added to the table ... the first row's second selectOneChoice values are setting with values of second row's secondSelectOneChoice.
    6. Finally ... what i'm trying to do is, the second selectOneChoice should not get affected/refreshed because of adding a new row.
    If it is not clear ... please share your email address. I can share the sample code with you.
    This is an high priority task given to me.
    Please let me know your comments ASAP.
    Thanks & Regards,
    Kiran Konjeti

    You could try the following to see where the class was loaded from.
    System.out.println(ResourcesAndRatesForm.class.getProtectionDomain().getCodeSource());

  • Handling general errors via class based exceptions

    Fairly standard scenario: I've got this.
      DATA:  l_requester TYPE xubname.
      CALL FUNCTION 'ENQUEUE_EZMYTAB'
        EXPORTING
          username             = i_username
        EXCEPTIONS
          foreign_lock         = 1
          system_failure       = 2
          OTHERS               = 3.
      CASE sy-subrc.
        WHEN 1.
          l_requester = sy-msgv1.
          RAISE EXCEPTION TYPE zcx_my_exception EXPORTING textid   = zcx_my_exception=>lock_error
                                                          user     = i_username
                                                          lockedby = l_requester.
        WHEN 2.
          RAISE EXCEPTION TYPE zcx_my_exception.
      ENDCASE.
    But what I really want for WHEN 2 is the class based exception of
    MESSAGE sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1...
    I.e., in my calling code, I want to catch the exception, and display whatever the original error message was as generated by the ENQUEUE function module.
    I suppose I could do this
    DATA: ls_error TYPE scx_t100key.
    WHEN 2.
      ls_error-msgid = sy-msgid.
      ls_error-msgty = sy-msgty.
      ls_error-msgno = sy-msgno.
      RAISE EXCEPTION TYPE zcx_my_exception EXPORTING textid = ls_error
    but I can't help feel I'm missing something staggeringly obvious...
    matt

    Hi Matt,
    this may sound too simple:
    For me the real advantage of class-based-exception is that they can be raised in an inner block and caught in an outer block at any level.
    I never use the exception attributes to communicate any details, but use
    IF SY-SUBRC NE 0.
      MESSAGE sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1... INTO lv_string.
      Raise Exception type zcx_my_exception.
    ENDIF.
    Catching the exception I may (roughly) know where it comes from. As the message variables are present, I can check their values or repeat the MESSAGE without INTO. The main function of MESSAGE INTO is for transparency, the ability to see the whole message in debugger in lv_string and the where-used-list if message is created by programmer..
    If I really need different reaction for different SY-SUBRC ( = different untyped exception), I'd rather create different class-based exceptions. This helps transparency.
    In other oo language you do not have an ABAP message concept with everywhere-present message variables. Why use this crutch of putting the message variable filled by functions exception into exception object attributes only to convert them back to message output?
    I prefer [KISS|http://en.wikipedia.org/wiki/KISS_principle].
    Regards,
    Clemens

  • ENQUEUE and Class-based Exceptions

    Hi,
    If I use the ENQUEUE Function module in a method which also raises class-based exceptions, I'd like to be able to raise equivalent class-based exceptions which map to the standard ENQUEUE function module exceptions.
    Normally I'd simply propogate the FM exception by calling MESSAGE ... RAISING and then raise my own exception with the message that the ENQUEUE FM returned in sy-msg* etc.
    But you can't have normal exceptions and class-based ones in the same method interface. Does anyone know if there's a SAP standard CX exception which has all the same messages and parameters in it so that we can raise the relevant class-based exception in the method after an ENQUEUE fails?
    Thanks
    Paul

    Hello Paul,
    I am not sure whether I understand your problem correctly, so please excuse me if I am completely off track
    I assume you want to transport the information that is normally stored in sy-msg variables via class-based exceptions.
    If you define your own exceptions, you can add attributes to the exception class. Any attributes, basically. I did something along this line by adding all relevant fields (message class, type, number, the four variables) as attributes to my exception class. Then, if you raise an exception with RAISE EXCEPTION TYPE <yourExceptionClass> and you use, for example, drag-and-drop from SE80 or the pattern feature for that, in the EXPORTING part of the statement you can fill these fields. As they are public fields, any method catching your exception can look into these and figure out what went wrong with the ENQUEUE.
    Hope this helps (if I understood your question right)
    Joerg

  • Accesing externally loaded variables

    i would greatly appreciate a pointer or two as i am having a
    painful transition to AS2.0
    an 8k zip test is at: www.cyan-animatica.com/v2/exttest.zip
    //(wasn`t there an option back in macromedia days to attach a
    file?)
    i am having a poblem accesing externally loaded variables :
    A.--------------------------------------------------------------------
    the external .txt has folowing content:
    &a1_0=hello&a1_1=bye&a1_2=whatever
    B.--------------------------------------------------------------------
    loaded on the first frame thus:
    var thumbs:LoadVars = new LoadVars();
    thumbs.onLoad = function(success:Boolean):Void {
    if (success) {
    trace("LoadVars loaded successfully: "+this.loaded);
    } else {
    trace("Error");
    thumbs.load("my_externals.txt");
    C.--------------------------------------------------------------------
    if want to access one of 3 loaded variable hardcoding, this
    works just fine:
    trace(_root.thumbs.a1_1) //bye
    BUT i need to do this based on the mc/buton name that calls
    it:
    on (press) {
    var kk:String = _name;
    trace(_root.thumbs.kk);
    i get UNDEFINED...obviously i am mixing datatypes if not
    worse
    pc win 2000
    flash prof for flash8 player[

    thanks for a prompt reply, blemmo.
    you write:<<to ADD vars to the LoadVars object, it has
    to be referenced correctly
    what i want to do is READ vars from LoadVars object and
    referencing is exactly what is killing me
    sorry bout the lack of clarity. the zip would help
    (www.cyan-animatica.com/v2/exttest.zip)
    i am loading 3 variables into an object var thumbs:LoadVars
    from one external .txt file:
    a1_0=hello
    a1_1=bye
    a1_2=whatever
    i want to see the contens of let us say the second variable
    trace(_root.thumbs.a1_1);
    produces bye , perfectly - this is exactly what i want, but i
    want it based on a constructed reference
    so, i have button in an mc named "a1_1", the button script
    is:
    on (press) {
    var kk:String = _name;
    trace(kk); // produces a1_1
    trace(_root.thumbs.kk); //this should be same as
    _root.thumbs.a1_1 and produce the same result, but does not
    i suspect that the problem is that kk is declared as string
    datatype, but no matter what i do i cannot get a result
    thanks for your help

  • Get data in a subreport based on a shared variable from the main report.

    Goodd morning,
    My question/problem is how to manage this scenario.
    I am transfering 2 shared variables (pereiod from /period To, ) from the main report to a subreport and now  i would like to get data in this subreport based on these 2 variables...
    The problem is that i can not find the shared one in select expert icon...
    Could anyone point me to solve this issue?
    Thks for any help.
    Jose Marin
    Crystal Report XI SR3

    Hello Jos,
    I recommend to post this query to the [Crystal Reports Design|SAP Crystal Reports; forum.
    This forum is dedicated to topics related to the creation and design of Crystal Report documents. This includes topics such as database connectivity, parameters and parameter prompting, report formulas, record selection formulas, charting, sorting, grouping, totaling, printing, and exporting but also installation and registering.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all Crystal Reports Design queries remain in one place and thus can be easily searched in one place.
    Best regards,
    Falk

  • ABAP OO Exception Class based processing

    Hi there,
    Note: In going forward with SAP WAS 6.20, one can handle exceptions using exception-class based handling using RAISE EXCEPTION TYPE abc and then CATCHing it in TRY/ ENDTRY block. Standard method like GET_TEXT can be used to get the text of the exception raised.
    Question: If I know the EXCEPTION CLASS and Exception ID of my exception class, is it possible to get the exception text directly from the repository without creating the exception class object?
    E.g. Exception class is CX_MY_SECRET_ID
    and Exception IDs for this class are
    ID_NOT_FOUND,
    ID_EXPIRED,
    ID_IS_FOR_SPECIAL_ACCESS
    E.g. last two exception IDs are my warning conditions, and if such conditions are encountered, all I want to do is collect the warning messages. Whereas first exception ID condition (i.e. ID_NOT_FOUND) is an error for me, in which I have pass the exception back to the calling program. E.g. the source code is like this:
    PERFORM.......
    If ID is not found
       RAISE EXCEPTION TYPE ZCX_MY_SECRET_ID
               EXPORTING TEXT_ID = 'ID_NOT_FOUND'.
    else if ID has expired
       ...... then do I have to first raise the exception like raised above and CATCH it before I can get its text? or can I get the exception text directly without raising the exception first (as I know i have to retrieve the text of ZCX_MY_SECRET_ID exception class for Exception ID ID_EXPIRED)?
    In other words, if a certain condition is warning for my program, can I get the condition for that exception (from exception class based on exception class name and exception ID), or do I have to RAISE it first explicitely and then CATCH it immediately and execute GET_TEXT to get its text?
    Thanks very much!

    Hello Chetan,
    in basic the raise exception type xxx creates an exception object and aborts normal execution continuing in the enclosing try block.
    The Abap runtime contains some optimizations regarding the try block has an 'into xxx' clause. But as long you use the same exception you cant take benefit from this.
    As far I understand your problem you have two different kind of severities. So I would use 2 differnt exception classes (maybe derived from a common parent type, or one from the other).
    So both the code which throws the exception and the one which catches it are aware of the different semantic.
    Kind Regards
    Klaus

  • Delivery split for STO based on Material Loading Group

    Hello, I want to split the Delivery created from STO based on material loading group. I checked SAP Note:166397 and it requires copying routine. But this solution is not accepted and looking for other solutions. Please help with any user-exit or badi which can solve the purpose. Delivery needs to be created from VL10B transaction.
    Edited by: ananthula sumanth on Aug 6, 2010 9:12 AM

    The copy routine is designed for this purpose - it's not clear why the client does not allow the use of it. In my opinion you should find the root casue of their resistance and offer an acceptable solution (if it is possible).
    If you want to solve it in another way I guess you should go into a big development and develop your own copy routine functionality which could mean much more work (for you) and money (of your client) - instread of modifying a copy routine (maybe within few minutes).

  • How to store a class-based exception as container element?

    Hello,
    In a BO type method, there are situations where unexpected class-based exceptions can occur, I handle them with TRY ... CATCH ... ENDTRY.
    If such an error occurs, my BO type method also returns a BO type method exception using a return code (as usually).
    1) Now, my question is how can I store the exception instance in the task container ? (so that to get more information about what happened... it is an unexpected error as I said)
    Note that my question may apply to any class instance.
    2) To achieve this, I have an idea but not sure if it's realistic (maybe the question is not realistic too ). I'll create a new BO type ZOOINSTANC with string attribute containing the serialized instance, with a method to display it.
    Example how it could work, in my BO type method (it returns EXCEPTION parameter of type ZOOINSTANC):
    TRY.
      CATCH cx_root INTO lo_exc.
        DATA l_exc TYPE string.
        CALL TRANSFORMATION id
            SOURCE oo = lo_exc
            RESULT XML l_exc.
        DATA l_bor_zooinstanc TYPE swc_object.
        swc_create_object l_bor_zooinstanc 'ZOOINSTANC' ''. "no key
        swc_set_property l_bor_zooinstanc l_exc.
        swc_set_element container 'EXCEPTION' l_exc.
        exit_return 1001 '' '' '' ''.
    ENDTRY.
    One important issue is that I don't know any API to display the instance :-p
    Do you have any ideas, advices, ... ?
    Thx
    sandra

    Hi Mike, thank you for your answer, and sorry for the delay.
    > I'd rather go with the idea of returning the error details in a structured format that you can view in the container
    Yes, but that's the issue as I don't know which exceptions can be triggered, as I'd like to handle all exceptions.
    > I'd also ask why it's necessary to use BOR for this?
    When a BOR method fails, I want technical support to have all the details of the error, not only a generic error message. It's why I want to store the exception in the workitem container, and be able to display it later.
    > It's obviously your own development, so why not use classes. Subclasses of CX_BO_ERROR are recognised by workflow and you can even  bring a proper message back to the WF log. There's also some info on this in the second edition of the WF book.
    I did a test using demo workflow WS56400159 ("absence"), where I forced CX_BO_ERROR right after SWX_FORMABS_CREATE call in CL_SWF_FORMABSENC / CREATE method, but it seems that only the short text of the exception is kept.
    So, I'm a little disappointed to see that we have a great exception "tool" with class-based exceptions, but only the last text is kept in the system! That would have been great to be able to store the whole information (the attributes, and the whole bunch of cascading exceptions (PREVIOUS attribute), instead of only a simple text).
    sandra

  • Working with class based exception and dynamic method calls

    Hi Gurus,
    we just changed out ERP from EHP6 to EHP7.
    Since we did so we are facing an issue with an Z-Report we are using quite often.
    This reports looks up Workitems and executes the according methods so that we can go into debugging if we were facing any problems or errors.
    since the EHP Upgrade this statement has problems:
      data:        lt_parmbind   type abap_parmbind_tab,         lt_excpbind   type abap_excpbind_tab,         lo_runtime    type ref to object.     call method lo_runtime->(iv_cls_method)       parameter-table       lt_parmbind       exception-table       lt_excpbind.this CALL METHOD Statement has Problem with the Exception Table. We are quite often getting DYN_CALL_METH_EXCP_NOT_FOUND short dumps with Exception "CX_SY_DYN_CALL_EXCP_NOT_FOUND".
    The system has problems handling the content of lt_excpbind. if i clear this table the CALL METHOD statement works fine.
    AS an example we are trying to call /IDXGC/CL_PD_PROCESS_STEPS-->CREATE_DATA. This method has 2 exceptions
    /IDXGC/CX_PROCESS_ERROR
    Process Layer Exception
    CX_BO_TEMPORARY
    Temporary Business Exception
    The Content of LT_EXCPBIND is
    INDEX
    NAME
    VALUE
    2
    /IDXGC/CX_PROCESS_ERROR
    1
    2
    CX_BO_TEMPORARY
    2
    From my point of view the Problem ist, that they are marked as "class based". I think so because if you looked up the SAP Help for the EXCEPTION-TABLE Statement it is written that is statement only works for none-classbased exception.
    I think that restriction is quiet clear. But what i am wondering about is.. that restriction also exists for EHP6. And in EHP6 it work. Does anyone know why? Or how i can change me CALL METHOD Statement that i will work again?
    Best Regards
    Udo

    Class-based exceptions must be caught using try/catch statement.
    Calling dynamically a method catchable exceptions are:
    CX_SY_DYN_CALL_EXCP_NOT_FOUND
    CX_SY_DYN_CALL_ILLEGAL_CLASS 
    CX_SY_DYN_CALL_ILLEGAL_METHOD
    CX_SY_DYN_CALL_PARAM_MISSING 
    CX_SY_DYN_CALL_PARAM_NOT_FOUND 
    CX_SY_REF_IS_INITIAL
    Anyway catching cx_root (as shown by Matthias) will catch everything is catchable.

  • How to load variables from a .txt file

    Hi.
    I usually make a flash aplication in colaboration with a php
    programmer. But i want to test my swfs without having to wait for
    him. So i want to do that through a text file. I know that flash
    can load variables from text files. The problem is i don't know how
    to format the text file ( example.txt).
    Thank you

    Here's a couple of ideas.
    First you probably want to change what you have...and put
    your 'if (pVar==1' etc inside a separate function and call it from
    the onLoad handler after you have assigned the value to pVar...
    because the onLoad will run at some unknown point in time after
    loading has finished (actually in the test environment this might
    work... but that wouldn't be the same as what happens in a
    production setting).
    To create test files for loadvars... simply create a new as2
    file and put this code on the first frame and test movie:

  • The MBean class could not be loaded by the default loader repositor

    Im trying to register a custom MBean to WebLogic 8.1 Sp5 Application Server but i get this error :
    The MBean class could not be loaded by the default loader repository .
    i have make a servelt that registers the Managed Bean i added the MBean jar file to the WAR file of the servelt and I added the Mbean jar file to the CLASSPATH in setEnv.cmd for the domain
    the code for the servlet is this :
    try
    Hashtable props = new Hashtable();
    props.put( Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory" );
    props.put( Context.PROVIDER_URL, "t3://naiden:7001" );
    props.put( Context.SECURITY_PRINCIPAL, "admin" );
    props.put( Context.SECURITY_CREDENTIALS, "secret:)" );
    InitialContext ctx = new InitialContext( props );
    mbeanServer = ( MBeanServer )
    ctx.lookup( "weblogic.management.server" );
    logger.debug( "domain name e " + mbeanServer.getDefaultDomain() );
    catch( NamingException ne )
    error=ne.getMessage();
    logger.debug( ne.getMessage() );
    try {
    ObjectName objName = new ObjectName("isy:Name=NaidenStandardMBean");
    mbeanServer.createMBean("samplembean.Standard", objName);
    catch( MalformedObjectNameException ex )
    }

    You should use jre 1.5 or 1.6 for migmon from 7.10. It looks like your jre is 1.4.

Maybe you are looking for

  • Creation of Excise Invoice

    Hi, Can anybody give steps in detail to create an excise invoice. chan

  • Load balancing and High Availability topology

    Our Forms 6i client-server application currently runs on Citrix farm of 20 Windows 2000 boxes (IBM Blade Servers 2 CPU and 2 Gig Memory). Application supports 2000 users. We are moving to AS 10g r2, forms 10g and the goal is to use same hardware, 20

  • SLI Video Cards

    Is there anyway to see if my two video cards have SLI enabled without opening up the case?

  • Quick question about null terminator string!

    Hello, I always feel that a char array should end with a "\0". But just to clear up something here, if I do: char *a[10]; and I fill out the array with 10 characters, then, should we *always* append the "\0" at the end of this array? And if so, shoul

  • "No subtransaction type allowed for this invoice"

    Dear Gurus While creating excise invoice (j1iin) from billing I am getting an error "No subtransaction type allowed for this invoice" . I get this error when I try to save the excise invoice. I am using subtransaction type. The required config for su