cancel
Showing results for 
Search instead for 
Did you mean: 

Copying one particular Pricing Condition Types from Invoice to Credit Memo Req

former_member207059
Participant
0 Kudos

Hi

We want to know, is there any specific User Exit, which can be used to copy one particular Pricing Condition Types from Invoice to Credit Memo Req document.

Let us say, we have the following pricing condition types in Invoice:

1. Sales Price

2. Discounts

3. Surcharge

4. Freight.

When I create Credit Memo Req with ref to the Invoice, I want to only Surcharge Condition Type value have to be copied into Credit memo req.

Please respond.

Accepted Solutions (0)

Answers (7)

Answers (7)

former_member183155
Active Contributor
0 Kudos

Hi all ;

We implement this project of invoice correction request creation referance from invoice. We eleminate all discount and calculate net price.

Program RV61AFZA and RV61AFZB.

Also check oss note :

SAP Note 24832 - Pricing rules / TVCPF

SAP Note 672681 - VPRS calculation in RK document

For example :

rv61afza

form userexit_pricing_copy.

* the following example modifies the calculation rule within invoices

* for condition type HD00

*

*   CHECK VBTYP_NEW CA VBTYP_FAKT.

*   IF KONV-KSCHL = 'HD00'.

*     KONV-KRECH = 'B'.

*   ENDIF.

*---------------------------------------------------------------------*

   data: lv_kposn like konv-kposn,

         lv_kposn_new like konv-kposn,

         lv_kschl  like konv-kschl,

         lv_kwert_old like konv-kwert,

         ls_konv like konv.

   data: ls_vbrp like vbrp,

         ls_vbrk like vbrk.

   data: lv_netpr type p decimals 2,

         lv_menge type p decimals 3,

         lv_netpr_new type p decimals 2.

   if vbtyp_new ca 'K'.

     clear: lv_kposn, lv_kschl, lv_kposn_new.

     lv_kposn = konv-kposn.

     lv_kschl = konv-kschl.

     lv_kposn_new = item_number_to.

     clear ls_konv.

     select single * into ls_konv from konv

             where knumv eq konv-knumv

               and kposn eq lv_kposn

               and kschl between 'ZI01' and 'ZI99'.

     if sy-subrc = 0 and ls_konv is not initial.

       clear ls_vbrk.

       select single * into ls_vbrk from vbrk

               where knumv eq konv-knumv.

       if sy-subrc = 0.

         clear ls_vbrp.

         select single * into ls_vbrp from vbrp

                 where vbeln = ls_vbrk-vbeln

                   and posnr = lv_kposn.

         if lv_kschl = 'ZFIY'.

           konv-kwert = ls_vbrp-netwr.

           konv-kbetr = ls_vbrp-netwr * 1000 * konv-kpein / ls_vbrp-fkimg.

         elseif lv_kschl = 'ZKDV' or lv_kschl = 'ZRMP'.

         elseif lv_kschl(2) = 'ZI'.

           u15_subrc = 4 .

         endif.

       endif.

     endif.

   endif.

endform.                    "USEREXIT_PRICING_COPY



rv61afzb


form userexit_xkomv_bewerten_init.


data: lv_kposn like konv-kposn,

         lv_kposn_new like konv-kposn,

         lv_kschl  like konv-kschl,

         lv_kwert_old like konv-kwert.

   data: ls_vbrp like vbrp,

         ls_vbrk like vbrk,

         ls_konv like konv.

   data: begin of lt_cvbrp occurs 10.

           include structure vbrpvb.

   data: pstyn like vbap-pstyv.

   data: end of lt_cvbrp.

   constants: c_cvbrp(15) type c value '(SAPFV45C)CVBRP'.

   field-symbols: <fs_cvbrp> like lt_cvbrp.

   assign (c_cvbrp) to <fs_cvbrp>.

   if <fs_cvbrp> is assigned.

     if <fs_cvbrp>-rkcop = 'X' and vbtyp_new ca 'K'.

       clear: lv_kposn, lv_kschl, lv_kposn_new.

       lv_kposn = konv-kposn.

       lv_kschl = konv-kschl.

       lv_kposn_new = item_number_to.

       clear ls_konv.

       select single * into ls_konv from konv

               where knumv eq konv-knumv

                 and kposn eq lv_kposn

                 and kschl between 'ZI01' and 'ZI99'.

"added by ounal.

       if ls_konv is initial.

       select single * into ls_konv from konv

               where knumv eq konv-knumv

                 and kposn eq lv_kposn

                 and kschl eq 'ZFIY'

                 and kinak ne ''. "inaktif koşul

       endif.

       if  ls_konv is not initial.

         clear ls_vbrk.

         select single * into ls_vbrk from vbrk

                 where knumv eq konv-knumv.

         if sy-subrc = 0.

           clear ls_vbrp.

           select single * into ls_vbrp from vbrp

                   where vbeln = ls_vbrk-vbeln

                     and posnr = lv_kposn.

           loop at xkomv where kposn = lv_kposn_new.

             if xkomv-kschl = 'ZFIY'.

               xkomv-kbetr = ls_vbrp-netwr * 1000 * xkomv-kpein / ls_vbrp-fkimg.

               modify xkomv.

             elseif xkomv-kschl = 'ZKDV' or xkomv-kschl = 'ZRMP'.

             elseif xkomv-kschl(2) = 'ZI'.

               delete xkomv.

             endif.

           endloop.

         endif.

       endif.

     endif.

   endif.

   " ************** Değişiklik-1 son ***************

endform.                    "USEREXIT_XKOMV_BEWERTEN_INIT



Regards.

M.Ozgur Unal

former_member182378
Active Contributor
0 Kudos

Ravi,

If in all cases, the credit memo request should have fixed condition types (e.g. always surcharge and price), then I would recommend a new pricing procedure for credit process.

As already suggested by members.

former_member182378
Active Contributor
0 Kudos

Ravi,

You can create a new pricing type. This shall let only the necessary condition types flow from the billing doc to the credit memo request.

This custom pricing type can be assigned in VTAF

phanikumar_v3
Active Contributor
0 Kudos

Dear TW,

Thanks for Appreciating by your likes.

"""You can create a new pricing type. This shall let only the necessary condition types flow from the billing doc to the credit memo request.""""

Can you please help me out where we can Create Pricing type as Mentioned by you in your Thread?

Phanikumar

moazzam_ali
Active Contributor
0 Kudos

Hi

If you use same pricing procedure for billing document and credit memo request and maintain D in VTAF item wise in field Pricing Type system copes all pricing elements unchaged along with all conditions. Now credit memo request will be showing you all conditions and you have three options here

  • Create a routine and assign to all your conditions which you dont want in credit memo request credit memo and write logic that if SD document category is equal to K or O then condition value would be zero. With this only your required condition will be showing its value.

  • Follow userexit and write coding in it to determine your required condition.

  • Leave credit memo request and create new PP and determine it in credit memo billing document type. Assign your required one condition only in that new PP and maintain D in copy control Pricing type field.

Thank$

former_member207059
Participant
0 Kudos

Hi MoazzaM,

Thanks for your suggestion, but I feel bit worried about assigning Routines to all Pricing Condition Types.

Rgds,

moazzam_ali
Active Contributor
0 Kudos

Hi

There is no need to worry and you can test it. If you are not feeling comfortable with this you can analyze two other solutions.

Thank$

Former Member
0 Kudos

Hi Ravikumar,

Please elaborate the biz reqt.

To meet your requirement, may be you can maintain a separate pricing procedure for CMR with the required Condition type and maintain the required value in the condition record as in Sales order / Invoice.

Regards


phanikumar_v3
Active Contributor
0 Kudos

I dont understand--while giving credit to customer (with the creation of Credit Memo request--Due to customer at loss)--Why surcharge---Can you please tell me what your business process is.

Phanikumar

former_member182378
Active Contributor
0 Kudos

Phani,

Good point raised!

I know cases where the company does not give back the freight charges to the customer, in the return of goods processes. As the freight charges are incurred by the company and it is not refunded.

But if surcharges are included in the credit memo request, then discounts too should also be!

Ravi,

Could you comment?

Lakshmipathi
Active Contributor
0 Kudos

Assuming that the same billing pricing procedure is being used for Credit Memo Request also, you can try with USEREXIT_PRICING_PREPARE_TKOMP in the program MV45AFZZ. 

G. Lakshmipathi

former_member207059
Participant
0 Kudos

Hi Lakshmipathi,

Your assumption is right, we are planning to use the same pricing procedure. Can you pls give us more details on how to go with the given User Exit.

Rgds,

former_member207059
Participant
0 Kudos

Hi Lakshmipathi,

We are planning to use User Exit - USEREXIT_PRICING_RULE as per SAP Note - 24832. To be precise, we need to copy only one Pricing Condition Type from Original Sales Invoice to Credit Memo Requests and other Pricing Conditions should not be copied into Credit Memo Req document.

But we are still finding it difficult to achieve it using above Exit.

Rgds,