cancel
Showing results for 
Search instead for 
Did you mean: 

Requested delivery date is not filled on the header

Former Member
0 Kudos

Hi everyone!

I'm trying to configure the system to automatically calculate delivery date in sales order based on the other date and duration.

I'm working with standalone CRM 7.0 and I've configured date profile for sales order that uses REQ_DLV_DATE date type, my own date type to enter a payment fact date there and duration DLVTIME. I've created a rule that calculates REQ_DLV_DATE=YPAYMFACT+DLVTIME. But when I enter Payment Fact date and delivery time, delivery date is calculated in Dates assignment block but it's not getting updated on the header ([screenshot|http://www.picdrop.net/images/requesteddeliverydat.png]). How can I achieve this?

Please, help.

Regards,

Alex.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The reason is the deliver date at the top belongs to the Sales segment and the other belongs to the Appointment segment of the One Order.

Implement the following code in the Badi CRM_SALES_BADI, method CRM_SALES_MERGE and sync them up.

DATA: ls_date_key TYPE DATE_LOGICAL_DATE_KEY.
DATA: ls_date_wrk TYPE CRMT_DATE_WRK

ls_date_key-appt_type = 'REQ_DLV_DATE'.

CALL FUNCTION 'CRM_DATES_READ_SINGLE_OW'
EXPORTING
   iv_ref_guid = iu_sales_wrk-guid
   iv_ref_kind = 'A'
   is_logical_date_key = ls_date_key
IMPORTING
  es_date_wrk = ls_date_wrk
EXCEPTIONS
  OTHERS = 1.

CS_SALES_BADI-REQ_DLV_DATE = ls_date_wrk-TIMESTAMP_FROM.

Former Member
0 Kudos

Thank you Robert and Peng for your suggestions.

I told our programmer to implement a BADI with the code you suggested but that BADI is not getting triggered.

What are the steps to trigger our implemented method?

Regards,

Alex

robert_kunstelj
Active Contributor
0 Kudos

Badi is not triggered because you are changing date of appointments section. You have to do it with event, as I told you.

Former Member
0 Kudos

Robert, could you please provide an example of a function that will change requested delivery date on the header level?

Should we work with some specific structure to set that field?

Thanks in advance!

P.S. By the way, I've tried to debug the other function on that event that performs checks, but still it doesn't break. I've put the breakpoint in the beginning. Maybe it's because of the Attribute name that has a space in the beginning like " REQ_DLV_DATE"?

Regards,

Alex

robert_kunstelj
Active Contributor
0 Kudos

Create event with parameters that I described in one of previous answer. Link it with one Z function. In that function use fm 'CRM_DATES_READ_SINGLE_OW' to get the value of date from appointment. And then pass the value in fm 'CRM_SALES_MAINTAIN_OW' to fill rdd field date.

Former Member
0 Kudos

Still no luck with this one. Developer made FM that updates the value, it does not getting updated though.

Also strange behavior began with that req_dlv_date field on the header. When I'm trying to enter a date there manually it instantly vanishes and the field becomes empty again. I changed a date profile to a standard and try to delete our FM from event still the same. Why is that happening?

Help, please. It's very important.

Regards, Alex

robert_kunstelj
Active Contributor
0 Kudos

This works for 100%. Your programmer must check the coding, because this functions must be filled very properly, otherwise they don't work.

Former Member
0 Kudos

I've found out why the value disappeared even if I enter it manually. It was because of the BADI suggested earlier wasn't turned off...

I guess the FM should work fine now. I'll update after test.

Regards, Alex.

Edited by: Alexander Milshtein on Jun 7, 2011 11:44 AM

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Robert for your help. It's working.

Regards, Alex.

robert_kunstelj
Active Contributor
0 Kudos

I had the same problem and solved it by developing event which fills also that field, when date is filled.

Regards.

Former Member
0 Kudos

Thank you for your answer Robert.

Could you please share some more details? Where should I place an event?

Regards, Alex.

robert_kunstelj
Active Contributor
0 Kudos

In crmv_event I created event for object BUS2000115 with the following parameters:

  • Trans. Category - BUS2000115

  • Execution Time - 1 Immediately

  • Priority - 2

  • Object Name - APPOINTMENT

  • Event - AFTER_CHANGE

  • Attribute - REQ_DLV_DATE

  • Function - ZCRM_ORDER_REQ_DLV_DATE_SET

Former Member
0 Kudos

Thanks for your answer Robert.

In crmv_event I've found

  • Trans. Category - BUS2000115

  • Execution Time - 1 Immediately

  • Priority - 1

  • Object Name - APPOINTMENT

  • Event - AFTER_CHANGE

  • Attribute - REQ_DLV_DATE

  • Function - CRM_LATEST_DELIVERY_DATE_CH_EC

  • Header - Checked

  • Item - Checked

I've tried to debug CRM_LATEST_DELIVERY_DATE_CH_EC func. module but it doesn't break in that module. Does it mean that the event is not getting handled?

robert_kunstelj
Active Contributor
0 Kudos

It should stop. there is one CASE statment at beging of that fm. Check that you set breakpoint befor it.