Application Development 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: 

Bapi or function to simulate billing plan

Former Member
0 Kudos

Hi,

I need to use a function module or a bapi to simulate (but no create) billing plan in the contract items. (VA42)

I know this function module : BILL_SCHED_GENER_UNTIL_HORIZON.

But even if i fill the different structures, i don't have any datas in the output tables.

Do you know another "moreeasy to use" function or bapi to simulate billing plan ?

I know this one : BILLING_SCHEDULE_GENERATE but it's harder to use it.

Thanks

5 REPLIES 5

Former Member
0 Kudos

Is anybody knows how to use this function module ?

0 Kudos

Hi,

I progressed with the use of this function module.

I will try to explain how i used it and maybe someone could tell me if 'im wrong somwhere.

So i select a document in VBAK. I also get the corresponding datas in VBAP, VBPA, VEDA, VBKD, FPLA and FPLT.

I forced the field endat of FPLA at 2009/12/31 and the billing plan of this document is generated until 2008/12/31.

So, what i expect is to generate the missing datas in the internal table FPLT (i first only have datas until 2008/12/31 and would like to generate billing plan until 2009/12/31)

I get the KOMK and KOMP data with this FM :

CLEAR : s_komk, s_komp.

CALL FUNCTION 'SPR_KOMK_KOMP_FILL'

EXPORTING

pi_i_spr = s_pispr (Get with MF PISPR_FILL)

IMPORTING

pe_i_komk = s_komk

pe_i_komp = s_komp

EXCEPTIONS

org_structure_not_completed = 1

OTHERS = 2.

I filled the VEDA_HEADER strcture with FM :

CALL FUNCTION 'SD_VEDA_SELECT'

EXPORTING

i_document_number = veda-vbeln

i_item_number = veda-vposn

i_trtyp = 'A'

IMPORTING

e_vedavb = s_veda_header.

MOVE s_veda_header TO s_veda_header2.

CLEAR s_veda_header2-vposn.

I filled the internal tables fpla and fplt with this FM :

REFRESH : t_fpla_old, t_fpla_new, t_fplt_old, t_fplt_new.

CALL FUNCTION 'BILLING_SCHEDULE_READ'

EXPORTING

fplnr = s_vbkd-fplnr

TABLES

zfpla = t_fpla_old

zfplt = t_fplt_old.

So, here are the values passed to the function module :

CALL FUNCTION 'BILL_SCHED_GENER_UNTIL_HORIZON'

EXPORTING

i_fplnr = vbkd-fplnr

i_waers = vbak-waerk

i_komk = s_komk

i_komp = s_komp

i_kompax = kompax

i_fkrel = 'I'

i_absagen = 'D'

i_kfplan = ''

i_veda = s_veda_header

i_veda_kopf = s_veda_header2

IMPORTING

e_kompax = kompax

TABLES

fpla_new = t_fpla_new

fpla_old = t_fpla_old

fplt_new = t_fplt_new

fplt_old = t_fplt_old.

So, i have the correct generated lines in t_fplt_new, until 2009/12/31, but i dont' have any amount in netpr field, for all lines, even the first ones that had amount in t_fplt_old.

So if anybody knows if i forgot something or if i'm wrong somewhere, please tell me. Maybe it's not the good way to simulate billing plan.

Thanks

Ps : if you need more details or if i'm not clear, tell me.

0 Kudos

I can't find examples and i tried to pass different values ton the function module, but i already have the same problem.

It's important for me to simulate the creation of the dates in the billing plan and i don't know how to do.

In VA42 it's simple, i just have to put a new date in the future for the billing plan header and when i go to the billing plan for Item, the new lines with amount are generated.

But i can't do the same thing using this function module (BILL_SCHED_GENER_UNTIL_HORIZON). I tried to understand how the standart program do it but there's many thousand of lines.

I don't think i'm the first who want to do this thing but i can't find any other informations.

Please help me if you know a way to simulate these lines.

Thanks in advance

Former Member
0 Kudos

Hi Olivier,

Even i have same issue (how to use BILLING_SCHEDULE_GENERATE). Can you tell me what you have done to resolve this.

Thanks and Regards,

Gautham

0 Kudos

HI ,
I m even looking for a solution to update Bill plan using some BAPI / FM .
Can you tell me if you got the solution .

Manish