cancel
Showing results for 
Search instead for 
Did you mean: 

FM to change order appointment

former_member227595
Active Participant
0 Kudos

Hi gurus,

My requirement, is to change an appointment date of a order.

Right now, I am using the FM CRM_ORDER_MAINTAIN, but the thing is it doesn't work. I executed this FM once the order is created but is not being changed.

My requirement is change the date below ( in yellow )

I've also cheked FM CRM_APPT_MAINTAIN_MULTI_OW. But I couldn't make it work.

Thanks in advance.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

former_member182421
Active Contributor
0 Kudos

In what moment of the process do you need change the appointment date?

Cheers!

Luis

former_member227595
Active Participant
0 Kudos

My idea is first create the order, using FM: CRM_ORDER_MAINTAIN, CRM_ORDER_SAVE, CRM_ORDER_INITIALIZE and BAPI_TRANSACTION_COMMIT.

As soon as is created then I excecuted another process, in which I use, the same FMs and in the same order as well. But in this case, the CRM_ORDER_MAINTAIN I fill only the appointment table. But it is not being changed.

Maybe there is another FM in which allows me to change it.

Thanks in advance.

Regards

former_member182421
Active Contributor
0 Kudos

Sorry but I don't get it, are you using a report to create the sales order?

former_member227595
Active Participant
0 Kudos

Yes sorry,

I have to make a program (report) to upload many orders, and then as soon as is create each one, I want to change the date.

Regards

former_member182421
Active Contributor
0 Kudos

That's "easy" I would go for the API  CRMXIF_ORDER_SAVE and inform the DATES table depending if you want to upload dates at header or item level.

I would suggest to put a break point inside CRM_ORDER_MAINTAIN, change the desired date in Web UI or GUI  and see which values has the table IT_APPOINTMENT.

At the very end the API CRMXIF_ORDER_SAVE  will call CRM_ORDER_MAINTAIN, but IMHO the XIF interface offers an easier interface (No CT_INPUT_FIELDS )

former_member227595
Active Participant
0 Kudos

I ll try to use this one..

Thanks !

former_member227595
Active Participant
0 Kudos

I use these fields:

   ls_data-object_task = 'U'.

   ls_data-object_guid = guid.

   ls_data-object_id = id.

   ls_appo-appt_type = 'SRV_RREADY'.

   ls_appo-timestamp_from = new_date.

   ls_appo-timestamp_to = new_date.

   ls_appo-rule_name = 'SRV_0002'.

   ls_appo-duration = 0.

   ls_appo-input_fields-appt_type = abap_true.

   ls_appo-input_fields-rule_name = abap_true.

   ls_appo-input_fields-timestamp_from = abap_true.

   ls_appo-input_fields-duration = abap_true.

   APPEND ls_appo TO ls_data-dates-data.

   ls_data-dates-datax = abap_true .

   APPEND ls_data TO lt_data.

   CALL FUNCTION 'CRMXIF_ORDER_SAVE'

     EXPORTING

       data   = lt_data

     IMPORTING

       return = ls_return.



But doesn't work

former_member182421
Active Contributor
0 Kudos

Check my blog maybe helps you to understand what's missing

There's no error in the return table?

former_member227595
Active Participant
0 Kudos

Yes Ive just found:

Validation error occurred: Module CRM_DOWNLOAD_BTMBDOC_VAL, BDoc type BUS_TRANS_MSG.

I ll take a look at your blog

former_member227595
Active Participant
0 Kudos
former_member182421
Active Contributor
0 Kudos

I created  another wiki page with a sample of the code, I know you already finished with the changes, but I thought maybe would be interesting to know a different approach

CRM - Change Document appointment date using XIF - Code Gallery - SCN Wiki

Answers (0)