SAP CALL METHOD STATIC SHORT ABAP Statements
Get Example source ABAP code based on a different SAP table
ABAP Syntax
ABAP_ALTERNATIVES:
1
2
3
4
What does it do? Static call of a method specified by the name
ABAP Alternative 1
What does it do? Calls the method
INTHINT Undocumented feature: The spaces after the opening and before
INTHINT the closing bracket can be omitted
INTHINT if the actual parameter is a text literal within quotes.
Example ABAP Coding
Calls a method without parameters. CLASS c1 DEFINITION.
PUBLIC SECTION.
CLASS-METHODS do_something.
ENDCLASS.
CLASS c1 IMPLEMENTATION.
METHOD do_something.
...
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
c1=>do_something( ).
ABAP Alternative 2
What does it do? This is the short form of:
The method
The method can only have optional input/output parameters. No actual parameters are assigned to these input/output parameters, any output parameters, or a return value.
INTHINT Undocumented feature: The space before the closing
INTHINT bracket can be omitted if the last actual parameter
INTHINT is a text literal within quotes.
Example ABAP Coding
Calls a method with an input parameter CLASS c1 DEFINITION.
PUBLIC SECTION.
CLASS-METHODS do_something IMPORTING p type i.
ENDCLASS.
CLASS c1 IMPLEMENTATION.
METHOD do_something.
...
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
c1=>do_something( 333 ).
ABAP Alternative 3
What does it do? This is the short form of:
The method
The method can only have optional input/output parameters. No actual parameters are assigned to these input/output parameters, any output parameters, or a return value.
INTHINT Undocumented feature: The space before the closing
INTHINT bracket can be omitted if the last actual parameter
INTHINT is a text literal within quotes.
Example ABAP Coding
Calls a method with two input parameters. CLASS c1 DEFINITION.
PUBLIC SECTION.
CLASS-METHODS do_something IMPORTING p1 type i
p2 type i.
ENDCLASS.
CLASS c1 IMPLEMENTATION.
METHOD do_something.
...
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
c1=>do_something( p1 = 333 p2 = 444 ).
ABAP Alternative 4
What does it do? Calls the method
Example ABAP Coding
Calls a method with explicit pass by parameter. CLASS c1 DEFINITION.
PUBLIC SECTION.
CLASS-METHODS do_something IMPORTING p1 type i
p2 type i
EXPORTING p3 TYPE i
p4 TYPE i
RETURNING VALUE(r) type i.
ENDCLASS.
CLASS c1 IMPLEMENTATION.
METHOD do_something.
...
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
c1=>do_something( EXPORTING p1 = 333
p2 = 444
IMPORTING p3 = DATA(a1)
p4 = DATA(a2)
RECEIVING r = DATA(a3) ).
Return to menu