Calling BAPIs

Depending on the number of receivers maintained in the distribution model, the remote BAPI is called one or more times:

loop at receivers.
        call function 'BAPI_TESTFH01_GETDETAIL'
                        destination receivers-rfc_dest
                        exporting
                        key1                    = 'SAP'
                        key2                    = '007'
                        importing
                        return                  = returnvalue
                        testdata                = testdata
                exceptions
                        communication_failure   = 1 message_text
                        system_failure          = 2 message_text.
                If sy-subrc ne 0.
                        ..........
                else.
                        ..........
                endif.
endloop.
         

For more information on the individual steps, please refer to the ALE Programming Guide under Determining Receivers for Synchronous BAPIs.