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: 

Function module ISU_S_MANUBILL_CREATE

ankit_munshi2
Participant
0 Kudos

hello,

I know this question has been asked several times but noone of the existing posts answers this question correctly. I am trying to create and relaease a manual bill in ISU (EA16). I am using Fm ISU_S_MANUBILL_CREATE to post the bill, but the bill is not getting created.

I am passing x_auto-bill_doc-erch and x_auto-bill_doc-erchz entries correctly (atleast I think so).

Any pointers ?

Here's the pseudo code:

xs_auto-bill_doc_use = abap_true.
xs_auto-bill_doc_done = abap_true.
xs_auto-bill_doc_okcode = 'SAVE'.

xs_auto-bill_doc-erch-bukrs = ls_ever-bukrs.
xs_auto-bill_doc-erch-sparte = ls_ever-sparte.
xs_auto-bill_doc-erch-gpartner = p_gpart.
xs_auto-bill_doc-erch-vkont = ls_ever-vkonto.
xs_auto-bill_doc-erch-vertrag = ls_ever-vertrag.
xs_auto-bill_doc-erch-begabrpe = p_date.
xs_auto-bill_doc-erch-endabrpe = p_date.
xs_auto-bill_doc-erch-belegdat = sy-datum.
xs_auto-bill_doc-erch-abrvorg = '06'.
xs_auto-bill_doc-erch-hvorg = '0300'.
xs_auto-bill_doc-erch-mandt = sy-mandt.
xs_auto-bill_doc-erch-kofiz = ls_ever-kofiz.
xs_auto-bill_doc-erch-portion = 'QJ03'.
xs_auto-bill_doc-erch-belegart = 'MB'.
xs_auto-bill_doc-erch-bergrund = '2'.
xs_auto-bill_doc-erch-eroetim = sy-uzeit.
xs_auto-bill_doc-erch-erchz_v = abap_true.
xs_auto-bill_doc-erch-erdat = sy-datum.
xs_auto-bill_doc-erch-ernam = sy-uname.
xs_auto-bill_doc-erch-zuorddaa = xs_auto-bill_doc-erch-endabrpe.
xs_auto-bill_doc-erch-billing_period = '2018/01'.
xs_auto-bill_doc-erch-billing_period = '0001'.
xs_auto-bill_doc-erch-manbillrel = abap_true.----

----------------------------------------------

ls_erchz-stattart = p_tarif.
ls_erchz-tarifnr = ls_ertfnd-tarifnr.
ls_erchz-belzeile = '0001'.
ls_erchz-csno = ls_eschs-sno.
ls_erchz-aklasse = ls_eanlh-aklasse.
ls_erchz-tvorg = ls_etrfv-s_tvorg.
ls_erchz-gegen_tvorg = ls_etrfv-h_tvorg.
ls_erchz-tax_tvorg = ls_etrfv-s_tvorg.
ls_erchz-belzart = XXXXX
ls_erchz-buchrel = abap_true.
ls_erchz-printrel = abap_true.
ls_erchz-linesort = ls_eschs-linesort1.
ls_erchz-ab = xs_auto-bill_doc-erch-begabrpe.
ls_erchz-bis = xs_auto-bill_doc-erch-endabrpe.
ls_erchz-i_abrmenge = '50'.
* ls_erchz-massbill =
ls_erchz-nettobtr = '111'.
ls_erchz-kostl = ls_ever-kostl.
ls_erchz-zeitant = '30'.
ls_erchz-mwskz = space.
ls_erchz-kondigr = space.

ls_erchz-mwskz = 'Z0'.
ls_erchz-ermwskz = 'Z0'.

ls_erchz-timtypza = '2'.
ls_erchz-mengestrel = ls_eschs-betrstrel.
ls_erchz-betrstrel = ls_eschs-betrstrel.
ls_erchz-stgramt = ls_eschs-stgramt.
ls_erchz-stgrqnt = ls_eschs-stgrqnt.
ls_erchz-sno = ls_eschs-sno.
ls_erchz-programm = ls_etrfv-programm.
ls_erchz-pertyp = 'NO'.
ls_erchz-twaers = XXX

******************************************************


APPEND ls_erchz TO lt_erchz.

xs_auto-rea16-tariftyp = XXXX
xs_auto-bill_doc-ierchz[] = lt_erchz[].
******************************************************
ls_obj-bill_doc-erch-vertrag = p_vertrg.
ls_obj-bill_doc-erch-belegart = XX

CALL FUNCTION 'ISU_S_MANUBILL_CREATE'
EXPORTING
x_vertrag = p_vertrg
x_stichtag = sy-datum
x_bukrs = ls_ever-bukrs
x_sparte = ls_ever-sparte
* X_PROPRICE =
* X_VBELNR =
* X_N_INVSEP =
* X_CANCEL =
* X_TRANSFER =
* X_UPD_ONLINE =
X_OBJ = ls_obj
* X_DATA =
* X_NO_DIALOG =
x_auto = xs_auto
IMPORTING
y_db_update = lv_update
* Y_EXIT_TYPE =
* Y_NEW_BILL_DOC =
* Y_MSGID =
* Y_MSGNO =
EXCEPTIONS
foreign_lock = 1
input_error = 2
general_fault = 3
bill_lock = 4
OTHERS = 5.
IF sy-subrc EQ 0.
COMMIT WORK.
ENDIF.

Thanks!

AM

1 ACCEPTED SOLUTION

katrin_frenzel
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Ankit,

Do you get any error message when trying to create a manual billing document over the above coding?
Have you already checked that all the data are passed into FM ISU_S_MANUBILL_CREATE (in debugger)?
Have you already tried out to set X_UPD_ONLINE and / or X_NO_DIALOG to 'X'?
May be BOR object BILLDOCMAN is helpful to get an idea how the data need to be filled.

Best regards,
Katrin Frenzel

View solution in original post

2 REPLIES 2

katrin_frenzel
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Ankit,

Do you get any error message when trying to create a manual billing document over the above coding?
Have you already checked that all the data are passed into FM ISU_S_MANUBILL_CREATE (in debugger)?
Have you already tried out to set X_UPD_ONLINE and / or X_NO_DIALOG to 'X'?
May be BOR object BILLDOCMAN is helpful to get an idea how the data need to be filled.

Best regards,
Katrin Frenzel

0 Kudos

This problem was resolved. I had to call the function module in background mode to enable it to work correctly. Thanks for your help anyways!