on 08-26-2010 8:56 PM
Using SRM 7.0, I have a requirement that newly entered items on a shopping cart default as a Service item type. To accomplish this, I use an implementation of BBP_DOC_CHANGE_BADI, method BBP_SC_CHANGE, to set the product_type field on a newly-entered item to '02'. The user can change it to a Material afterward if they want, and my logic is constructed such that the BADI will not do this to items that have already been entered on the cart.
Unfortunately, it appears my logic is affecting shopping carts that get copied. When I copy a shopping cart, all the items on it get set to a Service type, even if they are Material. I need to keep this from happening. I'd like to get into the debugger to see what data is getting passed through, but for some reason the copy operation is not hitting my external breakpoint. I think that if I could get into the debugger, I could probably figure out a way around this code when the cart is copied.
Does anybody know if there is any piece of data that gets passed in to BBP_SC_CHANGE on BBP_DOC_CHANGE_BADI that would indicate the shopping cart is a copy so that I can put in a check to bypass my Service-defaulting logic? Alternatively, is there a way I can get into the debugger on this?
Hi,
differentiate calling the BADI code based on user command SY-UCOMM
SAP Note 1334202 - How to get current action ID and transaction group
Just a thought,
Regards,
MRao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The Copy button does not trigger debug mode in DOC_CHANGE_BADI. At least not with the external breakpoint set up under my user name. I'm not sure if the process happens as a background process under a system username or what is going on there. Is there a way to check what username it is firing that process with? It is definitely using DOC_CHANGE_BADI, but I can't break into it.
I have already tried using IS_HEADER-COPY_OF_GUID as well, but it appears that this is empty, even when copying the shopping cart. I tried setting up my code to execute only IF is_header-copy_of_guid IS INITIAL, but this didn't seem to do anything.
I'm currently trying the procedures outlined in note 1334202, but the GET_CURRENT_ACTION method it describes does not return anything in this context. I may have to try the alternate process the note outlines, but it looks like that is going to be a bit more involved. I'll have to figure out which event handler is handling the click of the Copy button.
Thanks for the responses everyone. I haven't given up yet.
Hi
Doc Change badi is your culprit here where you have forcefully setting the item to service type item. Unfortunately there is no indicator in the system which could decide if the items are a copy of another SC....
In my opinion do not put the code in doc change badi, try to put default values to the item type field using Webdynpro Class and methods if possible, otherwise I do not see a clue to differentiate between a copied SC and vice versa
Regards
Virender Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any idea as to which field in the dynpro would do the trick? I tried setting the text of the ITM_TYP_DEFAULT to 'Service' under the ITEMS_TABLE_ITM_TYPE on the /SAPSRM/WDC_UI_SC_DOTC_BD dynpro component, but that really just made it say 'Service' under the Item Type column until I actually entered an item, at which time it went to Material. I've also looked at the /SAPSRM/WDC_DODC_SC_I_BD dynpro component (the item detail screen), but don't see what I can change in there to make it dfault to Service when an item is entered.
Hi Seth
Did you reslove your issue of copying lines.
You could try to first
copy your SC line item using SAP standard copy function
then use bbp_doc_change badi to modify the data of the created line item.
hope this helps....
If you did something different let me know I have a similar issue and this is my current approach
cheers
alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.