Skip to Content
0
Nov 16, 2016 at 12:45 PM

Call Method from a ABAP Program

1817 Views

Hi all,

I wrote two programs.

Program 1

REPORT ztm_prog1.
TABLES: scarr.


SELECTION-SCREEN BEGIN OF BLOCK 001 WITH FRAME TITLE text-001.
SELECT-OPTIONS: carrid FOR scarr-carrid.
SELECTION-SCREEN END OF BLOCK 001.

CLASS program DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS main.
    CLASS-METHODS initialization.
  PRIVATE SECTION.


ENDCLASS.
CLASS program IMPLEMENTATION.
  METHOD main.


  ENDMETHOD.
  METHOD initialization.
    CLEAR: carrid.
    carrid = VALUE #( low = 'LH' option = 'EQ' sign = 'I' ) .
    APPEND carrid TO carrid.
  ENDMETHOD.
ENDCLASS.


INITIALIZATION.
  program=>initialization( ).


START-OF-SELECTION.
  program=>main( ).

Program 2

REPORT ztm_prog2.


**** Call the method from Program 1
(ztm_prog1)program=>main( ). "How is the syntax ????

How can i call the static method main from program ztm_prog1?