2014 Oct 19 8:11 PM
Hi,
I've been trying to use BAPI_CUSTOMERCONTRACT_CHANGE to update an existing contract and the update is to add a new pricing condition - the condition type does not exist already in the header conditions of the contract.
I've seen alot of posts in SCN about BAPI_CUSTOMERCONTRACT_CHANGE and conditions but these all seem to be about updating existing conditions. My BAPI is populated as follows:
Importing parameters:
Tables parameters:
ITM_NUMBER 000000 (left blank as this is the header)
COND_TYPE ZNEW
UPDATEFLAG I
COND_VALUE X
CURRENCY X
When run and a commit is made at the end I get success return messages but the new condition is never added? Can anyone shed some light on this?
I have also tried using the LOGIC_SWITCH parameter COND_HANDL but this seems to be - from what I've read - more for handling updates to conditions.
Thanks in advance!
2014 Oct 20 6:45 PM
Looks like I solved my issue.
It was a case of BAPI_TRANSACTION_COMMIT or a COMMIT WORK not being used.
Actually I testing this via SE37 (Fucntion Builder) and was triggering the commits via the debugger at the end of the BAPI call but it seems they weren't having an effect.
Place the code into a program or add a next function module call to BAPI_TRANSACTION_COMMIT and all works.
2014 Oct 20 12:50 AM
Hi Peter, make sure you have followed the BAPI documentation for the structure CONDITIONS_IN. Have you filled CURRENCY or CURRENCY_ISO ?
- The condition calculation type is not expressed in percentage
In this case the COND_VALUE field is a currency quantity field. You must enter the CURRENCY or CURRENCY_ISO field so that the correct conversion takes place. Again, you must enter the amount kommagerecht.
If neither the CURRENCY or the CURRENCY_ISO fields are completed, the entry is issued as a percentage value. This could lead to an incomplete entry if the condition type is not in percentages.
2014 Oct 20 11:15 AM
Sorry , my typo. I forgot to add that CURRENCY was filled in my Conditions_In table.
So:
Thanks for spotting that.
2014 Oct 20 6:45 PM
Looks like I solved my issue.
It was a case of BAPI_TRANSACTION_COMMIT or a COMMIT WORK not being used.
Actually I testing this via SE37 (Fucntion Builder) and was triggering the commits via the debugger at the end of the BAPI call but it seems they weren't having an effect.
Place the code into a program or add a next function module call to BAPI_TRANSACTION_COMMIT and all works.