Changing Pricing Conditions in SRM
Hi,
Has anyone ever used either BADI PRC_DATA_SOURCES to change pricing conditions linked to a SC in SRM 5.0?
Kind Regards,
Hi,
did you find a solution to your question ? I am trying to find an answer to the same subject.
thanks,
Isaac
Similar Messages
-
Transfer of Pricing Conditions from SRM 5.0 to ECC (Extended Classic)
Hi All,
I am currently doing an enhancement on a copy of function module B46B_DPO_TRANSFER and the implementation of BBP_DRIVER_DETERMINE BAdI that will call the copied FM to transfer the pricing conditions from SRM 5.0 to ECC since in standard only net price is being transferred to ECC.
During the creation of PO, everything is ok. All conditions are transferred to ECC.
But we are encountering problems in the replication from SRM to ECC when changes are done in the PO during deleting or inserting a condition to an item. Our problem is in figuring out what will trigger us to use Change types U, I, E, D in populating the CHANGE_ID field in POCOND table that will be used in BBP_PO_INBOUND function module.
During creation of PO, I have set POCOND-CHANGE_ID = 'I' on all conditions to be transferred.
When there are modifications on a PO, I have set POCOND-CHANGE_ID = 'U' and I am encountering problem when new conditions are inserted to an item since it will not be displayed (which I believe in this case, POCOND-CHANGE_ID should be 'I'), and when deleting a condition to an item.
I would like to ask, if there is an indicator that a condition will be inserted to an item for us to assign POCOND-CHANGE_ID = 'I', and for us to assign POCOND-CHANGE_ID = 'D' when a condition will be deleted.
By the way, I used FM BBP_PD_PO_GETDETAIL (exporting: E_PRIDOC) to get the PO conditions to be transferred and have checked E_PRIDOC-DEL_IND to check if a condition will be deleted. Unfortunately, it is not working on the deletion since it seems that DEL_IND field is not being populated if a condition will be deleted.
Many thanks,
Kezia
Edited by: Kezia Layug on Mar 3, 2009 4:24 PMHi All,
I am currently doing an enhancement on a copy of function module B46B_DPO_TRANSFER and the implementation of BBP_DRIVER_DETERMINE BAdI that will call the copied FM to transfer the pricing conditions from SRM 5.0 to ECC since in standard only net price is being transferred to ECC.
During the creation of PO, everything is ok. All conditions are transferred to ECC.
But we are encountering problems in the replication from SRM to ECC when changes are done in the PO during deleting or inserting a condition to an item. Our problem is in figuring out what will trigger us to use Change types U, I, E, D in populating the CHANGE_ID field in POCOND table that will be used in BBP_PO_INBOUND function module.
During creation of PO, I have set POCOND-CHANGE_ID = 'I' on all conditions to be transferred.
When there are modifications on a PO, I have set POCOND-CHANGE_ID = 'U' and I am encountering problem when new conditions are inserted to an item since it will not be displayed (which I believe in this case, POCOND-CHANGE_ID should be 'I'), and when deleting a condition to an item.
I would like to ask, if there is an indicator that a condition will be inserted to an item for us to assign POCOND-CHANGE_ID = 'I', and for us to assign POCOND-CHANGE_ID = 'D' when a condition will be deleted.
By the way, I used FM BBP_PD_PO_GETDETAIL (exporting: E_PRIDOC) to get the PO conditions to be transferred and have checked E_PRIDOC-DEL_IND to check if a condition will be deleted. Unfortunately, it is not working on the deletion since it seems that DEL_IND field is not being populated if a condition will be deleted.
Many thanks,
Kezia
Edited by: Kezia Layug on Mar 3, 2009 4:24 PM -
How to change pricing Conditions in Sales order in change sales order bapi
Hi Experts,
How to change pricing Conditions in Sales order in change sales order bapi.
I have used the 2 function modules bapi-changesalesorder and sd salesdocument change, But it is creating the new record , instead of changing the existing one, Could please assist regarding the same
Thanks in Advance .
NLNHI NLN
I have just tried on my system and managed to overwrite the existing price by passing the following parameters.
<b>Import Paramters:</b>
SALESDOCUMENT - Sales Document Number
ORDER_HEADER_INX - UPDATEFLAG as <b>'U'</b>.
LOGIC_SWITCH - Import Structure - Pass 'X' to LOGIC_SWITCH-COND_HANDL.
<b>Tables:</b>
CONDITIONS_IN - ITM_NUMBER,
COND_COUNT, -> Condition counter same as KONV-ZAEHK generally it is <b>'01'</b>
COND_TYPE,
COND_VALUE,
CURRENCY.
CONDITIONS_INX - ITM_NUMBER,
COND_COUNT,
COND_TYPE,
UPDATEFLAG as <b>'U'</b>,
CURRENCY.
Hope i have clarified your query.
Kind Regards
Eswar -
How to change pricing conditions
Hello Experts,
i'm trying to change pricing conditions in routines.
SPRO --> SD --> System Modifications --> Routines --> Define Copying Requirements (double click any activities) --> it will open "Maintain Requirement and Formula"
select from menubar "Formulas --> Condition Value"
Routine Number --> 36 - Cumulation condition.
i want to change conditions in this Routine 36, so i copy this routine and create a new routine name
901 - Cumulation condition
i want to change Pricing Conditions in this routines. this standard routine adding all sub-total pricing values. but i want to display all sub-total pricing value separately in there respective field.
i'm checking this result in VA11.
any ideas? i know i have to change code in this copied rotines for this calculations. but i'm not finding any clue where this value is getting added in each sub-total field level.
if any more clarification needed, please ask.Hi Rabindra
For Net Price you can refer this Note 80183.
Neha -
Hi,
Is it possible to change pricing conditions after a PO has been created?Dear Friend,
yeah its possible -
How can we change Pricing condition price date
Hi SAP Gurus,
I have requirement as following.
When we create a sales order if any contract is available it should be populated in a diaglog box, and when user select a one , we keep this as a z-field in the sales order header level, so far fine.
And the requirement includes the pricing date for one of pricing condition should be the first delivery date(schedulelinedate).
We have the condition records with the pricing date as document date, we cannt keep commited delivery date as pricingdate(komv-kdatu).
So i need a solution, thru i can modify the KOMV-KDATU
for the condition type,with the first schedule line date.
could anybody knows how to modify the KOMV structure values?????
The quick answer will be highly apreciated?
Thanks & Regards,
PraveenHi Praveen,
You can use user exit "USEREXIT_PRICING_PREPARE_TKOMK" to change Pricing Condition Table at header level & "USEREXIT_PRICING_PREPARE_TKOMP" at item level. These exits are present in include "MV45AFZZ" of Sales Order program "SAPMV45A".
Cheers,
Gajendra -
SRM PO Pricing condition from SRM to ECC -Extended Classic Sceanrio
Dear SRM experts,
We have created couple of conditions in SRM7.0 and ECC 6.0 as per requirement. When we create PO in SRM and If we add any condition in SRM PO, PO is getting transferred with netprice(including condition amount).
We would like to see conditions also in ECC which are there in SRM.
For ex:
I have created SRM PO with net price 30 and having freight amount(15) in that PO with Fregiht condition type but when it comes to ECC PO net price is changing from 30 to 45.
We would like to see net price as 30 and 15 as Fregiht condition.
Overall I can say that Is it possible to pass conditions from SRM to ECC in Extended classic scenario.
Thanks
RaviHi,
the challenge lies in synchnizing the conditions and ensuring that price returned by IPC in SRM matches the price in the backend.
Please see thread
Pricing Conditions
Regards
Azad -
Change Pricing Condition for an item with CRM_ORDER_MAINTAIN
Hi community,
I try to change an existing condition with the function module crm_order_maintain.
Everything looks fine, no error no dump, but no success
The condition stays the same!
Can anybody find a solution for this?
Heres my report so far:
*& Report ZTEST_PRICING2
REPORT ztest_pricing2.
DATA: lt_guid TYPE crmt_object_guid_tab,
lt_item TYPE crmt_object_guid_tab,
lt_saved TYPE crmt_return_objects,
lt_pridoc TYPE crmt_pric_cond_t,
ls_pridoc TYPE crmt_pric_cond,
lt_pricom TYPE crmt_pridoc_comt,
ls_pricom TYPE crmt_pridoc_com,
lt_header TYPE crmt_orderadm_h_comt,
lt_input TYPE crmt_input_field_tab,
ls_input TYPE crmt_input_field,
ls_input_fn TYPE CRMT_INPUT_FIELD_NAMES,
ls_cond_chg TYPE prct_cond_external_change,
ls_cond TYPE PRCT_COND_DU,
lt_pricing_i TYPE CRMT_PRICING_I_WRKT.
PARAMETERS: lv_head TYPE crmt_object_guid DEFAULT 'C4C61C4E35DDF306E10000000A024089'.
PARAMETERS: lv_item TYPE crmt_object_guid DEFAULT '09C71C4E35DDF306E10000000A024089'.
PARAMETERS: lv_kbetr TYPE prct_cond_rate DEFAULT '100'.
INSERT lv_head INTO TABLE lt_guid.
INSERT lv_item INTO TABLE lt_item.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = lt_guid
it_item_guid = lt_item
* IV_MODE =
* IV_ONLY_SPEC_ITEMS =
* IT_REQUESTED_OBJECTS =
* IV_NO_AUTH_CHECK =
* IT_ITEM_USAGE_RANGE =
* IV_SUBITEM_DEPTH = -1
* IT_OBJECT_FILTER =
* IV_ONLY_CHANGED_OBJ = FALSE
* IV_STATUS_H_CHECK_RELEVANCE = FALSE
IMPORTING
et_pridoc = lt_pridoc
et_pricing_i = lt_pricing_i
* CHANGING
* CV_LOG_HANDLE =
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 AND lt_pridoc IS NOT INITIAL.
WRITE: / 'ERROR'.
EXIT.
ENDIF.
READ TABLE lt_pridoc INDEX 1 INTO ls_pridoc.
IF sy-subrc <> 0.
WRITE: / 'ERROR'.
EXIT.
ENDIF.
READ TABLE ls_pridoc-pric_cond INTO ls_cond WITH KEY kschl = 'PB00'.
IF sy-subrc <> 0.
WRITE: / 'ERROR'.
EXIT.
ENDIF.
ls_input-ref_guid = lv_head.
ls_input-ref_kind = 'A'.
ls_input-objectname = 'PRIDOC'.
ls_input_fn-fieldname = 'WAERS'.
INSERT ls_input_fn INTO TABLE ls_input-field_names.
ls_input_fn-fieldname = 'KBETR'.
INSERT ls_input_fn INTO TABLE ls_input-field_names.
INSERT ls_input INTO TABLE lt_input.
ls_pricom-ref_guid = lv_head.
ls_pricom-ref_kind = 'A'.
*ls_pricom-PRICING_TYPE = 'B'.
*ls_pricom-pricing_procedure = 'ZZMTA'.
ls_pricom-pric_cond[] = ls_pridoc-pric_cond[].
MOVE-CORRESPONDING ls_cond TO ls_cond_chg.
ls_cond_chg-waers = 'EUR'.
ls_cond_chg-kbetr = lv_kbetr.
INSERT ls_cond_chg INTO TABLE ls_pricom-cond_change.
APPEND ls_pricom TO lt_pricom.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_pridoc = lt_pricom
CHANGING
* ct_orderadm_h = lt_header
ct_input_fields = lt_input
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
IF sy-subrc <> 0.
EXIT.
ENDIF.
CALL FUNCTION 'CRM_ORDER_SAVE'
EXPORTING
it_objects_to_save = lt_guid
IMPORTING
et_saved_objects = lt_saved
* ET_EXCEPTION =
* ET_OBJECTS_NOT_SAVED =
EXCEPTIONS
document_not_saved = 1
OTHERS = 2.
IF sy-subrc EQ 0.
COMMIT WORK AND WAIT.
ELSE.
ROLLBACK WORK.
ENDIF.
regards
MarkusHello Jordi,
The example below is whereby i was trying to copy all the pricing condition on one document to another and deleting what's not present on the source document.
You can used this piece of code to adapt your requirement.
CALL FUNCTION 'ZCRC_FM_COPY_PRICE_COND_ALL'
EXPORTING
id_object_guid_src = <fs_el_con_guid>
id_object_guid_dest = <fs_el_so_guid>
id_commit = abap_false
EXCEPTIONS
not_allowed = 1
error_occured = 2
OTHERS = 3.
PERFORM f_recup_donnees USING id_object_guid_src
id_object_guid_dest.
PERFORM f_modif_condition_prix USING id_object_guid_src
id_object_guid_dest.
PERFORM f_header_copy_pricing using id_object_guid_src
id_object_guid_dest.
FORM f_recup_donnees USING pd_object_guid_src TYPE crmt_object_guid
pd_object_guid_dest TYPE crmt_object_guid.
DATA:
lt_header_guid TYPE crmt_object_guid_tab.
INSERT pd_object_guid_src INTO TABLE lt_header_guid.
INSERT pd_object_guid_dest INTO TABLE lt_header_guid.
CLEAR: gt_orderadm_i, gt_doc_flow.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = lt_header_guid
IMPORTING
et_doc_flow = gt_doc_flow
et_orderadm_i = gt_orderadm_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.
IF sy-subrc NE 0.
RAISE error_occured.
ENDIF.
" F_RECUP_DONNEES
FORM f_modif_condition_prix USING pd_guid_src TYPE crmt_object_guid
pd_guid_dest TYPE crmt_object_guid.
DATA : ld_pd_handle_src TYPE prct_handle,
ld_pd_handle_dest TYPE prct_handle,
lt_komv_print_src TYPE prct_cond_print_t,
lt_komv_print_dest TYPE prct_cond_print_t,
ls_komv_print_dest LIKE LINE OF lt_komv_print_dest,
ls_komv_print_src LIKE LINE OF lt_komv_print_src,
lt_cond_chg TYPE prct_cond_print_t,
lt_cond_chg_insert TYPE prct_cond_print_t,
ls_cond_chg TYPE prct_cond_print,
ls_cond_chg_tmp TYPE prct_cond_print,
ls_input_fields TYPE crmt_input_field,
lt_input_fields TYPE crmt_input_field_tab.
DATA : bal_log TYPE balloghndl,
lt_item_ret TYPE prct_item_ret_t,
lt_cond_ret TYPE prct_cond_print_t,
ld_data_changed TYPE xfeld,
gv_decimal TYPE usdefaults-dcpfm,
ld_lines TYPE i,
ld_ajout_cond TYPE abap_bool.
FIELD-SYMBOLS : <fs_orderadm_i_dest> TYPE crmt_orderadm_i_wrk,
<fs_orderadm_i_src> TYPE crmt_orderadm_i_wrk,
<fs_cond_chg> TYPE prct_cond_print,
<fs_cond_chg_insert> TYPE prct_cond_print.
* Début Ajout CD1K904313-001.
DATA: ld_guid_src TYPE crmt_object_guid.
FIELD-SYMBOLS: <fs_doc_flow> TYPE crmt_doc_flow_wrk.
* Début Ajout CD1K904313-001.
* Verrouillage des documents source et destinataire
PERFORM f_lock_document USING pd_guid_src.
PERFORM f_lock_document USING pd_guid_dest.
*Récupérer le pricing handle des documents
* Document source
CALL FUNCTION 'CRM_PRIDOC_GET_HANDLE_OW'
EXPORTING
iv_header_guid = pd_guid_src
IMPORTING
ev_pd_handle = ld_pd_handle_src
EXCEPTIONS
error_occurred = 1
handle_determination_error = 2
orgdata_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
RETURN.
ENDIF.
* Document destinataire
CALL FUNCTION 'CRM_PRIDOC_GET_HANDLE_OW'
EXPORTING
iv_header_guid = pd_guid_dest
IMPORTING
ev_pd_handle = ld_pd_handle_dest
EXCEPTIONS
error_occurred = 1
handle_determination_error = 2
orgdata_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
RETURN.
ENDIF.
* A ne pas traiter les postes de type ZPDF
DELETE gt_orderadm_i WHERE itm_type = 'ZPDF'.
LOOP AT gt_orderadm_i ASSIGNING <fs_orderadm_i_dest> WHERE header = pd_guid_dest.
REFRESH : lt_komv_print_src,
lt_komv_print_dest,
lt_cond_chg,
lt_cond_chg_insert.
* Début Modif CD1K904313-001.
* Récupérer le guid de l'item liée au item destinataire.
READ TABLE gt_doc_flow ASSIGNING <fs_doc_flow> WITH KEY objkey_b = <fs_orderadm_i_dest>-guid.
CHECK sy-subrc EQ 0.
ld_guid_src = <fs_doc_flow>-objkey_a.
* READ TABLE gt_orderadm_i ASSIGNING <fs_orderadm_i_src> WITH KEY header = pd_guid_src
* number_int = <fs_orderadm_i_dest>-number_int.
* Fin Modif CD1K904313-001.
* Récupérer les pricing document
IF sy-subrc EQ 0.
* Document source
CALL FUNCTION 'PRC_PD_ITEM_SHOW'
EXPORTING
iv_pd_handle = ld_pd_handle_src
* iv_item_no = <fs_orderadm_i_src>-guid "Supression CD1K904313-001
iv_item_no = ld_guid_src "Addition CD1K904313-001
IMPORTING
et_komv_print = lt_komv_print_src
EXCEPTIONS
non_existing_handle = 1
non_existing_item = 2
ipc_error = 3
OTHERS = 4.
ENDIF.
* Document destinataire
CALL FUNCTION 'PRC_PD_ITEM_SHOW'
EXPORTING
iv_pd_handle = ld_pd_handle_dest
iv_item_no = <fs_orderadm_i_dest>-guid
IMPORTING
et_komv_print = lt_komv_print_dest
EXCEPTIONS
non_existing_handle = 1
non_existing_item = 2
ipc_error = 3
OTHERS = 4.
* Modification et Suppression des conditions de prix
LOOP AT lt_komv_print_dest INTO ls_komv_print_dest .
CLEAR: ls_cond_chg,
ls_komv_print_src.
MOVE-CORRESPONDING ls_komv_print_dest TO ls_cond_chg.
* Rechercher la condition sur le document source
READ TABLE lt_komv_print_src INTO ls_komv_print_src WITH KEY kschl = ls_komv_print_dest-kschl
zaehk = ls_komv_print_dest-zaehk. "CD1K904313
IF sy-subrc EQ 0.
ls_cond_chg-kbetr_prt = ls_komv_print_src-kbetr_prt.
ls_cond_chg-kwert = ls_komv_print_src-kwert.
ls_cond_chg-kinak = ls_komv_print_src-kinak.
ELSEIF ls_cond_chg-kschl IS NOT INITIAL.
CLEAR ls_cond_chg.
CONTINUE.
ENDIF.
* Format décimal
CASE gv_decimal.
WHEN space. "format N.NNN,NN
REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
WHEN 'Y'. "format N NNN NNN,NN
REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
ENDCASE.
INSERT ls_cond_chg INTO TABLE lt_cond_chg.
CLEAR ls_cond_chg.
ENDLOOP.
* Ajout des conditions de prix
LOOP AT lt_komv_print_src INTO ls_komv_print_src WHERE kschl IS NOT INITIAL.
CLEAR: ls_cond_chg, ld_lines, ls_komv_print_dest, ls_cond_chg_tmp, ld_ajout_cond.
* Vérifier la présence de la condition sur le document destinataire
READ TABLE lt_komv_print_dest INTO ls_komv_print_dest WITH KEY kschl = ls_komv_print_src-kschl
zaehk = ls_komv_print_src-zaehk. "CD1K904313.
IF sy-subrc EQ 0.
CLEAR: ls_cond_chg, ls_komv_print_dest.
CONTINUE.
ELSE.
DESCRIBE TABLE lt_cond_chg LINES ld_lines.
READ TABLE lt_cond_chg INTO ls_cond_chg_tmp INDEX ld_lines.
IF sy-subrc EQ 0.
ld_ajout_cond = abap_true.
MOVE-CORRESPONDING ls_komv_print_src TO ls_cond_chg.
ls_cond_chg-knumv = ls_cond_chg_tmp-knumv.
ls_cond_chg-kposn = ls_cond_chg_tmp-kposn.
ls_cond_chg-stunr = ls_cond_chg_tmp-stunr + 10.
ELSE.
CLEAR: ls_cond_chg, ld_lines, ls_komv_print_dest, ls_cond_chg_tmp.
CONTINUE.
ENDIF.
ENDIF.
* Format décimal
CASE gv_decimal.
WHEN space. "format N.NNN,NN
REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
WHEN 'Y'. "format N NNN NNN,NN
REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
ENDCASE.
* Récupérer les nouvelles conditions qui seront ajouté au document destinataire
IF ld_ajout_cond EQ abap_true.
INSERT ls_cond_chg INTO TABLE lt_cond_chg_insert.
ENDIF.
INSERT ls_cond_chg INTO TABLE lt_cond_chg.
CLEAR ls_cond_chg.
ENDLOOP.
CALL FUNCTION 'PRC_INT_ITEM_INPUT'
EXPORTING
iv_pd_handle = ld_pd_handle_dest
iv_item_no = <fs_orderadm_i_dest>-guid
it_cond_prt = lt_cond_chg
iv_bal_log = bal_log
iv_req_ret = abap_true
iv_req_cond_prt = abap_true
IMPORTING
et_item_ret = lt_item_ret
et_cond_prt = lt_cond_ret
ev_data_changed = ld_data_changed
EXCEPTIONS
non_existing_handle = 1
non_existing_item = 2
ipc_error = 3.
IF sy-subrc = 0.
* En cas d'ajout de nouvelles conditions de prix, appeler le MF PRC_INT_ITEM_INPUT
* avec les montants
IF lt_cond_chg_insert IS NOT INITIAL.
REFRESH lt_cond_chg[].
lt_cond_chg[] = lt_cond_ret[].
LOOP AT lt_cond_chg_insert ASSIGNING <fs_cond_chg_insert>.
READ TABLE lt_cond_chg ASSIGNING <fs_cond_chg> WITH KEY kschl = <fs_cond_chg_insert>-kschl.
IF sy-subrc EQ 0.
<fs_cond_chg>-kwert = <fs_cond_chg_insert>-kwert.
<fs_cond_chg>-kbetr_prt = <fs_cond_chg_insert>-kbetr_prt.
ENDIF.
ENDLOOP.
REFRESH lt_cond_ret[].
CALL FUNCTION 'PRC_INT_ITEM_INPUT'
EXPORTING
iv_pd_handle = ld_pd_handle_dest
iv_item_no = <fs_orderadm_i_dest>-guid
it_cond_prt = lt_cond_chg
iv_bal_log = bal_log
iv_req_ret = abap_true
iv_req_cond_prt = abap_true
IMPORTING
et_item_ret = lt_item_ret
et_cond_prt = lt_cond_ret
ev_data_changed = ld_data_changed
EXCEPTIONS
non_existing_handle = 1
non_existing_item = 2
ipc_error = 3.
ENDIF.
* Publish event afin de sauvegarder les conditions de prix
CALL FUNCTION 'CRM_EVENT_PUBLISH_OW'
EXPORTING
iv_obj_name = 'PRIDOC'
iv_guid_hi = pd_guid_dest
iv_kind_hi = 'A'
iv_event = 'SAVE'
EXCEPTIONS
OTHERS = 1.
* As no order_maintain will follow implicitly and therefore no
* exec times for the events will be set, call CRM_ORDER_MAINTAIN
* without any parameters
* Then the exec time 'end of document' will be set and with the
* group logic also all exec times before
* But at least one object is needed in input_fields
* --> use PRIDOC
ls_input_fields-ref_guid = <fs_orderadm_i_dest>-guid.
ls_input_fields-ref_kind = 'B'.
ls_input_fields-objectname = 'PRIDOC'.
INSERT ls_input_fields INTO TABLE lt_input_fields.
CLEAR ls_input_fields.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
CHANGING
ct_input_fields = lt_input_fields
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
ENDIF.
ENDLOOP.
" F_MODIF_CONDITION_PRIX
*& Form F_LOCK_DOCUMENT
* Verrouillage d'un document
FORM f_lock_document USING pd_guid TYPE crmt_object_guid.
CONSTANTS : lc_orderadm_h TYPE crmt_object_name VALUE 'ORDERADM_H',
lc_orderadm_i TYPE crmt_object_name VALUE 'ORDERADM_I'.
DATA: lv_process_mode TYPE crmt_mode,
lv_order_initialized TYPE crmt_boolean,
lv_process_type TYPE crmt_process_type,
lv_already_locked TYPE abap_bool.
DATA: ls_admin_ui_status TYPE crmt_admin_ui_status,
ls_item_usage_range TYPE crmt_item_usage_range.
DATA: lt_objects_to_read TYPE crmt_object_guid_tab,
lt_requested_objects TYPE crmt_object_name_tab,
lt_item_usage_range TYPE crmt_item_usage_range_tab,
lt_locked_contract TYPE crmt_object_guid_tab.
INSERT pd_guid INTO TABLE lt_objects_to_read.
INSERT lc_orderadm_h INTO TABLE lt_requested_objects.
INSERT lc_orderadm_i INTO TABLE lt_requested_objects.
ls_item_usage_range-sign = 'E'.
ls_item_usage_range-value = '02'.
INSERT ls_item_usage_range INTO TABLE lt_item_usage_range.
* LAM: Financing Options should be viewed in a separate screen:
ls_item_usage_range-sign = 'E'.
ls_item_usage_range-value = '05'. "Financing options
INSERT ls_item_usage_range INTO TABLE lt_item_usage_range.
*-> read document in change mode
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = lt_objects_to_read
iv_mode = 'B'
it_requested_objects = lt_requested_objects
it_item_usage_range = lt_item_usage_range
EXCEPTIONS
document_not_found = 1
error_occurred = 2
document_locked = 3
no_change_authority = 4
no_display_authority = 5
OTHERS = 6.
PERFORM enqueue_order IN PROGRAM saplcrm_order_ow IF FOUND
USING pd_guid
abap_false
abap_false
abap_false
CHANGING sy-subrc
lv_already_locked
lt_locked_contract.
" F_LOCK_DOCUMENT
* Fin Ajout CD1K904074-001
FORM f_header_copy_pricing USING pd_guid_src
pd_guid_dest.
DATA : ld_pd_handle_src TYPE prct_handle,
ld_pd_handle_dest TYPE prct_handle,
lt_komv_print_src TYPE prct_cond_print_t,
lt_komv_print_dest TYPE prct_cond_print_t,
ls_komv_print_dest LIKE LINE OF lt_komv_print_dest,
ls_komv_print_src LIKE LINE OF lt_komv_print_src,
lt_cond_chg TYPE prct_cond_print_t,
ls_cond_chg TYPE prct_cond_print,
ls_input_fields TYPE crmt_input_field,
lt_input_fields TYPE crmt_input_field_tab.
DATA : bal_log TYPE balloghndl,
lt_cond_ret TYPE prct_cond_print_t,
ld_data_changed TYPE xfeld,
gv_decimal TYPE usdefaults-dcpfm.
* Verrouillage des documents source et destinataire
PERFORM f_lock_document USING pd_guid_src.
PERFORM f_lock_document USING pd_guid_dest.
* Récupérer le pricing handle des documents
* Document source
CALL FUNCTION 'CRM_PRIDOC_GET_HANDLE_OW'
EXPORTING
iv_header_guid = pd_guid_src
IMPORTING
ev_pd_handle = ld_pd_handle_src
EXCEPTIONS
error_occurred = 1
handle_determination_error = 2
orgdata_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
RETURN.
ENDIF.
* Document destinataire
CALL FUNCTION 'CRM_PRIDOC_GET_HANDLE_OW'
EXPORTING
iv_header_guid = pd_guid_dest
IMPORTING
ev_pd_handle = ld_pd_handle_dest
EXCEPTIONS
error_occurred = 1
handle_determination_error = 2
orgdata_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
RETURN.
ENDIF.
* * Récupérer les pricing document
* Document Source
CALL FUNCTION 'PRC_PD_HEAD_SHOW'
EXPORTING
iv_pd_handle = ld_pd_handle_src
IMPORTING
et_komv_print = lt_komv_print_src
EXCEPTIONS
non_existing_handle = 1
ipc_error = 2
OTHERS = 3.
CHECK sy-subrc EQ 0.
* Document Destinataire
CALL FUNCTION 'PRC_PD_HEAD_SHOW'
EXPORTING
iv_pd_handle = ld_pd_handle_dest
IMPORTING
et_komv_print = lt_komv_print_dest
EXCEPTIONS
non_existing_handle = 1
ipc_error = 2
OTHERS = 3.
CHECK sy-subrc EQ 0.
* * Modification et Suppression des conditions de prix
LOOP AT lt_komv_print_src INTO ls_komv_print_src .
CLEAR: ls_cond_chg,
ls_komv_print_dest.
MOVE-CORRESPONDING ls_komv_print_src TO ls_cond_chg.
* Rechercher la condition sur le document source
READ TABLE lt_komv_print_dest INTO ls_komv_print_dest WITH KEY kschl = ls_komv_print_src-kschl
zaehk = ls_komv_print_src-zaehk.
IF sy-subrc EQ 0.
IF ls_komv_print_src-kbetr NE ls_komv_print_dest-kbetr.
ls_cond_chg-kbetr_prt = ls_komv_print_src-kbetr_prt.
ls_cond_chg-kwert = ls_komv_print_src-kwert.
ls_cond_chg-kinak = ls_komv_print_src-kinak.
CASE gv_decimal.
WHEN space. "format N.NNN,NN
REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
WHEN 'Y'. "format N NNN NNN,NN
REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
ENDCASE.
ENDIF.
ENDIF.
CLEAR ls_cond_chg-krech.
INSERT ls_cond_chg INTO TABLE lt_cond_chg.
CLEAR ls_cond_chg.
ENDLOOP.
CALL FUNCTION 'PRC_INT_HEAD_INPUT'
EXPORTING
iv_pd_handle = ld_pd_handle_dest
iv_bal_log = bal_log
it_cond_prt = lt_cond_chg
iv_req_ret = abap_true
iv_req_cond_prt = abap_true
IMPORTING
et_cond_prt = lt_cond_ret
ev_data_changed = ld_data_changed
EXCEPTIONS
non_existing_handle = 1
ipc_error = 2
not_allowed = 3
OTHERS = 4.
CHECK sy-subrc EQ 0.
* * Publish event afin de sauvegarder les conditions de prix
CALL FUNCTION 'CRM_EVENT_PUBLISH_OW'
EXPORTING
iv_obj_name = 'PRIDOC'
iv_guid_hi = pd_guid_dest
iv_kind_hi = 'A'
iv_event = 'SAVE'
EXCEPTIONS
OTHERS = 1.
* As no order_maintain will follow implicitly and therefore no
* exec times for the events will be set, call CRM_ORDER_MAINTAIN
* without any parameters
* Then the exec time 'end of document' will be set and with the
* group logic also all exec times before
* But at least one object is needed in input_fields
* --> use PRIDOC
ls_input_fields-ref_guid = pd_guid_dest.
ls_input_fields-ref_kind = 'A'.
ls_input_fields-objectname = 'PRIDOC'.
INSERT ls_input_fields INTO TABLE lt_input_fields.
CLEAR ls_input_fields.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
CHANGING
ct_input_fields = lt_input_fields
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
ENDFORM.
FORM f_header_copy_pricing USING pd_guid_src
pd_guid_dest.
DATA : ld_pd_handle_src TYPE prct_handle,
ld_pd_handle_dest TYPE prct_handle,
lt_komv_print_src TYPE prct_cond_print_t,
lt_komv_print_dest TYPE prct_cond_print_t,
ls_komv_print_dest LIKE LINE OF lt_komv_print_dest,
ls_komv_print_src LIKE LINE OF lt_komv_print_src,
lt_cond_chg TYPE prct_cond_print_t,
ls_cond_chg TYPE prct_cond_print,
ls_input_fields TYPE crmt_input_field,
lt_input_fields TYPE crmt_input_field_tab.
DATA : bal_log TYPE balloghndl,
lt_cond_ret TYPE prct_cond_print_t,
ld_data_changed TYPE xfeld,
gv_decimal TYPE usdefaults-dcpfm.
PERFORM f_lock_document USING pd_guid_src.
PERFORM f_lock_document USING pd_guid_dest.
* Récupérer le pricing handle des documents
* Document source
CALL FUNCTION 'CRM_PRIDOC_GET_HANDLE_OW'
EXPORTING
iv_header_guid = pd_guid_src
IMPORTING
ev_pd_handle = ld_pd_handle_src
EXCEPTIONS
error_occurred = 1
handle_determination_error = 2
orgdata_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
RETURN.
ENDIF.
* Document destinataire
CALL FUNCTION 'CRM_PRIDOC_GET_HANDLE_OW'
EXPORTING
iv_header_guid = pd_guid_dest
IMPORTING
ev_pd_handle = ld_pd_handle_dest
EXCEPTIONS
error_occurred = 1
handle_determination_error = 2
orgdata_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
RETURN.
ENDIF.
* * Récupérer les pricing document
* Document Source
CALL FUNCTION 'PRC_PD_HEAD_SHOW'
EXPORTING
iv_pd_handle = ld_pd_handle_src
IMPORTING
et_komv_print = lt_komv_print_src
EXCEPTIONS
non_existing_handle = 1
ipc_error = 2
OTHERS = 3.
CHECK sy-subrc EQ 0.
* Document Destinataire
CALL FUNCTION 'PRC_PD_HEAD_SHOW'
EXPORTING
iv_pd_handle = ld_pd_handle_dest
IMPORTING
et_komv_print = lt_komv_print_dest
EXCEPTIONS
non_existing_handle = 1
ipc_error = 2
OTHERS = 3.
CHECK sy-subrc EQ 0.
* * Modification et Suppression des conditions de prix
LOOP AT lt_komv_print_src INTO ls_komv_print_src .
CLEAR: ls_cond_chg,
ls_komv_print_dest.
MOVE-CORRESPONDING ls_komv_print_src TO ls_cond_chg.
* Rechercher la condition sur le document source
READ TABLE lt_komv_print_dest INTO ls_komv_print_dest WITH KEY kschl = ls_komv_print_src-kschl
zaehk = ls_komv_print_src-zaehk.
IF sy-subrc EQ 0.
IF ls_komv_print_src-kbetr NE ls_komv_print_dest-kbetr.
ls_cond_chg-kbetr_prt = ls_komv_print_src-kbetr_prt.
ls_cond_chg-kwert = ls_komv_print_src-kwert.
ls_cond_chg-kinak = ls_komv_print_src-kinak.
CASE gv_decimal.
WHEN space. "format N.NNN,NN
REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
WHEN 'Y'. "format N NNN NNN,NN
REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
ENDCASE.
ENDIF.
ENDIF.
CLEAR ls_cond_chg-krech.
INSERT ls_cond_chg INTO TABLE lt_cond_chg.
CLEAR ls_cond_chg.
ENDLOOP.
CALL FUNCTION 'PRC_INT_HEAD_INPUT'
EXPORTING
iv_pd_handle = ld_pd_handle_dest
iv_bal_log = bal_log
it_cond_prt = lt_cond_chg
iv_req_ret = abap_true
iv_req_cond_prt = abap_true
IMPORTING
et_cond_prt = lt_cond_ret
ev_data_changed = ld_data_changed
EXCEPTIONS
non_existing_handle = 1
ipc_error = 2
not_allowed = 3
OTHERS = 4.
CHECK sy-subrc EQ 0.
CALL FUNCTION 'CRM_EVENT_PUBLISH_OW'
EXPORTING
iv_obj_name = 'PRIDOC'
iv_guid_hi = pd_guid_dest
iv_kind_hi = 'A'
iv_event = 'SAVE'
EXCEPTIONS
OTHERS = 1.
ls_input_fields-ref_guid = pd_guid_dest.
ls_input_fields-ref_kind = 'A'.
ls_input_fields-objectname = 'PRIDOC'.
INSERT ls_input_fields INTO TABLE lt_input_fields.
CLEAR ls_input_fields.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
CHANGING
ct_input_fields = lt_input_fields
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5. -
Exit for changing Pricing Conditions with change in Ship to party
Hi All,
In transaction VA01/ VA02 the pricing conditions are getting calculated with respect to the Sold-to-party no.. Instead I wanted it to get calculated with respect to the Ship-to-party. Please guide me with an Exit that i can use, or any other way of solving this.
Thanks in Advance.Hi Roberto,
I am creating a sales order with transaction VA01 using a Sold-to-party say 1 and a Ship-to-party 2. While saving the order the tax calculations (if it is interstate - cst and intrastate - vat) are happening with respect to the Sold-to-party.
But I want it to happen with respect to the Ship-to-party. Is there anyway of changing this tax calculations in the pricing condition to take place with respect to my Ship-to-party. -
Crm_order_maintain ,changing pricing condition value at item level
Hi,
I am trying to change the pricing condition value at item level while creating sales order through CRM_ORDER_MAINTAIN.
I am not able to change the condition value.
Code is below.
wa_inputfields-ref_guid = wa_orderi-guid.
wa_inputfields-ref_kind = 'B'.
wa_inputfields-objectname = 'PRIDOC'.
wa_fieldname-fieldname = 'KBETR'.
append wa_fieldname to wa_inputfields-FIELD_NAMES.
wa_fieldname-fieldname = 'KMEIN'.
append wa_fieldname to wa_inputfields-FIELD_NAMES.
wa_fieldname-fieldname = 'KPEIN'.
append wa_fieldname to wa_inputfields-FIELD_NAMES.
wa_fieldname-fieldname = 'KSCHL'.
append wa_fieldname to wa_inputfields-FIELD_NAMES.
wa_fieldname-fieldname = 'WAERS'.
append wa_fieldname to wa_inputfields-FIELD_NAMES.
INSERT wa_inputfields INTO TABLE it_inputfields.
wa_pricing_add-KSCHL = 'ZP06'.
wa_pricing_add-WAERS = 'USD'.
wa_pricing_add-KBETR = '10'.
wa_pricing_add-KPEIN = '1'.
wa_pricing_add-KMEIN = 'ST'.
INSERT wa_pricing_add INTO table it_pricing_add .
wa_pricing-REF_GUID = wa_orderi-guid.
wa_pricing-REF_KIND = 'B'.
wa_pricing-PRICING_TYPE = 'A'.
wa_pricing-COND_ADD = it_pricing_add.
wa_pricing-PRICING_PROCEDURE = 'ZVDSP'.
append wa_pricing to it_pricing.
Can you tell me how to overwrite the condition value while creating sales order using crm_order_maintain.?
Regards,
Indhra.EHello Indhra,
Check the CT_INPUT_FIELDS table, in the OBJECTNAME field you will find all the tables that are filled during the function call. Check those tables mentioned in the OBJECTNAME to look for any pricing related data.
When your order is in change mode and you activate debug <b>just before you make the change</b>, the CRM_ORDER_MAINTAIN FM call contains <b>data only relevant for the change you just made</b>. In other words, you need to fill exactly the same tables as CRMD_ORDER does.
E.g. You just change the pricing procedure and you see in debug that 5 tables are filled, you must do exactly the same in your code! It's quite anoying but you're using a low-level API FM that can handle ANY transaction type in CRM!
Check it, it works!!
<b>Reward points if useful!</b>
Regards,
Joost -
Changing Pricing Condition from VF02
Hi,
I'm an ABAPer, for a development purpose I'm trying to change the Pricing Condition data from VF02.But I have found that the Update button at the bottom is disabled.Looking for solution so that I can change the Pricing Procedure.
Thanks in advance.
Sarbajit Majumdar.Dear Sarabjit,
If you want to change the price which is coming in the order you need to change its condition record, for this kindly follow the following steps:
1- First go to the Analysis Tab on VF02 and check which pricing procedure is maintained over there.
2- Then check the condition type you want to change the records for, click on the extension icon before the Condition type you will get the access sequence which is maintained for the Condition type.
3- Click on the access sequence and see on the right side of the screen on which basis the condition records are maintained for it.
4- The condition record may appear like customer/material/plant.
5- Now use T Code VK12, on the initial screen it will ask for Condition Type, enter the condition type and press enter for which you want to change the value.
6- The system will ask for the key combination of the condition type which you will get from the step 3 & 4.
7- In the next screen it will ask for the values of key combination which are present on the analysis view(step 3 & 4)
8- Once you enter these data and press f8(execute) you will reach to the next screen where you can change the condition record for the condition type.
Regards,
Ashu -
Function Module to change pricing condition in Agreement
Hi Experts ,
While creating purchase agreement (ME31L) BDC i want to change the pricing condition in the document at item level .
Planing to use function modules to change the pricing condition after document is created .
Any help in function module which will change the pricing condition in Agreement will be appreciated .
Any other suggestion are also welcome (-: .
Thank You .how to change the pricing consition in agreement(ME31L)
-
Changing Pricing Conditions in CRM
Hi,
We'd like to change an already existing price condition on contracts in CRM using a batch program.
The prices doesn't exist in R/3 but only in CRM.
We have run some tests using Function Module
'CRM_ORDER_MAINTAIN' but the pricing conditions where not saved(the price sheet is updated and also the total net price of the contract).
Does anyone know of a functon module to use for changing a pricing condition for a contract in CRM ??
Thanks,
BjörnHi,
did you find a solution to your question ? I am trying to find an answer to the same subject.
thanks,
Isaac -
Not allow to change pricing condition in Billing,,,
Hi ,
I want to know the user exit or other solution for following:
System should not allow to change the value of basic pricing condition type in billing.
Ex. In sales order value of condition PR00 is 100, then it should not allow
to change the value of condition type PR00 in billing. If requires to change, it should allow
to change in sales order only.
Thanks & Regards,
SachinFor this no need to use user exit
goto V/06 condition type details
choose which condition type u want to give display view
go to controlling tab or changes can be made , uncheck the value and amount fields. than system should not allow to change the condition type in sales order level also.
(or)
if u want in billing document only
configure copy controls between delivery document to billing document (VTFL)
goto item category, select item category (TAN)> details and add pricing type E.
try this
regards
siva -
Sales order exit - changing pricing conditions
Hi Gurus
We have an issue where a customer was given $0 pricing on an item within their price list, but when an order is created, the system prices the item at List Price. Upon investigation, it was discovered that SAP cannot maintain pricing at $0 because the item categories are looking for a net value. We decided that we would create a user exist that would change the item category on the items and price that item as u201Cfree of chargeu201D for these customers. We did work on the user exit u201Csave_document_prepareu201D and were able to change the item category in sales order screen but the pricing conditions shows net values in that tab. The question here is how to update the pricing conditions when we change the item category for each item
Thanks
GaneshHi Ganesh,
For this Goto the User-Exit MV45AFZZ & From there Goto FORM USEREXIT_MOVE_FIELD_TO_VBAP.
Now here write your condition.
The data(Pricing details) is available in XKOMV. and The Item is in VBAP...
Now Check if the Item & Customer are same in a Simple If Condition.. If same the Clear XKOMV[]. Thats it..
It Clears Teh Pricing Conditions all to 0.
If you still have Net value & Netprice,, Then Clear the NETWR & NETPR fields As well in Header(VBAK) & Item(VBAP) as well..
Thanks & Regards,
Dileep .C
Maybe you are looking for
-
Saving a PDF file without the comments
In Acrobat Reader, is it possible to save a copy of a PDF file without the comments. I'm doing a PhD, and would like to be able to send some scientific papers to colleagues without the annotation I may have added. Of course, manually removing all the
-
Importing word 2004 docs with tables into Pages
I work in video production, and my clients send me shooting scrips as word documents formatted with tables. Needless to say, I was quick to discover that Pages doesn't really 'like' these documents. I can't keep asking my clients to reformat their do
-
Help itouch 2.0 apps dont start
help itouch 2.0 apps dont start it loads for like 2 secs and goes bak to the home screen what should i do?
-
Working with Multiple Projects
I recently started working for a company that has multiple webhelp projects created in robohelp v6. The projects are linked together under a shell merge so the TOC will display correctly. We have upgraded to v7 and will be converting all the projects
-
I have weird looking white lines on my screen
Greetings guys, Everytime I unlock my iPod Touch 4G it has some weird horizontal white lines and the screen in all washed out. I have to press the lock button again and than bring it up again. Do you know a good solution ? Thanks, Rebecca