cancel
Showing results for 
Search instead for 
Did you mean: 

Pricing Routine issue

Former Member
0 Kudos

Dear Members,

We have special issue in our company. We have created alternative calculation type routine for reading scales and get the right base price.

but we don't want  this routine not to apply when return order is created with reference to invoice.

Because this routine is already done the calculation required in the invoice . When i am creating return order with reference to Invoice above, routine is re triggering again doing the calculation in the pricing overwriting the value copied from the invoice.

could any one suggest  is there any way i will know this return order is creating with reference to invoice and stop executing the routine in the pricing procedure?

I need to stop this routine execution at the time of creation ? before i save the order , so i need to able to write the code in the same routine not to execute  if this order is created with reference to invoice ?

Any suggestion are helpful.

Thanks

VEER

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello Veer,

As Lakshmipathi suggested its not a standard routine, you can do a little more coding with the help of your ABAPr that if Return Doc.Type ( RE) or Return Item category (REN) is available then it should not work.

Regards

AG.

phanikumar_v3
Active Contributor
0 Kudos

Please Add  a little more logic in your routine like below:

If VBAK-VBTYP is C-then read the this routine

and if VBAK-VBTYP is H then don't read.

This was suggested by Mr Lakshmipathi.

I just added little more clarification.

Phanikumar

Former Member
0 Kudos

Hi Phani / Lakshmipathi,

Thanks for the reply , yes you are right i can use the field above mentioned , my scenario is bit more typical

in case of returns created with reference to invoice i should not apply the routine .

in case of returns crated without reference to invoice i should apply the logic.

I am not sure how will i differentiate this in the my routine in order to avoid ??

because i am in the creation mode of sales order ? if it is after save mostly i can use table VBFA?

Please suggest .

Thanks

VEER

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Check in your VOFM if you are capable to check the value for KOMP-VGBEL, it should be populated with the billing document ID.

For instance, write in the first lines

CHECK NOT komp-vgbel IS INITIAL.

Or do a check if it is in VBRK table.

Regards

Eduardo

former_member182378
Active Contributor
0 Kudos

VEER,

A suggestion similar to Kun's post, can you use Pricing type = D (Copy pricing elements unchanged), configured in copy control VTAF, at line item level?

What about adding a requirement, this too would be a routine; which shall check if return order is created with reference, if yes then that condition type shall populate in the return order or else not.

I am not sure about the logic for this requirement routine.

The trick is that while creating the return order, the logic should validate if return is created through a reference billing document. It is not after a sales order is created.

former_member182378
Active Contributor
0 Kudos

Eduardo,

The value of the condition type would trigger during the creation of the return order (not after the return order is created), then would a field in the sales order populate with the billing document number?

As, at this moment, there is no return order!

Thank you, in advance!

eduardo_hinojosa
Active Contributor
0 Kudos

Hi TW.

I am not sure, the way to check it is with a debugging session. After see the dictionary for KOMP is reasonable to think this field is populated (thanks to copy rules) with the value of the billing document ID (ie: VBRK-VBELN).

Regards

Eduardo

former_member182378
Active Contributor
0 Kudos

Eduardo,

What I understand from your post is that during the creation of a return order (that means, at the moment no return order number is generated), when creating with reference to the billing document -

the return order "contains" the reference billing document number (VBRK-VBELN).

This can be made use to distinguish whether a return order is created with or without reference.

This inturn can be used to determine whether the routine (alt cal type) should be triggered or not.

Thank you!

Extra comment - Your input as a techno-functional is value adding!

mahendra_jani3
Contributor
0 Kudos

Hi Veer,

I can see a lot of helpful answers about your issue.

Just add one more point, I was facing a similar issue earlier where I had updated all the conditions correctly but still while Copying system was ignoring the requirement Code.

In Addition to update of KOMP-VGBEL and Return Order Type checking, you ensure that you are updating logic in KOBEV form of Routine in requirement.

It happens that while copying details from Reference Invoice, if your Pricing type is D then system ignores the Requirement written if it is at KOBED form.

Hope this will be helpful.

Regards,

MJ.

Lakshmipathi
Active Contributor
0 Kudos

We have created alternative calculation type routine for reading scales

Since this routine is not a standard, you can very well add a coding to validate the return document type not to consider.  Take the help of your technical team.

G. Lakshmipathi


former_member182378
Active Contributor
0 Kudos

G Lakshmipathi,

The requirement is not to exclude some sales document types (returns)!

The requirement is to exclude returns document types ONLY if the return order is created with reference to a billing document.

If the same returns document type is used to create a return order without reference the routine should be triggered.

Added: by reading the original post, I understood the requirement and replied to your post. When I scroll down, the OP has said the exact same thing     

Message was edited by: TW Typewriter - comment added in blue

Former Member
0 Kudos

dear Ayyagari,

  I think u can use copy control from billing document to order document.

   In this step, there resver by SAP to define pricing type 'G' can be used in ur scenario.

   'G' mean: copy pricing elements urchanged and redetermine taxes.

  also , u can reference F1 help below item, to ensure which condition type will be redetermine

  G: Copy pricing elements unchanged and redetermine taxes. The system

  • redetermines the following condition types:
  • taxes (condition class D)
  • Rebate (condition class C)
  • Intercompany billing conditions (condition category I)
  • Invoice list conditions (condition category R)
  • Condition types with condition category L
  • Cost conditions (condition category G)
  • Cash discount conditions (condition category E)
  • all other condition types are treated as for pricing type

   wish helpful to u.

   Regards.