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: 

Updating custom field bill type in standard table ERCH

Former Member
0 Kudos

Hi All,

I need to update the custom field bill type in table ERCH depending upon the bill transaction( if bill transaction is periodic,bill type will be updated as P and so on for other cases)

I am implementing a BADI ISU_DEF_BILL_PERIOD and i have used case statements(when abrvorg is P,bill type is P). While debugging i saw that the importing parameter bill document is generated but if i enter the same bill document number at that point in time in table ERCH, it shows no entries found. Thus sy-subrc is retrieved as not zero and hence the custom field bill type does not get updated.

I would like to know how do i go about this requirement since it seems that the bill document entry is made in table ERCH outside this BADI.I used x_new_billing_doc-erch-zbill_type = 'P' in the code but it says that it cannot be changed. Any structure which can be used to be filled here?

Thanks,

Shreeraj

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Sheeraj,

You're using a wrong enhancement for your requirement. ISU_DEF_BILL_PERIOD is used to specify billing key date of a billing or print document depending on your requirements,.

SAP provides enhancement EBIA0001 for any custom enhancements to billing document. You can update the custom fields in the billing document before the document is updated.

Best,

Sai

View solution in original post

7 REPLIES 7

Former Member
0 Kudos

Sheeraj,

You're using a wrong enhancement for your requirement. ISU_DEF_BILL_PERIOD is used to specify billing key date of a billing or print document depending on your requirements,.

SAP provides enhancement EBIA0001 for any custom enhancements to billing document. You can update the custom fields in the billing document before the document is updated.

Best,

Sai

0 Kudos

Thanks for your reply,

I am updating the billing key date as well and basically the process is that depending upon the billing transaction(ABRVORG),the billing key date and the custom field bill type in table ERCH is updated.

Also,as per the requirement i have to pass this billing key date to invoice document and update the bill type field in table ERDK.

0 Kudos

I have one more question in relation to this:

I am trying to run manual billing and update the billing key date.I have done the coding inside BADI ISU_DEF_BILL_PERIOD's method SET_BILLING_PERIOD_BILL for the other billing transactions( periodic,interim etc).For other cases it seems fine but for manual billing,i am unable to update the billing key date since during runtime it seems that this method isn't getting called.I am using EA16 to create manual bill,is there any other way to update the billing key date for manual bill?

Thanks,

Shreeraj

0 Kudos

If you have implemented the BADI method set_billing_period_bill rightly, it should update the billing period for manual billing doc as well. Did you put a break point in this method and tried debugging?

0 Kudos

Check if this note 1081632 is implemented.

0 Kudos

Yes,i did try to put the breakpoint but it did not stop.I found that EA16 and the BADI belong to different packages(EE20 and EE21 respectively).

Thanks,

Shreeraj

0 Kudos

Thanks a lot sai,problem is solved now,i used the exit EBIA0001.