on 04-28-2009 6:27 AM
Hello All,
I am trying to use the CRM_ORDER_MAINTAIN to create a new activity from my code .Do I also have to use ORDER_SAVE ??? WHAT data has to be passed onto the CRM_ORDER_MAINTAIN.Please reply.
data : ls_orderadm_h type crmt_orderadm_h_com,
lt_orderadm_h1 type crmt_orderadm_h_comt.
ls_orderadm_h-guid = lv_header_guid.
insert ls_orderadm_h into table lt_orderadm_h1.
lv_product_i-ref_handle = '0000000001'.
lv_product_i-ref_guid = lv_header_guid.
insert lv_product_i into table lt_product_i.
ls_orderadm_i-header = lv_header_guid.
ls_orderadm_i-itm_type = 'ZCSA'.
ls_orderadm_i-number_int = '0000000001'.
ls_orderadm_i-ordered_prod = 'SLA_SRV_CS_A'.
ls_orderadm_i-handle = '0000000001'.
ls_orderadm_i-mode = 'A'.
ls_orderadm_i-itm_proc_ident = 'SRVC'.
insert ls_orderadm_i into table lt_orderadm_i.
clear ls_input_fields.
ls_input_fields-ref_handle = '0000000001'.
ls_input_fields-objectname = 'ORDERADM_I'.
clear ls_field_names.
ls_field_names-fieldname = 'HANDLE'.
append ls_field_names to ls_input_fields-field_names.
ls_field_names-fieldname = 'HEADER'.
append ls_field_names to ls_input_fields-field_names.
ls_field_names-fieldname = 'ITM_PROC_IDENT'.
append ls_field_names to ls_input_fields-field_names.
ls_field_names-fieldname = 'ITM_TYPE'.
append ls_field_names to ls_input_fields-field_names.
ls_field_names-fieldname = 'MODE'.
append ls_field_names to ls_input_fields-field_names.
ls_field_names-fieldname = 'NUMBER_INT'.
append ls_field_names to ls_input_fields-field_names.
ls_field_names-fieldname = 'ORDERED_PROD'.
append ls_field_names to ls_input_fields-field_names.
insert ls_input_fields into table lt_input_fields.
call function 'CRM_ORDER_MAINTAIN'
exporting
it_product_i = lt_product_i
changing
ct_orderadm_h = lt_orderadm_h1
ct_orderadm_i = lt_orderadm_i
ct_input_fields = lt_input_fields
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
data : ls_orderadm_h type crmt_orderadm_h_com,
lt_orderadm_h1 type crmt_orderadm_h_comt.
ls_orderadm_h-guid = lv_header_guid.
insert ls_orderadm_h into table lt_orderadm_h1.
lv_product_i-ref_handle = '0000000001'.
lv_product_i-ref_guid = lv_header_guid.
insert lv_product_i into table lt_product_i.
ls_orderadm_i-header = lv_header_guid.
ls_orderadm_i-itm_type = 'ZCSA'.
ls_orderadm_i-number_int = '0000000001'.
ls_orderadm_i-ordered_prod = 'SLA_SRV_CS_A'.
ls_orderadm_i-handle = '0000000001'.
ls_orderadm_i-mode = 'A'.
ls_orderadm_i-itm_proc_ident = 'SRVC'.
insert ls_orderadm_i into table lt_orderadm_i.
clear ls_input_fields.
ls_input_fields-ref_handle = '0000000001'.
ls_input_fields-objectname = 'ORDERADM_I'.
clear ls_field_names.
ls_field_names-fieldname = 'HANDLE'.
append ls_field_names to ls_input_fields-field_names.
ls_field_names-fieldname = 'HEADER'.
append ls_field_names to ls_input_fields-field_names.
ls_field_names-fieldname = 'ITM_PROC_IDENT'.
append ls_field_names to ls_input_fields-field_names.
ls_field_names-fieldname = 'ITM_TYPE'.
append ls_field_names to ls_input_fields-field_names.
ls_field_names-fieldname = 'MODE'.
append ls_field_names to ls_input_fields-field_names.
ls_field_names-fieldname = 'NUMBER_INT'.
append ls_field_names to ls_input_fields-field_names.
ls_field_names-fieldname = 'ORDERED_PROD'.
append ls_field_names to ls_input_fields-field_names.
insert ls_input_fields into table lt_input_fields.
call function 'CRM_ORDER_MAINTAIN'
exporting
it_product_i = lt_product_i
changing
ct_orderadm_h = lt_orderadm_h1
ct_orderadm_i = lt_orderadm_i
ct_input_fields = lt_input_fields
exceptions
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
others = 5.
data : lv_header_guid type guid_32,
lv_header_guid16 type guid_16,
lv_item_guid type guid_32,
lv_sched_guid type guid_32,
lt_header_guid16 type
crmt_object_guid_tab,
wa_header_guid16 like lt_header_guid16,
result type char40,
result1 type char100,
l_cr(1) type c value
cl_abap_char_utilities=>newline,
wa_header_guid16_2 like line of lt_header_guid16.
Hi Shakuntala,
What are all the data that you need to create an activity ? I mean to say what are all the Child structures that you need to pass like ( Item, Partners, Reference Objects, etc...)
The best way to work with Order maintain API is to debug the api from the SAP GUI. Just put a breakpoint in the API and create an activity with the necessary data and note down all the input structures as well as the lt_input_fields table. Now you can fill the details in your code and can create an activity.
And after you call order maintain, also call CRM_ORDER_SAVE and BAPI_TRANSACTION_COMMIT. Once the flow is maintained you need to call CRM_ORDER_INITIALIZE.
For the Document flow, you need to fill in the lt_doc_flow structure and need to pass on to order maintain.
Hope this helps.
Thanks,
Samantak.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.