cancel
Showing results for 
Search instead for 
Did you mean: 

CRM_ORDER_MAINTAIN causing dump in AFTER_CHANGE of crm_order_status badi

0 Kudos

Hi,

Could any help in this issue.I am using Below Code to update Date of Quote

  ls_input_field-ref_guid = is_status_wrk-guid.
         ls_input_field-objectname = 'APPOINTMENT'
         ls_input_field-ref_kind = 'A'
         ls_input_field-ref_handle = '0000000000'.
         ls_input_field-logical_key =  ZQUSA0 .

         ls_input_field_names-fieldname = TIMESTAMP_TO
         INSERT ls_input_field_names INTO TABLE lt_input_field_names.

         ls_input_field_names-fieldname = TIMESTAMP_FROM.
         INSERT ls_input_field_names INTO TABLE lt_input_field_names.

         ls_input_field-field_names = lt_input_field_names.
         APPEND ls_input_field TO lt_input_field.

         ls_appointment-mode = B.
         ls_appointment-ref_guid = is_status_wrk-guid .
         ls_appointment-ref_handle ='0000000000'
         ls_appointment-ref_kind = A
         ls_appointment-timestamp_to = lv_finish_quote. .
         ls_appointment-timestamp_from = lv_finish_quote.

         ls_appointment-appt_type = ZQUSA0 .
         APPEND ls_appointment  TO lt_appointment.
         ls_orderadm_h1-guid = is_status_wrk-guid.
         ls_orderadm_h1-handle = lc_handle.
         APPEND ls_orderadm_h1 TO lt_orderadm_h1.


         CALL FUNCTION 'CRM_ORDER_MAINTAIN'
           EXPORTING
             it_appointment    = lt_appointment
           CHANGING
             ct_orderadm_h     = lt_orderadm_h1
             ct_input_fields   = lt_input_field
           EXCEPTIONS
             error_occurred    = 1
             document_locked   = 2
             no_change_allowed = 3
             no_authority      = 4
             OTHERS            = 5.


Thnaks,

Anil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Anil,

Another approach would be to put a break-point in CRM_ORDER_MAINTAIN, change what you want to change in SAP GUI or WebUI and see with which parameters the function module is called. I use this approach quite often.

And I would also say: if you get a dump you should show us the screenshot of it. It might contain valuable information.

Best regards,

Thomas Wagner

0 Kudos

Hi Bruno,Thomas,

Thanks For your responses.

I used  FM CRM_DATES_TIMECONTEXT_DELETE before Order_maintain but doesnt solve my problem.

Please see below dump screenshot.

Thanks in Advance.

Anil

Former Member
0 Kudos

I see something like "recursive call". Do you call CRM_ORDER_MAINTAIN recursively?

Thomas

0 Kudos

Hi Thomas,

I dont understand why its showing Recursive call error.

Actually i used crm_order_maintain in After Change method of crm_Order_status  badi.

May be because this Badi I hope.

Is there any way to avoid recursive call?

Thanks,

Anil

Former Member
0 Kudos

Hello Anil,

The CRM_ORDER_STATUS BADI might already called by the CRM_ORDER_MAINTAIN function module and therefore it could be a recursive call. You could look for the precise function module which is only changing the appointment timestamps and call that one. That FM could be found by googleing or debugging or having a closer look at CRM_ORDER_MAINTAIN as CRM_ORDER_MAINTAIN will surely call that specific function module too.

Best regards,

Thomas

BGarcia
Active Contributor
0 Kudos

Hi Anil,

You can try with FM 'CRM_APPT_MAINTAIN_MULTI_OW'. Check the link I've provided you earlier.

Kind regards,

Garcia

0 Kudos

Thanks a lot Bruno,Thomas for your suggestions.

I will Check with specific FM and let you know the result.

Once again Thanks for your inputs.

Ragards,

Anil

0 Kudos

Hi Bruno,Thomas

FM: CRM_APPT_MAINTAIN_MULTI_OW solved my issue.

Thanks Bruno for providing Exact FM.

Regards,

Anil

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Anil,

are u intending to change or newly assigning date to the quote?

if u are changing date no need to pass handle and u have pass the field logical key

one more thing is in input fields have to pass  the field "appt_type".

Regards,

Padma.

BGarcia
Active Contributor
0 Kudos

Hi Anil,

Can you try to call function module CRM_DATES_TIMECONTEXT_DELETE before CRM_ORDER_MAINTAN? You have one example how to change dates in a business transaction here (just don't use the save statement in BADI).

If still with problems, can you share some lines of dump?

Kind regards,

Garcia