cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Default Delivery Date on Shopping Cart

Former Member
0 Likes
374

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

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.

Former Member
0 Likes

Hi,

When you enter to BADI check properties tab and Filter frame.

Check if you have BUS2121 (SC) object type. If yes you can maintain method BBP_SC_CHANGE.

If no - you can create new BADI implementation eg. ZBBP_SC_CHANGE with filter BUS2121 and only BUS2121.

Regards,

Marcin

Answers (2)

Answers (2)

Former Member
0 Likes

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.

Former Member
0 Likes

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