Skip to Content
0
Former Member
Jun 24, 2008 at 07:14 PM

is it corect way to write a bapi

25 Views


*data: begin of itab occurs 0,
*country like BAPI1011_KEY-BANK_CTRY,
*address like BAPI1011_ADDRESS,
*end of itab.
*
*start-of-selection.
*
*  CALL FUNCTION 'WS_UPLOAD'                                 "#EC *
*    EXPORTING
*      FILENAME                = 'C:/FILE.TXT'
*      FILETYPE                = 'DAT'
*    TABLES
*      DATA_TAB                =  itab
*    EXCEPTIONS
*      CONVERSION_ERROR        = 1
*      FILE_OPEN_ERROR         = 2
*      FILE_READ_ERROR         = 3
*      INVALID_TYPE            = 4
*      NO_BATCH                = 5
*      UNKNOWN_ERROR           = 6
*      INVALID_TABLE_WIDTH     = 7
*      GUI_REFUSE_FILETRANSFER = 8
*      CUSTOMER_ERROR          = 9
*      NO_AUTHORITY            = 10
*      OTHERS                  = 11.
*  IF  SY-SUBRC <> 0  .
**    MESSAGE E000.
*  ENDIF.
*
*loop at itab.
*CALL FUNCTION 'BAPI_BANK_CREATE'
*  EXPORTING
*    bank_ctry             = itab-country
**   BANK_KEY              =
*    bank_address          = itab-address
**   BANK_METHOD           =
**   BANK_FORMATTING       =
**   BANK_ADDRESS1         =
** IMPORTING
**   RETURN                =
**   BANKCOUNTRY           =
**   BANKKEY               =
*          .
* endloop.
*
*          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
**           EXPORTING
**             WAIT          =
**           IMPORTING
**             RETURN        =
*                    .
*  if sy-subrc = 0.
*  write:/ ' succesfully updated'.
*  endif.