Skip to Content
author's profile photo Former Member
Former Member

Method calls and IMPORTING parameters

I took the BC400 class awhile ago and am getting some free time to go back over the material in the class. Since I'm not an SAP dev by day I didn't have the opportunity to use the material right away. I'm finding it quite difficult to do this considering I don't have a training environment setup but I'll manage.

My question relates to method calls and the use of the importing and exporting statements. Please see the code snippet below. I've removed much of the code that I don't have questions on. The method call is meant to get a list of all connections from some database table and store it in an internal table gt_connections. Why is it doing this using an IMPORTING statement? I thought the purpose of the IMPORTING statement is to pass values to the called method and then use the EXPORTING statement to assign the values passed back to the calling method to some sort of data object.

TRY.
  CALL METHOD cl_bc400_flightmodel=>get_connections
    IMPORTING
      et_connections = gt_connections.
  CATCH cx_bc400_no_data.
    WRITE: / 'No data found!'(ndf). 
ENDTRY.

SORT gt_connections ASCENDING BY deptime.

LOOP AT gt_connections INTO gs_connection.
  WRITE: / gs_connection-carrid,
          ...
          ...
          ...
ENDLOOP.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2010 at 02:52 PM

    After taking a look at the material in the manual in more detail I realized that I had it backwards. IMPORTING is used to receive values back from the called method/function module. EXPORTING is used to send values from the caller.

    Edited by: Chuck DiRaimondi on Oct 26, 2010 4:52 PM

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.