Friday, December 8, 2017

Sales Order Item Billing Plan Change

A while ago I wrote a code that used BAPI_CUSTOMERCONTRACT_CHANGE to fill acceptance date in contract data tab of sales order item.

The challenge was that once BAPI_SALESORDER_CHANGE is found to not support contract data changes, one would be tempted to use any suggestion given by web search. For e.g calling update FM which is almost like updating the db table itself.

Question is how one to come to use BAPI_CUSTOMERCONTRACT_CHANGE by old fashion investigation instead of web search. Since VEDA table has acceptance date with data element VADAT_VEDA, a where used search for BAPI* structure gave a hit. Next where used showed FMs, more importantly the ones starting with BAPI* that may do what I needed. Since system was configured to create billing plan with start date same as contract acceptance date, I was indirectly able to create billing plan of sales order item.

Today I had to fill end date of existing billing plans. No rule was configured that would transfer the date from contract data tab to billing plan tab. Since BAPI_CUSTOMERCONTRACT_CHANGE was ruled out and where-used searched did not return a BAPI* FM, web search led me to copy code of standard report SDFPLA02. I feel this approach is better than using FM BILLING_SCHEDULE_SAVE.

Reference: https://archive.sap.com/discussions/thread/188338

No comments: