2006 Sep 06 8:40 AM
HI Experts,
I am new to BadIs. I need to do the following one.. I changing the BAdI method
I confused to do this with import export parameters. I need to the code, how to write in that method..
SELECTION CRITERIA:
This enhancement must only do the following selection criteria based on the account group field in table KNA1. The following account group field [KNA1/KTOKD] must be equal to one of the following:
1011
1012
1013
1014
XEM
ONE
SUN
INT
ENHANCEMENT DETAILS:
BADI : CUSTOMER_ADD_DATA
Method : MODIFY_ACCOUNT_NUMBER
Import Parameters : I_NROBJ Number range object
Change Parameters : C_KUNNR Customer number
Calculation of CDV for GJMC VENUS accounts:
The CDV is calculated, using a Modulus 11 algorithm
The following weights are used in the calculation
digit weight
1 29
2 23
3 19
4 17
5 13
6 7
7 5
8 3
Multiply each digit with the respective weight for the digit.
Calculate the modulus of the sum of the previous calculation.
If the remainder equals zero, then the CDV equals zero.
If the remainder equals ten then the CDV must be set to the fourth digit of the account number if the first digit of the account number is zero. Otherwise the CDV must be set to the third digit of the account number.
If the remainder is not equal to ten or zero then the CDV must be set to eleven minus the remainder.
Example A:
Account number 50369677, excluding CDV
5 0 3 6 9 6 7 7
x x x x x x x x
29 23 19 17 13 7 5 3
-- -- -- -- -- -- -- --
145 + 0 + 57 + 102 + 117 + 42 + 35 + 21 = 519
519 divided by 11 = 47
47 x 11 = 517
Remainder = 519 - 517 = 2
Test_CDV = 11 - 2
CDV = 9
Example B:
Account number 50370101, excluding CDV
5 0 3 7 0 1 0 1
x x x x x x x x
29 23 19 17 13 7 5 3
-- -- -- -- -- -- -- --
145 + 0 + 57 + 119 + 0 + 7 + 0 + 3 = 331
331 divided by 11 = 30
30 x 11 = 330
Remainder = 331 - 330 = 1
Test_CDV = 11 - 1
Test_CDV = 10
IF the first digit of the account number was a zero, the
CDV would be equal to the value of the fourth digit.
else
CDV is set to the value of the third digit (ie 3)
CDV = 3
Regards
Raj
2006 Sep 06 12:16 PM
Hello Rajendra
The procedure to implement a BAdI is as following:
(1) Define an implementation of the required BAdI (SE19)
(2) Create the implementing class for the BAdI interface (SE19).
(3) Put the required coding into the methods of the implementing class.
(4) Activate the BAdI implementation (SE19). Without activation your BAdI implementation will never passed.
That's all.
Regards
Uwe