Automatic generation of ABAP-classes from Function Groups?

Hey there,
is there a way of having (SE24)-ABAP-Classes generatetd outomaticaly by providing an existing function group?
I think, the following mapping shold be possible::
- the function group is the class
- its function modules are public (static) methods
- any form-routines are private methods
-> I don't want to to that boring work myself, some tool should be able to do that just fine, right? So, is there such a tool?
Thanks, regards
Joachim

Sorry, sounds like the only two people who answered are not aware of such a tool...
There is one additional point, which I hadn't thought about initially. With ABAP OO you also have a much stricter syntax and many more statement variants that are obsolete and thus cannot be used. This is another hindrance for writing such a tool (but of course not impossible, I just kind of doubt that any reasonable programmer would write such a thing).
Anyhow, I never understood why SAP is pushing OO so much (declaring all non-OO as obsolete), even going as far as implementing stricter syntax checks for OO. In my opinion a much better option would've been to implement some flag that switches on the more strict syntax checks, similarly to the Unicode check they've introduced. Coding in OO or non-OO, both have its use. Rules from SAP to code everything in OO even in cases where OO doesn't work seems straight silly as a general recommendation: E.g. if I have to code an RFC module, why would I want to bloat my code by introducing a class for implementing the functionality so that the RFC is just a wrapper around the class (unless the additional class gives me some real benefit)?
As much as I appreciate using OO classes supplied by SAP, I often have difficulties seeing objects in the requirements that I have to code (which might of course just be a reflection of my programming skills). A class with just some static methods is often an indication of poor OO design, i.e. there is no reasonable/tangible object and all you have is a utility class with a collection of various methods. To me it's important that the code is well structured, doesn't have any side effects, etc. This can be achieved with non-OO coding as well as OO, but switching from non-OO to OO doesn't guarantee at all that the code is any better.
In the end, if you just have a single function group, I'd recommend to do the translation manually and try to apply good OO design principles (instead of a straightforward 1-to-1 translation). E.g. for a class with just static methods (which I'd expect an automated translation would result in) one might want to take a peek at [singletons are evil|http://www.c2.com/cgi/wiki?SingletonsAreEvil] versus [singletons are good|http://www.c2.com/cgi/wiki?SingletonsAreGood]. I know it's silly advice if you're a seasoned OO programmer; but if not, I think your time is much better spent by thinking about the design and then applying it instead of using some automated tools where you'd later have to anyhow do some refactoring...

Similar Messages

  • ABAP class or function for retrieving BEx query properties at runtime

    Hello Experts,
    I'm working on BADI RSR_OLAP_BADI and for a special calculation I need to know which characteristics are in the drill-down of the BEX query, sol later on I can aggregate some key figures using only these characteristics.
    Problem is that structure C_s_DATA in method COMPUTE contains all fields of the query (filters, free chars, chars in the rows, etc) and I need to now which characteristics are currently being showing in the Bex analyzer.
    So is there an ABAP class or function module I can use to find out this kind of information at run time?
    Any suggestion?
    Thank you

    Tank you for the feedback,
    I tried to use the class you provided, but I'm stuck now in how to get from within my class that implements RSR_OLAP_BADI interface, a handle, reference, o whatever represent my runtime query (not the query at design time) . As the class you provide must be instantiated before I can use
    In pseudo code could be something like this
    DATA my_query type query_ref.
    my_query = get_rt_query().
    my_query->get_state()
    regards

  • Urgent: how to import or transport abap class from dev to q

    How to import/transport custom abap class from dev to q.
    Any suggestions points will be awarded.
    Thanks in advance.
    MK

    hi M K,
    try SE24, your class, and go to menu 'Go to' -> object directory entry,
    click pencil icon and give your package name, will raise request.
    SE10 to release and STMS from prod to import.
    hope this helps.

  • Define local classes in function groups

    Hi,
    I have seen in few code examples that programmers defined their classes as follows:
    1. Interfaces are defined globally i.e. under package->class library->interfaces.
    2. implementing classes are defined locally under: package->function group (as public local class in the function group).
    My question is What is the advantage/disadvantage of it?
    (beside encapsulation).
    I heard that the class loader is working better in that way, is that right?
    thanks,
    Yaron

    Hi
    excuse me I miserunderstood.
    Perhaps it's true I don't know.
    I think the different is the SE24 is a library, so it's the tool arranged to analyze all class components you can need.
    I don't think it's easier to analyze an include (function group) where the class is defined and implemented.
    You shuold measure the time in order to load the class for both case, but probably the different isn't meaningful.
    You should consider that ABAP wasn't OO language, but it was adapted for OO, and so the most ABAP developer weren't used to use OO.
    I think you should define a class as local class if it's your own class.
    Max
    Message was edited by: max bianchi

  • Calling a custom tcode using abap class from workflow

    Hi Experts,
    I have a requirement of calling a custom tcode from my workflow.
    For this i have created a class zcl_test ( has if_workflow ) .
    I created a method ztest which will call the tcode.
    CALL TRANSACTION 'ZTX'.  ( My tcode just has 1 input field, for testing purpose )
    Then i created a task in whichi hv used this abap class and method.
    But the tcode does not run when i execute the workflow.
    Please help.
    Thank You,
    Radhika Vadher.

    Radhika Vadher 
    use the sample code to get the data from the task container into the ABAP class
    DATA :
             w_ref        TYPE  REF TO      if_swf_run_wim_internal,
             w_ref_cnt  TYPE  REF TO      if_wapi_workitem_context,
              w_wi_ref   TYPE  REF TO      if_swf_ifs_parameter_container.
    TRY.
        CALL METHOD cl_swf_run_wim_factory=>find_by_wiid
          EXPORTING
            im_wiid     = w_wiid
          RECEIVING
            re_instance = w_ref.
      CATCH cx_swf_run_wim_enq_failed .
      CATCH cx_swf_run_wim_read_failed .
      CATCH cx_swf_run_wim .
    ENDTRY.
    CALL METHOD w_ref->get_workitem_context
      RECEIVING
        re_ctx = w_ref_cnt.
    CALL METHOD w_ref_cnt->get_wi_container
      RECEIVING
        re_container = w_wi_ref.
    and the w_wi_ref is having a method GET use that method to get the values of the task container into the ABAP class.

  • Calling CRM ABAP class from SAP Jco

    Hi,
    In CRM,  there is a class interface called CL_CRM_DOCUMENTS with static methods. I need to make call to these methods from my Java application that uses JCo. Is it possible to call ABAP methods from JCo? Any help in this regard will be highly appreciated.
    Thanks,
    Praneeth

    Hello Praneeth,
    CL_CRM_DOCUMENTS problem  -- URGENT!!
    Activity Mgmt - Attachment
    See if this helps.
    regards,
    Muralidhar Prasad.C

  • Local class and function group

    I want to write a local class in a function group, where is the best place I put the code? thanks!

    The best practice (according to a paper written by Horst Keller and Andreas Blumenthal - "An insider's guide...") is to put the DEFINITION in the TOP include and the IMPLEMENTATION part in a separate include such as LZ...C01.
    Get the paper here: https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c2992ca9-0e01-0010-adb1-b7629adb623c
    Regards
    Edited by: Alejandro Bindi on Apr 25, 2009 12:46 AM

  • How to delete a function module from function group

    I want delete a function module form function group.. iam unable tp do that , when i dlete that FM , it is saying " ralated objects are locked in another request"
    what to in this case?
    Pls anybody help me in this...
    Regards,
    pandu.

    Hi,
    go to se80
    type the function group and press enter
    select the function module right click and delete.....
    before that see the request number the FM is attached and delete that from that request and try deleting it
    Reward if usefull

  • Generation of java classes from XML Schema.

    Hi All,
    I am working with JWSDP-2.0 but got stucked.:
    To generate Java classes from an XML Schema with the JAXB ,I need to have following jar file in thils location with this JWSDP-2.0
    <JWSDP>/jaxb/lib/jaxb-api.jar
    <JWSDP>/jaxb/lib/jaxb-impl.jar
    <JWSDP>/jaxb/lib/jaxb-libs.jar
    <JWSDP>/jaxb/lib/jaxb-xjc.jar
    <JWSDP>/jwsdp-shared/lib/namespace.jar
    <JWSDP>/jwsdp-shared/lib/jax-qname.jar
    <JWSDP>/jwsdp-shared/lib/relaxngDatatype.jar
    And here I m not finding as jaxb-libs.jar,namespace.jar and jax-qname.jar on respective location.
    If I m putting these left jar file from another place it is not generating all the classes as at least in number it should be 45 but it is generating merely 5 classes.
    Can any one help me regarding this.
    Regards.
    Shelly.

    These JAXB JAR files are for JAXB 1.0.
    For JAXB 2.0 the following JAR files are required.
    C:\Sun\jwsdp-2.0\jaxb\lib\jaxb-api.jar
    C:\Sun\jwsdp-2.0\jaxb\lib\jaxb-impl.jar
    C:\Sun\jwsdp-2.0\jaxb\lib\jaxb-xjc.jar
    C:\Sun\jwsdp-2.0\jwsdp-shared\lib\activation.jar
    C:\Sun\jwsdp-2.0\sjsxp\lib\jsr173_api.jar
    C:\Sun\jwsdp-2.0\sjsxp\lib\sjsxp.jar

  • Automatic generation of enum members from name Strings

    I have a program in which I read information about Target objects from a text file. I store some of this information as an enum property of the target.
    }else if (itemKey.equalsIgnoreCase( "type")) {
    currentTarget.descriptor= itemValue;
    currentTarget.type = Target.getTargetType(currentTarget.descriptor);And elsewhere in the program I do the file reading and assignment of instance variables:
    class Target{
    enum TargetType {COUGH_DROP, RICE_CRACKER, PEPTO_BISMOL,UNDETERMINED};
    String descriptor;
    TargetType type;
    returns the target' s type as specified by a descriptor
    public static TargetType getTargetType (String descriptorString) {
    if (descriptorString.equals( "rice cracker")) {
    return (TargetType.RICE_CRACKER);
    } else if (descriptorString.equals ("cough drop")){
    return (TargetType.COUGH_DROP);
    } else if (descriptorString.equals ("Pepto-Bismol")){
    return (TargetType.PEPTO_BISMOL);
    } else {
    return (TargetType.UNDETERMINED);
    } I would like to be able to automatically generate the members of the TargetType enum from a list of strings as opposed to needing a method such as getTargetType above. Is this possible?
    Regards,
    Joe
    PS: I completely apologize for the appearance of the code above. I have no idea why this editor removed my indentation and added HTML markers. (I copied the code from a text editor, pasted into this editor, selected the code sections and clicked on the code button )
    PPS I now see that after a couple of switches between preview and rich text in the HTML markers have disappeared. WTF?

    I'm very curious to understand why one would like to create enum constants at run time? How can therse enums be used in the code that is not created at runtime? What are you really trying to achieve
    I know you marked your question as answered, but... you may have a look at the code below. It is a very very simple example of how to map real life descriptions (at runtime) to pre-existing enums. I didn't test it, but for all I know it should just work. Does this solve the problem that you are experiencing?
    import java.util.HashSet;
    import java.util.Set;
    public enum TargetType {
        RICE_CRACKER("C:/Descriptions/RiceCrackers.txt"),
        COUGH_DROP("C:/Descriptions/CouphDrops.txt"),
        PEPTO_BISMOL("C:/Descriptions/PeptoBismol.txt"),
        UNDETERMINED("C:/Descriptions/Empty.txt"),
        public static TargetType getType(String description) {
         for (TargetType targetType : TargetType.values()) {
             if (targetType.contains(description)) {
              return targetType;
         return UNDETERMINED;
        private final String fileName;
        private Set<String> descriptions = null;
        private TargetType(String fileName) {
         this.fileName = fileName;
        private boolean contains(String description) {
         if (descriptions == null) {
             descriptions = new HashSet<String>();
              * Populate descriptions from fileName.
         return descriptions.contains(description);
    }Piet

  • Automatic generation of JSP Project from tables

    JDeveloper had a feature in earlier versions (probably 9i) that automatically creates a JSP/Struts based project that can Add/Edit/Delete from a database table. I couldn't find it in the JDeveloper 10.1.3. Has this feature been taken out or its my inablility to find it?
    Can anyone point me to the right direction?

    We took this off since it was mostly nice for demos but when you wanted to customize the application it wasn't really helpful.
    Go through some of the ADF Tutorials on the JDeveloper tutorial page and you'll see similar functionality done with drag and drop - but in a way that lets you configure and customize whatever you want.

  • Automatic generation of PDF file from briefing book in OBIEE11g

    Hi all,
    Could anyone tell me if exist a way to generate PDF files from briefing books automatically in OBIEE11g?
    Thanks
    Annalisa

    I only got so far when I tried to do this in Windows. The problem comes when you try to tell the printer to print to a file with a particular name.
    The first steps are to get GhostWriter for Windows.
    Then you install the Apple LaserWriter pro 600 driver which can print to a postscript file (try it manually first). GhostWriter can then, with a command line command, using a java Process, convert that to a .pdf file.

  • Automatic Generation of Reservation Document from Sales Order

    Hello ABAP Peeps,
    I require some assistance. I need to have a resevation document to be created and saved automatically as soon as the Sales Order is saved. What sort of setting would I need to make for this to take place?
    Many Thanks
    Pranzo

    is an Abap forum, better ask in forums like or look via SPRO at the area Sales and Distribution, Sales, Sales Documents, Schedule Lines, Define Schedule Line Categories (VOV6).
    Regards,
    Raymond

  • Calling java class from abap function moduile

    Is it possible to call java class from function module.
    i am a java guy. my need is to call a java class from a  function module in the backend. which in turn performs certain functions.
    i would be highly obliged if someone could let me know if this is possible.
    regards
    Srikumar V

    Hi Srikumar ,
    you can call a java webservice in ABAP .
    u can call the webservice and via that u can trigger the java class..
    Regards
    Renu

  • Are Classes better than Function groups and Modules

    Hi,
    Are classes better than Function groups? For example if you want to execute something is back ground or use parallel processing you can't do it using classes. Even inside classes most of the places we use Function modules.
    Then how classes are beneficial?
    Regards,
    Deepak Bhalla

    Yes they are compared in the sense that the class and function group are the containers, and the methods and function modules are the interfaces in which you interact with the encapsulated data. 
    Again if you are developing an application in which you are not forced to push the processing to differenet work processes,  then using classes/methods is preferrable. The reason I say this, is because anything coming from SAP will most likely be implemented as a class as opposed to a function group.  This is not to say that SAP will not create new function modules, because of course there still is a use for them.
    Regards,
    Rich Heilman

Maybe you are looking for

  • Starting up in single-user mode problem

    I'm trying to start up in single user mode using the Apple article. I ran fsck and everything checked out fine but when I type /sbin/mount -uw / I just get another prompt(#). I want to restore defaults because the users pane is blank. Iv'e tried tras

  • Two step import, downsizing image file sizes and/or keeping copies?

    hi all, leonie was kind enough on another thread to suggest a two step import from the iphone in order to make sure that there is no accidental deletion or data loss. my understanding (i'm repeating it here myself in case i am misunderstanding) is th

  • Exponential to Numeric Conversion in ABAP

    Hi, This is regrardng the conversion of Exponential to Numeric values in ABAP.I have an exponential Value 4.8E+47 .I want to convert to numerical .If i use the Exponential Function ,It is agian yielding another Exponent value. If the Power is more th

  • Can Oracle 10g EM manage DB2 or SQL Server

    Need to know if Oracle 10g EM do have the capability to manage DB2 and SQL Server, as ct has this requirement. If so ct will manage all DB`s using Oracle 10g EM and use it for his enterprise.

  • HT5022 AirPort Utility 5.6 will not install on Lion

    I have an older airport express and I'd like to be able to manage it the new Aiprot utulity is not compatible and the older version of Airport Utility 5.6 is not able to be installed on Lion.