Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to overcome overlap of validity dates when uploading pricing conditions

Former Member
0 Kudos

I am using the bapi 'BAPI_PRICES_CONDITIONS' to upload pricing conditions. However if I have a pricing condition created previously in the system and I want to update the validity period and the data I provide has overlapping validity periods it results in an error. The program does not error out and it updates the database tables however if I want to view the condition via VK13 it ends in a hard error by the system due to the overlap of the validity periods. Is there a way to overcome this issue? How can I update the validity to period for the old record or deactivate the old record from my abap program?

7 REPLIES 7

Former Member
0 Kudos

Hi Pallavi

This is the standard behaviour of condition records. It happens the same way even when you use the transaction VK11 to create a new condition record and not because of the FM we are using. In the standard transaction it prompts the warning message saying the validity dates overlap.

If the requirement is not to create overlapping condition records, then you might need to read if any condition record exists for the combination and check the validity period.

Kind Regards

Eswar

Former Member
0 Kudos

No that is not how it works via VK11. When I create a record that overlaps then it goes and updates the previous record to end the validity to period to be a one day less than the valid from period of the new record.

For eg.

Valid-to old is 01/01/2008 to 12/31/9999

and I create a new record for 02/01/2008 to 12/31/9999

It will create the new record and update the old record to be 01/01/2008 to 01/31/2008

However when working with the BAPI the old record is not updated and if I read the table and determine the condition record for the old one to be updated it still does not change the old record.

Former Member
0 Kudos

I have found that I cannot use BAPI_PRICES_CONDITIONS to upload price conditions. I thought to update this on the forum so anybody using this BAPI is aware of what they are getting into!

Below info is from SAP

The function module BAPI_PRICES_CONDITIONS is an unreleased function

module. This means, it is an SAP internally used function module

and should not be called in any customer developments. Even the name

of the function module starts with BAPI, that doesn't mean that you

can use it for your own purposes. Only the interfaces mentiones in the

BAPI Explorer (Transaction BAPI) are official BAPI's.

If you call the function module within your customer developments,

please be aware that this can cause seriour problems (e.g. data

inconsistences). The function module has only been tested by SAP

in a special context. Using the function module in another context

is very dangerous and you will be responsible for any problems or

data inconsistencies. Please don't use it !

For further related

information please see notes 48204 and 83020.

0 Kudos

Dear Pallavi,

I am facing similar problem which was mentioned in the Thread. I am using same BAPI for updating constion records.

Finally you concluded that BAPI does not support Zprograms.

But , how you desiged program for geting solutuion for this reruirement.

Kindly revert back ASAP.

it is very urgent.

Thanks in advance Pallavi,

regards,

Bhaskar

Former Member
0 Kudos

Hi Pallavi,

I m facing the same problem what you have faced...can you tell me how u have overcome this problem..

I m very much thanqful to you if u help me out in this...

- Raj

0 Kudos

Hi,

I also faced the same problem, then I have done the BDC for creating the condition record by getting Condition type and Condition table name from selection screen as the standard transaction creates the correct one.

There are other way that find the last record from the condition table and update the record using the BAPI BAPI_PRICES_CONDITIONS by passing the previous date of the current date given and again call the same bapi by passing the new dates.

Regards,

SivaPrakasam.S

0 Kudos

Hi siva,

i have done the BDC for VK11 but here the problem i m facing is am unable to record the overlap screen.

when i m saving the record in shdb ,automatically the record is getting updated with out appering any overlapping screen..but when i do manually i,e with out recording i can see the overlapping screen.can u please help me in this its an urgent for me..

Raj