SAP for Retail Discussions
Join conversations about personalization, omnichannel strategies, and operational excellence in retail using SAP for Retail software.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP POSDM Discount segment

vikrant_mohite
Active Contributor
0 Kudos

Hi,

Is it possible to create a discount segment uner line item using external ABAP code in POSDM?

I have a error messge where I have line item no where discount need to be adjusted. So I want to write a separate abap code to read this message and extract the line item no and discount value to be adjust. Once this is done I want to create a discount segment under that line item  with the value in the error message.

Please do reply if any one is having suggestion/ idea / reference on this query.

Thanks,

Vikrant

5 REPLIES 5

Former Member
0 Kudos

Hi Vikrant,

You can create discount segment under a line item, although it is not very clear in your question what you are expecting. please see the below mentioned details that i assumed from your query. i think you are looking for below mentioned structure

POS Transaction

Transaction No XXXXXXX Transaction Type XXXX

Sales Item data

Sales item no.  sales item type  Material no.  Qty.  sales Value

1                          xxxx                     xxxxxxxx          xx     xxxxx. xx

2                          xxxx                     xxxxxxxx          xx     xxxxx. xx

3                          xxxx                     xxxxxxxx          xx     xxxxx. xx

               Discount

               Doicount No. xx  Discount type xxxx  Discount Value xxxx.xx

Means Of Payment

Tende No. XX  Payment Means xxxx

even you can create any number of segment under line item like item level discount, tax etc.

hope this helps.

BR

Anup

0 Kudos

Hi Anup,

First of all thanks for your quick reply.

I want to create a discount segment exactly below the line item no.

Suppose you have error message with line item no 2 and discount value 0.23 then I want to create a discount segment below the line item no(in bold) and not in the Discount(in italic) segment that appears after all line items.

POS Transaction

Transaction No XXXXXXX Transaction Type XXXX

Sales Item data

Sales item no.  sales item type  Material no.  Qty.  sales Value

1                          xxxx                     xxxxxxxx          xx     xxxxx. xx

2                          xxxx                     xxxxxxxx          xx     xxxxx. xx

                              Here I want a discount segment (0.23)

3                          xxxx                     xxxxxxxx          xx     xxxxx. xx

               Discount

                              Not here

               Doicount No. xx  Discount type xxxx  Discount Value xxxx.xx

Means Of Payment

Tende No. XX  Payment Means xxxx

I hope it is clear to you now.
If it is possible can you please tell me how it can be done?

0 Kudos

Hi Vikrant,

yes it is possible, even what i have explian you was the same. i know  that why you got confused on my example, as i have given you three line items in the transactions and only on last item i have shown you discount field.

But as you explained in you details, you can create discount segment for all individual line items and not even discount feild you can create tax and any required feild for all individual line items.

hope it helps.

Anup

0 Kudos

Hi Anup,

Can you explain how it can be done?

Vikrant

0 Kudos

Hi Vikrant

You have to create a line item extension segment (Discount) where you will map the line item discount. Then you will have to map the aggregated line to the line item segment in POS DM, and carry the line item discount amount to the line item extension segment for your informational purposes as you want. 

In POSDM the sales price of the line items will be the price before the discount is applied, and the transaction will net out when the discount is mapped with the negative value.

Then you can use Aggregation Badi /POSDW/BADI_AGGR_TRANSACTION within POS DM required to perform this enhancement to meet the your requirements

Use Standard Method /POSDW/IF_BADI_AGGR_TRANS~AGGREGATE_TRANSACTION to include logic:

o   LOOP at Transaction-LineItem (to get Discount Line Items)

§  Get the Discount value from Line item-extensions-fieldvlaue where extention-fieldname = ‘Discount’

Hope this helps.

BR

Anup