cancel
Showing results for 
Search instead for 
Did you mean: 

Updating Pricing Conditions via FM not working

Former Member
0 Kudos

Good Morning,

I'm trying to update a pricing condition type of an existing Job, and nothing I've tried seems to work.

We're on 4.0 using IPC. I've tried debugging fm crm_order_maintain when maintaining a Job online to see if perhaps I was not filling my internal tables properly, but it_pridoc seems to be empty which leads me to believe that perhaps the pricing is updated elsewhere when IPC is involved.

I've read multiple older threads that mention that crm_order_maintain doesn't work very well for pricing updates. Is this true? Some people have suggested deleting the recod from the db and using crm_order_maintain to recreate it since the _add piece seems to work whilst the _change and _delete do not? should I be looking elsewhere?

Any help will be greatly appreciated

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Have you gotten anywhere with your problem.

I have exactly the same problem and would apreciate hints.

regards,

T

Former Member
0 Kudos

No, I'm sorry I haven't found a clean way to do it yet. We asked OSS several times, and got several answers. The last one stated that there wasn't a standard BAPI available to do this.

Regards

C

Former Member
0 Kudos

CRM_ORDER_MAINTAIN works for everything except pricing determination.

I even tried using the IPC proxy RFCs, but that didn't work either.

For creation/change I used the CRMXIF_ORDER_SAVE function, which is not easy to use (and I don't remember how I did it) but it gets the job done as far as pricing is concerned. It is easy for order creation, but for change i remember it was VERY hard to get to know how it worked.

Message was edited by: João Sousa

mahesh_jagannath
Participant
0 Kudos

Hi,

Pricing Conditions can be changed by using CRM_ORDER_MAINTAIN provided that the condition type should be allowed to changed manually. For Eg: If you check the pricing condition configuration for PR00 in IMG CRM --> Basic Functions --> Pricing --> Define Settings for Pricing --> Create Condition Types you would find something as below.

If such setting is not there it may not be possible for a user to change it. Alternatively you can also implement an IPC Java routine to change the condition value.

Kind Regards,

Mahesh

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi all,

it would <b>be extremely useful</b> to know how you solved this issue, as we are experiencing a very similar case, with usage of CRM_ORDER_MAINTAIN.

Basically our case is that we are trying to create a new price condition in a new item added to a CRM order. Automatically it fails, but manually it works.

If you have solved this problem, please send me an e-mail at the following e-mail:

andreacanella@gmail.com.

Many thanks in advance,

Andrea.

Former Member
0 Kudos

Hi Andrea,

As explained to you in the email, you need to do following steps:

1- Read order item or Head (Function 'CRM_ORDER_READ')

2- Read its PA (Function 'CRM_PRICE_AGRMNTS_READ_OW')

3- Add and/or change records in structure /table ls_pa_crm_w-price_agreements_crm returned by function in step 2

4- Maintain PA using your modified structure (Function 'CRM_PRICE_AGRMNTS_MAINTAIN_OW')

5- Save order (Function 'CRM_ORDER_SAVE')

6- last but not least, commit your changes.

Hope this helps.

Tania

former_member184067
Active Contributor
0 Kudos

hi Carlos,

what version the IPC that you used ?

i am also facing the same problem with your due to IPC version.

before that, i want to ask a question.

you said that you want to update a pricing condition of an existing job.

the question is : you want to add a new pricing condition or you just want to update the value of existing pricing condition of an existing job ?

the pricing condition that you want to update is on header level or item level ?

based on experience, there is no problem for updating value of an existing pricing condition of an existing job. the problem occured while adding new pricing condtion in an existing job if the pricing condition on item level.

hopes it helps.

regards

eddhie

Former Member
0 Kudos

Hello,

I'm trying to change an existing pricing condition for a document in CRM. I can't get CRM_ORDER_MAINTAIN to do it regardless of what I do. What are you using to maintain them?

former_member184067
Active Contributor
0 Kudos

hi Carlos,

before you used CRM_ORDER_MAINTAIN to chagen the existing pricing condition, you need to get the data of existing pricing condition.

before that, is your pricing condition for item level or header level ?

because the way for updating it via CRM_ORDER_MAINTAIN will be a bit different between pricing condition for item level or header level.

here an example code for item level price condition :

data :

lv_guid type crmt_object_guid,

lt_guid type crmt_object_guid_tab,

ls_pridoc type crmt_pric_cond,

ls_pric_cond type PRCT_COND_DU_TAB,

is_pridoc type crmt_pridoc_com,

gt_pridoc type crmt_pridoc_comt,

ls_pricond_change type PRCT_COND_EXTERNAL_CHANGE,

ls_input_field type crmt_input_field,

ls_input_field_names type crmt_input_field_names,.

lv_guid = <..your document guid..>.

call function 'CRM_PRIDOC_READ_OW'

exporting

iv_header_guid = lv_guid

importing

ES_PRIDOC = ls_pridoc.

loop at ls_pridoc-pric_cond into ls_pric_cond.

is_pridoc-ref_guid = ls_pric_cond-kposn.

is_pridoc-ref_kind = 'B'.

is_pridoc-pricing_type = <..your pricing type..>.

ls_pricond_change-stunr = ls_pric_cond1-stunr.

ls_pricond_change-zaehk = ls_pric_cond-zaehk.

ls_pricond_change-waers = ls_pric_cond-waers.

ls_pricond_change-kbetr = ls_pric_cond-kbetr.

ls_pricond_change-kpein = ls_pric_cond-kpein.

ls_pricond_change-kmein = ls_pric_cond-kmein.

insert ls_pricond_change into table is_pridoc-cond_change.

ls_input_field-ref_guid = ls_orderadm_i-guid.

ls_input_field-ref_kind = gc_object_ref_kind-orderadm_i.

endloop.

INSERT is_pridoc INTO TABLE gt_pridoc.

ls_input_field-objectname = 'PRIDOC'.

ls_input_field_names-fieldname = 'REF_GUID'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'REF_KIND'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'PRICING_TYPE'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'KSCHL'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'WAERS'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'KBETR'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'KPEIN'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'KMEIN'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

INSERT ls_input_field INTO TABLE lt_input_fields.

call function 'CRM_ORDER_MAINTAIN'

exporting

it_pridoc = gt_pridoc

CHANGING

ct_input_fields = Lt_input_fields

EXCEPTIONS

ERROR_OCCURRED = 1

DOCUMENT_LOCKED = 2

NO_CHANGE_ALLOWED = 3

NO_AUTHORITY = 4

OTHERS = 5.

regards

Message was edited by: eddhie kurnianto