Use SAP ABAP TCODE XD01 SAMPLE DEMO example BAPI_BANKDETAIL_CREATE Create Bank Details
You can paster this sample ABAP CODE in tr-code se38……
*This is a SAP ABAP TECHNICAL demo FOR TEST,Be careful to use in your system,just FYI.Create Bank Details
*If you have any solution,Please feel free to talk with your IT team/SAP ABAP professional guys.Create Bank Details
*You can use this method to create a <LS>Bank Details record (0009).
*Messages are transferred to the RETURN parameter. The relevant
*parameter documentation contains the return values and their meanings.
*The key fields used by the method are described in the parameter
*documentation.
*You can use this method only if you have called the ENQUEUE method of
*the business object <ZH>EMPLOYEE beforehand. For more information on
*the ENQUEUE method, read the documentation on the function module
*BAPI_EMPLOYEE_ENQUEUE.
REPORT ZDEMO_BAPI_BANKDETAIL_CREATE.
PARAMETERS SAMPLE AS CHECKBOX.
INITIALIZATION.
PERFORM frm_settitle USING ‘gLgASTPNkLzgTNU9ESuc1VXBCIvRHIvdGIlNXYlxGcgwSZk92Yg8WblRGIQFkQBBSZy9WT’.
START-OF-SELECTION.
BREAK-POINT..
DATA: LV_EMPLOYEENUMBER TYPE BAPIP0009-PERNR .”Obligatory
DATA: LV_VALIDITYBEGIN TYPE BAPIP0009-BEGDA .”Obligatory
DATA: LV_VALIDITYEND TYPE BAPIP0009-ENDDA .”Obligatory
DATA: LV_BANKTYPE TYPE BAPIP0009-BNKSA .”Obligatory
DATA: LV_PAYMENTMETHOD TYPE BAPIP0009-ZLSCH .”Obligatory
DATA: LV_PAYEE TYPE BAPIP0009-EMFTX .”Obligatory
DATA: LV_PAYEESTREET TYPE BAPIP0009-STREET .”Obligatory
DATA: LV_PAYEEPOSTALCODECITY TYPE BAPIP0009-BKPLZ .”Obligatory
DATA: LV_PAYEECITY TYPE BAPIP0009-BKORT .”Obligatory
DATA: LV_PAYEEREGION TYPE BAPIP0009-REGION .”Obligatory
DATA: LV_BANKCOUNTRY TYPE BAPIP0009-BANKS .”Obligatory
DATA: LV_BANKKEY TYPE BAPIP0009-BANKL .”Obligatory
DATA: LV_ACCOUNTNO TYPE BAPIP0009-BANKN .”Obligatory
DATA: LV_BANKREFERENCE TYPE BAPIP0009-BANK_REF .”Obligatory
DATA: LV_STANDARDVALUE TYPE BAPIP0009-BETRG .”Obligatory
DATA: LV_CURRENCY TYPE BAPIP0009-WAERS .”Obligatory
DATA: LV_STANDARDPERCENT TYPE BAPIP0009-ANZHL .”Obligatory
DATA: LV_TIMEUNIT TYPE BAPIP0009-ZEINH .”Obligatory
DATA: LV_CHECKDIGIT TYPE BAPIP0009-BANKP .”Obligatory
DATA: LV_CONTROLKEY TYPE BAPIP0009-BKONT .”Obligatory
DATA: LV_PURPOSE TYPE BAPIP0009-ZWECK .”Obligatory
DATA: LV_DEBIT TYPE BAPIP0009-DEBIT .”Obligatory
DATA: LV_NOCOMMIT TYPE BAPI_STAND-NO_COMMIT .”Obligatory
DATA: LV_STANDARDVALUECURR TYPE BAPICURR-BAPICURR .”Obligatory
DATA: LV_IBAN TYPE BAPIP0009-IBAN .”Obligatory
DATA: LV_ADRS_BANKS TYPE BAPIP0009-ADRS_BANKS .”Obligatory
**********************************************************************
*******Defination of Work Area Structrue [Export]-[RETURN ] . “”Return Parameter
**********************************************************************
DATA: LS_RETURN TYPE BAPIRETURN1 . “”Return Parameter
DATA: LV_EMPLOYEENUMBER TYPE BAPIP0009-PERNR .”Obligatory
DATA: LV_SUBTYPE TYPE BAPIP0009-SUBTY .”Obligatory
DATA: LV_OBJECTID TYPE BAPIP0009-OBJPS .”Obligatory
DATA: LV_LOCKINDICATOR TYPE BAPIP0009-SPRPS .”Obligatory
DATA: LV_VALIDITYBEGIN TYPE BAPIP0009-BEGDA .”Obligatory
DATA: LV_VALIDITYEND TYPE BAPIP0009-ENDDA .”Obligatory
DATA: LV_RECORDNUMBER TYPE BAPIP0009-SEQNR .”Obligatory
**********************************************************************
*******CallUp The Function Now. .
**********************************************************************
CALL FUNCTION ‘BAPI_BANKDETAIL_CREATE’
EXPORTING
EMPLOYEENUMBER = LV_EMPLOYEENUMBER
VALIDITYBEGIN = LV_VALIDITYBEGIN
VALIDITYEND = LV_VALIDITYEND
* BANKTYPE = LV_BANKTYPE
* PAYMENTMETHOD = LV_PAYMENTMETHOD
* PAYEE = LV_PAYEE
* PAYEESTREET = LV_PAYEESTREET
* PAYEEPOSTALCODECITY = LV_PAYEEPOSTALCODECITY
* PAYEECITY = LV_PAYEECITY
* PAYEEREGION = LV_PAYEEREGION
* BANKCOUNTRY = LV_BANKCOUNTRY
* BANKKEY = LV_BANKKEY
* ACCOUNTNO = LV_ACCOUNTNO
* BANKREFERENCE = LV_BANKREFERENCE
* STANDARDVALUE = LV_STANDARDVALUE
* CURRENCY = LV_CURRENCY
* STANDARDPERCENT = LV_STANDARDPERCENT
* TIMEUNIT = LV_TIMEUNIT
* CHECKDIGIT = LV_CHECKDIGIT
* CONTROLKEY = LV_CONTROLKEY
* PURPOSE = LV_PURPOSE
* DEBIT = LV_DEBIT
* NOCOMMIT = LV_NOCOMMIT
* STANDARDVALUECURR = LV_STANDARDVALUECURR
* IBAN = LV_IBAN
* ADRS_BANKS = LV_ADRS_BANKS
IMPORTING
RETURN = LS_RETURN
EMPLOYEENUMBER = LV_EMPLOYEENUMBER
SUBTYPE = LV_SUBTYPE
OBJECTID = LV_OBJECTID
LOCKINDICATOR = LV_LOCKINDICATOR
VALIDITYBEGIN = LV_VALIDITYBEGIN
VALIDITYEND = LV_VALIDITYEND
RECORDNUMBER = LV_RECORDNUMBER
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》