cancel
Showing results for 
Search instead for 
Did you mean: 

Periodic Billing Plan - Issue with settlement value

praburam_suresh
Explorer
0 Kudos

Dear All,

I have configured the Billing plan for a Sales order where as everything worked at item level except the value changes as per the settlement end date.

And also configured the Rule table for Date Determination:

The same has been assigned to Item category and now I could able to get billing plan in Item level of Sales order:

Now my client requirement is to end the sales order billing. In between the month for eg: 20.08.2014 as show below. However the value remains same:

Kindly help me with fixing this issue. Thanks in Advance.

Kind Regards,

S. Praburam

Accepted Solutions (1)

Accepted Solutions (1)

rahul_vishwakarma2
Contributor
0 Kudos

Hi Friend,

For this you can ask them to do it manually or by using Function module you can achieve this.

The following code will be like this:

1) Split first line billing up to (cancellation date – 1);

*      change billing date to cancellation date (cancellation date – 1).

    LOOP AT fplt_new.

      IF cancel_date GE fplt_new-nfdat  AND cancel_date LE  fplt_new-fkdat.

        IF fplt_new-fksaf EQ 'C'.

          lv_flagstc = 'X'.

        ELSE.

          if fplt_new-fkdat eq cancel_date.

            lv_mnthend = 'X'.

          endif.

          lv_todate      = fplt_new-fkdat.

          lv_nfdat       = fplt_new-nfdat.

          fplt_new-fkdat = cancel_date.

          lv_cnvdate = fplt_new-fkdat.

          lv_fkdat = fplt_new-fkdat.

          fplt_new-afdat = fplt_new-fkdat.

          fplt_new-teman = 'X'.

          fplt_new-updkz = 'U'.

          lv_daydiff = fplt_new-fkdat+6(2) - fplt_new-nfdat+6(2) + 1.

          fplt_new-fakwr = lv_mulfact * lv_daydiff.

          fplt_new-netwr = fplt_new-fakwr.

          CLEAR lv_daydiff.

          MODIFY fplt_new.

          CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

            EXPORTING

              date      = cancel_date

              days      = lv_addday "1

              months    = lv_addmnt

              signum    = '+'               " 11 feb 2014

              years     = lv_addyer

            IMPORTING

              calc_date = fplt_new-nfdat.

          fplt_new-fkdat =  lv_todate.

          CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'

            EXPORTING

              day_in            = fplt_new-nfdat

            IMPORTING

              last_day_of_month = fplt_new-afdat

            EXCEPTIONS

              day_in_no_date    = 1

              OTHERS            = 2.

          fplt_new-updkz = 'I'.

          lv_daydiff = fplt_new-fkdat+6(2) - fplt_new-nfdat+6(2) + 1.

          fplt_new-fakwr = lv_mulfact * lv_daydiff.

********

          fplt_new-fpltr = lv_fpltr + 1.

********

          fplt_new-netwr = fplt_new-fakwr.

          lv_fpltr = fplt_new-fpltr.

          IF ( lv_edate NE cancel_date and lv_mnthend ne 'X' ).

            APPEND fplt_new.

          ENDIF.

          clear: lv_mnthend.

          EXIT.

        ENDIF.

*        elseif fplt_new-afdat lt cancel_date.

      ENDIF.

    ENDLOOP.

    SORT fplt_new BY nfdat.

You can take the help your developer guy for this. Hope this will help you .

Regards,

Kundan

praburam_suresh
Explorer
0 Kudos

Thanks for the reply sir, Do we need to setup a field for Cancellation date. Because in Sales order we do not have any start date / End date / Cancellation date fields.

Answers (1)

Answers (1)

rahul_vishwakarma2
Contributor
0 Kudos

Hi Friend,

We don't required to do any kind of setup for the cancellation date for this. Just use above coding with the help of your technical guy. It will solve your issue.

Regards,

Kundan