cancel
Showing results for 
Search instead for 
Did you mean: 

Structure et_sc_accounting not populated in BADi

GreggHinkle
Participant
0 Kudos

Hi

I have a requirement to update the account code category for an item depending on a value that is contained in one of the user defined fields that is coming across the OCI from an external catalog. I found the BAdI BBP_CATALOG_TRANSFER it looks like what I need and the user defined field with the data to be evaluated is contained in the parameter CATALOG_CONTENT which used by the BAdI. The parameter ET_SC_ACCOUNTING has a field called ACC_CAT which is defined as "Account Assignment Category in Enterprise Buyer". So far it looks easy, just populate the ET_SC_ACCOUNTING-ACC_CAT in the BAdI depending on what is in CATALOG_CONTENT-CUST_FIELD1. The problem is that while CATALOG_CONTENT contains records and the field CUST_FIELD1 has the proper data, ET_SC_ACCOUNTING is not populated with anything (0 records to be exact). I even looked at ENRICHED_ACCT_DATA which is the old way to transfer data prior to 4.0 (according to the documentation) and that also is not populated. So my question is do I have to populate the required contents of ET_SC_ACCOUNTING manually in addition to ACC_CAT and if so, what fields are required and what are the relations needed particularly with the GUID's or is there a setting somewhere so that this table is filled with the default values upon entry into the BAdI so that I only need to update the field ACC_CAT? Please let me know or tell me if I am going about this the wrong way. I am running SRM 4.0 level 10.

Thanks,

Gregg

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

In previous Releases, only the tables with the prefix "ENRICHED" were available. These were then returned to the calling application and transferred to the relevant document structure from there.

From 4.0,the data is transferred from the current document structure to the application. The relevant tables are included as additional parameters (parameters with the prefix "ET_SC_").

New implementations should use these tables only <b>and set the parameter "ev_sc_structures_used".</b>

So i think you should set this paramater and then check.

BR,

Disha.

Pls reward points for helpful answers.

GreggHinkle
Participant
0 Kudos

Thanks Disha for the response,

However the problem is that the BAdi BBP_CATALOG_TRANSFER is called from function module BBP_WS_IMPORT_SC_DATA. The value that is passed to the EV_SC_STRUCTURES_USED parameter is defined as a local variable in this function module and is not passed in from the outside of BBP_WS_IMPORT_SC_DATA. The first place it this variable is referenced in BBP_WS_IMPORT_SC_DATA is in the call to the BAdi. Therefore the value will always be initial upon the call to the BAdi. Now I can set the value of EV_SC_STRUCTURES_USED in the BAdi and it will then affect the subsequent function module MAP_AFTER_BADI, but it will not affect the BAdi itself. If I have to manually populate the table ET_SC_ACCOUNTING, then I definitely want to set the value of EV_SC_STRUCTURES_USED to 'X' in the BAdi, but I don't know what all the values should be set to if I have to manually populate this table myself. Any additional help will be greatly appreciated.

Thanks,

Gregg

Former Member
0 Kudos

Hi,

How are you calling the BADI thorugh the FM??

BR,

Disha.

Pls reward points for helpful answers.

GreggHinkle
Participant
0 Kudos

I am not calling the BAdi or the FM itself. It is being called through the normal process flow after the materials are added to the Shopping Cart from the External Catalog and the Order items button is pressed. From reading OSS notes and performing a where used on BAdi definition (se18) I found out that the function module BBP_WS_IMPORT_SC_DATA is what calls the BAdi BBP_CATALOG_TRANSFER. If you view this function module in SE37, you can see how the values are populated in this FM, but I have not implemented any special code to call this FM, it is being called via regular process flow.

Former Member
0 Kudos

Hi,

Then you just set the parameter in the BADI implementation.If you have found out that the BADI is the correct one then this should work.

BR,

Disha.

Pls reward points for helpful answers.

GreggHinkle
Participant
0 Kudos

HI Disha,

I have opened up a customer message with SAP and have been in communication with them. The SAP contact confirmed that this is not being populated and that they would check to see what can be done. I will update with what comes back. Thanks for you assistance

Gregg

GreggHinkle
Participant
0 Kudos

I mentioned in my last response that I would let everyone know the final solution to this problem that it can assist someone else who has a similar problem.

First of all, the BAdi BBP_CATALOG_TRANSFER was a false lead for this solution. The accounting internal tables, ENRICHED_ACCT_DATA and ET_SC_ACCOUNTING are not populated coming into this BAdi regardless of EV_SC_STRUCTURES_USED being updated with a ‘X’ or not (at least in version that we are running - BBPCRM 4.0 SAPKU40010). Therefore all the time I spent looking into this BAdi for the solution was wasted time.

What I ended up doing was to create a user defined field named zzacc_cat_ctlg on includes CI_BBP_ITEM, CI_BBP_ITEM_SC, and CI_OCI_CUSTOMER_EXTENSION. This was so I could pass the value that I wanted the Account Assignment Category to be for a particular line from the OCI referenced by NEW_ITEM-ZZACC_CAT_CTLG and it would be passed to all the needed internal tables at the item level without the need to change any code.

Then I created an implementation of BAdi BBP_SC_CHANGE with a filter of BUS2121 since I only want it for shopping carts. In this new implementation, in method BBP_SC_CHANGE, I looped at IT_ITEM and if IT_ITEM-ZZACC_CAT_CTLG was not initial, I updated ET_ACCOUNT-ACC_CAT with this value where ET_ACCOUNT-P_GUID = LS_ITEM–GUID. Of course I moved all IT tables to the corresponding ET tables also as shown in the Example implementation class, CL_EXM_IM_BBP_DOC_CHANGE_BADI.

I wanted to thank everyone again for their help in tracking down this problem and give the final solution others can gain from it.

Thanks,

Gregg Hinkle

Former Member
0 Kudos

Hi,

What value does this field zzacc_cat_ctlg contain at runtime???

BR,

Disha.