Crm_order_maintain product
Hi Experts,
Please find my code in the following link.
http://pastebin.ca/1400952
I am trying to assign a product to my service ticket in a function module.There are no errors coming.The service ticket is getting created but the product is not getting maintained.
Everywhere sy-subrc = 0 so i dont even know where to debug.
Totally and endlessly stuck!!
Please give ur valuable inputs.
Thanks and Regards
Shilpi
In this function module line no 278 you have called CRM_ORDER_SAVE. in that function module line no 52 it is giving error that parmeter missing when function module com_product_read_single is called.
Similar Messages
-
Adding item data in Product tab for sales contract (crm_order_maintain)
Hi, can I use crm_order_maintain to add line items under the product tab for a sales contract while creating or modifying an order. Is there any sample code to add the line items, I could look at. I tried calling this FM from my custom tab and then called CRM_ORDER_SAVE but that did not add the line item. I guess I need to call it from the order_save badi and then call the crm_order_save FM as well from within the BADI. If someone could send me some sample code then I can double check if I am missing something.Am I on the right track to be using this FM for adding a line item under the product tab for the sales contract? Please help. thanks
Hi, I've encountered the same problem while I was creating a Sub-Contract from a Master Contract.
In my case the solution was:
first create the Sub-Contract,
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
CHANGING
ct_orderadm_h = i_ctorderadm_h
ct_input_fields = i_ctinput_fields
ct_doc_flow = i_ctdoc_flow
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
READ TABLE i_ctorderadm_h INTO wa_ctorderadm_h INDEX 1.
APPEND wa_ctorderadm_h-guid TO i_objects_to_save.
in wa_ctorderadm_h-guid now we have the guid of the newly created Sub-Contract.
SELECT SINGLE it_type_to
INTO v_it_type_to " --> target item type
FROM crmc_it_copy_ma
WHERE it_type_from = wa_out_orderadm_i-itm_type.
Prepare tables
wa_ctorderadm_i-header =
wa_out_orderadm_i-header. "Retrieved from CRM_ORDER_READ
wa_ctorderadm_i-handle = '0000000001'.
wa_ctorderadm_i-number_int = '0000000001'.
wa_ctorderadm_i-product = wa_out_orderadm_i-product.
wa_ctorderadm_i-ordered_prod =
wa_out_orderadm_i-ordered_prod.
wa_ctorderadm_i-description = wa_out_orderadm_i-description.
wa_ctorderadm_i-itm_type = v_it_type_to.
wa_ctorderadm_i-order_date = sy-datum.
wa_ctorderadm_i-itm_language = sy-langu.
wa_ctorderadm_i-mode = c_a. "c_a = 'A'
wa_ctorderadm_i-header = wa_ctorderadm_h-guid.
APPEND wa_ctorderadm_i TO i_ctorderadm_i.
wa_input_fields-ref_handle = '0000000001'.
wa_input_fields-objectname = 'ORDERADM_I'.
REFRESH i_input_field_names.
wa_input_field_names-fieldname = 'DESCRIPTION'.
APPEND wa_input_field_names TO i_input_field_names.
wa_input_field_names-fieldname = 'HEADER'.
APPEND wa_input_field_names TO i_input_field_names.
wa_input_field_names-fieldname = 'ITM_TYPE'.
APPEND wa_input_field_names TO i_input_field_names.
wa_input_field_names-fieldname = 'MODE'.
APPEND wa_input_field_names TO i_input_field_names.
wa_input_field_names-fieldname = 'NUMBER_INT'.
APPEND wa_input_field_names TO i_input_field_names.
wa_input_field_names-fieldname = 'ORDERED_PROD'.
APPEND wa_input_field_names TO i_input_field_names.
wa_input_field_names-fieldname = 'ORDER_DATE'.
APPEND wa_input_field_names TO i_input_field_names.
wa_input_field_names-fieldname = 'PRODUCT'.
APPEND wa_input_field_names TO i_input_field_names.
wa_input_fields-field_names = i_input_field_names.
APPEND wa_input_fields TO i_ctinput_fields.
After that I've called function 'CRM_ORDER_MAINTAIN', to copy the Items from the Master Contract.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_sales = i_sales
it_schedlin_i = i_schedlin_i
CHANGING
ct_orderadm_i = i_ctorderadm_i
ct_input_fields = i_ctinput_fields
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
Maybe if you're not working with Contracts, the procedure is not properly correct.
I suggest to put a break-point into crm_order_maintain and try to add the Item manually.
If you reproduce exactly the standard, I'm shure it will work.
Lorenzo -
Adding Product Using CRM_ORDER_MAINTAIN
Hello Techie,
I am creating lead for that I need to give product what are mandatory fields i should have to maintain so that i can successfully create mmy lead using crm_order_maintain.
Please give me mandatory field input for product.
Thank's In Advance.Hello Pavel,
I also follow the same approach for partner,status,qualification,lead header ,But while coming to product its not creating what exactly issue I don't know..... I added following code can you please review and let me knw where i am missing...
ls_sales-ref_handle = '0000000001'.
ls_sales-ref_guid = l_guid.
ls_sales-ref_kind = 'B'.
APPEND ls_sales TO lt_sales.
ls_product_i-ref_guid = l_guid.
ls_product_i-ref_handle = '0000000001'.
ls_product_i-gross_weight = '0.000'.
ls_product_i-net_weight = '0.000'.
ls_product_i-mode = 'B'.
APPEND ls_product_i to lt_product_i.
ls_orderadm_i-GUID = l_guid.
ls_orderadm_i-HANDLE = '0000000001'.
ls_orderadm_i-HEADER = l_guid.
ls_orderadm_i-ORDERED_PROD = 'HT-1030'.
ls_orderadm_i-PRODUCT_KIND = 'X'.
ls_orderadm_i-LOG_SYSTEM_EXT = ''.
ls_orderadm_i-MODE = 'B'.
APPEND ls_orderadm_i TO lT_orderadm_i.
ls_schedlin_i-REF_GUID = l_guid.
ls_schedlin_i-REF_HANDLE = '0000000001'.
APPEND ls_schedlin_i to lt_schedlin_i.
ls_nametab = 'ALTID_TYPE'.
APPEND ls_nametab TO lt_nametab.
ls_nametab = 'ORDERED_PROD'.
APPEND ls_nametab TO lt_nametab.
ls_nametab = 'PRODUCT'.
APPEND ls_nametab TO lt_nametab.
ls_input_fields-REF_HANDLE = '0000000001'.
ls_input_fields-OBJECTNAME = 'ORDERADM_I'.
ls_input_fields-field_names[] = lt_nametab[].
INSERT ls_input_fields INTO TABLE lt_input_fields.
CLEAR : ls_nametab,lt_nametab[].
Thank's,
Tasnim -
CRM Pricing error after 5000 seconds with CRM_ORDER_MAINTAIN in background
Hi,
This is Rajender. I am using function module CRM_ORDER_MAINTAIN to create sales order. I am facing a error while creating sales order from text file. while uploading 15000 records it is taking more than 5000 seconds. But after 5000 seconds the background job gets cancelled raising the error "Error occurred when processing Java programs".
Can anybody please tell me why the error is coming.
I am using the following sequence to create sales order.
CRM_ORDER_MAINTAIN - To create sales order header
CRM_ORDER_MAINTAIN - To create Item - Product, quantity, partner, manual price.
CRM_ORDER_SAVE
CRM_ORDER_INITIALIZE
Thanks & Regards,
Rajender Naik.Hi Rajender,
Try using the FM CRMXIF_ORDER_SAVE which is more of like an interface FM and its better to use this FM for interfaces/data loading. We had issues with using crm_order_maintain FM and had to replace with this one.
Refer to this below link on how to use this FM for a specific scenario-
http://www.divulgesap.com/blog.php?p=MTEy
Hope it helps.
Cheers,
Ravikiran -
Error in crm_order_maintain.
Hi All,
I want to create Service Contract with Perticular Product here i am getting someProblem when adding Product line item in it when i am submitting correct item Category then system is giving me mail with i am giving you code.
Update was terminated
System ID.... TCD
Client....... 110
User..... IBMABAP_
Transaction.. SE38
Update key... 4B46FA07D7B80092E10080000A600525
Generated.... 09.01.2010, 10:24:15
Completed.... 09.01.2010, 10:24:15
Error Info... ABAP/4 processor: SAPSQLARRAY_INSERT_DUPREC_
here i am giving you my code.
REPORT ytest10.
DATA: lv_header_guid TYPE guid_32,
ls_orderadm_h TYPE TABLE OF bapibus20001_header_ins WITH HEADER LINE,
ls_input_fields TYPE TABLE OF bapibus20001_input_fields WITH HEADER LINE,
lt_created_process TYPE TABLE OF bapibus20001_header_ins WITH HEADER LINE,
lt_return TYPE TABLE OF bapiret2 WITH HEADER LINE ,
lt_objects_to_save TYPE TABLE OF bapibus20001_guid_dis WITH HEADER LINE,
lt_saved_objects TYPE TABLE OF bapibus20001_object_id WITH HEADER LINE,
lt_log TYPE bapibus20001_control-log_handle,
ls_objects_to_save TYPE bapibus20001_guid_dis,
lt_orgman TYPE TABLE OF bapibus20001_orgman_ins WITH HEADER LINE,
lt_partner TYPE TABLE OF bapibus20001_partner_ins WITH HEADER LINE,
lt_service TYPE TABLE OF bapibus20001_service_os_ins WITH HEADER LINE,
ls_item TYPE TABLE OF BAPIBUS20001_ITEM WITH HEADER LINE .
DATA: t_CRMM_BUT_CUSTNO TYPE TABLE OF CRMM_BUT_CUSTNO WITH HEADER LINE,
t_CRMM_BUT_FRG0081 TYPE TABLE OF CRMM_BUT_FRG0081 WITH HEADER LINE,
t_adrc TYPE TABLE OF adrc WITH HEADER LINE,
t_zzcomplaintroute TYPE TABLE OF zzcomplaintroute WITH HEADER LINE,
it_STATUS TYPE TABLE OF BAPIBUS20001_STATUS_INS WITH HEADER LINE,
IT_PRICING TYPE TABLE OF BAPIBUS20001_PRICING WITH HEADER LINE,
IT_PRODUCT TYPE TABLE OF BAPIBUS20001_PRODUCT WITH HEADER LINE,
IT_PRODUCT_ITEM TYPE TABLE OF BAPIBUS20001_PRODUCTS WITH HEADER LINE.
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_32 = lv_header_guid.
*CONCATENATE text-d01 is_import-complt_id i
*INTO ls_orderadm_h-description SEPARATED BY space.
PERFORM orderadm_h.
*PERFORM item.
PERFORM orgman.
PERFORM partner.
*PERFORM lt_service.
PERFORM status.
PERFORM pricing.
*PERFORM PRODUCT_LIST.
*PERFORM PRODUCT_ITEM.
CLEAR: lt_created_process, lt_return.DATA : gv_exit TYPE REF TO if_ex_crm_serviceprod_badi,
ev_product_id TYPE comt_product_id VALUE '4AE694A1BAF800B8E10080000A600525',
lt_schedlin_i TYPE crmt_schedlin_i_comt,
lv_schedlin_i TYPE crmt_schedlin_i_com,
lt_schedlin TYPE crmt_schedlin_extdt,
lv_schedlin TYPE crmt_schedlin_extd,
lt_header_guids TYPE crmt_object_guid_tab,
lt_req_obj TYPE crmt_object_name_tab,
lt_appointment_wrk TYPE crmt_appointment_wrkt,
lv_appointment_wrk TYPE crmt_appointment_wrk,
lt_product_i TYPE crmt_product_i_comt,
lv_product_i TYPE crmt_product_i_com,
ls_schedlines TYPE TABLE OF crmt_schedlin_extdt,
wa_schedlines TYPE crmt_schedlin_extd,
ls_orderadm_i TYPE crmt_orderadm_i_com,
lt_orderadm_i TYPE crmt_orderadm_i_comt,
ls_field_names TYPE crmt_input_field_names,
lt_input_fields1 TYPE crmt_input_field_tab,
ls_input_fields1 TYPE crmt_input_field,
lt_orderadm_h1 TYPE crmt_orderadm_h_comt,
ls_orderadm_h1 TYPE crmt_orderadm_h_com.
lv_schedlin-quantity = '1.000'.
INSERT lv_schedlin INTO TABLE lt_schedlin.
lv_schedlin_i-schedlines = lt_schedlin.
lv_schedlin_i-ref_handle = '0000000001'.
INSERT lv_schedlin_i INTO TABLE lt_schedlin_i.
ls_input_fields1-ref_handle = '0000000001'.
ls_input_fields1-ref_kind = 'B'.
ls_input_fields1-objectname = 'SCHEDLIN'.
ls_field_names-fieldname = 'LOGICAL_KEY'.
APPEND ls_field_names TO ls_input_fields1-field_names.
ls_field_names-fieldname = 'QUANTITY'.
APPEND ls_field_names TO ls_input_fields1-field_names.
INSERT ls_input_fields1 INTO TABLE lt_input_fields1.
WAIT UP TO 1 SECONDS.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_product_i = lt_product_i
it_schedlin_i = lt_schedlin_i
CHANGING
ct_orderadm_i = lt_orderadm_i
ct_orderadm_h = lt_orderadm_h1
ct_input_fields = lt_input_fields1
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5. -
CRM_ORDER_MAINTAIN with many contracts
Hi,
I have a probleme to update more than one contracts with the Function Module CRM_ORDER_MAINTAIN.
I want to add agreement CRM and so I use the FM with below parameters :
it_price_agreements_crm = gt_price_agr_crm
ct_input_fields = gt_input_fields.
When I execute this FM fwith one contract, it's correctly updated.
But with more than one, only the first is updated.
I must use an other parameter or a flag to say that I want update many contracts?.
Thanks for your help
best regardsThanks for your answers,
After CRM_ORDER_MAINTAIN, I call the FM CRM_ORDER_SAVE and then BAPI_TRANSACTION_COMMIT.
and this work correctly when I want to update one contract. But if I fill GT_PRICE_AGR_CRM and GT_INPUT_FIELDS with more than one contract as below, only the first contract is correctly updated.
fields of GT_PRICE_AGR_CRM :
ref_guid = item_guid.
ref_kind = 'B'.
crm_item_guid = item_guid.
product = product_guid.
mnt_ow_exists_at_db = 'X'.
mnt_ow_maint_mode_on_select = 'A'.
and kvewe, kappl, kbetr, konwa, kschl ...
fields of GT_INPUT_FIELDS :
ref_guid = item_guid.
ref_kind = 'D'.
objectname = 'PRICE_AGREEMENTS_CRM'.
fieldname = 'KSCHL' and KAPPL and KWERT. -
Crm_order_maintain . create items.
hi all.
i have to update order using fm crm_order_maintian.
i am able to update header but when i c order using crm_order_read there is no item data now i have to craete items of header.
please suggest how to create items in order using crm_order_maintain....
Message was edited by:
gaurav jainHi Gaurav,
The following the code i used to add a product( Item ) to Service order.
Service Contract Updating while Sales Order Creation
FUNCTION zzomotc_sc_update.
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_GUID) TYPE CRMT_OBJECT_GUID
*" CHANGING
*" VALUE(CV_OWN_MESSAGE) TYPE CRMT_BOOLEAN OPTIONAL
***& Constants *
CONSTANTS: c_stparty TYPE comt_partner_fct VALUE '00000001'. "Sold-To-Party
*& Internal Tables Declaration *
DATA:i_orderadm_h TYPE crmt_orderadm_h_wrkt,
i_orderadm_i TYPE crmt_orderadm_i_wrkt,
i_orderadmsc_i TYPE crmt_orderadm_i_wrkt,
i_itemdet TYPE crmt_orderadm_i_comt,
i_product_i TYPE crmt_product_i_wrkt,
i_sales TYPE crmt_sales_wrkt,
i_orgman TYPE crmt_orgman_wrkt,
i_shipping TYPE crmt_shipping_wrkt,
i_schedlin TYPE crmt_schedlin_wrkt,
i_partner TYPE crmt_partner_external_wrkt,
i_guid_header TYPE crmt_object_guid_tab,
i_status TYPE crmt_status_wrkt,
i_text TYPE crmt_text_wrkt,
i_billing TYPE crmt_billing_wrkt,
i_service_contracts TYPE TABLE OF crmt_portal_resultlist,
i_customer_h TYPE crmt_customer_h_wrkt,
i_customer_i TYPE crmt_customer_i_wrkt,
i_input_fields TYPE crmt_input_field_tab,
i_sales_sc TYPE crmt_sales_comt,
i_field_names TYPE crmt_input_field_names_tab,
i_guid_save TYPE crmt_object_guid_tab.
*& Local structure/Work Area Declaration *
DATA:st_sales TYPE crmt_sales_wrk,
st_shipping TYPE crmt_shipping_wrk,
st_orderadm_i TYPE crmt_orderadm_i_wrk,
st_orderadmsc_i TYPE crmt_orderadm_i_wrk,
st_orderadmsc1_i TYPE crmt_orderadm_i_wrk,
st_partner TYPE crmt_partner_external_wrk,
st_billing TYPE crmt_billing_wrk,
st_customer_i TYPE crmt_customer_i_wrk,
st_service TYPE crmt_portal_resultlist,
st_input_fields TYPE crmt_input_field,
st_field_names TYPE crmt_input_field_names,
st_itemdet TYPE crmt_orderadm_i_com.
*& local Variables Declaration *
DATA: l_guid TYPE crmt_object_guid,
l_flag TYPE c VALUE ' ',
l_partner_fct TYPE crmt_portal_service_search-partner_fct,
l_partner_no TYPE crmt_portal_service_search-bu_partner.
CHECK iv_guid IS NOT INITIAL.
COLLECT iv_guid INTO i_guid_header.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = i_guid_header
IMPORTING
et_orderadm_h = i_orderadm_h
et_orderadm_i = i_orderadm_i
et_product_i = i_product_i
et_customer_h = i_customer_h
et_customer_i = i_customer_i
et_sales = i_sales
et_orgman = i_orgman
et_shipping = i_shipping
et_billing = i_billing
et_schedlin = i_schedlin
et_partner = i_partner
et_text = i_text
EXCEPTIONS
document_not_found = 1
error_occurred = 2
document_locked = 3
no_change_authority = 4
no_display_authority = 5
no_change_allowed = 6
OTHERS = 7.
IF sy-subrc <> 0.
** SO Order doesn't exists
ENDIF.
***Get partner function as sold-to-party
DELETE ADJACENT DUPLICATES FROM i_partner.
READ TABLE i_partner WITH KEY partner_fct = c_stparty INTO st_partner.
LOOP AT i_orderadm_i INTO st_orderadm_i.
IF ( st_orderadm_i-itm_type EQ 'ZTAP' ) OR ( st_orderadm_i-itm_type EQ 'ZWVN' ) OR
( st_orderadm_i-itm_type EQ 'ZCPP' ) OR ( st_orderadm_i-itm_type EQ 'YWVN' ).
** Search a valid Service contract based on customer i.e.sold-to-party and product combination
l_partner_fct = c_stparty.
l_partner_no = st_partner-partner_no.
CALL FUNCTION 'CRM_SERVICE_CONTRACTS_SEARCH'
EXPORTING
partner_function = l_partner_fct
partner_number = l_partner_no
* product_id = st_orderadm_i-ordered_prod
* to = sy-datum
TABLES
service_contract_list = i_service_contracts.
IF i_service_contracts[] IS NOT INITIAL.
LOOP AT i_service_contracts INTO st_service WHERE date_end GE sy-datum.
REFRESH i_guid_header.
COLLECT st_service-guid INTO i_guid_header.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = i_guid_header
IMPORTING
et_orderadm_i = i_orderadmsc_i
EXCEPTIONS
document_not_found = 1
error_occurred = 2
document_locked = 3
no_change_authority = 4
no_display_authority = 5
no_change_allowed = 6
OTHERS = 7.
READ TABLE i_orderadmsc_i INTO st_orderadmsc_i
WITH KEY ordered_prod = st_orderadm_i-ordered_prod.
IF sy-subrc EQ 0.
l_flag = 'X'.
l_guid = st_service-guid.
EXIT.
ENDIF.
ENDLOOP.
**** Deactivate the line item of existing service contract and add new service item to this contract
IF l_flag EQ 'X'.
REFRESH : i_guid_header, i_orderadm_h, i_orderadmsc_i.
COLLECT l_guid INTO i_guid_header.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = i_guid_header
IMPORTING
et_orderadm_h = i_orderadm_h
et_orderadm_i = i_orderadmsc_i
* et_pricing_i = i_pricing_i
et_status = i_status
EXCEPTIONS
document_not_found = 1
error_occurred = 2
document_locked = 3
no_change_authority = 4
no_display_authority = 5
no_change_allowed = 6
OTHERS = 7.
READ TABLE i_orderadmsc_i INTO st_orderadmsc_i INDEX sy-tabix.
st_input_fields-ref_guid = st_orderadmsc_i-guid.
st_input_fields-ref_kind = 'B'.
st_input_fields-objectname = 'ORDERADM_I'.
st_field_names-fieldname = 'MODE'.
APPEND st_field_names TO i_field_names.
st_field_names-fieldname = 'ORDERED_PROD'.
APPEND st_field_names TO i_field_names.
st_input_fields-field_names = i_field_names.
APPEND st_input_fields TO i_input_fields.
REFRESH i_field_names.
st_input_fields-ref_guid = st_orderadmsc_i-guid.
st_input_fields-ref_kind = 'B'.
st_input_fields-objectname = 'PRODUCT_I'.
st_field_names-fieldname = 'PROCESS_QTY_UNIT'.
APPEND st_field_names TO i_field_names.
st_input_fields-field_names = i_field_names.
APPEND st_input_fields TO i_input_fields.
REFRESH i_field_names.
st_input_fields-ref_guid = st_orderadmsc_i-guid.
st_input_fields-ref_kind = 'B'.
st_input_fields-objectname = 'SCHEDLIN'.
st_field_names-fieldname = 'QUANTITY'.
APPEND st_field_names TO i_field_names.
st_input_fields-field_names = i_field_names.
APPEND st_input_fields TO i_input_fields.
REFRESH i_field_names.
MOVE-CORRESPONDING st_orderadmsc_i TO st_itemdet.
* st_orderadmsc1_i-header = st_orderadmsc_i-header.
* st_orderadmsc1_i-ordered_prod = st_orderadm_i-ordered_prod.
APPEND st_itemdet TO i_itemdet.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
* EXPORTING
** it_pricing_i = i_pricing_i
* it_product_i = i_product_i
* it_schedlin_i = i_schedlin_i
CHANGING
ct_orderadm_i = i_itemdet
ct_input_fields = i_input_fields
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
IF sy-subrc EQ 0.
COLLECT l_guid INTO i_guid_save.
CALL FUNCTION 'CRM_ORDER_SAVE'
EXPORTING
it_objects_to_save = i_guid_save
EXCEPTIONS
document_not_saved = 1
OTHERS = 2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
REFRESH i_guid_save.
l_flag = 'X'.
ENDIF.
ELSE.
REFRESH: i_guid_header, i_orderadmsc_i.
READ TABLE i_service_contracts INTO st_service INDEX 1.
COLLECT st_service-guid INTO i_guid_header.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = i_guid_header
IMPORTING
et_orderadm_h = i_orderadm_h
et_orderadm_i = i_orderadmsc_i
* et_pricing_i = i_pricing_i
et_status = i_status
EXCEPTIONS
document_not_found = 1
error_occurred = 2
document_locked = 3
no_change_authority = 4
no_display_authority = 5
no_change_allowed = 6
OTHERS = 7.
READ TABLE i_orderadmsc_i INTO st_orderadmsc_i INDEX sy-tabix.
st_input_fields-ref_guid = st_orderadmsc_i-guid.
st_input_fields-ref_kind = 'B'.
st_input_fields-objectname = 'ORDERADM_I'.
st_field_names-fieldname = 'MODE'.
APPEND st_field_names TO i_field_names.
st_field_names-fieldname = 'ORDERED_PROD'.
APPEND st_field_names TO i_field_names.
st_input_fields-field_names = i_field_names.
APPEND st_input_fields TO i_input_fields.
REFRESH i_field_names.
st_input_fields-ref_guid = st_orderadmsc_i-guid.
st_input_fields-ref_kind = 'B'.
st_input_fields-objectname = 'PRODUCT_I'.
st_field_names-fieldname = 'PROCESS_QTY_UNIT'.
APPEND st_field_names TO i_field_names.
st_input_fields-field_names = i_field_names.
APPEND st_input_fields TO i_input_fields.
REFRESH i_field_names.
st_input_fields-ref_guid = st_orderadmsc_i-guid.
st_input_fields-ref_kind = 'B'.
st_input_fields-objectname = 'SCHEDLIN'.
st_field_names-fieldname = 'QUANTITY'.
APPEND st_field_names TO i_field_names.
st_input_fields-field_names = i_field_names.
APPEND st_input_fields TO i_input_fields.
REFRESH i_field_names.
st_orderadmsc1_i-header = st_orderadmsc_i-header.
st_orderadmsc1_i-ordered_prod = st_orderadm_i-ordered_prod.
APPEND st_orderadmsc1_i TO i_orderadmsc_i.
MOVE-CORRESPONDING st_orderadmsc1_i TO st_itemdet.
APPEND st_itemdet TO i_itemdet.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
* EXPORTING
** it_pricing_i = i_pricing_i
* it_product_i = i_product_i
* it_schedlin_i = i_schedlin_i
CHANGING
ct_orderadm_i = i_itemdet
ct_input_fields = i_input_fields
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
IF sy-subrc EQ 0.
COLLECT st_service-guid INTO i_guid_save.
CALL FUNCTION 'CRM_ORDER_SAVE'
EXPORTING
it_objects_to_save = i_guid_save
EXCEPTIONS
document_not_saved = 1
OTHERS = 2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
REFRESH i_guid_save.
l_flag = 'X'.
ENDIF.
ENDIF.
ELSE.
*** Create a new service contract for it and add line item to it.
DATA: st_servicec_h TYPE crmt_iservice_baskethead_il,
st_servicec_i TYPE crmt_srv_webreq_item_il ,
st_screate_h TYPE crmt_orderadm_h_com,
st_screate_i TYPE crmt_orderadm_i_com.
READ TABLE i_partner INTO st_partner WITH KEY partner_fct = '00000001'.
st_servicec_h-handle = '00001'.
st_servicec_h-ref_handle = '00001'.
st_servicec_h-process_type = 'ZSC'.
st_servicec_h-description = 'Service Contract'.
st_servicec_h-descr_language = 'E'.
st_servicec_i-handle = '00002'.
st_servicec_i-ref_handle = '00001'.
* st_servicec_i-ITM_TYPE =
st_servicec_i-ordered_prod = st_orderadm_i-ordered_prod.
* st_servicec_i-ORDER_QTY =
* st_servicec_i-QTY_UNIT =
CALL FUNCTION 'CRM_SERVICE_ORDER_CREATE'
EXPORTING
is_service_baskethead = st_servicec_h
is_service_basketitem = st_servicec_i
iv_service_productguid = st_orderadm_i-product
iv_partner_ag = st_partner-partner_no
iv_partn_fct_ag = '00000001'
IMPORTING
es_orderadm_h = st_screate_h
es_orderadm_i = st_screate_i
EXCEPTIONS
error_occured = 1
OTHERS = 2.
IF sy-subrc EQ 0.
COLLECT st_screate_h-guid INTO i_guid_save.
CALL FUNCTION 'CRM_ORDER_SAVE'
EXPORTING
it_objects_to_save = i_guid_save
EXCEPTIONS
document_not_saved = 1
OTHERS = 2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
REFRESH i_guid_save.
l_flag = 'X'.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDFUNCTION.
Actually, this FM was created for updating the service contract while creation of sales order with serivce product as its line item. It search for valid SC for sold-to-Party and checks for the products if not there adds the same product as line item to SC. If SC not avaliable , Creates SC and adds the same product
Hope it will help you.
Regards,
Arjun
<b>Pl. Reward points</b> -
CRM_ORDER_MAINTAIN for Complaints
Hello Experts,
I have the below requiremets.
1. Creation of complaint from xl file: I have a file which contais complaints created in some legacy system.I have to write a program which will read the file and create the compalints in CRM.Iam using CRM_ORDER_MAINTAIN in my code.The fields that i need to populate are Heade,Product,Partner and Subject Profile.
I am able to create all these except the subject profile.there is a input parameter IT_SUBJECT.even though I pass all the fields I am not able to create the subject profile in complaints.I am ale to create the complaints with Header,Parner and Product.
Is there any standard example which will help me populate the subject?
2.While uploading the complaints I have to set he complaint Priority and the Category to a specified value.However the header input parameter of the CRM_ORDER_MAINTAIN does not take these fields and inputs.Is there any way in which i can set the priority and category fields?
It wil be great if you kindly share any idea or experience with me.
Your help will be much appreciated.
Thanks a lot in advance.
Regads
AnupamHi,
You can pass value of priority and category to internal table IT_ACTIVITY_H in CRM_ORDER_MAINTAIN function model.
Also you can check CRM_TEST_SER_ORDER_MAINTAIN report as a reference.
If helpful kindly reward me.
Thanks & Regards,
Anirban -
Need to Create Line Items through CRM_ORDER_MAINTAIN
Hi all,
I need code for creating Line Items with product and Quantity through CRM_ORDER_MAINTAIN,
I am able to create header and the partner data through CRM_ORDER_MAINTAIN.
Suggest the solution.Since you have already used the function module CRM_ORDER_MAINTAIN for partners, it shouldn't be difficult for you to use it for more sets of data. Well, the idea is to know what is required to be filled in the input fields and keys. There is a report program CRM_ORDER_READ. Use this with an existing transaction that contains the type of data you want to know about. You will get lot of insight into the data required to for any set of data.
Also, see this thread for some sample code
Set item, partner data of sales order using BAPI_BUSPROCESSND_CREATEMULTI -
Create items using func mod crm_order_maintain
Hi,
I am trying to create items within a service order with higher level item. Items are create but higher level item field is blank.
insert fieldnames
ls_fldnames-fieldname = 'MODE'.
insert ls_fldnames into table lt_fldnames.
ls_fldnames-fieldname = 'ORDERED_PROD'.
insert ls_fldnames into table lt_fldnames.
ls_fldnames-fieldname = 'NUMBER_PARENT'.
ls_fldnames-fieldname = 'PARENT_HANDLE'.
insert ls_fldnames into table lt_fldnames.
ls_fldnames-fieldname = 'ITM_PROC_IDENT'.
insert ls_fldnames into table lt_fldnames.
ls_ordm_i-header = gv_hdrguid.
ls_ordm_i-itm_proc_ident = 'SRVC'.
if gs_hier-parent is not initial.
ls_ordm_i-ordered_prod = ls_outtab-sor.
else.
ls_ordm_i-ordered_prod = ls_outtab-svc_act.
endif.
lv_prodid = ls_ordm_i-ordered_prod.
if lv_prodid co '0123456789 '.
unpack lv_prodid to lv_prodid.
endif.
add 1 to lv_handle.
ls_ordm_i-mode = 'A'. "create
ls_ordm_i-handle = lv_handle.
if gs_hier-parent is not initial.
ls_ordm_i-parent_handle = ls_parent-handle.
endif.
insert ls_ordm_i into table lt_ordm_i.
ls_parent-posnr = gv_posnr.
ls_parent-handle = lv_handle.
append ls_parent to lt_parent.
ls_product-ref_handle = lv_handle.
insert ls_product into table lt_product.
insert input fields
ls_inputflds-field_names[] = lt_fldnames[].
ls_inputflds-ref_handle = lv_Handle.
ls_inputflds-objectname = 'ORDERADM_I'.
insert ls_inputflds into table lt_inputflds.
endloop.
return selected products back to service order's items
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_product_i = lt_product
CHANGING
CT_ORDERADM_I = lt_ordm_i
ct_input_fields = lt_inputflds
EXCEPTIONS
ERROR_OCCURRED = 1
DOCUMENT_LOCKED = 2
NO_CHANGE_ALLOWED = 3
NO_AUTHORITY = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.Amit,
I am calling a action from a service order which will popup a window containing product tree. User will select the products. If a higher level product is select, child product will also be created as items with higher level item.
As I said the items are showing in the service order, but child item's higher level item is blank.
Cheers. -
CRM_MKT_MODIFY_ORDER for Adding Products in Journal
Hi ,
We are trying to insert Product and Journal Data in
CRM_MKT_MODIFY_ORDER BAdI.
The CRM_ORDER_MAINTAIN FM being called with proper data after this BADI call.But no
products are getting created in Journal.Journal is cerated.
Also Observed we can't do in ORDER_SAVE BAdI ,As GUID not available in order save when the
activity being created in back ground
Please post me if any code available with you for adding products.If posible ,drop u r mail id ,So i can send more info.
Reference FM related to Adding products in CRMV_EVENTS will also OK.
PS : This Campaign run actually create multiple activities in back ground.
Message was edited by: Ranganatha Prasad KurupatiHello,
Regarding CRMV_EVENT, have a look to CRM_PRODUCT_I_A_CHANGE_PROD_EC.
Could you send me your coding at [email protected]?
Regards,
Frédéric -
Updating price conditions using CRM_ORDER_MAINTAIN
Hello everyone!
Could anyone help me out with respect to price updation using "CRM_ORDER_MAINTAIN"?
I am supposed to do the following:
I obtain the current unit price for a sales order item using "CRM_ORDER_READ". The feild et_pridoc-pric_cond-kbetr gives me this value. Then i get new price for the product from a condition table. I compare this new price with the kbetr value for a particular condition type. If the new price is less than the kbetr value then i should update the kbetr value of the item using "CRM_ORDER_MAINTAIN". I am sending all the parameters necessary to the FM.
I have gone through the previous posts with the same query but with no luck i am running out of ideas! Any sample code will be greatly appeciated.
Thanks and Regards,
Smithahi,
please pass all the parameters & check updating parameters.like when u create a new entry u need to enter X & modify Y so pass all the parameters ...
thanks,
chaitanya -
BAPI CHANGEMULTI and CRM_ORDER_MAINTAIN
Hi all,
I have a couple of questions which are strictly connected:
1. Does anybody know if BAPI BAPI_BUSPROCESSND_CHANGEMULTI, in CRM application is suitable for adding a new item in a sales order already created?
The fact we have set up parameter <b>A (CREATE)</b>, in the internal table ITEM , but after a long debuggins Bapi return us the parameter<b> A (MODIFY).</b>
CALL FUNCTION 'BAPI_BUSPROCESSND_CHANGEMULTI'
TABLES
HEADER = CT_ORDERADM_H
ITEM = CT_ORDERADM_I
SALES = it_sales
ORGANISATION = it_organiz
PRICING = it_pricing
APPOINTMENT = it_appointment
TEXT = it_text
INPUT_FIELDS = ct_input
RETURN = it_return_bapi
CONDITION_CREATE = it_preciopos
SCHEDULELINE = it_repartos
BILLING = it_billing_maintain.
LOOP AT it_return_bapi.
IF it_return_bapi-TYPE = 'E' OR
it_return_bapi-TYPE = 'A'.
MESSAGE it_return_bapi-message type 'I'.
ENDIF.
ENDLOOP.
2 . <b>CRM_ORDER MAINTAIN</b> used in another version of the program, return us the new position but unfortunately it create <b>PRICE CONDITIONS INACTIVE</b>, filled with 0.
So far we do not know why it create inactive conditions, especially the price one as, this condition is not statistical.
The code is the following:
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
IT_BILLING = it_billing_maintain
IT_SCHEDLIN_I = IT_SCHEDLIN_maintain
IT_PRIDOC = IT_PRIDOC
IT_TEXT = IT_TEXT
IMPORTING
ET_EXCEPTION = ET_EXCEPTION
CHANGING
CT_ORDERADM_H = CT_ORDERADM_H
CT_ORDERADM_I = CT_ORDERADM_I
CT_INPUT_FIELDS = CT_INPUT
CT_DOC_FLOW = CT_DOC_FLOW
EXCEPTIONS
ERROR_OCCURRED = 1
DOCUMENT_LOCKED = 2
NO_CHANGE_ALLOWED = 3
NO_AUTHORITY = 4
OTHERS = 5.
Any suggestions are welcomed.
Many thanks in advance,
AndreaHi Amit,
basically we checked all input fields.
We noticed that input fields are set up exatly as you said as for
ORDERADM_H is A and for ORDERADM_I is B.
Unfortunately it still does not work. We think that input fields may be wrong.
Attached you find the code use for this BAPI.
In any case many thanks for your answer.
Andrea.
FORM rellenar_input_fields .
inicio modificacion jgarciar 11122006 ********************
rellenar tabla input_fields con datos de header
loop at it_header.
it_inputfields-REF_GUID = it_header-GUID.
it_inputfields-REF_KIND = 'A'.
it_inputfields-OBJECTNAME = 'ORDERADM_H'.
append it_inputfields.
ct_input-REF_GUID = it_header-GUID.
ct_input-REF_KIND = 'A'.
ct_input-OBJECTNAME = 'ORDERADM_H'.
ct_input-fieldname = 'GUID'.
append ct_input.
endloop.
loop at it_header.
CT_INPUT-REF_GUID = it_header-GUID.
CT_INPUT-REF_KIND = 'A'.
CT_INPUT-FIELDNAME = 'OBJECT_ID'.
CT_INPUT-OBJECTNAME = 'ORDERADM_H'.
ct_input-changeable = 'A'.
append CT_INPUT.
endloop.
Fin modificacion jgarciar 11122006 ********************
Rellenar tbla input_fields de billing
LOOP AT it_billing_maintain INTO wa_billing_maintain.
Inicio modificacion jgarciar 11122006 ***************
REFRESH WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 ***************
CLEAR: WA_INPUT, WA_NOMBRES.
Datos de facturacion
WA_INPUT-REF_GUID = wa_billing_maintain-ref_guid.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'BILLING'.
WA_input-FIELDNAME = 'BILLING_BLOCK'.
WA_NOMBRES-FIELDNAME = 'BILLING_BLOCK'.
WA_NOMBRES-changeable = ''.
Inicio modificacion jgarciar 11122006 ************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 ************
Inicio modificacion jgarciar 11122006 ************
INSERT WA_INPUT INTO TABLE CT_INPUT.
append WA_INPUT TO CT_INPUT.
Fin modificacion jgarciar 11122006 ************
ENDLOOP.
rellenar tabla input_fields con datos de item
loop at CT_ORDERADM_I INTO WA_CT_ORDERADM_I.
Inicio modificacion jgarciar 11122006 ******************
SELECT SINGLE * FROM CRMD_ORDERADM_I
WHERE GUID = WA_CT_ORDERADM_I-GUID.
Si existe, solo se modifica la descripcion
IF sy-subrc = 0.
Fin modificacion jgarciar 11122006 ********************
MMG - Description
CLEAR WA_INPUT.
Inicio modificacion jgarciar 11122006 **************
REFRESH WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 **************
WA_INPUT-REF_GUID = WA_CT_ORDERADM_I-GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'ORDERADM_I'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_input-FIELDNAME = 'DESCRIPTION'.
WA_input-CHANGEABLE = ''.
WA_NOMBRES-FIELDNAME = 'DESCRIPTION'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 **************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 **************
WA_NOMBRES-FIELDNAME = 'MODE'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 **************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
append wa_input to ct_input.
CLEAR WA_INPUT.
CLEAR WA_INPUT.
Inicio modificacion jgarciar 11122006 **************
REFRESH WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 **************
WA_INPUT-REF_GUID = WA_CT_ORDERADM_I-GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'ORDERADM_I'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_input-FIELDNAME = 'MODE'.
WA_input-CHANGEABLE = ''.
WA_NOMBRES-FIELDNAME = 'DESCRIPTION'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 **************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 **************
WA_NOMBRES-FIELDNAME = 'MODE'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 **************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
append wa_input to ct_input.
CLEAR WA_INPUT.
INSERT WA_INPUT INTO TABLE CT_INPUT.
Fin modificacion jgarciar 11122006 **************
Inicio modificacion jgarciar 11122006 ***************
endif.
SELECT SINGLE * FROM CRMD_ORDERADM_I
WHERE GUID = WA_CT_ORDERADM_I-GUID.
Si existe, solo se modifica la descripcion
IF sy-subrc <> 0.
clear wa_input.
MMG - GUID
WA_INPUT-REF_GUID = WA_CT_ORDERADM_I-GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'ORDERADM_I'.
Inicio modificacion jgarciar 11122006 **************
REFRESH WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 **************
WA_input-FIELDNAME = 'GUID'.
WA_NOMBRES-FIELDNAME = 'GUID'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 **************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
append wa_input to ct_input.
CLEAR WA_INPUT.
WA_INPUT-REF_GUID = WA_CT_ORDERADM_I-GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'ORDERADM_I'.
Inicio modificacion jgarciar 11122006 **************
REFRESH WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 **************
WA_input-FIELDNAME = 'DESCRIPTION'.
WA_NOMBRES-FIELDNAME = 'GUID'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 **************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
append wa_input to ct_input.
CLEAR WA_INPUT.
Fin modificacion jgarciar 11122006 **************
MMG -HEADER
WA_INPUT-REF_GUID = WA_CT_ORDERADM_I-GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'ORDERADM_I'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_input-FIELDNAME = 'HEADER'.
WA_NOMBRES-FIELDNAME = 'HEADER'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 **************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 **************
INSERT WA_INPUT INTO TABLE CT_INPUT.
WA_INPUT-REF_GUID = WA_CT_ORDERADM_I-GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'ORDERADM_I'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_input-FIELDNAME = 'PRODUCT'.
WA_NOMBRES-FIELDNAME = 'PRODUCT'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 **************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
append WA_INPUT TO CT_INPUT.
CLEAR WA_INPUT.
Fin modificacion jgarciar 11122006 **************
WA_INPUT-REF_GUID = WA_CT_ORDERADM_I-GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'ORDERADM_I'.
WA_input-FIELDNAME = 'ORDERED_PROD'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'ORDERED_PROD'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 **************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
append WA_INPUT TO CT_INPUT.
INSERT WA_INPUT INTO TABLE CT_INPUT.
CLEAR WA_INPUT.
Fin modificacion jgarciar 11122006 **************
WA_INPUT-REF_GUID = WA_CT_ORDERADM_I-GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'ORDERADM_I'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_input-FIELDNAME = 'ITM_TYPE'.
WA_NOMBRES-FIELDNAME = 'ITM_TYPE'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 **************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
append WA_INPUT TO CT_INPUT.
INSERT WA_INPUT INTO TABLE CT_INPUT.
CLEAR WA_INPUT.
Fin modificacion jgarciar 11122006 **************
WA_INPUT-REF_GUID = WA_CT_ORDERADM_I-GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'ORDERADM_I'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_input-FIELDNAME = 'PARTNER_PROD'.
WA_NOMBRES-FIELDNAME = 'PARTNER_PROD'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 ***************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 ***************
INSERT WA_INPUT INTO TABLE CT_INPUT.
WA_INPUT-REF_GUID = WA_CT_ORDERADM_I-GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'ORDERADM_I'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_input-FIELDNAME = 'NUMBER_INT'.
WA_NOMBRES-FIELDNAME = 'NUMBER_INT'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 **************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
append WA_INPUT TO CT_INPUT.
CLEAR WA_INPUT.
Fin modificacion jgarciar 11122006 **************
WA_INPUT-REF_GUID = WA_CT_ORDERADM_I-GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'ORDERADM_I'.
REFRESH WA_INPUT-FIELD_NAMES.
MMG - 18-11-04
WA_NOMBRES-FIELDNAME = 'NUMBER_EXT'.
WA_NOMBRES-CHANGEABLE = ''.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
IF WA_CT_ORDERADM_I-ITM_TYPE <> 'ZTAD'.
IF WA_CT_ORDERADM_I-NUMBER_PARENT <> ''.
MMG - PARENT
WA_INPUT-REF_GUID = WA_CT_ORDERADM_I-GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'ORDERADM_I'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_input-FIELDNAME = 'PARENT'.
WA_NOMBRES-FIELDNAME = 'PARENT'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 **************
append WA_INPUT TO CT_INPUT.
CLEAR WA_INPUT.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
Fin modificacion jgarciar 11122006 **************
MMG - NUMBER_PARENT
WA_INPUT-REF_GUID = WA_CT_ORDERADM_I-GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'ORDERADM_I'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_input-FIELDNAME = 'NUMBER_PARENT'.
WA_NOMBRES-FIELDNAME = 'NUMBER_PARENT'.
WA_NOMBRES-CHANGEABLE = ''.
Inicio modificacion jgarciar 11122006 **************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
append wa_input to ct_input.
CLEAR WA_INPUT.
Fin modificacion jgarciar 11122006 **************
ENDIF. "<> ZTAD
ENDIF.
Inicio modificacion jgarciar 11122006 ***************
Fin modificacion jgarciar 11122006 ***************
endloop.
rellenar tabla input_fields con datos de item
loop at ct_orderadm_i.
ct_input-REF_GUID = ct_orderadm_i-GUID.
ct_input-REF_KIND = 'B'.
ct_input-OBJECTNAME = 'ORDERADM_I'.
ct_input-FIELDNAME = 'GUID'.
append ct_input.
ct_input-REF_GUID = ct_orderadm_i-GUID.
ct_input-REF_KIND = 'B'.
ct_input-OBJECTNAME = 'ORDERADM_I'.
ct_input-FIELDNAME = 'HEADER'.
append ct_input.
ct_input-REF_GUID = ct_orderadm_i-GUID.
ct_input-REF_KIND = 'B'.
ct_input-OBJECTNAME = 'ORDERADM_I'.
ct_input-FIELDNAME = 'PRODUCT'.
append ct_input.
ct_input-REF_GUID = ct_orderadm_i-GUID.
ct_input-REF_KIND = 'B'.
ct_input-OBJECTNAME = 'ORDERADM_I'.
ct_input-FIELDNAME = 'ORDERED_PROD'.
append ct_input.
ct_input-REF_GUID = ct_orderadm_i-GUID.
ct_input-REF_KIND = 'B'.
ct_input-OBJECTNAME = 'ORDERADM_I'.
ct_input-FIELDNAME = 'ITM_TYPE'.
append ct_input.
ct_input-REF_GUID = ct_orderadm_i-GUID.
ct_input-REF_KIND = 'B'.
ct_input-OBJECTNAME = 'ORDERADM_I'.
ct_input-FIELDNAME = 'PARTNER_PROD'.
append ct_input.
ct_input-REF_GUID = ct_orderadm_i-GUID.
ct_input-REF_KIND = 'B'.
ct_input-OBJECTNAME = 'ORDERADM_I'.
ct_input-FIELDNAME = 'NUMBER_INT'.
append ct_input.
ct_input-REF_GUID = ct_orderadm_i-GUID.
ct_input-REF_KIND = 'B'.
ct_input-OBJECTNAME = 'ORDERADM_I'.
ct_input-FIELDNAME = 'NUMBER_EXT'.
append ct_input.
ct_input-REF_GUID = ct_orderadm_i-GUID.
ct_input-REF_KIND = 'B'.
ct_input-OBJECTNAME = 'ORDERADM_I'.
ct_input-FIELDNAME = 'PARENT'.
append ct_input.
ct_input-REF_GUID = ct_orderadm_i-GUID.
ct_input-REF_KIND = 'B'.
ct_input-OBJECTNAME = 'ORDERADM_I'.
ct_input-FIELDNAME = 'NUMBER_PARENT'.
append ct_input.
endloop.
rellenar tabla input_fields con datos de item
Rellenar input fields con campos de doc_flow
Loop At ct_doc_flow Into wa_ct_doc_flow.
REFRESH WA_INPUT-FIELD_NAMES.
wa_input-REF_GUID = wa_ct_doc_flow-REF_GUID.
wa_input-REF_KIND = wa_ct_doc_flow-REF_KIND.
wa_input-OBJECTNAME = 'DOC_FLOW'.
wa_nombres-fieldname = 'REF_GUID'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
wa_nombres-fieldname = 'REF_KIND'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
wa_nombres-fieldname = 'OBJTYPE_A'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
wa_nombres-fieldname = 'OBJTYPE_B'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
wa_nombres-fieldname = 'OBJKEY_A'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
wa_nombres-fieldname = 'OBJKEY_B'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
wa_nombres-fieldname = 'VONA_KIND'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
wa_nombres-fieldname = 'RELTYPE'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
wa_nombres-fieldname = 'BREL_KIND'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
EndLoop.
rellenar tabla input_fields con datos de sales
loop at it_sales.
WA_INPUT-REF_GUID = it_sales-REF_GUID.
WA_INPUT-REF_KIND = it_sales-REF_KIND.
WA_INPUT-OBJECTNAME = 'SALES'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'PO_NUMBER_SOLD'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
endloop.
rellenar tabla input_fields con datos de organización
loop at it_organiz.
WA_INPUT-REF_GUID = it_organiz-REF_GUID.
WA_INPUT-REF_KIND = 'A'.
WA_INPUT-OBJECTNAME = 'ORGMAN'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'SALES_ORG_RESP'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
endloop.
rellenar tabla input_fields con datos de SCHEDULELINE
loop at it_repartos.
WA_INPUT-REF_GUID = it_repartos-ITEM_GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'SCHEDLIN'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'QUANTITY'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
endloop.
Inicio modificacion jgarciar 11122006 ********************
Datos de schedulin - Cantidades
loop at IT_SCHEDLIN_MAINTAIN INTO WA_IT_SCHEDLIN_MAINTAIN.
WA_INPUT-REF_GUID = WA_IT_SCHEDLIN_MAINTAIN-REF_GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'SCHEDLIN'.
Inicio modificacion jgarciar 11122006 *****************
REFRESH WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 *****************
WA_NOMBRES-FIELDNAME = 'QUANTITY'.
Inicio modificacion jgarciar 11122006 *****************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 *****************
INSERT WA_INPUT INTO TABLE CT_INPUT.
endloop.
Fin modificacion jgarciar 11122006 ********************
rellenar tabla input_fields con datos de CONDITION_COM
loop at it_pridoc into wa_pridoc.
WA_INPUT-REF_GUID = wa_pridoc-REF_GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'PRIDOC'.
Inicio modificacion jgarciar 11122006 *****************
REFRESH WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 *****************
WA_NOMBRES-FIELDNAME = 'CURRENCY'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'COND_TYPE'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'COND_RATE'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'COND_P_UNT'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
Mod. 04.12.2006 ASA INICIO.
WA_NOMBRES-FIELDNAME = 'KSCHL'.
Inicio modificacion jgarciar 11122006 *****************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-field_names.
Fin modificacion jgarciar 11122006 *****************
WA_NOMBRES-FIELDNAME = 'WAERS'.
Inicio modificacion jgarciar 11122006 *****************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-field_names.
Fin modificacion jgarciar 11122006 *****************
WA_NOMBRES-FIELDNAME = 'KBETR'.
Inicio modificacion jgarciar 11122006 *****************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-field_names.
WA_NOMBRES-FIELDNAME = 'KPEIN'.
Inicio modificacion jgarciar 11122006 *****************
INSERT WA_NOMBRES INTO TABLE WA_INPUT-field_names.
Fin modificacion jgarciar 11122006 *****************
INSERT WA_INPUT INTO TABLE CT_INPUT.
Mod. 04.12.2006 ASA FINAL.
endloop.
MMG - Input fields para los textos
Inicio modificacion jgarciar 11122006 ********************
loop at it_text into wa_it_text.
clear wa_input.
WA_INPUT-REF_GUID = wa_it_text-REF_GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'TEXTS'.
wa_input-fieldname = 'TDID'.
APPEND WA_INPUT TO CT_INPUT.
clear wa_input.
WA_INPUT-REF_GUID = wa_it_text-REF_GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'TEXTS'.
wa_input-fieldname = 'TDSPRAS'.
APPEND WA_INPUT TO CT_INPUT.
clear wa_input.
WA_INPUT-REF_GUID = wa_it_text-REF_GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'TEXTS'.
wa_input-fieldname = 'TDSTYLE'.
APPEND WA_INPUT TO CT_INPUT.
clear wa_input.
WA_INPUT-REF_GUID = wa_it_text-REF_GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'TEXTS'.
wa_input-fieldname = 'MODE'.
APPEND WA_INPUT TO CT_INPUT.
clear wa_input.
WA_INPUT-REF_GUID = wa_it_text-REF_GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'TEXTS'.
wa_input-fieldname = 'LINES'.
APPEND WA_INPUT TO CT_INPUT.
clear wa_input.
WA_INPUT-REF_GUID = wa_it_text-REF_GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'TEXTS'.
wa_input-fieldname = 'TDFORMAT'.
APPEND WA_INPUT TO CT_INPUT.
clear wa_input.
WA_INPUT-REF_GUID = wa_it_text-REF_GUID.
WA_INPUT-REF_KIND = 'B'.
WA_INPUT-OBJECTNAME = 'TEXTS'.
wa_input-fieldname = 'TDLINE'.
APPEND WA_INPUT TO CT_INPUT.
Inicio modificacion jgarciar 11122006 *****************
REFRESH WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'TDID'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'TDSPRAS'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'TDSTYLE'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'MODE'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'LINES'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'TDFORMAT'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
WA_NOMBRES-FIELDNAME = 'TDLINE'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
Fin modificacion jgarciar 11122006 *****************
INSERT WA_INPUT INTO TABLE CT_INPUT.
endloop.
Fin modificacion jgarciar 11122006 ********************
rellenar tabla input_fields con datos de PARTNER
loop at it_partner.
WA_INPUT-REF_GUID = it_partner-REF_GUID.
WA_INPUT-REF_KIND = it_partner-REF_KIND.
WA_INPUT-OBJECTNAME = 'PARTNER'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_INPUT-LOGICAL_KEY = it_partner-REF_PARTNER_HANDLE.
WA_NOMBRES-FIELDNAME = 'PARTNER_FCT'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
WA_INPUT-REF_GUID = it_partner-REF_GUID.
WA_INPUT-REF_KIND = it_partner-REF_KIND.
WA_INPUT-OBJECTNAME = 'PARTNER'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_INPUT-LOGICAL_KEY = it_partner-REF_PARTNER_HANDLE.
WA_NOMBRES-FIELDNAME = 'PARTNER_NO'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
WA_INPUT-REF_GUID = it_partner-REF_GUID.
WA_INPUT-REF_KIND = it_partner-REF_KIND.
WA_INPUT-OBJECTNAME = 'PARTNER'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_INPUT-LOGICAL_KEY = it_partner-REF_PARTNER_HANDLE.
WA_NOMBRES-FIELDNAME = 'NO_TYPE'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
WA_INPUT-REF_GUID = it_partner-REF_GUID.
WA_INPUT-REF_KIND = it_partner-REF_KIND.
WA_INPUT-OBJECTNAME = 'PARTNER'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_INPUT-LOGICAL_KEY = it_partner-REF_PARTNER_HANDLE.
WA_NOMBRES-FIELDNAME = 'DISPLAY_TYPE'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
WA_INPUT-REF_GUID = it_partner-REF_GUID.
WA_INPUT-REF_KIND = it_partner-REF_KIND.
WA_INPUT-OBJECTNAME = 'PARTNER'.
REFRESH WA_INPUT-FIELD_NAMES.
WA_INPUT-LOGICAL_KEY = it_partner-REF_PARTNER_HANDLE.
WA_NOMBRES-FIELDNAME = 'KIND_OF_ENTRY'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
endloop.
JCF 19/12/2003 Incorporar funcionalidad fechas de ZSUBIROFERTA
Rellenar input_fields con datos de appointment
LOOP AT it_appointment.
WA_INPUT-REF_GUID = it_appointment-ref_guid.
WA_INPUT-REF_KIND = 'A'.
WA_INPUT-OBJECTNAME = 'APPOINTMENT'.
REFRESH WA_INPUT-FIELD_NAMES.
if it_appointment-APPT_TYPE = 'ZLIQUIDACION'.
WA_INPUT-LOGICAL_KEY = 'ZLIQUIDACIONX'.
ELSE.
WA_INPUT-LOGICAL_KEY = it_appointment-APPT_TYPE.
ENDIF.
WA_NOMBRES-FIELDNAME = 'APPT_TYPE'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
wa_input-fieldname = 'APPT_TYPE'.
append wa_input to ct_input.
WA_INPUT-REF_GUID = it_appointment-ref_guid.
WA_INPUT-REF_KIND = 'A'.
WA_INPUT-OBJECTNAME = 'APPOINTMENT'.
REFRESH WA_INPUT-FIELD_NAMES.
if it_appointment-APPT_TYPE = 'ZLIQUIDACION'.
WA_INPUT-LOGICAL_KEY = 'ZLIQUIDACIONX'.
ELSE.
WA_INPUT-LOGICAL_KEY = it_appointment-APPT_TYPE.
ENDIF.
WA_NOMBRES-FIELDNAME = 'TIMESTAMP_FROM'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
wa_input-fieldname = 'APPT_TYPE'.
append wa_input to ct_input.
WA_INPUT-REF_GUID = it_appointment-ref_guid.
WA_INPUT-REF_KIND = 'A'.
WA_INPUT-OBJECTNAME = 'TIMESTAMP_FROM'.
REFRESH WA_INPUT-FIELD_NAMES.
if it_appointment-APPT_TYPE = 'ZLIQUIDACION'.
WA_INPUT-LOGICAL_KEY = 'ZLIQUIDACIONX'.
ELSE.
WA_INPUT-LOGICAL_KEY = it_appointment-APPT_TYPE.
ENDIF.
WA_NOMBRES-FIELDNAME = 'TIMEZONE_FROM'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
wa_input-fieldname = 'TIMEZONE_FROM'.
append wa_input to ct_input.
WA_INPUT-REF_GUID = it_appointment-ref_guid.
WA_INPUT-REF_KIND = 'A'.
WA_INPUT-OBJECTNAME = 'APPOINTMENT'.
REFRESH WA_INPUT-FIELD_NAMES.
if it_appointment-APPT_TYPE = 'ZLIQUIDACION'.
WA_INPUT-LOGICAL_KEY = 'ZLIQUIDACIONX'.
ELSE.
WA_INPUT-LOGICAL_KEY = it_appointment-APPT_TYPE.
ENDIF.
WA_NOMBRES-FIELDNAME = 'TIMESTAMP_TO'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
wa_input-fieldname = 'TIMESTAMP_TO'.
append wa_input to ct_input.
WA_INPUT-REF_GUID = it_appointment-ref_guid.
WA_INPUT-REF_KIND = 'A'.
WA_INPUT-OBJECTNAME = 'APPOINTMENT'.
REFRESH WA_INPUT-FIELD_NAMES.
if it_appointment-APPT_TYPE = 'ZLIQUIDACION'.
WA_INPUT-LOGICAL_KEY = 'ZLIQUIDACIONX'.
ELSE.
WA_INPUT-LOGICAL_KEY = it_appointment-APPT_TYPE.
ENDIF.
WA_NOMBRES-FIELDNAME = 'TIMEZONE_TO'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
wa_input-fieldname = 'TIMEZONE_TO'.
append wa_input to ct_input.
WA_INPUT-REF_GUID = it_appointment-ref_guid.
WA_INPUT-REF_KIND = 'A'.
WA_INPUT-OBJECTNAME = 'APPOINTMENT'.
REFRESH WA_INPUT-FIELD_NAMES.
if it_appointment-APPT_TYPE = 'ZLIQUIDACION'.
WA_INPUT-LOGICAL_KEY = 'ZLIQUIDACIONX'.
ELSE.
WA_INPUT-LOGICAL_KEY = it_appointment-APPT_TYPE.
ENDIF.
WA_NOMBRES-FIELDNAME = 'DURATION'.
INSERT WA_NOMBRES INTO TABLE WA_INPUT-FIELD_NAMES.
INSERT WA_INPUT INTO TABLE CT_INPUT.
wa_input-fieldname = 'DURATION'.
append wa_input to ct_input.
endloop.
Fin JCF 19/12/2003 Incorporar funcionalidad fechas de ZSUBIROFERTA
Inicio modificacion jgarciar 11122006 ********************
rellenar tabla input_fields con datos de CONDITION_COM
loop at it_preciopos.
CT_INPUT-REF_GUID = it_preciopos-REF_GUID.
CT_INPUT-REF_KIND = 'B'.
CT_INPUT-OBJECTNAME = 'CONDITION_COM'.
CT_INPUT-FIELDNAME = 'CURRENCY'.
append CT_INPUT.
CT_INPUT-REF_GUID = it_preciopos-REF_GUID.
CT_INPUT-REF_KIND = 'B'.
CT_INPUT-OBJECTNAME = 'CONDITION_COM'.
CT_INPUT-FIELDNAME = 'COND_TYPE'.
append CT_INPUT.
CT_INPUT-REF_GUID = it_preciopos-REF_GUID.
CT_INPUT-REF_KIND = 'B'.
CT_INPUT-OBJECTNAME = 'CONDITION_COM'.
CT_INPUT-FIELDNAME = 'COND_RATE'.
append CT_INPUT.
CT_INPUT-REF_GUID = it_preciopos-REF_GUID.
CT_INPUT-REF_KIND = 'B'.
CT_INPUT-OBJECTNAME = 'CONDITION_COM'.
CT_INPUT-FIELDNAME = 'COND_P_UNT'.
append CT_INPUT.
endloop.
rellenar tabla input_fields con datos de sales
loop at it_sales.
CT_INPUT-REF_GUID = it_sales-REF_GUID.
CT_INPUT-REF_KIND = it_sales-REF_KIND.
CT_INPUT-OBJECTNAME = 'SALES'.
CT_INPUT-FIELDNAME = 'PO_NUMBER_SOLD'.
append CT_INPUT.
endloop.
rellenar tabla input_fields con datos de pricing
loop at IT_PRICING.
CT_INPUT-REF_GUID = it_pricing-REF_GUID.
CT_INPUT-REF_KIND = it_pricing-REF_KIND.
CT_INPUT-OBJECTNAME = 'PRICING'.
CT_INPUT-FIELDNAME = 'PRICE_DATE'.
append CT_INPUT.
endloop.
rellenar tabla input_fields con datos de organización
loop at IT_ORGANIZ.
CT_INPUT-REF_GUID = it_organiz-REF_GUID.
CT_INPUT-REF_KIND = 'A'.
CT_INPUT-OBJECTNAME = 'ORGMAN'.
CT_INPUT-FIELDNAME = 'SALES_ORG_RESP'.
append CT_INPUT.
endloop.
LLenar tabla scheduline.
loop at it_repartos.
ct_input-REF_GUID = it_repartos-ITEM_GUID.
ct_input-REF_KIND = 'B'.
ct_input-OBJECTNAME = 'SCHEDLIN'.
ct_input-FIELDNAME = 'QUANTITY'.
append ct_input.
endloop.
Fin modificacion jgarciar 11122006 ********************
ENDFORM. " rellenar_input_fields -
Adding multiple in sales order using fm crm_order_maintain
hi experts,
we have requirement of creating sales order with multiple products. We used FM CRM_ORDER_MAINTAIN to avhieve the same. But problem that we are facing is we are able to add only one product in sales order through this function module. But we need to add multiple product.
Please provide direction. Are we on right track or we need to use other function module to achieve the same.
Thanks and regards
Pankaj KumarHi Pankaj,
You are in the correct way. I am sure you should be able to update multiple products to the order. I feel you might be passing some other parameters which actually restricts somewhere..
Regards,
Vinay -
Error calling CRM_ORDER_MAINTAIN twice
Hello experts,
i am facing following problem; i made a Fm in which i call CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE, the first call from product 'A' from BADI works fine but the second call in same sesion (SAME HEADER GUID) gives an error;
EXCEPTIONS no_change_allowed is thrown.
Do i need to release the order after SAVE or ..??
Grtz Richard
CLEAR w_customer_i_maintain.
w_customer_i_maintain-ref_handle = 1.
w_customer_i_maintain-ref_guid = iv_item_guid. "ls_orderadm_i-guid.
w_customer_i_maintain-mode = 'A'. "create mode
CASE iv_fieldname.
WHEN 'ZZPOLICY_NUM'.
w_customer_i_maintain-zzpolicy_num = iv_value.
WHEN 'ZZSAVING_ACNT'.
w_customer_i_maintain-zzsaving_acnt = iv_value.
ENDCASE.
APPEND w_customer_i_maintain TO it_customer_i_maintain.
CLEAR: w_input_fields, w_field_names.
w_input_fields-ref_handle = 1.
w_input_fields-ref_guid = iv_item_guid. "ls_orderadm_i-guid.
w_input_fields-ref_kind = 'D'.
w_input_fields-objectname = 'CUSTOMER_I'.
w_field_names-fieldname = iv_fieldname.
INSERT w_field_names INTO TABLE w_input_fields-field_names.
w_field_names-fieldname = 'MODE'.
INSERT w_field_names INTO TABLE w_input_fields-field_names.
w_field_names-fieldname = 'REF_GUID'.
INSERT w_field_names INTO TABLE w_input_fields-field_names.
INSERT w_input_fields INTO TABLE it_input_fields.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_customer_i = it_customer_i_maintain
CHANGING
ct_input_fields = it_input_fields
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
IF sy-subrc = 0.
INSERT iv_head_guid INTO TABLE et_objects_to_save.
INSERT iv_item_guid INTO TABLE et_objects_to_save.
CALL FUNCTION 'CRM_ORDER_SAVE'
EXPORTING
it_objects_to_save = et_objects_to_save
IMPORTING
et_saved_objects = it_saved_objects
CHANGING
cv_log_handle = cv_log_handle
EXCEPTIONS
document_not_saved = 1
OTHERS = 2.Solved by adding two FM calls:
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
CALL FUNCTION 'CRM_ORDER_INITIALIZE'
EXPORTING
it_guids_to_init = et_objects_to_save
iv_keep_lock = ''.
Maybe you are looking for
-
Hi friends iam facing problem with amended purchase order. when ever i make any changes to any line items in spool iam getting only those line items which got changed . but my client want me to display all the line items . i copied standard script ME
-
Migrating 9.0.2.3 to 10.1.2.3
We are migrating Oracle portal 9.0.2.3.0B on windows to 10.1.2.3 on Linux. Are there some manuals, how to migrate? Thanks, Mitja
-
Overheating GPU while power cord plugged in.
Simply put, my laptop's GPU temp skyrockets to 60+ degrees when playing anything in full screen with the AC power cord plugged in to charge the battery... even games like Diablo 2 with low graphic quality. When I run the games without the cord and si
-
Macbook Pro not waking up if battery is low (~15%)
My new generation Macbook Pro 13" is not waking after re-opening the closed lid if the battery icon indicates low by red color (I guess it is about 15%) before putting it to sleep. I mean, if I close lid when the battery icon is red, it does not auto
-
ICloud photostream in folder on Mac ?
Hi, I would like to have photo stream on my mac to import pictures in a specific folder instead of iPhoto. Is there a way to do it ? Reason is that iPhoto is not my library but Lightroom. Thanks !