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: 

Need help with creating invoice and list of invoices

former_member699400
Active Participant
0 Kudos

Hello everybody,

I need to create Credit / Debit memo invoices and for this I try to use FM GN_INVOICE_CREATE in my Z program, please let me know if it is correct way to go?

As well I need to create list of Credit / Debit memo invoices, how to achieve this?

Thanks in advance.

Usefull answers will be awarded.

Regards, M.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can use RV_INVOICE_CREATE for credit memo and debit memo

list of credit and debit memo - use this FM - RV_INVOICE_LIST_CREATE

see the below sample code

refresh: XKOMFK, XKOMV,

XTHEAD, XVBFS,

XVBPA, XVBRK,

XVBRP, XVBSS.

clear : XKOMFK, XKOMV,

XTHEAD, XVBFS,

XVBPA, XVBRK,

XVBRP, XVBSS,

VBSK_I.

VBSK_I-SMART = 'F'.

XKOMFK-VBELN = v_deliv.

XKOMFK-VBTYP = 'J'.

APPEND XKOMFK.

CALL FUNCTION 'RV_INVOICE_CREATE'

EXPORTING

VBSK_I = VBSK_I

WITH_POSTING = 'C'

TABLES

XKOMFK = XKOMFK

XKOMV = XKOMV

XTHEAD = XTHEAD

XVBFS = XVBFS

XVBPA = XVBPA

XVBRK = XVBRK

XVBRP = XVBRP

XVBSS = XVBSS.

if sy-subrc eq 0.

COMMIT WORK.

flag = 'X'.

else.

message i011 with p_vbeln.

endif.

Reward Points if it is helpful

Thanks

Seshu

3 REPLIES 3

Former Member
0 Kudos

You can use RV_INVOICE_CREATE for credit memo and debit memo

list of credit and debit memo - use this FM - RV_INVOICE_LIST_CREATE

see the below sample code

refresh: XKOMFK, XKOMV,

XTHEAD, XVBFS,

XVBPA, XVBRK,

XVBRP, XVBSS.

clear : XKOMFK, XKOMV,

XTHEAD, XVBFS,

XVBPA, XVBRK,

XVBRP, XVBSS,

VBSK_I.

VBSK_I-SMART = 'F'.

XKOMFK-VBELN = v_deliv.

XKOMFK-VBTYP = 'J'.

APPEND XKOMFK.

CALL FUNCTION 'RV_INVOICE_CREATE'

EXPORTING

VBSK_I = VBSK_I

WITH_POSTING = 'C'

TABLES

XKOMFK = XKOMFK

XKOMV = XKOMV

XTHEAD = XTHEAD

XVBFS = XVBFS

XVBPA = XVBPA

XVBRK = XVBRK

XVBRP = XVBRP

XVBSS = XVBSS.

if sy-subrc eq 0.

COMMIT WORK.

flag = 'X'.

else.

message i011 with p_vbeln.

endif.

Reward Points if it is helpful

Thanks

Seshu

0 Kudos

Seshu,

thanks for your input, it is very helpfull.

The thing is that I am new to ABAP so not sure about the parametres of RV_INVOICE_CREATE and RV_INVOICE_LIST_CREATE...

My Z program has to create a Credit / Debit memo with total values, so I need to know what does the parametres of RV_INVOICE_CREATE mean in order to pass needed values to FM.

The same with list of invoices - do not know too much about the parametres and could not find info on the internet...

It is urgent for me...

Help would be very appreciated.

Kind regards, M.

0 Kudos

See the thread for RV_INVOICE_CREATE

RV_INVOICE_LIST_CREATE - I do not have any program.

see the include MV60SSAM and this program uses list FM.

Look at VF21 Transaction to get more details on invoice list.

Message was edited by:

Seshu Maramreddy