Bank Detail Update
ATA: ls_message TYPE bapiret2,
lt_message TYPE STANDARD TABLE OF bapiret2,
ls_message1 TYPE bapiret2,
ls_msg TYPE bapiret2,
bank_detail TYPE bapibus1006_bankdetail,
business_par TYPE bu_partner,
gt_status type STANDARD TABLE OF ZVENDOR_BANK_S,
gs_status type ZVENDOR_BANK_S.
LOOP AT gt_file INTO gs_file.
MOVE gs_file-bpartner TO business_par.
MOVE gs_file-bank_ctry TO bank_detail-bank_ctry.
MOVE gs_file-bank_key TO bank_detail-bank_key.
MOVE gs_file-bank_acct TO bank_detail-bank_acct.
MOVE gs_file-ctrl_key TO bank_detail-ctrl_key.
MOVE gs_file-accountholder TO bank_detail-accountholder.
CONDENSE : business_par,bank_detail-bank_ctry,bank_detail-bank_key,bank_detail-bank_acct,bank_detail-bank_acct,bank_detail-ctrl_key,bank_detail-accountholder.
MOVE gs_file-bankaccountname TO bank_detail-bankaccountname.
CALL FUNCTION 'BAPI_BUPA_BANKDETAIL_ADD'
EXPORTING
businesspartner = business_par
* BANKDETAILID =
bankdetaildata = bank_detail
* IMPORTING
* BANKDETAILIDOUT =
TABLES
return = lt_message.
READ TABLE lt_message INTO ls_msg INDEX 1.
if sy-subrc eq 0.
gs_status-PARTNER = business_par.
gs_status-MESSAGES = ls_msg-MESSAGE.
APPEND gs_status to gt_status.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = ls_message1.
CLEAR: business_par,bank_detail,gs_file.
ENDLOOP.
IF gt_status IS NOT INITIAL.
MODIFY ZVENDOR_BANK_S FROM TABLE gt_status.
ENDIF.
lt_message TYPE STANDARD TABLE OF bapiret2,
ls_message1 TYPE bapiret2,
ls_msg TYPE bapiret2,
bank_detail TYPE bapibus1006_bankdetail,
business_par TYPE bu_partner,
gt_status type STANDARD TABLE OF ZVENDOR_BANK_S,
gs_status type ZVENDOR_BANK_S.
LOOP AT gt_file INTO gs_file.
MOVE gs_file-bpartner TO business_par.
MOVE gs_file-bank_ctry TO bank_detail-bank_ctry.
MOVE gs_file-bank_key TO bank_detail-bank_key.
MOVE gs_file-bank_acct TO bank_detail-bank_acct.
MOVE gs_file-ctrl_key TO bank_detail-ctrl_key.
MOVE gs_file-accountholder TO bank_detail-accountholder.
CONDENSE : business_par,bank_detail-bank_ctry,bank_detail-bank_key,bank_detail-bank_acct,bank_detail-bank_acct,bank_detail-ctrl_key,bank_detail-accountholder.
MOVE gs_file-bankaccountname TO bank_detail-bankaccountname.
CALL FUNCTION 'BAPI_BUPA_BANKDETAIL_ADD'
EXPORTING
businesspartner = business_par
* BANKDETAILID =
bankdetaildata = bank_detail
* IMPORTING
* BANKDETAILIDOUT =
TABLES
return = lt_message.
READ TABLE lt_message INTO ls_msg INDEX 1.
if sy-subrc eq 0.
gs_status-PARTNER = business_par.
gs_status-MESSAGES = ls_msg-MESSAGE.
APPEND gs_status to gt_status.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = ls_message1.
CLEAR: business_par,bank_detail,gs_file.
ENDLOOP.
IF gt_status IS NOT INITIAL.
MODIFY ZVENDOR_BANK_S FROM TABLE gt_status.
ENDIF.
Comments
Post a Comment