Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FB ISU_S_MANUBILL_CREATE - samplecode

Former Member
0 Likes
1,166

Has anyone experience with fb ISU_S_MANUBILL_CREATE? Although a read SAP-note 148198, it would be easier to have an example-coding.

Thanks

Johann Grünwald

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
586

Hi Johann,

I hope following piece of pseudo code will give you idea how to use this FM.

We need to create following structure before they are passed to FM.

  • Populate ERCH structure

wa_erch-hvorg = '0300'.

wa_erch-mandt = sy-mandt.

wa_erch-vertrag = gv_vertrag.

wa_erch-gpartner = gv_gpart.

wa_erch-vkont = gv_vkonto.

wa_erch-bukrs = gv_bukrs.

wa_erch-sparte = gv_sparte.

wa_erch-kofiz = gv_kofiz.

wa_erch-portion = gv_ableinh.

wa_erch-begabrpe = gvvalid_from.

wa_erch-endabrpe = gvvalid_to.

wa_erch-abrvorg = '06'.

wa_erch-belegart = 'MN'.

wa_erch-ktoklasse = '0001'.

wa_erch-belegdat = sy-datum.

wa_erch-manbillrel = 'X'.

  • This is line item data for each charge type

  • So you need to populate one internal table record for

  • each charge type

  • Populate I_ERCHZ data.

wa_erchz-belzeile = gv_data-belzeile.

wa_erchz-stattart = gv_tarifart.

wa_erchz-tariftyp = gv_tariftyp.

wa_erchz-tarifnr = gv_tarifnr.

wa_erchz-aklasse = gv_aklasse.

wa_erchz-kondigr = space.

wa_erchz-i_abrmenge = gv_abrmenge.

wa_erchz-artmenge = gv_artmenge.

wa_erchz-mass1 = gv_unit.

wa_erchz-mass2 = gv_unit.

wa_erchz-mass3 = gv_unit.

wa_erchz-mass4 = gv_unit.

wa_erchz-mass5 = gv_unit.

wa_erchz-mass6 = gv_unit.

wa_erchz-massbill = gv_unit.

wa_erchz-ab = gv_ab.

wa_erchz-bis = gv_bis.

wa_erchz-zeitant =

( wa_erchz-bis - wa_erchz-ab ) + 1.

wa_erchz-timecontrl = '00'.

wa_erchz-tvorg = gv_tvorg.

wa_erchz-linesort = '0002'.

wa_erchz-belzart = gv_belzart.

wa_erchz-preistyp = '1'.

wa_erchz-mwskz = space.

wa_erchz-preis = 'UNIT-PR-IC'.

wa_erchz-preisbtr = gv_preisbtr.

wa_erchz-mngbasis = '1.00'.

wa_erchz-nettobtr = gv_nettobtr.

wa_erchz-twaers = 'GBP'.

wa_erchz-buchrel = 'X'.

wa_erchz-mengestrel = 'X'.

wa_erchz-printrel = 'X'.

wa_erchz-betrstrel = 'X'.

*- use this ZFM to get tax code for Man billing

CALL FUNCTION 'ISU_TAX_CODE_FOR_MANUBILLING'

wa_erchz-mwskz = wa_mwskz-mwskz.

wa_erchz-ermwskz = wa_mwskz-mwskz.

*----


*- Append the data to internal table before passing to FM

*- ISU_S_MANUBILL_CREATE

gv_bdoc-erch = wa_erch.

gv_bdoc-ierchz = git_ierchz.

  • Append the data to structure lit_auto

gv_auto-bill_doc = gv_bdoc.

gv_auto-bill_doc_use = 'X'.

CALL FUNCTION 'ISU_S_MANUBILL_CREATE'

EXPORTING

x_vertrag = gv_vertrag

x_stichtag = wa_leg-key_date

x_bukrs = gv_bukrs

x_sparte = gv_sparte

x_upd_online = 'X'

x_no_dialog = 'X'

x_auto = gv_auto

IMPORTING

y_new_bill_doc = gv_bill_doc

EXCEPTIONS

foreign_lock = 1

input_error = 2

general_fault = 3

OTHERS = 4.

3 REPLIES 3
Read only

Former Member
0 Likes
587

Hi Johann,

I hope following piece of pseudo code will give you idea how to use this FM.

We need to create following structure before they are passed to FM.

  • Populate ERCH structure

wa_erch-hvorg = '0300'.

wa_erch-mandt = sy-mandt.

wa_erch-vertrag = gv_vertrag.

wa_erch-gpartner = gv_gpart.

wa_erch-vkont = gv_vkonto.

wa_erch-bukrs = gv_bukrs.

wa_erch-sparte = gv_sparte.

wa_erch-kofiz = gv_kofiz.

wa_erch-portion = gv_ableinh.

wa_erch-begabrpe = gvvalid_from.

wa_erch-endabrpe = gvvalid_to.

wa_erch-abrvorg = '06'.

wa_erch-belegart = 'MN'.

wa_erch-ktoklasse = '0001'.

wa_erch-belegdat = sy-datum.

wa_erch-manbillrel = 'X'.

  • This is line item data for each charge type

  • So you need to populate one internal table record for

  • each charge type

  • Populate I_ERCHZ data.

wa_erchz-belzeile = gv_data-belzeile.

wa_erchz-stattart = gv_tarifart.

wa_erchz-tariftyp = gv_tariftyp.

wa_erchz-tarifnr = gv_tarifnr.

wa_erchz-aklasse = gv_aklasse.

wa_erchz-kondigr = space.

wa_erchz-i_abrmenge = gv_abrmenge.

wa_erchz-artmenge = gv_artmenge.

wa_erchz-mass1 = gv_unit.

wa_erchz-mass2 = gv_unit.

wa_erchz-mass3 = gv_unit.

wa_erchz-mass4 = gv_unit.

wa_erchz-mass5 = gv_unit.

wa_erchz-mass6 = gv_unit.

wa_erchz-massbill = gv_unit.

wa_erchz-ab = gv_ab.

wa_erchz-bis = gv_bis.

wa_erchz-zeitant =

( wa_erchz-bis - wa_erchz-ab ) + 1.

wa_erchz-timecontrl = '00'.

wa_erchz-tvorg = gv_tvorg.

wa_erchz-linesort = '0002'.

wa_erchz-belzart = gv_belzart.

wa_erchz-preistyp = '1'.

wa_erchz-mwskz = space.

wa_erchz-preis = 'UNIT-PR-IC'.

wa_erchz-preisbtr = gv_preisbtr.

wa_erchz-mngbasis = '1.00'.

wa_erchz-nettobtr = gv_nettobtr.

wa_erchz-twaers = 'GBP'.

wa_erchz-buchrel = 'X'.

wa_erchz-mengestrel = 'X'.

wa_erchz-printrel = 'X'.

wa_erchz-betrstrel = 'X'.

*- use this ZFM to get tax code for Man billing

CALL FUNCTION 'ISU_TAX_CODE_FOR_MANUBILLING'

wa_erchz-mwskz = wa_mwskz-mwskz.

wa_erchz-ermwskz = wa_mwskz-mwskz.

*----


*- Append the data to internal table before passing to FM

*- ISU_S_MANUBILL_CREATE

gv_bdoc-erch = wa_erch.

gv_bdoc-ierchz = git_ierchz.

  • Append the data to structure lit_auto

gv_auto-bill_doc = gv_bdoc.

gv_auto-bill_doc_use = 'X'.

CALL FUNCTION 'ISU_S_MANUBILL_CREATE'

EXPORTING

x_vertrag = gv_vertrag

x_stichtag = wa_leg-key_date

x_bukrs = gv_bukrs

x_sparte = gv_sparte

x_upd_online = 'X'

x_no_dialog = 'X'

x_auto = gv_auto

IMPORTING

y_new_bill_doc = gv_bill_doc

EXCEPTIONS

foreign_lock = 1

input_error = 2

general_fault = 3

OTHERS = 4.

Read only

0 Likes
586

Hi Sunil,

thank you for your help. I will try your code on Monday (and then reward points of course)

Johann

Read only

0 Likes
586

Hello,

Please, can you help me with this FM ?

I wanna know if instead of use BILLDOC structure (erch + ierchz) Can I only use the REA16 structure?

I wanna know it because I need to use some parameters like MENGE, ABRFAKT that is not found in IERCHZ.

Thanks a lot!

Fábio

mail: fabio.tedrus@gmail.com