2009 Nov 24 4:10 PM
Hi Guys,
I am using the FM: BAPI_PRICES_CONDITIONS to create / change conditions. The following conditions exist:
KOND_1
valid from: 01.06.2010
Valid to : 30.06.2010
KOND_2
valid from: 01.07.2010
Valid to : 31.12.2010
New condition to be created is
KOND_3
valid from: 06.06.2010
Valid to : 15.07.2010
To do this I have changed the old cond. and created new cond. as follows:
KOND_1
valid from: 01.06.2010
Valid to : 05.06.2010
KOND_2
valid from: 16.07.2010
Valid to : 31.12.2010
New condition to be created is
KOND_3
valid from: 06.06.2010
Valid to : 15.07.2010
This works fine and the entries in DB KONH and KONP are OK. Now the funny thing is that the database A006 still contains the old cond. and there is overlapping. So this give an error if I try ti vew using sap code vk13:
Internal error: T IVAKE F IVAKE_INSERT I MV130F0I
Message no. VK067
This is because of the ovelapp in the valid period in database A006
KOND_1
valid from: 01.06.2010
Valid to : 05.06.2010
KOND_1
valid from: 01.06.2010
Valid to : 30.06.2010
Question.
How can I get this solved using the bapi. OK, the work around would be to make a delete SQL statement where KNUMH = 'old cond Nr.' and then create the new cond. with new valid period accordingly, But I would like to use the bapi.
Please help.
Yours,
Blacky.
Hi Guys,
I am using the FM: BAPI_PRICES_CONDITIONS to create / change conditions. The following conditions exist:
KOND_1
valid from: 01.06.2010
Valid to : 30.06.2010
KOND_2
valid from: 01.07.2010
Valid to : 31.12.2010
New condition to be created is
KOND_3
valid from: 06.06.2010
Valid to : 15.07.2010
To do this I have changed the old cond. and created new cond. as follows:
KOND_1
valid from: 01.06.2010
Valid to : 05.06.2010
KOND_2
valid from: 16.07.2010
Valid to : 31.12.2010
New condition to be created is
KOND_3
valid from: 06.06.2010
Valid to : 15.07.2010
This works fine and the entries in DB KONH and KONP are OK. Now the funny thing is that the database A006 still contains the old cond. and there is overlapping. So this give an error if I try ti vew using sap code vk13:
Internal error: T IVAKE F IVAKE_INSERT I MV130F0I
Message no. VK067
This is because of the ovelapp in the valid period in database A006
KOND_1
valid from: 01.06.2010
Valid to : 05.06.2010
KOND_1
valid from: 01.06.2010
Valid to : 30.06.2010
Question.
How can I get this solved using the bapi. OK, the work around would be to make a delete SQL statement where KNUMH = 'old cond Nr.' and then create the new cond. with new valid period accordingly, But I would like to use the bapi.
Please help.
Yours,
Blacky.
2009 Nov 24 4:21 PM
The conditions will be exist physically even if you delete them but the deletion indicator will be set to the conditions that are marked for deletion.
Are you using commit work (just to remind you) after the BAPI? What is the error you are are getting after BAPI run?
EDITED:
One more, you cannot have 2 active conditions for same period. So you need to deactivate/Delete or change the validity period before the next condition period active.
Edited by: Sampath Kumar on Nov 24, 2009 9:21 AM
2009 Nov 24 9:32 PM
Hi Sampath,
Yes, I have used commit work and I did not get any error message from bapi. I also change the period of the old condition before craeting the new. This is all OK in KONH and KONP. The problem is that the old condition is not deleted in Database A006.
Any ideas or simple coding?
Ys,
Blacky
2009 Nov 25 3:22 AM
it will not be deleted from database but the deletion indicator will be set in tables which means they are not accessible for anything.
So make sure that the deletion indicator is set or not in konp.
I think the field is lv**** some i forgot and i dont have system now.
let me know if you dont find it
2009 Nov 25 7:41 PM
Hi Sampath.
Thanks, Yes I know this and I have set the deletion flag. I have also solved the problem with this logic.
Step 1.
I deleted the old price condition.
Bapi
import parameter
PI_PHYSICAL_DELETION = 'X'
Structure
BAPICONDIT-INDIDELETE = 'X'
Step 2.
With the data structure of the old condition (still within the loop over KONP structure), I changed the valid period accordingly.
Step 3.
I then created a new price condition still using the old price but CHANGED valid period (updated in consideration of the new price condition to be created)
Step 4.
Lastly, I then created new price condition with new period.
This is how It worked.
Thanks and I have given points.
Blacky.
2012 Apr 24 2:21 PM
Hi SAP-Specialists,
sorry, for warming up this very old thread, but i have sleepless nights about the same problem
HOW CAN I DELETE Entries from table A018??
I tried to fill the structures of the BAPI_PRICES_CONDITIONS with the data from KONH / KONP (COND_NO = old KNUMH) with the operation 003 (delete) as descriped in thread from Nov 25, 2009 8:41 PM => Step1.
After this step and the commit work the dataset already exists in A018 table. Any idea what the problem could be?
Many Thanks
Regards
Timo
2012 Apr 25 10:28 AM
2015 Sep 08 3:20 PM
Hi,Timo Stark,
I have the same problem,Could you tell me how did you solve it?
Regards