Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

is it corect way to write a bapi

Former Member
0 Likes
1,282


*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.



*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.

10 REPLIES 10
Read only

Clemenss
Active Contributor
0 Likes
1,234

Hi,

to me it looks good. Did you try?

If it does not work, please compare the [documentation of the function module|http://abap.wikiprog.com/wiki/BAPI_BANK_CREATE]

Regards,

Clemens

Read only

Former Member
0 Likes
1,234

Hello,

Do not use WS_UPLOAD. Use gui_upload. WS_upload is outdated and obsolate.

Thanks and rgds,

Anand

Read only

Former Member
0 Likes
1,234

above code works fine .but which tables i have to see so that i kow banks are created

Read only

Former Member
0 Likes
1,234

Hi,

Code seems to be ok.

Thanks,

Sriram POnna.

Read only

0 Likes
1,234

yes its ok but i have uploaded some data which tables i have to see that data is present or not

Read only

0 Likes
1,234

table bnka

Read only

0 Likes
1,234

Hi,

Please refer table BNKA.

Thanks,

Sriram Ponna.

Read only

0 Likes
1,234

hi,

this BAPI wud help u create banks. Check the table BNKA to check the updated data.

Thanks

Nayan

Read only

0 Likes
1,234

when i try to view the contents of able bnka its saying changes to sap objects not allowed .

i am unable to view the contents

Read only

0 Likes
1,234

are u trying to edit the table?

go to se16-->bnka