I need to enhance 0customer_attr extractor to pull business partner base on logic given below. Please provide me the sample code to jump start.
1.For each extracted record of customer attribute, we will first check if customer account group is equal to Z001 or not. If Account group is not equal to Z001 then Zbusinesspartner = null
2. If customer account group is equal to Z001 then we will check if there is any entry in BUT000 table for KNA1.customer id = BUT000. Business partner id. If we find any entry in BUT000 then Zbusinesspartner = customer id.
3. If we do not find any value in BUT000 for KNA1.customer id = BUT000.business partner id then Zbusinesspartner = null.
For KNA1.customerid = XXXX
If KNA1.account group NE Z001
Zbusinesspartner = null
If account group EQ Z001
Check for entry in BUT000 table where KNA1.customer ID = BUT000. BusinessPartnerID.
If entry found in BUT000 then Zbusinesspartner = KNA1.customer id
If no entry found in BUT000 then Zbusinesspartner = Null.