Editing class public section in ABAP editor

Hi!
Protected and private sections of dictionary classes' definition can be edited directly in ABAP editor by using "GoTo->Protected section", for instance. However, public section is display-only, probably for security reasons. Is there a trick to bypass this and edit public section directly? I tried SE38, but clever bastard just redirects me to class builder.
Thanks!
Kind regards,
Igor Barbaric

Klaus!
I succesfully uploaded your code. I also succesfully started it after a minor correction (it dumped because table of line type STRING cannot accept the result of READ REPORT command). I created the status command MY_EDIT and navigated to the object. However, it was the same as if I went there in standard way. It didn't make public section editable.
By the way, what is exactly the purpose of your program?
Thanks for a try anyway.
Kind regards,
Igor Barbaric

Similar Messages

  • ABAP Editor. Flag meanings from: User-specific settings - 'pattrn' tab

    If you go through this path once you are in the ABAP editor (ECC 6.0):
    utilities -> settings
    Does anybody know how the flags from the 'pattrn' tab work? They are about patterns in Function modules and Class generators.
    I cannot find anything through F1 help or SDN.
    Best,
    Cristian

    You might be aware of the "Edit -> Pattern" functionality in the ABAP editor. The settings you are referring to influence some details, e.g. whether OTHERS will be included in the exceptions list when inserting function module patterns.
    Play around with the settings to see the effect.
    Thomas

  • How to call a method in private section of a class in the public section

    Hi Everybody,
    i have written a method(meth1) in the private section of a class(C1).
    it is as follows
    class C1 definition.
    private section.
    methods: meth1 importing im_dt1 like tp1
                                             im_dt2 like tp2
                                             im_dt3 like tp3
                                             im_dt4 like tp4
                               returning value(re_dt1) like tp5.
    endclass.
    i have the final data that has to be displayed in internal table re_dt1.
    now my question is how to call  this method present in private section into public section and display the data present in re_dt1.
    Thanks,
    learning.abap.

    Hi,
    what you need is one public method being called at start-of-selection. Within this the private methods have to be called.
    The question is, why has the method for reading the database tables to be private? If you have only one private method reading all database tables the public method being called at start-of-selection will only consist of a call-method statement.
    This seems to be one call to much.
    The logic for reading the different database tables is hidden inside the class anyway.
    Is there any further logic reading the different database tables?
    Have always all table to be read? If not another approach would be one private method for each database table being called by a public method deciding which table has to be read:
    public section.
    methods get_data returning value(re_Dt1).
    private section.
    methods:
    get_table_a returning value(im_dt1),
    get_table_b returning value(im_dt2),
    get_table_c returning value(im_dt3),
    get_table_d returning value(im_dt4),
    combine_data importing im_dt1
                                    im_dt2
                                    im_dt3
                                    im_dt4
                            returning value(re_dt1).
    *- implementation of public method:
    method get_data.
      data: lt_dt1 ...
               lt_dt2,
               lt_dt3,
               lt_dt4.
    * here decide which tables have to be read:
    lt_dt1 = get_table_a( ).
    lt_dt2 = get_table_b( ).
    lt_dt3 = get_table_c( ).
    lt_dt4 = get_table_d( ).
    re_dt1 = combine_data( i_dt1 = lt_dt1
                                           i_dt2 = lt_dt2
                                           i_dt3 = lt_dt3
                                           i_dt4 = lt_dt4 ).
    endmethod.
    *- implementation of private methods
    method get_table_a.
    endmethod.
    method get_table_b.
    endmethod.
    method get_table_c.
    endmethod.
    method get_table_d.
    endmethod.
    method combine_data.
    endmethod.
    Regards
    Dirk

  • Declaring Field Symbols in Public Section of class

    Dear All,
    I am working with class and hav declared some field symbols in one of the method.
    Now I want to move these declaration in Public section of the class so that this field symbol declaration can be used by other methods of the class but I am not able to do the same.
    Can anyone help me in finding as what I am doing wrong here.
    Regards,
    Lalit Kabra

    What you are trying to do is define an attribute. I doubt you can use field symbol as a class attribute. Consider using a data object instead.
    Data : dref type ref to data.
    This can later be deferenced in the individual methods.
    Hope this helps.
    Here's an example for the same:
    REPORT  z_class_001                             .
    *       CLASS lcl_class1 DEFINITION
    CLASS lcl_class1 DEFINITION.
      PUBLIC SECTION.
        DATA dref TYPE REF TO data.
        METHODS : constructor IMPORTING i_type TYPE char20,
                  meth1 IMPORTING value TYPE i.
    ENDCLASS.                    "lcl_class1 DEFINITION
    *       CLASS lcl_class1 IMPLEMENTATION
    CLASS lcl_class1 IMPLEMENTATION.
      METHOD constructor.
        CREATE DATA dref TYPE (i_type).
      ENDMETHOD.                    "constructor
      METHOD meth1.
        FIELD-SYMBOLS <fs> TYPE ANY.
        ASSIGN dref->* TO <fs>.
        WRITE: 'Value is ' ,value.
        ASSIGN value TO <fs>.
        WRITE: 'Field symbol is ', <fs>.
      ENDMETHOD.                                                "meth1
    ENDCLASS.                    "lcl_class1 IMPLEMENTATION
    START-OF-SELECTION.
      DATA ref_class TYPE REF TO lcl_class1.
      CREATE OBJECT ref_class EXPORTING i_type = 'I'.
      CALL METHOD ref_class->meth1
        EXPORTING
          value = 3.
    BR,
    Advait
    Edited by: Advait Gode on Sep 16, 2009 9:44 AM

  • Is it possible to call a class method using pattern in ABAP editor.

    Hi,
         Is it possible to call a class method using pattern in ABAP editor.
    Thank U for Ur time.
    Cheers,
    Sam

    Yes,
    Click patterns.
    Then choose Abap objects patterns.
    Click on the Tick
    It will give a new screen
    Here Give the name of the class first.
    Then the object (instance of the calss)
    And finally the method ..
    it will give you the pattern
    Hope this helps.

  • Abap editor change to a edition mode unknown

    hi, i want to make some changes in a report but when i try it the next information message is sent "only repairs in non original system", after the abap editor switch to a edition mode that i dont know.
    Can you help me?

    In the se38> edit> modification operations--> switch off assistant

  • Editing ABAP Program with out using ABAP Editor

    Dear Gurus,
    I know that ABAP Programs like SAPMSSY1, etc. are stored in Table D010S or REPOSRC as per the version of the SAP Released.
    my problem is that whem i open the table REPOSRC (Having around 34 colums), no doubt thati found the program list but i am not be able to see any thing which is written in Program language..!
    how I will be able to access these program in there source language and so make certain changes in them.
    actually during the RFC Logon, I am getting the error that "Error in Reading Program SAPMSSY1"
    R/3 Basis System: Run-time error "GEN_SOURCE_FORMAT  " occurred in accessing SAPMSSY1.
    So pls tell me where I can find the actual program language so that I can make certian changes in them.
    Pls REMEMBER THAT I CAN NOT USE ANY T-CODE LIKE SE36 etc. TO ENTER INTO ABAP EDITOR, AS STILL I AM NOT LOGGED ON. AT THE TIME OF GUI LOGIN I AM GETTING THE SYSTEM ERROR MESSAGE "DUMMY". WHAT THIS IS MEAN FOR??
    Regards,
    Abhishek

    I CAN NOT ENTER INTO THE SYSTEM. AS I GOT THIS ERROR IN THE LAST STEP (RFC JOBS- POST PROCESSING) OF MY SAP INSTALLATION.so can not log in into the system.
    SO WHERE I CAN MODIFY THE PROGRAMMING OF "SAPMSSY1" ?
    AND RESOLLVED THE ABOVE SAID PROBLEM.
    I am using ORACLE 9i with patch 92080 on Windows 2000 Server with SP 4
    SAP Kernel is 620 with patch no. 251 and patch level 0
    SAP GUI IS 710
    Abhishek

  • Class-data versus data and methods versus class-methods in OO ABAP

    Hi
    I was going thorugh following OO ABAP code.
    CLASS vessel DEFINITION.
      PUBLIC SECTION.
        METHODS: constructor,
                 drive IMPORTING speed_up TYPE i,
                 get_id RETURNING value(id) TYPE i.
        CLASS-METHODS: start,
                       objects,
                       inheritance,
                       interfaces,
                       events.
      PROTECTED SECTION.
        DATA: speed TYPE i,
              max_speed TYPE i VALUE 100.
      PRIVATE SECTION.
        CLASS-DATA object_count TYPE i.
        DATA id TYPE i.
    ENDCLASS.
    Whats is difference between methods and class-methods ?
    What is the difference between data and class-data ?

    Hi Rajesh,
    There are two types of componenets in a class
    1)Static components
    2) Instance components
    Instance components exist for every instance of the class, while static exist only once for any number of instances of the class.
    Components of the class are methods, attributes, events etc.
    static attributes are represented by CLASS-DATA and instance attributes are represented by DATA.
    static methods hence are done by CLASS-METHODS and can access only static attributes.
    Instance methods are done by METHODS and can access any attribute.
    For eg: supposing that in a class, there is a static attribute. Suppose after one instance is created, we are setting this static attribute value as 10. Now we are creating another instance of the same class. Now when you try to display the value of this attribute, it will be 10.ie. it needs to be initialized once and can be shared between instances.
    Just go through this document..You will get nice info from this.
    http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    If you want to go deeper, like object persistence and all, just refer this document.
    http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    Regards,
    SP.

  • CLASS-DATA in OO ABAP

    Hi,
    I know the definition of CLASS-DATA in OO concept. I understand that it can be accessed by on CLASS-METHODS.
    But what is the use of it ? Why do we need static data ?
    Is this different fro STATICS we use in procedural ABAP.
    Regards,
    Rajesh.

    If there are multiple instances of the class, the data area is shared between all instances, which means when instance 1 of the class sets the value, then all other instances have the attribute with the same value,  I believe that  iit points to the same memory.  Here is an example app, notice that then the first object is created, it sets the value,  then when writing out the objects,  both instances see the same value for NUM1 even though only the first object actually filled the value,  so the second is looking at the same memory area because it is labeled as CLASS-DATA.
    report zrich_0001.
    *       CLASS lcl_tst DEFINITION
    class lcl_tst definition.
      public section.
        class-data: num1 type n.
        data: num2 type n,
              num3 type n.
        methods: constructor importing im_num1 type n
                                       im_num2 type n
                                       im_num3 type n.
    endclass.
    *       CLASS lcl_tst IMPLEMENTATION
    class lcl_tst implementation.
      method constructor.
        if not im_num1 is initial.
          num1 = im_num1.
        endif.
        if not im_num2 is initial.
          num2 = im_num2.
        endif.
        if not im_num3 is initial.
          num3 = im_num3.
        endif.
      endmethod.
    endclass.
    data: o_tst type ref to lcl_tst.
    data: o_tst_list type table of ref to lcl_tst.
    data: no_value type n.
    start-of-selection.
      create object o_tst
            exporting
                 im_num1 = '3'
                 im_num2 = '4'
                 im_num3 = '5'.
      append o_tst to o_tst_list.
      create object o_tst
         exporting
              im_num1 = no_value
              im_num2 = '6'
              im_num3 = '7'.
      append o_tst to o_tst_list.
      loop at o_tst_list into o_tst.
        write:/ o_tst->num1, o_tst->num2, o_tst->num3.
      endloop.
    Regards,
    Rich Heilman

  • Error while calling a super class public method in the subclass constructor

    Hi ,
    I have code like this:
    CLASS gacl_applog DEFINITION ABSTRACT.
      PUBLIC SECTION.
        METHODS:
                create_new_a
                   IMPORTING  pf_obj       TYPE balobj_d
                              pf_subobj    TYPE balsubobj
                              pf_extnumber TYPE string
                   EXPORTING  pfx_log_hndl TYPE balloghndl
                   EXCEPTIONS error
    ENDCLASS.
    CLASS gacl_applog IMPLEMENTATION.
      METHOD create_new_a.
        DATA: ls_log TYPE bal_s_log.
      Header aufsetzen
        MOVE pf_extnumber TO ls_log-extnumber.
        ls_log-object     = pf_obj.
        ls_log-subobject  = pf_subobj.
        ls_log-aluser     = sy-uname.
        ls_log-alprog     = sy-repid.
        ls_log-aldate     = sy-datum.
        ls_log-altime     = sy-uzeit.
        ls_log-aldate_del = ls_log-aldate + 1.
        CALL FUNCTION 'BAL_LOG_CREATE'
             EXPORTING
                  i_s_log      = ls_log
             IMPORTING
                  e_log_handle = pfx_log_hndl
             EXCEPTIONS
                  OTHERS       = 1.
        IF ( sy-subrc NE 0 ).
          MESSAGE ID      sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH    sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                  RAISING error.
        ENDIF.
      ENDMETHOD.
    CLASS gcl_applog_temp DEFINITION INHERITING FROM gacl_applog.
      PUBLIC SECTION.
        DATA: log_hndl   TYPE balloghndl READ-ONLY
            , t_log_hndl TYPE bal_t_logh READ-ONLY
        METHODS: constructor
                   IMPORTING  pf_obj       TYPE balobj_d
                              pf_subobj    TYPE balsubobj
                              pf_extnumber TYPE string
                   EXCEPTIONS error
               , msg_add      REDEFINITION
               , display      REDEFINITION
    ENDCLASS.
    CLASS gcl_applog_temp IMPLEMENTATION.
      METHOD constructor.
        CALL METHOD create_new_a
               EXPORTING  pf_obj       = pf_obj
                          pf_subobj    = pf_subobj
                          pf_extnumber = pf_extnumber
               IMPORTING  pfx_log_hndl = log_hndl.
        IF ( sy-subrc NE 0 ).
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                  RAISING error.
        ENDIF.
      ENDMETHOD.
    A public method of Super class has been called from the constructor of the sub class. we are getting the syntax error :
    ' In the constructor method, you can only access instance attributes, instance methods, or "ME" after calling the constructor of the superclass…'
    Can you please suggest how to change the code with out affecting the functioanlity.
    Thank you ,
    Lakshmi.

    Hi,
    Call that method by instance of Subclass.   OR
    SUPER-->method.
    Read very useful document
    Constructors
    Constructors are special methods that cannot be called using CALL METHOD. Instead, they are called automatically by the system to set the starting state of a new object or class. There are two types of constructors - instance constructors and static constructors. Constructors are methods with a predefined name. To use them, you must declare them explicitly in the class.
    The instance constructor of a class is the predefined instance method CONSTRUCTOR. You declare it in the public section as follows:
    METHODS CONSTRUCTOR
            IMPORTING.. [VALUE(]<ii>[)] TYPE type [OPTIONAL]..
            EXCEPTIONS.. <ei>.
    and implement it in the implementation section like any other method. The system calls the instance constructor once for each instance of the class, directly after the object has been created in the CREATE OBJECT statement. You can pass the input parameters of the instance constructor and handle its exceptions using the EXPORTING and EXCEPTIONS additions in the CREATE OBJECT statement.
    The static constructor of a class is the predefined static method CLASS_CONSTRUCTOR. You declare it in the public section as follows:
    CLASS-METHODS CLASS_CONSTRUCTOR.
    and implement it in the implementation section like any other method. The static constructor has no parameters. The system calls the static constructor once for each class, before the class is accessed for the first time. The static constructor cannot therefore access the components of its own class.
    Pls. reward if useful....

  • Command in ABAP Editor to improve the source code

    Which command in ABAP Editor to be used to improve the readability of the program code ?plzz tell
    Edited by: Alvaro Tejada Galindo on Feb 13, 2008 3:48 PM

    Use Pretty Printer or do a CTRL+F1.
    Also u can change the settings of the way u want preety printer to behave by
    going in the Settings->Abap Editor -> Pretty Printer

  • Issue in SAP GUI 7.0 for ECC6 (ABAP Editor not working)

    Dear SAP Team,
                             We have installed SAP ECC6.0 EHP4.We have installed SAP GUI 7.0 in our clients machine but in some machines the ABAP Editor i.e Tcode SE38 is not working properly.When our Client selects any transaction for editing the system gets HANG.
    We have tried uninstalling & reinstalling the software & the patch but the problem still persists.The configuration of all our client machine are same & we work on Windows XP platform.Please help us in solving our issue as soon as possible.
    Thanks & Regards,
    Manoj Mhatre.

    Dear Manoj
    you mean the SAP Gui for windows 7.20 or 7.10?
    Please install the latest Sapgui Patch 3 for the Sapgui 720, or the Sapgui
    Patch 19  for the Sapgui 7.10.
    As workaround, please use the OLD  frontend editor.
    Best regards,
    Sven

  • How to declare variable for Table type in the ABAP Editor

    Hi!
    I have Table Type 'FIELDNAME_TAB' (Table of fieldnames). I want to pass the list of fieldnames to this Table Type in the ABAP Editor.
    Can anyone help me in this?

    You would declare the internal table like so.
    data: itab type FIELDNAME_TAB.
    data: wa like line of itab.
    wa = 'This_value'.
    append wa to itab.
    Regards.
    Rich Heilman
    Message was edited by:
            Rich Heilman

  • Abap editor in ecc 6.0

    hi all
    abap editor in ecc 6.0 is having a icon enhancement...wat is the use of tht and how to use it...

    This is the Enhancement Framework which is new.  It allows you to modify SAP code without actually modifying the program.   Really, the code which is inserted in the ENHANCEMENT..... ENDHANCEMENT section is compile separate from the program being "modified".   This also means, that you do not require a registration key for the object.  The code inside the enhancement is actually called at the kernal level.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/94/9cdc40132a8531e10000000a1550b0/frameset.htm
    Regards,
    Rich Heilman

  • Problem using new ABAP editor in GUI 7.20

    Hi Guys,
    I need some help. I am running SAP GUI 7.20 on Windows 7 professional.
    When I open the new ABAP editor from SE38 it does not open the mouse pointer keeps rotating for ever.
    I tried changing the setting to ABAP Editor old. It did work this time, I could open the ABAP editor.
    I also tried uninstalling and re installing the SAP GUI,but the problem persists.
    Please suggest if anyone has a solution for this.
    Thanks
    Ramya

    Hi
    check OSS Note 1456628 This may be helpful  [Click here|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1456628]
    4.1.1.1 Fixed a CrossThreadException due to the change of the mouse cursor in the repair background worker. Fix an KeyNotFoundException in the construction of the tree in the edit form.
    also did you try Installing MSXML 4.0 software as mentioned by Suresh Dareddy
    [Ref Post|http://forums.sdn.sap.com/profile.jspa?userID=3753798]
    Regards,
    koolspy.

Maybe you are looking for

  • Passing one parameter to multiple views

    Is this possible?  I would like to pass one parameter, a date field, to multiple views.  I cannot use it in the record selection, because my views do a mathematical computation which returns a single value, but I only want to select the data for a si

  • Z77A-GD65 Quick Sync with Virtu MVP Issue

    Hi everyone! My apologies if this has been answered elsewhere but my searching didn't find anything conclusive. I'm a very happy convert from an EVGA P67 SLI board (ugh) to an MSI Z77A-GD65 (YAY!) So far, I absolutely love this board but I'm having a

  • With PRE 8 when I try toExport & burn a DVD, I get error code 150:30

    With PRE 8 when I try to Export & burn a DVD, I get error code 150:30 What is wrong? Thanks, Tom My Laptop is Dell Studio 17 Laptop PCS17HN Windows 7 Home Premium Processor Intel® Core™ i7-720QM Quad Core Processor 1.6GHz 6GB, DDR3, 1333MHz, 2 DIMM (

  • Real Noob Question: Indesign to MS Word

    I have been trying to make a logo and document/letterhead for some forms etc and a friend suggested Indesign was the way to go and helped get me started. I have previously created the forms etc that I need to use in MS Word. What I want to do is to e

  • VM Template for Fusion Middleware 11g

    How often do the VM templates get refreshed? Is there a new one for the latest SOA suite? I think it would save us some time to have a VM for the SOA suite set up for development environments