on 2011 May 05 11:38 AM
Hi
We have a requirement to have delivery date in future (current date + n days) on the shopping cart line items. I have searched and found a BADI BBP_CHANGE_DEFAULT to handle this requirement. I have implemented the method CHANGE_DEFAULT_DELIV_DATE to make the delviery date in future. Now this works fine when we create SC with "Describe Requirement" or "Create from old SC/template".
However when we try to create SC from the catalog the default date remains as current date? I have debugged the code but it seems to be ignoring the date calculated from BADI. Is there any other BADI or different logic for SC created from service catalogs?
Regards
Manish.
Request clarification before answering.
Thanks Marcin for your reply.
I have checked the BADI BBP_DOC_CHANGE_BADI and found that in SRM 7.0 an active implementation already exist by SAP BBP_CONF_CHANGE. Since defination of this BADI don't have "Multiple use" checked we cannot have more than 1 active implementation. It gives us dump when tried to implement it.
Was this solution working in other versions? Is there any way around?
Regards,
Manish.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Marcin for your quick response.
This has solved the problem. So I now have the solution to this issue.
I however have raised this with SAP regarding Why implementation of BADI - BBP_CHANGE_DEFAULT is catering to only 2 scenarios and not the scenario of adding item via catalog.
Infact on debugging I found that in include LBBP_WS_APIF25 there is code as below
IF NOT cs_sc_item_data-leadtime IS INITIAL.
cs_sc_item_data-deliv_date = sy-datlo + cs_sc_item_data-leadtime.
ELSE.
cs_sc_item_data-deliv_date = sy-datlo.
ENDIF.
So I believe the lead time should have been picked from EKPO-PLIFZ (Planned Delivery Time in Days) of the contract and hence the delivery date would have gone to future. However its not picking the lead time correctly.
Thanks again for the solution.
Regards,
Manish.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use BADI BBP_DOC_CHANGE_BADI.
and this sample code:
LOOP AT it_item ASSIGNING <sc_item>.
lv_delivery_date = sy-datum.
lv_delivery_date = lv_delivery_date + ls_sc_item-leadtime.
WHILE lv_working_day_flag IS NOT INITIAL.
CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
date = lv_delivery_date
factory_calendar_id = 'AA'
IMPORTING
workingday_indicator = lv_working_day_ind.
IF sy-subrc EQ 0.
IF lv_working_day_ind NE space.
lv_delivery_date = lv_delivery_date + 1.
ELSE.
CLEAR lv_working_day_flag.
ENDIF.
ENDIF.
ENDWHILE.
<sc_item>-deliv_date = lv_delivery_date.
APPEND <sc_item> TO et_item.
ENDLOOP.
In this code I add lead time to delivery date and check if this date is a working day (factory calendar eq AA).
If yes - it is my delivery date, if not - I add to date one day and recheck.
Regards,
Marcin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.