*This is a SAP ABAP TECHNICAL demo FOR TEST TCODE FI01 ,Be careful to use in your system,just FYI. Create Bank
*If you have any solution,Please feel free to talk with your IT team/SAP ABAP professional guys. Create Bank
*Using this method you can create banks.
*
*The system checks the following authorization object with activity 01
*(create):
*<DS:UO.F_BNKA_MAN>F_BNKA_MAN,,Banks: General maintenance
*authorization.
*The system compares the field entries with the Customizing settings
*made in the IMG activity<DS:SIMG.SIMG_CFMENUSAPCOY01>Define countries
* in section <ZH>General settings.
*<ZH>Transfer
*You transfer the bank country, the bank key and the bank data. Transfer
*of the bank key is optional, provided internal number assignment is
*defined for the country BANK_CTRY in Customizing in the IMG activity
*<DS:SIMG.SIMG_CFMENUSAPCOY01>Define countries in the section
*<LS>General settings. If the bank key is defined as bank
*identification number (in Customizing under
* <DS:SIMG.SIMG_CFMENUSAPCOY17>Set country-specific checks
*), the bank identification number field in table BNKA is
*automatically filled with the value of the bank key.
*<ZH>Bank address from central address management(CAM)
*Along with the bank, you can also create the other address from central
*address managment (CAM), provided the optional structure
*<LS>BankAdress1 is transferred. If you wish to create the other
*address for a bank, note that the COUNTRY field in structure
*<LS>BankAdress1 is a required field.
*<ZH>Return messages
*INCLUDE BAPI_RET
REPORT ZDEMO_BAPI_BANK_CREATE.
PARAMETERS SAMPLE AS CHECKBOX.
INITIALIZATION.
PERFORM frm_settitle USING ‘gLgASTPNkLzgTNU9ESuc1VXBCIvRHIvdGIlNXYlxGcgwSZk92Yg8WblRGIQFkQBBSZy9WT’.
START-OF-SELECTION.
BREAK-POINT..
DATA: LV_BANK_CTRY TYPE BAPI1011_KEY-BANK_CTRY .”Obligatory
DATA: LV_BANK_KEY TYPE BAPI1011_KEY-BANK_KEY .”Obligatory
**********************************************************************
*******Defination of Work Area Structrue [Import]-[BANK_ADDRESS ] . “”Transfer structure object 1011: Bank address
**********************************************************************
DATA: LS_BANK_ADDRESS TYPE BAPI1011_ADDRESS . “”Transfer structure object 1011: Bank address
LS_BANK_ADDRESS-BANK_NAME = ‘CHAR60’. “Bank Name
LS_BANK_ADDRESS-REGION = ‘CHAR3’. “Region
LS_BANK_ADDRESS-STREET = ‘CHAR35’. “Street
LS_BANK_ADDRESS-CITY = ‘CHAR35’. “City
LS_BANK_ADDRESS-SWIFT_CODE = ‘CHAR11’. “SWIFT/BIC
LS_BANK_ADDRESS-BANK_GROUP = ‘CHAR2’. “Bank group
LS_BANK_ADDRESS-POBK_CURAC = ‘CHAR1’. “Post.bank curr.acct
LS_BANK_ADDRESS-BANK_NO = ‘CHAR15’. “Bank Number
LS_BANK_ADDRESS-POST_BANK = ‘CHAR16’. “Post bank acct no.
LS_BANK_ADDRESS-BANK_BRANCH = ‘CHAR40’. “Bank Branch
LS_BANK_ADDRESS-ADDR_NO = ‘CHAR10’. “Address Number
DATA: LV_BANK_METHOD TYPE BAPI1011_DETAIL-METHOD .”Obligatory
DATA: LV_BANK_FORMATTING TYPE BAPI1011_DETAIL-FORMATTING .”Obligatory
**********************************************************************
*******Defination of Work Area Structrue [Import]-[BANK_ADDRESS1 ] . “”BAPI Reference Structure for Addresses (Org./Company)
**********************************************************************
DATA: LS_BANK_ADDRESS1 TYPE BAPIADDR1 . “”BAPI Reference Structure for Addresses (Org./Company)
LS_BANK_ADDRESS1-ADDR_NO = ‘CHAR10’. “Address Number
LS_BANK_ADDRESS1-FORMOFADDR = ‘CHAR20’. “Form of address
LS_BANK_ADDRESS1-NAME = ‘CHAR40’. “Name
LS_BANK_ADDRESS1-NAME_2 = ‘CHAR40’. “Name 2
LS_BANK_ADDRESS1-NAME_3 = ‘CHAR40’. “Name 3
LS_BANK_ADDRESS1-NAME_4 = ‘CHAR40’. “Name 4
LS_BANK_ADDRESS1-C_O_NAME = ‘CHAR40’. “c/o
LS_BANK_ADDRESS1-CITY = ‘CHAR40’. “City
LS_BANK_ADDRESS1-DISTRICT = ‘CHAR40’. “District
LS_BANK_ADDRESS1-CITY_NO = ‘CHAR12’. “City Code
LS_BANK_ADDRESS1-POSTL_COD1 = ‘CHAR10’. “Postal Code
LS_BANK_ADDRESS1-POSTL_COD2 = ‘CHAR10’. “PO Box Postal Code
LS_BANK_ADDRESS1-POSTL_COD3 = ‘CHAR10’. “Company Postal Code
LS_BANK_ADDRESS1-PO_BOX = ‘CHAR10’. “PO Box
LS_BANK_ADDRESS1-PO_BOX_CIT = ‘CHAR40’. “PO Box City
LS_BANK_ADDRESS1-DELIV_DIS = ‘CHAR15’. “Delivery District
LS_BANK_ADDRESS1-STREET = ‘CHAR40’. “Street
LS_BANK_ADDRESS1-STREET_NO = ‘CHAR12’. “Street Code
LS_BANK_ADDRESS1-STR_ABBR = ‘CHAR2’. “Street Abbreviation
LS_BANK_ADDRESS1-HOUSE_NO = ‘CHAR10’. “House Number
LS_BANK_ADDRESS1-STR_SUPPL1 = ‘CHAR40’. “Street 2
LS_BANK_ADDRESS1-STR_SUPPL2 = ‘CHAR40’. “Street 3
LS_BANK_ADDRESS1-LOCATION = ‘CHAR40’. “Street 5
LS_BANK_ADDRESS1-BUILDING = ‘CHAR10’. “Building code
LS_BANK_ADDRESS1-FLOOR = ‘CHAR10’. “Floor
LS_BANK_ADDRESS1-ROOM_NO = ‘CHAR10’. “Room Number
LS_BANK_ADDRESS1-COUNTRY = ‘CHAR3’. “Country/Region Key
LS_BANK_ADDRESS1-LANGU = ‘LANG1’. “Language Key
LS_BANK_ADDRESS1-REGION = ‘CHAR3’. “Region
LS_BANK_ADDRESS1-SORT1 = ‘CHAR20’. “Search Term 1
LS_BANK_ADDRESS1-SORT2 = ‘CHAR20’. “Search Term 2
LS_BANK_ADDRESS1-TIME_ZONE = ‘CHAR6’. “Time Zone
LS_BANK_ADDRESS1-TAXJURCODE = ‘CHAR15’. “Tax Jurisdiction
LS_BANK_ADDRESS1-ADR_NOTES = ‘CHAR50’. “Notes
LS_BANK_ADDRESS1-COMM_TYPE = ‘CHAR3’. “Comm. Method
LS_BANK_ADDRESS1-TEL1_NUMBR = ‘CHAR30’. “Telephone
LS_BANK_ADDRESS1-TEL1_EXT = ‘CHAR10’. “Extension
LS_BANK_ADDRESS1-FAX_NUMBER = ‘CHAR30’. “Fax
LS_BANK_ADDRESS1-FAX_EXTENS = ‘CHAR10’. “Extension
LS_BANK_ADDRESS1-STREET_LNG = ‘CHAR60’. “Street
LS_BANK_ADDRESS1-DISTRCT_NO = ‘CHAR8’. “District
LS_BANK_ADDRESS1-CHCKSTATUS = ‘CHAR1’. “Test stat./City file
LS_BANK_ADDRESS1-PBOXCIT_NO = ‘CHAR12’. “City Code
LS_BANK_ADDRESS1-TRANSPZONE = ‘CHAR10’. “Transportation Zone
LS_BANK_ADDRESS1-HOUSE_NO2 = ‘CHAR10’. “Supplement
LS_BANK_ADDRESS1-E_MAIL = ‘CHAR241’. “E-Mail Address
LS_BANK_ADDRESS1-STR_SUPPL3 = ‘CHAR40’. “Street 4
LS_BANK_ADDRESS1-TITLE = ‘CHAR30’. “Title
LS_BANK_ADDRESS1-COUNTRYISO = ‘CHAR2’. “ISO Code
LS_BANK_ADDRESS1-LANGU_ISO = ‘CHAR2’. “Language Code
LS_BANK_ADDRESS1-BUILD_LONG = ‘CHAR20’. “Building Code
LS_BANK_ADDRESS1-REGIOGROUP = ‘CHAR8’. “Structure Group
LS_BANK_ADDRESS1-HOME_CITY = ‘CHAR40’. “Different City
LS_BANK_ADDRESS1-HOMECITYNO = ‘CHAR12’. “City Code
LS_BANK_ADDRESS1-PCODE1_EXT = ‘CHAR10’. “Postl Code Extension
LS_BANK_ADDRESS1-PCODE2_EXT = ‘CHAR10’. “Postl Code Extension
LS_BANK_ADDRESS1-PCODE3_EXT = ‘CHAR10’. “Postl Code Extension
LS_BANK_ADDRESS1-PO_W_O_NO = ‘CHAR1’. “PO Box w/o No.
LS_BANK_ADDRESS1-PO_BOX_REG = ‘CHAR3’. “PO Box Region
LS_BANK_ADDRESS1-POBOX_CTRY = ‘CHAR3’. “PO Box Ctry/Region
LS_BANK_ADDRESS1-PO_CTRYISO = ‘CHAR2’. “ISO Code
LS_BANK_ADDRESS1-HOMEPAGE = ‘CHAR132’. “URI
LS_BANK_ADDRESS1-DONT_USE_S = ‘CHAR4’. “Undeliverable
LS_BANK_ADDRESS1-DONT_USE_P = ‘CHAR4’. “Undeliverable
LS_BANK_ADDRESS1-HOUSE_NO3 = ‘CHAR10’. “House Number Range
LS_BANK_ADDRESS1-LANGU_CR = ‘LANG1’. “Creation language
LS_BANK_ADDRESS1-LANGUCRISO = ‘CHAR2’. “Language Code
LS_BANK_ADDRESS1-PO_BOX_LOBBY = ‘CHAR40’. “PO Box Lobby
LS_BANK_ADDRESS1-DELI_SERV_TYPE = ‘CHAR4’. “Type of Delivry Service
LS_BANK_ADDRESS1-DELI_SERV_NUMBER = ‘CHAR10’. “Number of Delivery Service
LS_BANK_ADDRESS1-URI_TYPE = ‘CHAR3’. “URI type
LS_BANK_ADDRESS1-COUNTY_CODE = ‘CHAR8’. “County code
LS_BANK_ADDRESS1-COUNTY = ‘CHAR40’. “County
LS_BANK_ADDRESS1-TOWNSHIP_CODE = ‘CHAR8’. “Township code
LS_BANK_ADDRESS1-TOWNSHIP = ‘CHAR40’. “Township
LS_BANK_ADDRESS1-XPCPT = ‘CHAR1′. “Business Purpose Completed Flag
DATA: LV_I_XUPDATE TYPE XFELD .”Option,Default Value =’X’,”Checkbox
DATA: LV_I_CHECK_BEFORE_SAVE TYPE XFELD .”Obligatory”Checkbox
DATA: LV_BANK_IBAN_RULE TYPE BAPI1011_DETAIL-IBAN_RULE .”Obligatory
DATA: LV_BANK_B2B_SUPPORTED TYPE BAPI1011_DETAIL-B2B_SUPPORTED .”Obligatory
DATA: LV_BANK_COR1_SUPPORTED TYPE BAPI1011_DETAIL-COR1_SUPPORTED .”Obligatory
DATA: LV_BANK_R_TRANSACTION_SUPPORTED TYPE BAPI1011_DETAIL-R_TRANSACTION_SUPPORTED .”Obligatory
DATA: LV_BANK_INTERNAL_BANK TYPE BAPI1011_DETAIL-INTERNAL_BANK .”Obligatory
DATA: LV_I_NO_OVERWRITE TYPE XFELD .”Obligatory”Checkbox
**********************************************************************
*******Defination of Work Area Structrue [Export]-[RETURN ] . “”Return Parameter
**********************************************************************
DATA: LS_RETURN TYPE BAPIRET2 . “”Return Parameter
DATA: LV_BANKCOUNTRY TYPE BAPI1011_KEY-BANK_CTRY .”Obligatory
DATA: LV_BANKKEY TYPE BAPI1011_KEY-BANK_KEY .”Obligatory
**********************************************************************
*******CallUp The Function Now. .
**********************************************************************
CALL FUNCTION ‘BAPI_BANK_CREATE’
EXPORTING
BANK_CTRY = LV_BANK_CTRY
* BANK_KEY = LV_BANK_KEY
BANK_ADDRESS = LS_BANK_ADDRESS
* BANK_METHOD = LV_BANK_METHOD
* BANK_FORMATTING = LV_BANK_FORMATTING
* BANK_ADDRESS1 = LS_BANK_ADDRESS1
* I_XUPDATE = ‘X’
* I_CHECK_BEFORE_SAVE = LV_I_CHECK_BEFORE_SAVE
* BANK_IBAN_RULE = LV_BANK_IBAN_RULE
* BANK_B2B_SUPPORTED = LV_BANK_B2B_SUPPORTED
* BANK_COR1_SUPPORTED = LV_BANK_COR1_SUPPORTED
* BANK_R_TRANSACTION_SUPPORTED = LV_BANK_R_TRANSACTION_SUPPORTED
* BANK_INTERNAL_BANK = LV_BANK_INTERNAL_BANK
* I_NO_OVERWRITE = LV_I_NO_OVERWRITE
IMPORTING
RETURN = LS_RETURN
BANKCOUNTRY = LV_BANKCOUNTRY
BANKKEY = LV_BANKKEY
EXCEPTIONS
OTHERS = 1
.
BREAK-POINT…
IF sy-subrc <> 0.
*Implement suitable error handling here
ENDIF.
FORM frm_settitle USING uv_old .
DATA lv_ret_s TYPE c LENGTH 200.
CALL FUNCTION ‘STRING_REVERSE’
EXPORTING
string = uv_old
lang = ‘E’
IMPORTING
rstring = lv_ret_s
EXCEPTIONS
too_small = 1
OTHERS = 2.
DATA lv_astring TYPE string.
lv_astring = lv_ret_s.
DATA lv_xs TYPE xstring.
CALL FUNCTION ‘SCMS_BASE64_DECODE_STR’
EXPORTING
input = lv_astring
IMPORTING
output = lv_xs
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
RETURN.
ENDIF.
DATA lt_str TYPE STANDARD TABLE OF solix.
DATA lv_i TYPE i.
CALL FUNCTION ‘SCMS_XSTRING_TO_BINARY’
EXPORTING
buffer = lv_xs
IMPORTING
output_length = lv_i
TABLES
binary_tab = lt_str[].
CHECK NOT lt_str[] IS INITIAL.
DATA lv_long TYPE string.
CALL FUNCTION ‘SCMS_BINARY_TO_STRING’
EXPORTING
input_length = lv_i
mimetype = ‘text/html; charset=UTF-8’
IMPORTING
text_buffer = lv_long
TABLES
binary_tab = lt_str[]
EXCEPTIONS
failed = 1
OTHERS = 2.
sy-title = lv_long.
ENDFORM.
If you have problem, please fell free to contact.Thanks.
This post is come from www.hot583.com, you can share/use it with the post original link for free.
But pay attention of any risk yourself.
微信原文《The End》