SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

How can we create manual bill with negative quantity?

Former Member
0 Kudos

Hi Experts,

I have a requirement, where the user wants to post negative quantity i.e. consumption via manual bill. I tried but SAP doesn't allow posting negative quantity via Manual bill. The situation is for the rectifications happening for the documents/bills which were migrated. We dont have actual billing documents for them but we now want to post rectification bill for those customers via manual bill. Is there a possibility?

Thanks in advance.

3 REPLIES 3

Former Member
0 Kudos

Hi Priyanka,

Yes it is possible, Please find the solution as below. We have implemented the same foe one of our client. Let me know if you have any questions.

  1. 1.  *Generates the Billing Run number

FUNCTION MODULE ISU_NUMBER_GET

  1. 2.  Use function module to simulate the bill

CALL FUNCTION 'ISU_SIMULATION_PERIOD_BILL'
EXPORTING
x_vertrag     
= lv_vertrag
x_begabrpe    
= v_sdate
x_endabrpe    
= v_edate
x_billingrunno
= v_number
x_no_update   
= 'X'
IMPORTING
y_belnr       
= lv_belnr
y_bill_doc    
= ls_bill_doc
y_obj         
= ls_obj
y_sobj        
= ls_sobj
EXCEPTIONS
general_fault 
= 1
OTHERS         = 2.

MOVE ls_bill_doc-ierchz TO t_ierchz.

LOOP AT t_ierchz INTO wa_ierchz.
IF wa_ierchz-buchrel = 'X' OR wa_ierchz-belzart = 'YGBCON'.
MOVE-CORRESPONDING wa_ierchz TO ls_man_ierchz.
IF v_man_type = 'CREDIT'.
CLEAR: lv_tvorg.
lv_tvorg
= ls_man_ierchz-tvorg.
ls_man_ierchz
-tvorg = ls_man_ierchz-gegen_tvorg.
ls_man_ierchz
-tax_tvorg = ls_man_ierchz-gegen_tvorg.
ls_man_ierchz
-gegen_tvorg = lv_tvorg.
IF ls_man_ierchz-buchrel = 'X'.
MULTIPLY ls_man_ierchz-nettobtr BY -1.
MULTIPLY ls_man_ierchz-i_abrmenge BY -1.
ELSE.
MULTIPLY ls_man_ierchz-i_abrmenge BY -1.
ENDIF.
ENDIF.
CLEAR: ls_man_ierchz-belnr.
lv_count
= lv_count + 1.
ls_man_ierchz
-belzeile = lv_count.
ls_man_ierchz
-printrel = 'X'.
ls_man_ierchz
-mngbasis = '1.00'.
APPEND ls_man_ierchz TO t_man_ierchz.
ENDIF.
CLEAR: ls_man_ierchz.
ENDLOOP.

ls_man_doc-erch = ls_man_erch.
ls_man_doc
-ierchz = t_man_ierchz.
ls_auto
-bill_doc = ls_man_doc.
ls_auto
-bill_doc_use = 'X'.

CLEAR : ls_man_doc,ls_man_erch.
REFRESH : t_man_ierchz.

3. Use the following function module to create manual bill doc.   

CALL FUNCTION 'ISU_S_MANUBILL_CREATE'
EXPORTING
x_vertrag     
= lv_vertrag
x_stichtag    
= sy-datum
x_upd_online  
= 'X'
x_no_dialog   
= 'X'
x_auto        
= ls_auto
IMPORTING
y_new_bill_doc
= lwa_new_bill_doc
EXCEPTIONS
foreign_lock  
= 1
input_error   
= 2
general_fault 
= 3
OTHERS         = 4.

ivor_martin
Active Contributor
0 Kudos

Hi Priyanka,

Your IS-U Billing functional resource needs to configure a Rate that outputs a negative amount based on the consumption that you enter in your Manual Bill.

You would have to also configure an Credit Sub-transaction that can be used by the negative amount calculation in the Rate steps configuration.

In the Manual Bill transaction, you would then assign  the configured Rate Category and Rate Type that will trigger your Rate calculation and post a negative amount.

Regards,

Ivor 

former_member230926
Active Participant
0 Kudos

Hi,

If you want to put negative Quantity through EA16 then use below way .

When we put -ve quantity system makes it Zero because of below FM

"ISU_METER_DATA_FORMAT_CHECK"

So write a custome code and just change the value again to -ve at the end of FM "ISU_METER_DATA_FORMAT_CHECK"

change " c_zwstanda" variable to desired consumption value.