cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Billing plan and Billing date needs to be updated in sales order

former_member185462
Active Participant
0 Likes
4,140

billing.jpgHello,

I am using periodic billing plan.

We have requirement to create sales order through excel upload.

As standard sales order create bapi does not support billing plan.

I am using the program SDFPLA02 to update the start and end date, so that the schedule gets updated.

But there is a possibility that user can choose billing period either 50 or 51.But by default it chooses 50,if the billing period from excel is 51,i dont know how to update it. I used FM:SD_SALES_BILLINGPLAN_CHANGE it is not working.

I need to change billing type for last schedule.

How can i achieve updating Billing period and Billing type

Can you please provide me a suitable BAPI/Program through which i can achieved?

Do we need to go with BDC option?

Thanks

Accepted Solutions (0)

Answers (4)

Answers (4)

Kartehiik
Explorer
0 Likes

Execute the below code in include RV60FUS4 for user exit call.

FORM USEREXIT_FIELD_MODIFICATION.
* For Date Determination Rule: 'ZD'-Quarterly (on First of Next Month)
* Update the billing date to 1st day of second month of the Quarter
* for selected line item in a Contract.

* Data Declaration
DATA: lv_mon TYPE i,
lv_day TYPE i.

READ TABLE xfpla TRANSPORTING NO FIELDS WITH KEY perio = 'ZD'.
IF sy-subrc IS INITIAL.
IF xfpla-bedar IS NOT INITIAL AND xfpla-endar IS NOT INITIAL.
CLEAR: xfpla-bedar, xfpla-endar.
ENDIF.
LOOP AT xfplt ASSIGNING FIELD-SYMBOL(<fs_fplt>).
IF <fs_fplt> IS ASSIGNED.
lv_mon = <fs_fplt>-nfdat+4(2).
lv_day = <fs_fplt>-afdat+6(2).
lv_mon = lv_mon - 1.
IF lv_mon = 00 OR lv_mon IS INITIAL.
lv_mon = 12.
ENDIF.
<fs_fplt>-afdat+4(2) = lv_mon.
IF lv_day GT 01.
lv_day = 01.
ENDIF.
<fs_fplt>-afdat+6(2) = lv_day.
ENDIF.
ENDLOOP.
ENDIF.

ENDFORM. " USEREXIT_FIELD_MODIFICATION

former_member185462
Active Participant
0 Likes

Yes we can have two billing type. It can be achieved by standard.

A billing plan can be assigned to multiple billing type.OVBJ transaction.

But while order is created with billing, first billing type will be called by default.

I used BILLING_SCHEDULE_SAVE to change billing period as system default from configuration is fetching 50,so through this BAPI i changed period.

Latter used program-SDFPLA02 to update start date and end date. Billing schedule got determined in order.

Then again i used BILLING_SCHEDULE_SAVE to change billing type in the last schedule.

So in a net shell we need to create order through BAPI_SALESORDER_CREATEFROMDAT2(supports document category C),then use BILLING_SCHEDULE_SAVE,SDFPLA02 and finally BILLING_SCHEDULE_SAVE

Lakshmipathi
SAP Champion
SAP Champion
0 Likes

With the standard configuration, it is not possible to have two billing types in one Billing Plan. You need to go for an enhancement

Lakshmipathi
SAP Champion
SAP Champion
0 Likes

For Billing Plan dates, you can try with BAPI_BILLINGPLAN_CREATE but it is not clear as to why you want to change the billing type also which is not possible I believe

former_member185462
Active Participant
0 Likes

seperate form is used in final billing type where it will have details of each instalment bill value and final break up value,it was adopted by implementation partner and now client want to automate it,that is why I am trying to update it through bapi