cancel
Showing results for 
Search instead for 
Did you mean: 

How make acc assignment details default to user

Former Member
0 Kudos

Hi experts,

I am working on SRM7.0.My requirement is to make the account assignment data default to particular user.

If an user User1 ordering a cart ,he enters acc assignment details.While ordering the cart those details should be stored as default.When the particular user User1 opens the shopping cart screen he should get those values as default.

There are few function modules to to retrieve the data based on the user.But how to save the acc assignment data based on user

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

You can use FM BBP_UPDATE_ATTRIBUTES to update the cost center to user attributes in SRM Org Structure and set it as default.

Calling this FM will set a lock on the user data which will get released when the user either saves/Orders shopping cart. This is when the COMMIT WORK is called from standard.

But you have to consider a few things:

1. location to call above FM - BBP_DOC_CHANGE_BADI (called multiple times), BBP_DOC_SAVE_BADI(called once when saving/order of shopping cart, closer to issuing of COMMIT WORK)

2. if you have some background jobs running which update the user attributes in parallel (from say ECC HR), the lock set for the duration of SC creation will cause this job to fail.

Also check http://wiki.sdn.sap.com/wiki/display/SRM/How+to+Automate+Attribute+Maintenance+in+SRM

Regards,

Sushil.

Answers (2)

Answers (2)

former_member184111
Active Contributor
0 Kudos

Hi,

I am not suggesting anything new...but may be you do not need to store the details anywhere by proceeing as follows..

..in BBP_DOC_CHANGE_BADI check if the mode is 'C' i.e. Create, then Get list of all shopping carts created by this user using FM 'BBP_PD_SC_GETLIST' sort the list by CREATEDAT field to get the latest SC created by the user and the fetch the Accounting details for this SC using FM 'BBP_PD_SC_GETDETAIL'.....change the accounting data in BADI from fetched data...

so basically instead of displaying the data from user attributes you display it from what user last filled..hope it gives you some idea...

Regards,

Anubhav

former_member208675
Active Contributor
0 Kudos

Hi,

Account Assignment for specific user has taken from Org Structrue. Look for attributes CNT & KNT.

Regards,

Former Member
0 Kudos

Hi Vinay

Thanks for the reply.

My requirement is I have to save the account assignment details from shopping cart itself.

As per your reply CNT is cost center and KNT is account assignment category.Can you please elaborate.

Former Member
0 Kudos

Hi srm srm1,

In your org structure, under attribute 'Account Assignment Category' (KNT), maintain value 'Cost Center' (CC) for example and mark it as default.

Then under attribute 'Cost Center' (CNT), maintain the value that you would like to default.

Finally navigate to SPRO--Cross App Basic settings--Account Assignment--Define G/L account for Prod category and Acct Assgnmnt Category, maintain the product category, account assignment category and G/L account combinations.

Thus when you create a SC with a prod category, the Cost center will default from User's attributes and G/L account will default from above setting.

Nikhil

Former Member
0 Kudos

Hi Nikhil,

Here requirement is in reverse direction.Even we give some values in org structure it will come as default.

But when user changes these default values For ex : Costcentrer CC to FI and entered G/L account and other fields a different value in the shopping cart and he orders the cart , these values should get save and should be default.

Former Member
0 Kudos

Hi srm,

This is certainly not supported as per standard.

Does not sound logical also....If a user changes default settings as per his convenience, then system won't remember user's changes and then maintain those as default.

Nikhil

Former Member
0 Kudos

Hi Nihkil,

You are right that SAP need not remember all user changes but my hope is same funda was going on as far as org structure is concerned.

There user is creating default values in org structure and displaying in shopping cart.

I am searching alot for any Func modules or class methods avaialable to do this task.

Just searched bbp_set_user_attr.But it doesn't cater my need

Former Member
0 Kudos

Hello SRM,

We had something similar requirement for delivery address. Keeping same delivery address for user whenever PR or PO transfer into ECC.

You can achieve your requirement as follows;

- Create Z table in SRM with User ID, Account assignment type, Cost center, GL etc.

- Update this Z table via BBP_DOC_SAVE_BADI with account assignment data.  You can put validation in here if for user Cost center, GL combination is already exist in table then do not update it.

- Implement DOC_CHECK BADI which get call whenever user tries to create SC and update the Default attribute from the table.

Hope this helps.

Thank you

Ritesh

Former Member
0 Kudos

Hi SRM,

As Ritesh suggested,you can create some custom table to store the last changed data by the user and then put in  custom check the next time the user creates a new shoppign cart.

Also if the user wants to change the account assignment data everytime he creates a new shopping cart,the users can also click on DEFAULT SETTINGS Link in the shopping cart header and then enter the new account assignment data everytime they create a new shopping cart.THis is just one of the ways to change the account assignment data manually in the shopping cart screen but if you need the automated approach,you would need to follow the approach which Ritesh mentioned.