cancel
Showing results for 
Search instead for 
Did you mean: 

SD Pricing

Former Member
0 Kudos

Hi, I want to create a new table called coupon codes in Addtional Data B. Order creator will input one or more coupon codes in this table.

I wiant to have ONE condtion type with one access sequence with coupon code field.

Where should I do the coding to read the coupon code table and create multiple condtions for each values in the coupon code table.

Appreciate your help.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi ,

I think this can be done. What I would do is Create a condition type say.ZCOP having condition table say( Ord typ/sold-to/Zcoup).

Now This ZCOUP will be the Zfield added to your sales order that takes value dynamically from the coupon table with unlimited values that you add.

Logic:

During sales order creation User enters all the unlimited value in the Coupen table.Create one additional Zfield say ZCOUP populate this Zcoup field with first entry of the coupen table. Create one caluculation routine and assign it to cond type ZCOP. This routine must have logic in place that if action is order save then loop it on to Cuopen table and fetch all condition record values and determine the best (as per ur requirement) and update the field Zcoup and also value to ZCOP condition type.

I am not sure if the above functionality works but you can give it a try

Former Member
0 Kudos

Rathan,

Thank you for the GREAT response.

This is what I have in mind but the issue here is determining the BEST in the user exit. If I can somehow avoid that, as this can get very very complex if there are many many access sequences (with scales) related to each of the coupon codes then the logic to determine best coupon can be super complex.

Ideally if I can extend KOMK with ZZCOUPON field of TYPE ANY.

Build a dynamic strcuture in user exit ZCOUPFLDS that will have a dynamic # of columns (fields - ZZCOUF01, ZZCOUF02) based on the number of coupons the user enters in the table.

Assign the ZZCOUFLDS structure to ZZCOUPON field of KOMK.

Now Loop though the coupons table and move the value of each row in coupons table to KOMK-ZZCOUPON-ZZCOUF01, ZZCOUF02 etc.

By process I will tell the config. to use the SAME ZZCOUF01, ZZCOUF02 in Field Catalogue to create more access sequences as needed by business.

This will make it some what flexible - no need for futher ABAP work as config can do the field catalogue and that is all is needed.

Any help from anyone?. Thank you.

Former Member
0 Kudos

Hi Gopi,

I have one question in your logic. As you said you will add the Access tables based on fields (ZZCOUF01, ZZCOUF02). But if you are mapping coupon table with these fields that would be one to one and first entry in coupon table goes to ZZCOUF01, Second entry goes to ZZCOUF02 and so on. Now during pricing if you are maintaining different access tables for ZZCOUF01, ZZCOUF02 as you said, system would always pick the record from the first access that would be using ZZCOUF01. So system would always use the first coupon. How are you gonna dynamically choose the best access?

Thanks,

Rathan Kumar.

Former Member
0 Kudos

Hi Rathan,

In the access sequence - there is field called Exclusive - if that is unchecked (BLANK), SAP will NOT pick the 1st one but will add as many as applicable. So if there are 10 codes in the table and 5 of them match, you will see 5 ZXYZ condition types. Based on the business scenario, we can keep ALL meaning accumulate the discount - add all of them or put them in a BEST pricing configuration and pick the TOP value of those 5.

Example access sequence:

Sales org = US01 COUCODE01 = 001 Condition value = - 2 %

Country = US COUCODE02 = 002 Condition Value = -3%

Country = CA COUCODE03 = 003 COndition value = -4%

If an order comes from US - you will see both US01 and US as eligible, in that case if BEST pricing is configired we will get -3% if NOT you will get -5%.

Hope this helps.

jpfriends079
Active Contributor
0 Kudos

First, be sure where you want these coupon codes in sales order at header or at item.

I want to create a new table called coupon codes in Additional Data B. Order creator will input one or more coupon codes in this table.

1. Refer following SDN Thread:

-

I want to have ONE condition type with one access sequence with coupon code field.

Where should I do the coding to read the coupon code table and create multiple conditions for each values in the coupon code table.

2. As coupon code is not a standard field in pricing field catalog. So, you need to add that in field catalog. Refer following SDN thread, to know how to it:

-

3. Then create condition table that field.

4. Create a access sequence & maintain that condition table in that.

5. Now, you might need to create a relevant condition type for the coupon and maintain access sequence in it.

6. Place the condition type in your desired pricing procedure.

7. Create a condition record for the condition.

8. Maintain field value for Coupon Codes in Additional Data B in sales order.

Regards

JP

Former Member
0 Kudos

Thank you Jyoti for a quick reply.

I want to add a TABLE instead of a filed in Addtional Data B. Idea is to take several coupon codes.

Each coupon code will then be evaluated and possible use best pricing to come up with a single applicable code per line item.

Example: User Enters CODE1, CODE1 and CODE3 in Addtional Data B custom table.

I want to loop though this table and for each row values, I have to select the "proper access sequence". SAP uses Addtional Data A - Condtion Group1 thur 5 fields >>> static 5 fields for similar use but what I want to achieve is make is "unlimited" with a table. Not sure if this can be done.

Edited by: Seshagiri Gopi on Feb 8, 2012 4:20 AM