Reflection like mechanism in ABAP?

Hello Experts,
I'm looking for a mechanism in ABAP which will allow me to create an instance of a class which is known only at runtime, much like the reflection mechanism in Java.
The reason I need this is that I'm writing a generic code for a factory method which needs to instantiate a concrete class which is known only at runtime, and could be possibly extended later on.
So far the only thing that comes close is the statement
CREATE OBJECT oref TYPE classname.
The problem is that when using this statement "classname" should be an existing class. In the solution I'm looking for, "classname" is known only at runtime, and may not exist in the specific landscape (in which case I'd like to get an exception that the class does not exist).
Thanks in advance for your help,
Idan

Looking for something like this:
DATA: gv_classname TYPE seoclsname.
DATA: gob_object TYPE REF TO object.
DATA: gr_error TYPE REF TO cx_dynamic_check.
DATA: gv_message TYPE string.
gv_classname = 'CL_GUI_ALV_GRID'.
TRY .
    CREATE OBJECT gob_object TYPE (gv_classname).
  CATCH cx_sy_create_object_error INTO gr_error.
    gv_message = gr_error->get_text( ).
    WRITE :/1 gv_message.
  CATCH cx_sy_dyn_call_param_missing INTO gr_error.
    gv_message = gr_error->get_text( ).
    WRITE :/1 gv_message.
ENDTRY.
The problem would be to determine, like in this case, the obligatory parameters upon creating the object.

Similar Messages

  • Java conversion for xkwert like komv-kwert ABAP filed

    Hi all,
    I am in process of converting the ABAP routines present in ECC into user exists in CRM.
    I am stuck up at a point wherein i am unable to find the java conversion for xkwert like komv-kwert abap field. If anyone has an idea on what exactly is the java conversion for the above field then please reply.
    Thanks In Advance,
    Vipin.

    vipin,
    I think this is condition value(komv-kwert ) , to get the condition value you can use the following method in java.
    pricingConditon.getConditionValue().
    Thanks and Regards
    shanto aloor

  • T-code or Table to find total errors in SAP APO like ST22 in ABAP

    hi all,
    Could please tell me the T-code or Table to find total errors in SAP APO like ST22 t-code in SAP ABAP.
    Thanks.
    Suryam S

    Hello Venu,
    Do you mean other functional errors?
    You can check SLG1, /SAPAPO/C3, STAD
    Best Regards,
    R.Brahmankar

  • Install Trial BO like SAP Netweaver ABAP Trial version

    Hello, i would like to know if it´s possible to install some trial Version of BO in orther to install it in my laptop like i´ve just done with the SAP Netweaver ABAP Trial Version 701 (With SAP-BW 70).
    I know that that there are some links to download BO software but i really don´t know where to start and if there is any problem with the installation on my laptop with MaxDB ans SAP server installed... basically i have installed SAP with BW in my laptop and it´s working ok. Wich software may i install and wich are the requirements if i want to practice with BO ?
    I´ve just downloaded BO from the following link but it´s the correct one ?
    http://www.businessobjects.com/forms/datasave.asp?id=701600000008kgy
    Besides this i´ve just found another one
    https://www.sdn.sap.com/irj/boc/business-objects-for-sap?rid=/webcontent/uuid/806c9894-42a5-2b10-648a-d900489b76da
    Wich one i have to install ? it´s the same ? it works with OS XP-Pro ? anything else to install ?
    Thanks in advance,
    Best regards,
    Joaquin Casas

    Hi,
    this should get you started:
    Install Part #1
    /people/ingo.hilgefort/blog/2008/09/17/businessobjects-and-sap--installation-and-configuration-part-1-of-4
    Install Part #2
    /people/ingo.hilgefort/blog/2008/09/17/businessobjects-and-sap--installation-and-configuration-part-2-of-4
    Install Part #3
    /people/ingo.hilgefort/blog/2008/09/17/businessobjects-and-sap--installation-and-configuration-part-3-of-4
    Install Part #4
    /people/ingo.hilgefort/blog/2008/09/17/businessobjects-and-sap--installation-and-configuration-part-4-of-4
    SAP Authentication
    /people/ingo.hilgefort/blog/2008/09/19/businessobjects-and-sap--configure-sap-authentication
    Publishing part 1
    /people/ingo.hilgefort/blog/2008/09/23/businessobjects-and-sap--publishing-of-crystal-reports-part-1-of-3
    Publishing part 2
    /people/ingo.hilgefort/blog/2008/09/24/businessobjects-and-sap--publishing-of-crystal-reports-part-2-of-3
    Publishing part 3
    /people/ingo.hilgefort/blog/2008/09/24/businessobjects-and-sap--publishing-of-crystal-reports-part-3-of-3
    XC, CR and LO Part 1 of 4
    /people/ingo.hilgefort/blog/2008/10/03/businessobjects-and-sap-part-1-of-4--creating-a-xcelsius-dashboard-on-top-of-sap-bi
    XC, CR and LO Part 2 of 4
    /people/ingo.hilgefort/blog/2008/10/07/businessobjects-and-sap-part-2-of-4--creating-a-xcelsius-dashboard-on-top-of-sap-bi
    XC, CR and LO Part 3 of 4
    /people/ingo.hilgefort/blog/2008/10/07/businessobjects-and-sap-part-3-of-4--creating-a-xcelsius-dashboard-on-top-of-sap-bi
    XC, CR and LO Part 4 of 4
    /people/ingo.hilgefort/blog/2008/10/10/businessobjects-and-sap-part-4-of-4--creating-a-xcelsius-dashboard-on-top-of-sap-bi
    Technical Material
    /people/ingo.hilgefort/blog/2008/11/19/businessobjects-integration-with-sap-netweaver-bi--technical-material
    In regards to the supported platforms look at http://service.sap.com/bosap-support
    Ingo

  • How to implementing locking mechanism in abap?

    Hi
         my program run by different users. I want
         to ensure that at a particular point of time only
         one instance of my program running, and all others
         should be in wait.
         if have a solution for this. i can make use of a flag
         (global flag ) i set/get this flag from import/export
         mechanism. for example.
         do.
         import v_flag = v_flag from MEMORY id 'ZFLAG'.
         if v_flag is initial.
             v_flag = '1'.
             export v_flag to memory id 'ZFLAG'.
             exit.
         endif.  
         enddo.
         ***Rest of the program main code****
         clear v_flag.
         export v_flag to memory id 'ZFLAG'.
         is this ok? or any other locking mechanism supported
         by abap.
    Regards,
    Abhimanyu.L

    Hi
    Check the following,
    http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/aa/fd823730fa874ae10000009b38f8cf/content.htm
    http://www.sapdb.org/7.4/htmhelp/7d/75d34a6a210b4b95f232e5f9acd232/content.htm
    http://www.sapdb.org/7.4/htmhelp/6e/ab5d79286b3d4a9f72ef140191d208/content.htm
    http://sapdb.net/7.4/htmhelp/43/151d12671a2240947990c5152a4bbd/content.htm
    Please reward if it helps.

  • RPM Portal - not reflecting - change in WD Abap structure

    Hello,
    I am Abap developer and know very few things about portal.
    Recently changed a struture(enlarged two fields from INT1 to INT2) in WD ABAP.
    The problem is change is not reflected in RPM Portal.
    My questions :
    1.How to find from which struture the portal fetches the value ?
    2.New error is displayed on an other field in the same structure which was modified.
        Type conversion error, field ZZRPM_INV_MAK,complex type class
        com.sap.xapps.cprxrpm.model__Rpm_Ts_Item_D_Api.
    Solution is quite urgent.
    Thank you

    It was resolved after restart of Portal server.

  • Editable ALV's in WD4A (Like in Straight ABAP OO)

    Last year I had to master ABAP OO editable ALV's to put one in a MIGO dialog process exit.  The editable ALV class methods are pretty cool and do a lot of the work for you.
    So while in NET310 this week, I was looking at all the SAP-provided WD4A ALV components (demo, test, etc) and I didn't see one dealing with editable ALV's.
    Am I correct in assuming that this "editable ALV" functionality is not in WD4A yet?
    Or is it buried in SALV_WD methods that no one has bothered to put in a demo or tutorial?

    Hello David,
    I have these, too.
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/101df93f-4b5c-2910-14aa-9eb0338c2110],
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1] and
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/63a47dd9-0b01-0010-3d8e-de27242bf011].
    Regards,

  • How to implement bundle-like mechanism in Arch Linux

    I like Chakra's bundle system and I want to make it in Arch.
    I heard that bundle system is just a separate file system(like loop? I am not sure).
    Can you give some details?
    However, I think there must be some reasons that Arch does not implement such a convenient tool as bundle system.
    I want to hear about these reasons.
    Thank you.

    If you go back more in the history behind Chakra, how it came to live, you might know, it started bc of a desire to do another split.  That one was for KDE, resulting in KDEmod, which was fully accepted by Arch, a few years after, and is currently the way KDE is build in Arch too (KDE being split in multiple packages).
    While Chakra was just Arch + KDEmod, more and more users stated, there was a desire to split toolkits too.  Have a system that was either based on GTK, and for Chakra users, a system base on just Qt/KDE.  When the late Chakra founder Jan Mette called the meeting in February 2010 the discuss the plans for a full split from Arch, this desire expressed by many users was one of the driving factors for his decision.
    To have a fully functioning distro, and doing something this different, the discussion included finding some MacOS way of including some of the most well known, and revered Linux apps, that were GTK based.  That is how the idea of bundles came to fruit.
    At the start, a few hundred packages had either makedeps  or full dependency to gtk2, so it was left up to the user to install those apps, though the ISO's were gtk free.
    Once the bundles became more functional, and included all those most well known and revered Linux apps, the majority of the gtk apps were removed (slowly) from all repo's.  Plus in the good 2 years since, many apps/libs have been stripped of gtk, since many apps are build to function on both gtk and qt based systems, though they do not need the gtk libs at all to work just fine on a qt based system.  To remove gtk libs/functions from one app, makes very little difference, for ten, it is not a big difference, but you repeat it over a hundred times.....
    GTK is still in the repo's, and probably will stay there.  Users who do not want to stay gtk free have added many such apps in ccr, and as a service to them, it is nice to not have to compile gtk.  Plus there is no real solid substitute yet for flash, again as a service, it is still an option.  The bundle buildsystem also draws from the repo's, if a certain lib/app is set to draw from there during the bundle process, that is another reason gtk/gtk-apps are still in the repo's.
    As Allan states, downloading multiple bundles, will download multiple instance of a highly compressed gtk (or other lib/app).  This is ofc a draw back for bundles, but again, a well thought out, and chosen draw back.  Users who need more then 4-5 bundles, should really rethink using a distro that made the choice to see if a distro can be fully functional, when splitting toolkits.  Those users can install their needed apps from ccr, or perhaps should choose another distro.  But to have an application not needing a rebuild/break bc of a .so update is a big plus.  When libreoffice was not stripped of it's gtk deps, it was one of those bundles.  It included all, and one such bundle still runs perfectly on one of my installs, it was build February 2011 (granted, I'm using this one as a test case for bundle longevity).
    For those who do not need but 3-5 bundles, there is no gtk installed (takes more room, then downloading it in compressed form a few times).  And many bundles do contain more then one gtk app (GIMP bundle includes xsane for example, chromium includes flash, google-talkplugin, pdf plugin), so as an example in my case, I run one bundle almost all the time, and it brings me the only 3 gtk apps I need and I my installs are gtk free.  Btw, all bundled browser include the flashplugin.
    But bundles are not just for gtk, Skype is another example for bundle use.  This app brings in about 50 lib32 packages, if you are on x86_64, why install all those for just one app?  Some will state, it makes no difference, don't care to have a lot of extra libs installed, some will prefer to keep a more "clean" system.  Chakra goes with the latter.
    Since the bundle process can draw from the repo's, or build all needed packages in that system, in any setting chosen, any security update is no extra work, then any other rebuild.  That security update was either done in the regular repo's, all needed then is rebundle all included apps (the final bundle process, squash them, etc, takes about 40 secs), or if the apps is not in the repo's, just that one is rebuild/adjusted in the bundle system, and again, bundled with the rest of the existing packages included in that particular bundle.
    To address as a final note, the point made, you can't be bleeding edge bc of bundles.  I'll give the example of the gimp-dev bundle.  It needed the latest babl, gegl, much newer glib2, gtk2 (and more from that stack) then was in the repo's.  All those were updated in the bundle system (though not a visible repo, the bundle build system has some 200-250 packages at most times), tested and ran successfully for many users, and always making the latest dev version available for gimp, until the final release this week.  Since all glib2 updates were tested in this bundle for quite some time, when it was time for this update in the regular repo's, it was a simple and quick update for the whole stack.
    Bundles are not perfect at this stage, far from it, there are still many plans to improve on the whole system, but for something that is in use just 1 1/2 years, it truly is a viable option to have a system running on a single tooolkit.
    To address a question posted while writing this.  Chakra uses testing repo's a lot too.  Bundles are fully rolling, always the latest available, just like the apps and games repo in Chakra.
    Last edited by abveritas (2012-05-04 18:17:43)

  • Query Customization Not Reflecting in POWL WD ABAP

    Hello All,
    We are customizing Powl in MSS for CATS and Leave Management. Changes done in POWL_QUERY are not reflecting in POWL Application.
    In MSS we have done following customization in POWL:
    We are using query MSS_POWL_CATS_APPROVAL_1 for CATS approval and we are enabling search criteria through query parameters by
    ticking search checkbox. We have also cleared powl cache by running POWL_D01.
      2.  Changes done in Powl_Query transaction are not getting reflected in Powl Application.
    We have changed the Admin layout in leave approval query MSS_POWL_LEA_APPROVAL using configuration mode ( sap-config-mode
    = config ) in layout variant and assigned a new layout to leave approval and cleared cache (POWL_D01 report) but still changes are not reflected in POWL.
    Looking forward for your support. Any help will be highly appreciated
    Regards,
    Nishant Gaur

    Hi.
    Please try.
    SQ01
    Input query ID.
    menu-Query-More functions-Generate program

  • A  trigger or trigger like mechanism for the following...

    Hello.
    I'm wondering if there is a way to fire off a user-defined procedure anytime a user in a session does a rollback or a commit, regardless of the the table? So I'm thinking along the lines of a trigger or perhaps an audit feature?
    Is there anything?
    thanks.

    What is the business rule you're trying to code? What would the procedure do when a transaction ended?
    Given that you may have explicit rollback & commit calls, separate autonomous transactions, implicit commits when DDL is executed, implicit statement-level rollbacks for certain exceptions, partial transaction rollbacks to a savepoint, etc., I'm not sure what this could hope to accomplish.
    Justin

  • Error while usinjg the JDBC to ABAP Proxy Scenario

    Hello Rocks,
    This is my scenario like JDBC --- Pi --- ABAP Proxy
    while i am given a sender side jdbc XSD structure is like this
    VWENTITYAGGREMENT
      Row             1-unbound  occurence
          POOL_ID   0-1 occurence
          CUST_ID
          AGREEMENT
           PRODUCT_ID
            CONTRACT_TYPE
            CONTRACT_TYPE_DESCR
            AGRMNT_STATUS
            STATUS_DESCR
              EFFDT
             TERMINATION_DT
             ADD_DT
             ADD_TM
    while i am writing a select query in Sender JDBC CC is like this
    SELECT POOL_ID,CUST_ID,AGREEMENT,PRODUCT_ID,CONTRACT_TYPE,CONTRACT_TYPE_DESCR,AGRMNT_STATUS,STATUS_DESCR,EFFDT,TERMINATION_DT,ADD_DT,ADD_TM FROM vwEntityAgreement.
    Here i am getting this Error message like this :
    Error Description: Database-level error reported by JDBC driver while executing statement 'SELECT POOL_ID,CUST_ID,AGREEMENT,PRODUCT_ID,CONTRACT_TYPE,CONTRACT_TYPE_DESCR,AGRMNT_STATUS,STATUS_DESCR,EFFDT,TERMINATION_DT,ADD_DT,ADD_TM FROM vwEntityAgreement'. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'POOL_ID'.'. For details, contact your database server vendor.
    So please give me your valuable inputs !
    Regards,
    Ravi.

    Invalid column name 'POOL_ID'.'. For details, contact your database server vendor.
    Did you confirmed the name POOL_ID as suggested?
    Why is the tablename different (check the case) in the query that you make and in the XSD structure that you mentioned......check if this is causing the problem.
    Regards,
    Abhishek.
    Edited by: abhishek salvi on Jun 4, 2010 10:24 AM

  • How to create relationship to call PO13 in ABAP program.

    Hi,
    Could anybody help me how to create relationship (like PO13) in abap program. Do we have any Function modules or any other way?
    Regards,
    Ram.

    Hi,
    You can use function module RH_INSERT_INFTY. There are plenty of threads of the forum on how to use it.
    Donnie

  • ABAP-Proxy to SOAP: Error in SOAP Adapter

    Hi!
    I would like to implement ABAP-Proxy to SOAP scenario.
    Unfortunately my SOAP receiver channnel has the following error:
    SOAP: call failed: java.io.IOException: No SOAP Envelope but 1 definitions; HTTP 200 OK
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: No SOAP Envelope but 1 definitions; HTTP 200 OK: java.io.IOException: No SOAP Envelope but 1 definitions; HTTP 200 OK
    Furthermore the call of  /sap/bc/soap/rfc of business system B is erroneous
    http://<server system B>:8000/sap/bc/soap/rfc
    Here I get the error: HTTP 500 Internal Server error
    Can some one help me to solve this problem?
    Thank you very much!
    regards
    Holger

    Hi,
    Are you using the webservice exposed by SAP or it is third party webservice. Can you explain your complete scenario? What is the url you have given in your receiver SOAP Channel? Was that no configured earlier?
    If at all you are using the SAP webservice, the wsdl link should be.
    http://<server>:<http port>/sap/bc/soap/wsdl11?services=BAPI_MATERIAL_EXISTENCECHECK&sap-client=200
    The target url you will be able to see in the wsdl itself also
    amit

  • FAQ's, intros and memorable discussions in the ABAP Objects Forum

    Welcome to the SDN ABAP Objects Forum!
    In addition to release dependent information avalaible by:
    - pressing the F1 key on an ABAP statement,
    - or searching for them in transaction ABAPDOCU,
    - using the [SDN ABAP Development Forum Search|https://www.sdn.sap.com/irj/sdn/directforumsearch?threadid=&q=&objid=c42&daterange=all&numresults=15&rankby=10001],
    - the information accessible via the [SDN ABAP Main Wiki|https://wiki.sdn.sap.com/wiki/display/ABAP],
    - the [SAP Service Marketplace|http://service.sap.com] and see [SAP Note 192194|https://service.sap.com/sap/support/notes/192194] for search tips,
    - the 3 part [How to write guru ABAP code series|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f2dac69e-0e01-0010-e2b6-81c1e8e5ce50] ... (use the search to easily find the other 2 documents...)
    ... this "sticky post" lists some threads from the ABAP forums as:
    - An introduction for new members / visitors on topics discussed in threads,
    - An introduction to how the forums are used and the quality expected,
    - A collection of some threads which provided usefull answers to questions which are frequently asked, and,
    - A collection of some memorable threads if you feel like reading some ABAP related material.
    The listed threads will be enhanced from time to time. Please feel welcome to post to [this thread|Suggestions thread for ABAP FAQ sticky; to suggest any additional inclusions.
    Note: When asking a question in the forum, please also provide sufficient information such that the question can be answered usefully, do not repeat interview-type questions, and once closed please indicate which solution was usefull - to help others who search for it.
    ABAP Objects
    About polymorphism - still not sure after searching... => Polymorphism adaptation with referencing the source, and a Guest who did not...

    Obsolete ABAP Statements from 2004s - what about your existing code-base?  A great discussion about the changes in syntax checking between 46c and basis release 7.0.

  • Execute ABAP Code Inspector from Outside of SAP

    Hi all...
    For reporting purpose, I would like to use ABAP Code Inspector (transaction SCI) for generating output as a file, it should call from outside of SAP through RFC function module and generate the list (output) as flat file (or XML), does anyone have been done with similar work like this? I wonder if you could share your experience with me...
    thanks in advance,
    yayan irianto.

    I managed to set up the variant, however found a problem.
    I used "Search ABAP Statement Patterns" under "Search Functs" and set the pattern like followings.
    SELECT + INTO *
    SELECT SINGLE + INTO *
    However following statements were detected.
    SELECT * INTO TABLE IT_DRAW FROM DRAW.
    SELECT MANDT INTO TABLE IT_DRAW FROM DRAW.
    SELECT SINGLE * INTO TABLE IT_DRAW FROM DRAW.
    SELECT SINGLE MANDT INTO TABLE IT_DRAW FROM DRAW.
    It's because + means one ABAP token in the code inspector.
    Is there anyway to find only "SELECT SINGLE *" and "SELECT *" ?

Maybe you are looking for

  • Character error

    Hi! We have a strange error on our webshop engined by J2EE 620, B2B configured, SAP CRM. All swedish 'å' (å) becomes # ONLY in the hungarian version (variant) We have no encoding settings in the configured part of the jsp files, all encoding comes fr

  • My HP OfficeJet 6600 won't scan and email. It used to do it

    Explain how to get my HP OfficeJet 6600 to scan & email. I keep getting error messaage that the device is not attached. But it used to scan & email  fine prior. All of a sudden it stopped working.

  • How to re download my purchases on a new harddrive

    i just reformatted my hard drive and i need to redownload my purchases how do i do that? what back up??

  • Problem with my 9550

    Hi all! I have 9550 Storm2  Verizon Unlocked phone. After updating OS i got the unsolvable problem. The screen is black, any update/downgrade operations will not solve the problem. Any solutions? Solved! Go to Solution.

  • How to add more than 1 External Editor to Aperture 3?

    I am evaluating Aperture 3...I have LR, CS4 as well as some of the editors from Nik Software e.g. Viveza, DFine...How can I add more than one of these as external editors without going into Preferences and changing Export every single time when I wan