Skip to Content
0
Former Member
Oct 26, 2010 at 02:48 PM

Method calls and IMPORTING parameters

66 Views

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.