Skip to Content
avatar image
Former Member

How to insert Method of a interface in ABAP code


Plz tell me how to insert a interface METHOD in ABAP code as we do in the case of inserting function in ABAP code using PATTERN Button.

I want insert 'Call method lo_class->zif_acct~get_acct_detail",

But when i use ABAP object patterns,Select call method,Then give the instance name , class/interface name and the method name.

I only get ' Call method lo_class->get_acct_detail.'

So i have to manually correct it .

Please Help.



Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Jul 28, 2015 at 08:47 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Tomas Buryanek

      Two times Ctrl Space is not required.

      You are talking about the case where partial method name is given before Ctrl Space and multiple matches are found.

      I do Ctrl+Space, up/down arrows to select match from list and then Shift+Enter.

      Shift+Enter always works for me.

  • Jul 28, 2015 at 08:55 AM

    Dear Roger,

    Follow the below steps. In this example, I am using class object "CL_GUI_FRONTEND_SERVICES" and method "GUI_UPLOAD".

    Click on Pattern. Choose,radio button "ABAP Object Pattern". Press continue

    You can try other Radio button option. I have displayed one way of doing it. Enter your class name and method name as shown below. Press continue.. that it you are there. :-)



    Download.jpg (52.2 kB)
    Download.jpg (44.6 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      It is working on my system, ABAP release 7.31.

      1. DATA lo TYPE REF TO cl_abap_c_reader.
      2. *TRY.
      3. CALL METHOD lo->if_abap_c_reader~read
      4. EXPORTING
      5. length = length
      6. RECEIVING
      7. result = result.
      8. * CATCH cx_resource_already_closed .
      9. * CATCH cx_stream_error .
      10. * CATCH cx_parameter_invalid_range .
      11. *ENDTRY.

      I called ABAP objects pattern and wrote instance as LO, class/interface as CL_ABAP_C_READER and then F4 help to get IF_ABAP_C_READER~READ, and press enter.