From Classic abap FMs to ObjectOriented instance/static methods: reference

Hi All,
we are migrating one of our project developed using classic abap to abap objects.
mostly we are replacing the Function modules with either instance methods or static methods.
for e.g.
if there are FMs like GUI_UPLOAD, SO_NEW_DOCUMENT_SEND_API1 are used, after exploring in sdn for abap objects, we realized
we can use cl_gui_frontend_services=>gui_upload( ) instead of the GUI_UPLOAD.
send_request = cl_bcs=>create_persistent( ). send_request->send( ).  can be used instead of SO_NEW_DOCUMENT_SEND_API1
like that there are several FMs present, is there any easy way where we can find this reference of object oriented methods corresponding to the plain old Function modules of classic abap.
i was thinking, after seeing the blogs of people like Thomas Jung, Horst Keller, they encouraged a lot on abap objects over procedural abap. are there any such guidlines, references present to migrate (rather upgrade) to abap objects from existing procedural abap
thanks,
Madhu_1980

I don't think it makes sense to do 1:1 mapping and replacement in your code.
It does make sense to refactor using Object oriented techniques and patterns but it is usually a non-trivial task.

Similar Messages

  • I have an Adobe Flash Professionals digital classroom book for CS6 and was following all steps easily until it ask me to select the text tool and change it from classic to tfl in the property inspector. I looked and all that drops down is dynamic, static,

    I have an Adobe Flash Professionals digital classroom book and was following all steps easily until it ask me to select the text tool and change it from classic to tfl in the property inspector. I looked and all that drops down is dynamic, static, and input. Where is the TFL and Classic ? I watched adobe learning center but he was using CS5. Can anyone please help?

    Hi,
    Do you use Flash CS6 to follow the instructions in the classroom book? If yes, then you can find it under text drop down for an AS3 Document as shown below
    If you follow the instruction in Flash CC or Flash CC2014 then you will not find this option as this is deprecated.
    Thanks!
    Mohan

  • Are DLL methods called as instance or static methods from Java ?

    Hi,
    I have only a small question.
    When I call a C++ DLL method from Java using JNI, do I instantiate it like an object method or is it called as a static method ?
    I am asking you this because I will use servlets (Java 1.2.2) to call a DLL. These servlets may run concurrently in any moment, and I pass some data to this DLL. I want to know if there is any possibility of this data becoming corrupt, because of one concurrent servlet rewriting the data another servlet has passed.
    Thanks and regards.

    The question is not specific enough.
    Methods in C/C++ can be qualified with the following forms:
    -global (C/C++)
    -static member(C++ class method)
    -instance member(C++ class method)
    Since you didn't provide your code I couldn't possible determine which of the above you are using, but presumably you know.
    On the other hand a java native method is either static or non-static depending on how you defined it in the class. Once again without the code there is no way to say and presumably you already know this.
    The context of the methods is the same context that a similar servlet method has. But naturally in C/C++ is is easy to circumvent the context - for example by using a global variable.
    Data in C/C++ can always become corrupt and in the vast (all?) cases it is because something is wrong in the C/C++ code. Like a pointer that is not initialized, or a pointer used after it is free'd. Or writing past the end of a buffer, or writing before the beginning of a buffer.

  • This static method cannot hide the instance method from...

    What means the error message "This static method cannot hide the instance method from Referee"?
    Referee.java is a interface. I implemented it in the class RefereeMyName.java and made a method in that class to be static. Thats why I received that error message.
    But can't I use static methods when I have implemented a interface in that class? I want to have a Player.java class which I want to access RefereeMyName.getTarget(). I cannot use a instance instead because I wouldn't receive a valid return value then (RefereeMyName is the client class).
    What is the solution?

    Hi,
    Well i do not think that you can do that b'cos that way you are not giving the same signature for the method as that exists in the interface. I do not know how other way it can be done but if something urgent for you then you can remove that method from that interface and only define in the class.
    Regards,
    Shishank

  • Classical ABAP -- Is the END in sight  -- I think so

    Going on again from the posts on "Persistent Objects" it seems to me it's only a matter of time before "Classical ABAP" is dead in the water.
    For example take a sales order. Once it's been created why on earth should transactions like VA02 / Va03 etc have to execute  a whole lot of code to display it / manipulate it.
    If its stored as a "Real Persistent Object" then it just needs to be retrieved via its instance or ("key")  and manipulations should be simple.
    You'd have all the info you need encapsulated within the object such as Partners, delivery information etc etc so you would only need minimal coding to do anything with the order.
    Object management would be responsible for maintining the "physical data store"'.
    All you would need to do say if the delivery address changed would be to do something like this
    <b>Get.Order xxxxxxxxxx
    Change. delivery.address =   new  address
    save object.
    No more complex ABAP etc.
    Just have a lok at the code in program SAPMV45A which has to be executed each time you do a VAXX transaction.
    Would be much simpler to have a basic standard code Get.Object=saleorder.salesorder.num
    display.object=object key.</b>
    Implementation of this I agree would be difficult considering the amount of legacy code in the system but given the usefulness of Object Orientated coding this has to be the end logical outcome.
    Data storage would probably need to be much greater but given the fact that disks of around 1TB can be had for less than 300 USD these days I don't think that's an issue any more.
    Anyway I've just mulling around some ideas which I've been thinking about since reading an initial post on "Persistent Objects".
    I'd be interested on other views on this development whatever you think.
    Cheers
    Jimbo

    Hi Guys,
    just to put in my take on some of this.
    I find it interesting that SAP have "helped us out" by committing to not releasing a new ERP release for five years. They tell us that the reason for this is to give customers some certainty and minimise TCO.
    My view is that the move to SOA and OO principles means they have to go back and rewrite all the old Dynpros that mix UI code and Business Logic together. Not only is this a huge job, but now they are going to be touching all the old ABAP code that hasn't changed in years. This will create a QA and support challenge for them as I suspect that some of the old code in GL and SD would have hardly been changed for a decade or more.
    CRM is interesting. While there is extensive use of OO concepts, including persistent object services, it is by no means consistently implemented. Most frustratingly there is still very little documentation to help the developer. It is still a case of wandering along with the debugger to see how stuff hangs together, and this is much harder in OO code than procedural.
    Of course the emerging development regime is "Model Driven". So maybe application development might involve using a BPML tool to model the process, then extend the model down to incorporate the underlying business objects. The modelling tool then assigns attributes and the standard CRUD ( create, read, update and delete) methods to each business object and describes the rules that exist between business objects. This is all done in the modelling tool, not by writing code. In theory it is all language independent.
    Now we employ a developer for a few days to write the language specific pieces, which only consists of the CRUD methods. Maybe we employ two developers because we want some of our business objects on one platform and some on another. Or maybe we don't need any developers because our modelling tool is clever enough to generate the persitency layer and the defined rules take care of everything else.
    Now we need a user interface ( the service interfaces are already supplied by the platform). Well that could be pretty easy if we used a tool like Visual Composer. Link a few Business Processes, or Business Objects, together and move the UI elements around the screen a bit and away we go!
    If we need to change something we adjust the model and regenerate. (I'd like to see that on a production system)
    Sounds easy! Now all we need is a modelling tool to generate the BPML tool - that is where the real opportunity lies.
    Cheers
    Graham

  • Static Classes/Methods vs Objects/Instance Classes/Methods?

    Hi,
    I am reading "Official ABAP Programming Guidelines" book. And I saw the rule:
    Rule 5.3: Do Not Use Static Classes
    Preferably use objects instead of static classes. If you don't want to have a multiple instantiation, you can use singletons.
    I needed to create a global class and some methods under that. And there is no any object-oriented design idea exists. Instead of creating a function group/modules, I have decided to create a global class (even is a abstract class) and some static methods.So I directly use these static methods by using zcl_class=>method().
    But the rule above says "Don't use static classes/methods, always use instance methods if even there is no object-oriented design".
    The book listed several reasons, one for example
    1-) Static classes are implicitly loaded first time they are used, and the corresponding static constructor -of available- is executed. They remain in the memory as long as the current internal session exists. Therefore, if you use static classes, you cannot actually control the time of initialization and have no option to release the memory.
    So if I use a static class/method in a subroutine, it will be loaded into memory and it will stay in the memory till I close the program.
    But if I use instance class/method, I can CREATE OBJECT lo_object TYPE REF TO zcl_class then use method lo_object->method(), then I can FREE  lo_object to delete from the memory. Is my understanding correct?
    Any idea? What do you prefer Static Class OR Object/Instance Class?
    Thanks in advance.
    Tuncay

    @Naimesh Patel
    So you recommend to use instance class/methods even though method logic is just self-executable. Right?
    <h3>Example:</h3>
    <h4>Instance option</h4>
    CLASS zcl_class DEFINITION.
      METHODS add_1 IMPORTING i_input type i EXPORTING e_output type i.
      METHODS subtract_1 IMPORTING i_input type i EXPORTING e_output type i.
    ENDCLASS
    CLASS zcl_class IMPLEMENTATION.
      METHOD add_1.
        e_output = i_input + 1.
      ENDMETHOD.
      METHOD subtract_1.
        e_output = i_input - 1.
      ENDMETHOD.
    ENDCLASS
    CREATE OBJECT lo_object.
    lo_object->add_1(
      exporting i_input = 1
      importing e_output = lv_output ).
    lo_object->subtract_1(
      exporting i_input = 2
      importing e_output = lv_output2 ).
    <h4>Static option</h4>
    CLASS zcl_class DEFINITION.
      CLASS-METHODS add_1 IMPORTING i_input type i EXPORTING e_output type i.
      CLASS-METHODS subtract_1 IMPORTING i_input type i EXPORTING e_output type i.
    ENDCLASS
    CLASS zcl_class IMPLEMENTATION.
      METHOD add_1.
        e_output = i_input + 1.
      ENDMETHOD.
      METHOD subtract_1.
        e_output = i_input - 1.
      ENDMETHOD.
    ENDCLASS
    CREATE OBJECT lo_object.
    lo_object->add_1(
    zcl_class=>add_1(
      exporting i_input = 1
      importing e_output = lv_output ).
    lo_object->subtract_1(
    zcl_class=>subtract_1(
      exporting i_input = 2
      importing e_output = lv_output2 ).
    So which option is best? Pros and Cons?

  • Error when Interative Adobe Form is called from Webdynpro ABAP.

    Hi Experts,
    I trying to call a Interactive adobe form from ABAP Webdynpro application but I am facing the below error.
    Line: -
    The following error text was processed in the system GJD : User session (HTTP/SMTP/..) closed after timeout
    The error occurred on the application server az18u021_GJD_01 and in the work process 0 .
    The termination type was: ERROR_MESSAGE_STATE
    The ABAP call stack was:
    Method: PREPROCESS_REQUEST of program CL_WDR_CLIENT_ABSTRACT_HTTP===CP
    Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_WDR_MAIN_TASK==============CP
    Method: EXECUTE_REQUEST_FROM_MEMORY of program CL_HTTP_SERVER================CP
    Function: HTTP_DISPATCH_REQUEST of program SAPLHTTP_RUNTIME
    Module: %_HTTP_START of program SAPMHTTP
    Line: -
    When I uncheck the enabled property of the Interactive From in the Page of the WebDynpro I am able to execute the application successfully.But the Adobe form behaves as a Static Form when I uncheck the enabled property.
    So kindly provide your valuable suggestions to avoid the above error when I am calling a Interactive adobe form from Webdynpro ABAP.
    Thanks in Advance.
    Regards,
    Arun.

    Hello,
    Hello, are you sure you have your ADS credentials configured correctly and valid? I guess you know that is the only difference between clicking enabled on true or false. If you are not sure, you can use SE38, search for FP_* and pick some reports to check the licencing. The names of the reports are good enough to recognize the right one.
    Or maybe that is a security problem? Have you checked the ADS_ERROR string? Did you use the ADS trace?
    check: http://help.sap.com/saphelp_nw70/helpdata/en/2c/241a427ff6db2ce10000000a1550b0/content.htm
    and especially note 999998
    Regards, Otto

  • How to call a static method from an event handler

    Hi,
       I'm trying to call a static method of class I designed.  But I don't know how to do it.  This method will be called from an event handler of a web dynpro for Abap application.
    Can somebody help me?
    Thx in advance.
    Hamza.

    To clearly specify the problem.
    I have a big part code that I use many times in my applications. So I decided to put it in a static method to reuse the code.  but my method calls functions module of HR module.  but just after the declaration ( at the first line of the call function) it thows an exception.  So I can't call my method.

  • Calling a method from a static method

    hello all,
    I'm calling a non-static method from a static method (from the main method). To overcome this i can make the method i am calling static but is there another way to get this to work without making the method that is being called static?
    all replies welcome, thanks

    When you call a non-static method, you are saying you are calling a method on an object. The object is an instance of the class in which the method is defined. It is a non-static method, because the instance holds data in it's instance variables that is needed to perform the method. Therefore to call this kind of method, you need to get (or create an instance of the class. Assuming the two methods are in the same class, you could do
    public class Foo
         public static void main(String[] args)
                Foo f = new Foo();
                f.callNonStaticMethod();
    }for instance.

  • Calling a non-static method from another Class

    Hello forum experts:
    Please excuse me for my poor Java vocabulary. I am a newbie and requesting for help. So please bear with me! I am listing below the program flow to enable the experts understand the problem and guide me towards a solution.
    1. ClassA instantiates ClassB to create an object instance, say ObjB1 that
        populates a JTable.
    2. User selects a row in the table and then clicks a button on the icon toolbar
        which is part of UIMenu class.
    3. This user action is to invoke a method UpdateDatabase() of object ObjB1. Now I want to call this method from UIMenu class.
    (a). I could create a new instance ObjB2 of ClassB and call UpdateDatabase(),
                                      == OR ==
    (b). I could declare UpdateDatabase() as static and call this method without
         creating a new instance of ClassB.With option (a), I will be looking at two different object instances.The UpdateDatabase() method manipulates
    object specific data.
    With option (b), if I declare the method as static, the variables used in the method would also have to be static.
    The variables, in which case, would not be object specific.
    Is there a way or technique in Java that will allow me to reference the UpdateDatabase() method of the existing
    object ObjB1 without requiring me to use static variables? In other words, call non-static methods in a static
    way?
    Any ideas or thoughts will be of tremendous help. Thanks in advance.

    Hello Forum:
    Danny_From_Tower, Encephalatic: Thank you both for your responses.
    Here is what I have done so far. I have a button called "btnAccept" created in the class MyMenu.
    and declared as public.
    public class MyMenu {
        public JButton btnAccept;
         //Constructor
         public MyMenu()     {
              btnAccept = new JButton("Accept");
    }     I instantiate an object for MyMenu class in the main application class MyApp.
    public class MyApp {
         private     MyMenu menu;
         //Constructor     
         public MyApp(){
              menu = new MyMenu();     
         public void openOrder(){
               MyGUI MyIntFrame = new MyGUI(menu.btnAccept);          
    }I pass this button all the way down to the class detail02. Now I want to set up a listener for this
    button in the class detail02. I am not able to do this.
    public class MyGUI {
         private JButton acceptButton;
         private detail02 dtl1 = new detail02(acceptButton);
         //Constructor
         public AppGUI(JButton iButton){
         acceptButton = iButton;
    public class detail02{
        private JButton acceptButton;
        //Constructor
        public detail02(JButton iButton){
          acceptButton = iButton;
          acceptButton.addActionListener(new acceptListener());               
       //method
        private void acceptListener_actionPerformed(ActionEvent e){
           System.out.println("Menu item [" + e.getActionCommand(  ) + "] was pressed.");
        class acceptListener implements ActionListener {       
            public void actionPerformed(ActionEvent e) {
                   acceptListener_actionPerformed(e);
    }  I am not able to get the button Listener to work. I get NullPointerException at this line
              acceptButton.addActionListener(new acceptListener());in the class detail02.
    Is this the right way? Or is there a better way of accomplishing my objective?
    Please help. Your inputs are precious! Thank you very much for your time!

  • Example of how to call a BadI from an Abap and use the NEW OO ALV Grid

    Very easy to do.
    <b>REPORT  Z_BADI_TEST.
    test call Badi from standard abap.
    *Only from rel 6.40
    do the following
    1) define the Badi  (SE18).
    For Abap call test uncheck multiple use
    and filter boxes
    2) Implement the badi (SE19).
    Add any methods here in the implementation
    3) activate
    4)  define the standard class exithandler to the
    Abap. This class is the "Badi caller
    5)  define an exit variable referring to your Badi
    Implementation interface
    this interface  will normally be
    called something like 
    ZIF_EX***************
      You will see the actual name in SE18/SE19.
    6)  Instantiate your instance of the badi
    via  method call get_instance
    7)  Now call any method(s) in the Badi.
    *****************start of abap code **************
    Define the Badi calling class (standard sap class)
      class cl_exithandler definition load.   "Declaration
    *Interface reference  
      data exit type ref to zif_ex__jimbotest.    
         data yes type c.
    Used in Fmod call in Badi methods
        data: v_knvv type knvv.
        start-of-selection.
        yes = ' '.
      selection-screen  begin of block b1.
      parameters: r1  radiobutton  group rad1,
                  r2  radiobutton group rad1,
                  r3  radiobutton group rad1.
      selection-screen end of block b1.
        parameters: p_kunnr type knvv-kunnr.
        select  single * into v_knvv
        from knvv
         where kunnr eq p_kunnr.
         export v_knvv to memory id 'CUST6A'.
    *Save customer data for the function module call
    call method cl_exithandler=>get_instance 
           exporting 
           exit_name    = 'Z_JIMBOTEST' "Your Badi Name
           null_instance_accepted = yes
              changing instance = exit.
       if not exit is initial.
           if r1 = 'X'.
         call method exit->dispord .  "Badi call
          endif.
    if r2 = 'X'.
    call method exit->dispfakt.     "Badi Call
    endif.
    if r3 = 'X'.
    call method exit->dispmat.      "Badi call
    endif.
    end of calling abap******** </b>
    In the badi   methods code as shown
    1)
    method ZIF_EX__JIMBOTEST~DISPORD.
    CALL FUNCTION 'Z_DISPLAY_CUST'.
    endmethod.
    2)
    method ZIF_EX__JIMBOTEST~DISPFAKT.
    CALL FUNCTION 'Z_DISPLAY_FAKT'.
    endmethod
    3)
    method ZIF_EX__JIMBOTEST~DISPMAT.
    CALL FUNCTION 'Z_DISPLAY_CUST'.
    endmethod.
    Copy via SE 41 the status SALV_STANDARD from  standard SAP program SALV_DEMO_METADATA into the main program where you've created the 3 function modules below (SAP______TOP)
    Global Data for the three function modules I'm calling
    FUNCTION-POOL Z_BADI_KNVV.                  "MESSAGE-ID ..
    include <color>.
    include <icon>.
    include <symbol>.
    tables: zknvv.
    data: v_zzkvgr6  TYPE KNVV-ZZKVGR6.
    data: choice1  type c.
    data: choice2 type c.
    data: choice3 type c.
    data: choice4 Type c.
    data: ok-code(5) type c.
    data: answer type string.
    data: value1 type SPOP-VARVALUE1.
    data: answer1  type string.
    tables:  vbak, vbap,  vakpa, vbrk, vrkpa.
    data: lr_functions type ref to cl_salv_functions_list.
    constants: gc_true  type sap_bool value 'X',
               gc_false type sap_bool value space.
    add for colour displays
       data: ls_color type lvc_s_colo.
       DATA : LV_SALV_COLUMNS_TABLE TYPE REF TO CL_SALV_COLUMNS_TABLE.
      data: lr_columns type ref to cl_salv_columns_table,
            lr_column  type ref to cl_salv_column_table.
    Data:
            gr_table TYPE REF TO cl_salv_table.
    data: z_datum type sy-datum.
    data: v_knvv type knvv.
    data : begin of s_vbak,
              vkorg   type vakpa-vkorg,
              vkgrp   type vakpa-vkgrp,
              vtweg   type vakpa-vtweg,
              spart   type vakpa-spart,
              auart   type vakpa-auart,
              vbeln   type vakpa-vbeln,
              bstnk   type vakpa-bstnk,
              audat   type vakpa-audat,
              netwr   type vbak-netwr,
           end of s_vbak.
    data : begin of s_vbrk,
              vbeln   type vrkpa-vbeln,
              vkorg   type vrkpa-vkorg,
              fkart   type vrkpa-fkart,
              fkdat   type vrkpa-fkdat,
              netwr   type vbrk-netwr,
           end of s_vbrk.
      data: begin of s_vbap,
             matnr   type vbap-matnr,
             arktx   type vbap-arktx,
             netwr   type vbap-netwr,
             kwmeng  type vbap-kwmeng,
          end of s_vbap.
    data: t_vbap like table of s_vbap.
    data:   t_vbak
            like table of s_vbak.
      data:   t_vbrk
            like table of s_vbrk.
    data:   s_name  type tabname.
    data: gr_selections type ref to cl_salv_selections.
    data: gr_events type ref to cl_salv_events_table.
    Source code of the function modules.
    Function modules themselves
    FUNCTION Z_DISPLAY_CUST.
    s_name = 'S_VBAK'.
    orders in last 6 months
    z_datum = sy-datum - 180.
    import v_knvv from memory id 'CUST6A'.
    get data
       select avkorg aaudat avkgrp avtweg aspart aauart abstnk avbeln b~netwr
          into corresponding fields of  table t_vbak
          up to 100 rows
             from (  vakpa as a
              inner join vbak as b
               on avbeln eq bvbeln )
            where a~kunde eq v_knvv-kunnr
            and a~parvw eq 'AG'
           and a~vkorg eq 'EN01'
            and a~trvog eq '0'
            and a~audat gt z_datum.
    sort t_vbak by audat descending.
    *data: gt_hyperlink type standard table of g_type_s_hyperlink.
    Instead of if_salv_c_bool_sap=>false, you can pass the
    value if_salv_c_bool_sap=>true to this method to
    see your ALV as a list.
    display data in Grid / List
      TRY.
          CALL METHOD cl_salv_table=>factory
            EXPORTING
              list_display   = if_salv_c_bool_sap=>false
            IMPORTING
              r_salv_table   = gr_table
            CHANGING
              t_table    = t_vbak.
        CATCH cx_salv_msg.
      ENDTRY.
    try.
    LV_SALV_COLUMNS_TABLE = gr_table->get_columns( ).
    lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'NETWR' ).
          ls_color-col = col_negative.
          ls_color-int = 0.
          ls_color-inv = 0.
          lr_column->set_color( ls_color ).
      catch cx_salv_not_found.
    endtry.
    try.
    lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'VBELN' ).
    ls_color-col = col_negative.
          ls_color-int = 1.
          ls_color-inv = 1.
          lr_column->set_color( ls_color ).
    catch cx_salv_not_found.
    endtry.
    try.
    *LV_SALV_COLUMNS_TABLE = gr_table->get_columns( ).
    lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'NETWR' ).
    lr_column->set_short_text( 'Short' ).
    lr_column->set_medium_text( 'Medium' ).
    lr_column->set_long_text( 'Net Value' ).
    *lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'URL' ).
    catch cx_salv_not_found.
    endtry.
    gr_table->set_screen_status( pfstatus = 'SALV_STANDARD'
    report = sy-repid
    set_functions = gr_table->c_functions_all ).
    this statement actually does the display.
      gr_table->display( ).
    ENDFUNCTION.
    FUNCTION Z_DISPLAY_FAKT.
    s_name = 'S_VBRK'.
    invoices in last 6 months
    z_datum = sy-datum - 180.
    import v_knvv from memory id 'CUST6A'.
    get data
       select avbeln afkart avkorg afkdat
         b~netwr
          into corresponding fields of  table t_vbrk
          up to 100 rows
             from (  vrkpa as a
              inner join vbrk as b
               on avbeln eq bvbeln )
            where a~kunde eq v_knvv-kunnr
            and a~parvw eq 'RG'
           and a~vkorg eq 'EN01'
            and a~vbtyp eq 'M'
            and a~fkdat gt z_datum.
    sort t_vbrk by fkdat descending.
    *data: gt_hyperlink type standard table of g_type_s_hyperlink.
    Instead of if_salv_c_bool_sap=>false, you can pass the
    value if_salv_c_bool_sap=>true to this method to
    see your ALV as a list.
    display data in Grid / List
      TRY.
          CALL METHOD cl_salv_table=>factory
            EXPORTING
              list_display   = if_salv_c_bool_sap=>false
            IMPORTING
              r_salv_table   = gr_table
            CHANGING
              t_table    = t_vbrk.
        CATCH cx_salv_msg.
      ENDTRY.
    try.
    LV_SALV_COLUMNS_TABLE = gr_table->get_columns( ).
    lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'NETWR' ).
          ls_color-col = col_negative.
          ls_color-int = 0.
          ls_color-inv = 0.
          lr_column->set_color( ls_color ).
          catch cx_salv_not_found.
    endtry.
    try.
    lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'VBELN' ).
    ls_color-col = col_negative.
          ls_color-int = 1.
          ls_color-inv = 1.
          lr_column->set_color( ls_color ).
    catch cx_salv_not_found.
    endtry.
    try.
    *LV_SALV_COLUMNS_TABLE = gr_table->get_columns( ).
    lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'NETWR' ).
    lr_column->set_short_text( 'Short' ).
    lr_column->set_medium_text( 'Medium' ).
    lr_column->set_long_text( 'Net Value' ).
    *lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'URL' ).
    catch cx_salv_not_found.
    endtry.
    gr_table->set_screen_status( pfstatus = 'SALV_STANDARD'
    report = sy-repid
    set_functions = gr_table->c_functions_all ).
    this statement actually does the display.
      gr_table->display( ).
    ENDFUNCTION.
    FUNCTION Z_DISPLAY_MATERIAL.
    s_name = 'S_VBAP'.
    invoicesrs in last 6 months
    z_datum = sy-datum - 180.
    import v_knvv from memory id 'CUST6A'.
    get data
    select avbeln bmatnr barktx bnetwr b~kwmeng
    into corresponding fields of  table t_vbap
          up to 100 rows
    from (  vakpa as a
              inner join vbap as b
               on avbeln eq bvbeln )
            where a~kunde eq v_knvv-kunnr
            and a~parvw eq 'AG'
           and a~vkorg eq 'EN01'
            and a~trvog eq '0'
            and a~audat gt z_datum.
    TRY.
          CALL METHOD cl_salv_table=>factory
            EXPORTING
              list_display   = if_salv_c_bool_sap=>false
            IMPORTING
              r_salv_table   = gr_table
            CHANGING
              t_table    = t_vbap.
        CATCH cx_salv_msg.
      ENDTRY.
    try.
    LV_SALV_COLUMNS_TABLE = gr_table->get_columns( ).
    lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'NETWR' ).
          ls_color-col = col_negative.
          ls_color-int = 0.
          ls_color-inv = 0.
          lr_column->set_color( ls_color ).
      catch cx_salv_not_found.
    endtry.
    try.
    lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'ARKTX' ).
    ls_color-col = col_negative.
          ls_color-int = 1.
          ls_color-inv = 1.
          lr_column->set_color( ls_color ).
    catch cx_salv_not_found.
    endtry.
    try.
    *LV_SALV_COLUMNS_TABLE = gr_table->get_columns( ).
    lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'NETWR' ).
    lr_column->set_short_text( 'Short' ).
    lr_column->set_medium_text( 'Medium' ).
    lr_column->set_long_text( 'Net Value' ).
    *lr_column ?= LV_SALV_COLUMNS_TABLE->get_column( 'URL' ).
    catch cx_salv_not_found.
    endtry.
    gr_table->set_screen_status( pfstatus = 'SALV_STANDARD'
    report = sy-repid
    set_functions = gr_table->c_functions_all ).
    this statement actually does the display.
      gr_table->display( ).
    ENDFUNCTION.
    You can extend this as far as you like -- it's really easy and MUCH MUCH easier than the old way with fieldcatalogs etc etc.

    If the pagecontainer_mc holds another movieclip that contains the button you are trying to target, then you need to include that loaded movieclip in the targeting.  And if contacts is that movieclip, then you should be able to target it directly using...
    var contacts:contatti = new contatti;
    contacts.contacts_btn.addEventListener(MouseEvent.CLICK,showContacts);

  • Non-static method cannot be referenced from a static context....again sry

    Hey, I know you guys have probably seen a lot of these, but its for an assignment and I need some help. The error I'm getting is: non-static method printHistory() cannot be referenced from a static context. Here are the classes effected
    public class BankAccount {
    private static int nextAccountNumber = 1000;
    //used to generate account numbers
    private String owner; //name of person who owns the account
    private int accountNumber; //a valid and unique account number;
    private double balance; //amount of money in the account
    private TransactionHistory transactions; //collection of past transactions
    private Transaction transaction;
    //constructor
    public BankAccount(String anOwnerName){
    owner = anOwnerName;
    accountNumber = nextAccountNumber++;
    balance = 0.0;
    transactions = new TransactionHistory();
    //public String getOwner() {
    public void deposit(double anAmount ){
         balance=balance+anAmount;
         transaction=new Transaction(TransactionType.DEPOSIT,accountNumber,anAmount,balance);
         transactions.add(transaction);
    //public void withdraw(double anAmount){
    //public String toString() {
    ***public void printHistory(){
         TransactionHistory.printHistory();
    AND
    public class TransactionHistory {
    final static int CAPACITY = 6; //maximum number of transactions that can be remembered
    //intentionally set low to make testing easier
    private Transaction[] transactions = new Transaction[CAPACITY];
    //array to store transaction objects
    private int size = 0;
    //the number of actual Transaction objects in the collection
    public void add(Transaction aTransaction){
         if (size>5){
         transactions[0]=transactions[1];
         transactions[1]=transactions[2];
         transactions[2]=transactions[3];
         transactions[3]=transactions[4];
         transactions[4]=transactions[5];
         transactions[5]=aTransaction;     
         transactions[size]=aTransaction;
         size=size++;
    public int size() {
         return size;
    ***public void printHistory() {
         for(int i=0;i<6;i++){
              System.out.println(transactions);
    //public void printHistory(int n){
    The project still isn't finished, so thats why some code is commented out. The line with *** infront on it are the methods directly effected, I think. Any help would be great.

    In Java, static means "something pertaining to an object class". Often, the term class is substituted for static, as in "class method" or "class variable." Non-static, on the other hand, means "something pertaining to an actual instance of an object. Similarly, the term +instance+ is often substituted for +non-static+, as in "instance method" or "instance variable."
    The error comes about because static members (methods, variables, classes, etc.) don't require an instance of the object to be accessed; they belong to the class. But a non-static member belongs to an instance -- an individual object. There's no way in a static context to know which instance's variable to use or method to call. Indeed, there may not be any instances at all! Thus, the compiler happily tells you that you can't access an instance member (non-static) from a class context (static).
    ~

  • Non-static method paint cannot be referenced from static context

    i cant seem to figure out this error dealing method paint:
    public class TemplateCanvas extends Canvas implements Runnable {
        //static
        public static final int STATE_IDLE      = 0;
        public static final int STATE_ACTIVE    = 1;
        public static final int STATE_DONE      = 2;
        private int     width;
        private int     height;
        private Font    font;
        private Command start;   
        private int state;
        private String message;
        public TemplateCanvas() {
            width = getWidth();
            height = getHeight();       
            font = Font.getDefaultFont();
            //// set up a command button to start network fetch
            start = new Command("Start", Command.SCREEN, 1);
            addCommand(start);
        public void paint(Graphics g) {
            g.setColor(0xffffff);
            g.fillRect(0, 0, width, height);
            g.setColor(0);
            g.setFont(font);
            if (state == STATE_ACTIVE) {
                Animation.paint(g);
            } else if (state == STATE_DONE) {
                g.drawString(message, width >> 1, height >> 1, Graphics.TOP | Graphics.HCENTER);
        public void commandAction(Command c, Displayable d) {
            if (c == start) {
                removeCommand(start);
                //// start fetching in a new thread
                Thread t = new Thread(this);
                t.start();
        public void run() {
            state = STATE_ACTIVE;
            //// start network fetch
            Network network = new Network();
            network.start();
            //// start busy animation
            Animation anim = new Animation(this);
            anim.start();
            //// wait for network to finish
            synchronized (network) {
                try {
                    wait();
                } catch (InterruptedException ie) { }
            //// end animation
            anim.end();
            //// get message from network
            message = network.getResult();
            //// repaint message
            state = STATE_DONE;
            repaint();
    }TemplateCanvas.java:38: non-static method paint(javax.microedition.lcdui.Graphics) cannot be referenced from a static context

    Animation.paint(g); paint() is not a static method. That means you have to call it on an instance of an Animation class (an object), not on the class itself. This is designed this way because the paint() method uses variables that have to be instantiated, so if you don't have an instance to use, it can't access the variables it needs. Static methods don't use instance variables, they only use what's passed in to them, so they don't need to be called on an object. Hope that was clear.

  • Non-static method getIDnumber() cannot be referenced from a static context

    Student.java
    public class Student
         private int IDnumber;
         private int hours;
         private int points;
         public Student()
       IDnumber = 9999;
       points = 12;
       hours = 3;
         public void setIDnumber(int number)
         IDnumber = number;
       public int getIDnumber()
         return IDnumber;
       public void setHours(int number)
       hours = number;
       public int getHours()
       return hours;
       public void setPoints(int number)
       points = number;
       public int getPoints()
       return points;
         public void showIDnumber()
       System.out.println("ID Number is " + IDnumber);
       public void showHours()
       System.out.println("Credit Hours are " + hours);
       public void showPoints()
       System.out.println("Points Earned are " + points);
       public double getGradePoint()
       return (double) (points / hours);
    ShowStudent.java
    public class ShowStudent
         public static void main(String[] args)
              Student learner = new Student();
              int IDnumber;
              int points;
              int hours;
              IDnumber = Student.getIDnumber();
              points = Student.getPoints();
              hours = Student.getHours();
              System.out.println("ID number is " + IDnumber);
              System.out.println("Hours are " + hours);
              System.out.println("Points are " + points);
    Here I get the following.  How do I fix this?  Thanks.
    ShowStudent.java:9: non-static method getIDnumber() cannot be referenced from a
    static context
    IDnumber = Student.getIDnumber();
    ^
    ShowStudent.java:10: non-static method getPoints() cannot be referenced from a
    static context
    points = Student.getPoints();
    ^
    ShowStudent.java:11: non-static method getHours() cannot be referenced from a s
    tatic context
    hours = Student.getHours();
    ^
    3 errors

    You have to get the ID number of a particular instance i.e. IDnumber = learner.getIDnumber();

  • Non-static method getContentPane() cannot be referenced from a static conte

    From this line I'm getting an error
    Container bmC = getContentPane();
    - non-static method getContentPane() cannot be referenced from a static context
    Aprecciate solution,
    thx

    The reason this is happening is that you can't call non-static methods from a static method. Non-static methods need an instance in order to be called. Static methods are not associated with an instance.

Maybe you are looking for

  • Web dynpro and database

    I need to get to the sap db from my web dynpro, and I need to be able to save/retrieve/modify data.  Any idea how to approach it?? I've looked into creating ejbs but have been unsuccessful at finding an ejb document on how to create them and then use

  • Change the speed of the Directions.HD Template

    I want to use this template (Direction.HD) but it goes way too fast for my project. I can't find where to change the speed of any of the elements - particularly the arrows. The only items that I can find a speed on are in the Video Group - the clone

  • Will an HD 5870 run on a Mac Pro 1,1 under Windows?

    Hey Guys, Done a search for this but can't find any information. I'm looking into getting a little more life out of my Mac Pro (Quad 2.66, 13Gb RAM, HD 3870) by being able to use it for PC gaming, and was wondering whether any of the latest video car

  • Built-in mic on Thinkpad Edge E545 Win 8.1 not working

    OK so when I got this computer shipped to me from school back in November of 2014 it had Win. 7 on it. I had the Windows 8 recovery disc and decided to use that to upgrade the OS. Since that day my mic has been on steriods. I also keep getting the st

  • Connectivity of Applet with Oracle

    I am able to connect an Applet to oracle.It is displayed on the client browser only when there is an .java.policy file in my home directory.I created a .java.policy file on my server home directory.It is not running on the client machine.Please let m