cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI Update BankDetails

Former Member
0 Kudos

hello Friends,

I am using the following bapi to update the bank details BAPI_BUPA_BANKDETAIL_CHANGE, and here is my ABAP code.

Data: businessPartner type BAPIBUS1006_HEAD-BPARTNER.

Data: bankDetail type BUT0BK-BKVID.

Data: bankDetailData type BAPIBUS1006_BANKDETAIL.

Data: bankDetailData_X type BAPIBUS1006_BANKDETAIL_X.

data: my_Table type standard table of BAPIRET2 with default key,

wa_myTab like line of my_Table.

move '0000000001' to businessPartner.

move '1' to bankDetail.

bankDetailData-BANK_CTRY = 'DE'.

bankDetailData_X-BANK_CTRY = 'X'.

bankDetailData-BANK_KEY = '00000001'.

bankDetailData_X-BANK_KEY = 'X'.

bankDetailData-BANK_ACCT = '1'.

bankDetailData_X-BANK_ACCT = 'X'.

bankDetailData-ACCOUNTHOLDER = 'testtest'.

bankDetailData_X-ACCOUNTHOLDER = 'X'.

CALL FUNCTION 'BAPI_BUPA_BANKDETAIL_CHANGE'

EXPORTING

BUSINESSPARTNER = businessPartner

BANKDETAILID = bankDetail

BANKDETAILDATA = bankDetailData

BANKDETAILDATA_X = bankDetailData_X

TABLES

RETURN = my_Table.

.

write 'PrintTable'.

write wa_myTab-TYPE.

LOOP AT my_Table INTO wa_myTab.

write wa_myTab-TYPE.

ENDLOOP.

I dont know why not its working, I just want to chage the accountHolder name, and else thing I have provided as it is!

and also it does not print when i try to print the return table!

Can any one pls let me know what is possibly wrong in the code!

Many thanks

marek.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Marek,

I tried out your code piece and its working fine.

Since i don't have entries that you want to change in my SAP system its returning E as return type. i.e. I don't have bank details for business partner 1.

This return type is also being printed.

Also I don't think there is need for the write wa_myTab-TYPE right before Loop. Comment the statement.

Cheers,

Samanjay