cancel
Showing results for 
Search instead for 
Did you mean: 

FM to associate price to object - CRM

former_member227595
Active Participant
0 Kudos

Hi Gurus,

Does anybody knows any FM which allows me to give price to an object, in CRM.

I thought that was CRMXIF_PRODUCT_INDOBJ_SAVE, but at the end, didn't work.

Thanks in advance.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

former_member182421
Active Contributor
0 Kudos

If I understood you correctly, this work a little different, you don't assign a condition to a product, you assign a product to a condition.

Prices - Products - SAP Library

so you need to create a condition associate it to the product, you can use the API CRMXIF_COND_REC_SLIM_SAVE for that. To be honest I never created pricing condition for IObjects, but as IObjects technically are products I guess the principles are the same.

Cheers!

Luis

former_member227595
Active Participant
0 Kudos

Hi, Ive checked the FM CRMXIF_COND_REC_SLIM_SAVE. But doesn't work for this case.

The thing is that I have to create a price into an object (which is a product with family).

Thank in advance.

Regards

former_member182421
Active Contributor
0 Kudos

Sorry but I don't understand your issue, in theory should work, can you explain with a litte more detail what did you check and why is not working?

former_member227595
Active Participant
0 Kudos

Hi, yes sorry. What I need is to associate to an object guid a price with a sales organization, currency. I don't find in the FM you gave me and object guid.

Regards

former_member182421
Active Contributor
0 Kudos

That's because you must use the table VARIABLE_FIELDS, is placed in the input parameter data-cond_record 

There you have the follwoing fiedls:

FIELDNAME = PRODUCT_ID (for example)

SEGMENTNO = you can leave this blank, the standard will fill it for you

FIELDVALUE = Product ID number

former_member227595
Active Participant
0 Kudos

Awesome!! If it works like this

But At the same time I need the price field, and there is not avaible.

Regards

former_member182421
Active Contributor
0 Kudos

KBETR_PRT - Amount

KONWA - Amount currency

If I'm not wrong, check the structure  /1CN/WORKING_SET_E_D_SUP to see the available fields.

former_member227595
Active Participant
0 Kudos

Luis, thank you vey much!! I think I am quite close..,

OK, so you mean:

KBETR_PRT - Amount

KONWA - Amount currency

Would be in VARIABLE_FIELDS as well ??

I am trying to get an example of this FM.

Regards

former_member182421
Active Contributor
0 Kudos

Yes, you are correct, "all" the fields in the structure /1CN/WORKING_SET_E_D_SUP which applies to you condition are mapped to the VARIABLE_FIELDS in the same way I described the product.

I believe you will also need to inform the LOGSYS (logical system)  and PRODUCT_TYPE. and maybe the PRODUCT_OBJECT_FAMILY.

I would first try without all the new fieds I described here, check if the API returns any error which you can understand...some times the output messages are quite cryptic, if doesn't work I would try to add the logical system and the product type, and if the error persist with the product object family. As I said before I never did it with IObjects so I'm not sure if some mandatroy parameter for this scenario will rise...anyway...keep in mind the input parameters directly depends how the condition/table is defined.

former_member227595
Active Participant
0 Kudos

Yes, Thanks in advance, again

One thing, do you have the FM documentation ??

Regards

former_member182421
Active Contributor
0 Kudos

Nope, everything is in my head   The FM CRMXIF_COND_REC_SLIM_SAVE has some documentation (SE37 -  "Doc Funciton module button" on the application toolbar (first on the right side) ) but I'm not sure if will bee enough, truly in scn there isn't a lot of documentation about this maybe is a good opportunity to write your first blog

former_member227595
Active Participant
0 Kudos

Luis, Ive readed the documentation, is quite useful .

Well I ll try this, then I ll let you know ...

former_member227595
Active Participant
0 Kudos

Luis, it has worked!!

Thank you very mux.

At the end I inserted the below records into the table variable_fields

code:

    ls_var_fie-fieldname = 'PRODUCT_ID'.

    ls_var_fie-fieldvalue = product_id.

    APPEND ls_var_fie TO ls_datasal-cond_record-variable_fields.

    ls_var_fie-fieldname = 'SALES_ORG_SHORT'.

    ls_var_fie-fieldvalue = sales_org_short.

    APPEND ls_var_fie TO ls_datasal-cond_record-variable_fields.

    ls_var_fie-fieldname = 'DIS_CHANNEL'.

    ls_var_fie-fieldvalue = dis_channel.

    APPEND ls_var_fie TO ls_datasal-cond_record-variable_fields.

    CLEAR: ls_var_fie.

    ls_var_fie-fieldname = 'MNT_RATE'.

    ls_var_fie-fieldvalue = price.

    APPEND ls_var_fie TO ls_datasal-cond_record-variable_fields.

    ls_var_fie-fieldname = 'COND_CURRENCY'.

    ls_var_fie-fieldvalue = currency.

    APPEND ls_var_fie TO ls_datasal-cond_record-variable_fields.

    ls_var_fie-fieldname = 'DATE_FROM'.

    ls_var_fie-fieldvalue = date_from.

    APPEND ls_var_fie TO ls_datasal-cond_record-variable_fields.

 

    ls_var_fie-fieldname = 'DATE_TO'.

    ls_var_fie-fieldvalue = date_to.

    APPEND ls_var_fie TO ls_datasal-cond_record-variable_fields.

    CLEAR: ls_var_fie.

    ls_var_fie-fieldname = 'MEINS'.

    ls_var_fie-fieldvalue = unit.

    APPEND ls_var_fie TO ls_datasal-cond_record-variable_fields.

    ls_var_fie-fieldname = 'PRODUCT_OBJECT_FAMILY'.

    ls_var_fie-fieldvalue = family.

    APPEND ls_var_fie TO ls_datasal-cond_record-variable_fields.

Regards

Answers (0)