2014 Jun 13 10:47 AM
Hi Experts,
I have requirement where I want to automatically update bank details.
I have used BADI ‘VENDOR_ADD_DATA’ and method ‘CHECK_ALL_DATA’ but it is
giving syntax error as : ‘The field "T_LFBK" cannot be changed’
Following is my sample code:
loop at t_lfbk into ls_lfbk.
clear: len.
len = strlen( ls_lfbk-bankn ).
if ls_lfbk-bvtyp = '0001'.
len = strlen( ls_lfbk-bankn ).
len = len - 1.
concatenate ls_lfbk-bankn(len) '-' ls_lfbk-bankn+len(1) into ls_lfbk-bankn.
clear len.
endif.
modify t_lfbk from ls_lfbk.
endloop.
Hi Experts,
I have requirement where I want to automatically update bank details.
I have used BADI ‘VENDOR_ADD_DATA’ and method ‘CHECK_ALL_DATA’ but it is
giving syntax error as : ‘The field "T_LFBK" cannot be changed’
Following is my sample code:
loop at t_lfbk into ls_lfbk.
clear: len.
len = strlen( ls_lfbk-bankn ).
if ls_lfbk-bvtyp = '0001'.
len = strlen( ls_lfbk-bankn ).
len = len - 1.
concatenate ls_lfbk-bankn(len) '-' ls_lfbk-bankn+len(1) into ls_lfbk-bankn.
clear len.
endif.
modify t_lfbk from ls_lfbk.
endloop.
2014 Jun 13 10:58 AM
Hi,
The field "T_LFBK" is importing parameter of the method CHECK_ALL_DATA
You can only change the parameters with attribute 'Changing'.
You can chose a suitable method in the same BADI, I think MODIFY_ACCOUNT_NUMBER should work for you.
Regards
Bikas
2014 Jun 13 11:03 AM
2014 Jun 13 11:09 AM
Hi Bikas,
Thanks for reply, but method 'MODIFY_ACCOUNT_NUMBER' does not have table LFBK in changing parameters which I want to update.
Any other solution to achive this.
Br,
Omkar
2014 Jun 13 11:00 AM
Look at method signature, those "Importing" parameters cannot be changed.
You could start analyzing FM BANK_ACCOUNT_CHECK its where-called and implicit enhancement options. Also with BTE 00003000 (called in the FM) you may raise an error if account number does not respect your rule.
Else try to "play" with the additional data VENDOR_ADD_DATA[_CS] (*) those BAdI intended to manage customer fields in customer screen, allow modificaiton of fields of main screen, so you get a better chance there.
Regards,
Raymond
(*) Look at SET and GET_DATA.
2014 Jun 13 2:04 PM
Hi Raymond,
Thanks for ur suggestions, but for FM BANK_ACCOUNT_CHECK we don’t have any exporting
parameters so we cannot use this FM.
And BADI VENDOR_ADD_DATA_CS is not getting called while changing Vendor master data.
Kindly suggest any other possible way to do this.
Br,
Omkar
2014 Jun 13 11:19 AM
Hi,
Try this,
FIELD-SYMBOL <fs> like t_lfbk.
ASSIGN t_lfbk to <fs>.
Now use <fs> instead of t_lfbk.
Regards
2014 Jun 13 11:43 AM
Hi Sreekanth,
I have tried this code, but it gives run time error as follows :
Short Text
Error at assignment: Overwritten protected field.
What happened?
Error in the ABAP Application Program
The current ABAP program "ZCL_IM_VENDOR_ADD_DATA========CP" had to be
terminated because it has
come across a statement that unfortunately cannot be executed.
Error analysis
A new value is to be assigned to the field "<FS>", although this field is
entirely or partly protected against changes.
The following are protected against changes:
- Character literals or numeric literals
- Constants (CONSTANTS)
- Parameters of the category IMPORTING REFERENCE for functions and
methods
- Untyped field symbols not yet assigned a field using ASSIGN
- TABLES parameters if the actual parameter is protected against changes
- USING reference parameters and CHANGING parameters for FORMs, if the
actual parameter is protected against changes and
- Accesses using field symbols if the field assigned using ASSIGN is
protected (or partially protected, e.g. key components of an internal
table with the type SORTED or HASHED TABLE) against changes
- Accesses using references, if the field bound to the reference is
protected (or partially protected) against changes
- External write accesses to READ-ONLY attributes,
- Content of a shared object area instance accessed using a shared lock
(ATTACH_FOR_READ).
2014 Jun 13 2:13 PM
HI Omkar,
I have also faced this issue before some time and as per my experience 1 way is to use the BDC for the same.
( BDC of Bank data change of Vendor )
Thanks & regards,
Susheel Joshi
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |