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

Function Module RV_INVOICE_CREATE

Former Member
0 Likes
4,700

Hello,

first I have a problem.

For weeks now I get answers for questions another person asked. For that I'm deleting every answer in my inbox I'm getting from this tool and I have change to identify the one's which had been addressed to me.

If you have an answer to solve current problem please address to <removed by moderator>

Now the question.

With above function module I try to create invoices. It works for invoices with one single item to be invoiced.

It doesn't work for credit and debit notes and for invoices with more than one item. They will be split of in several invoices, one for each item.

Coding for credit/debit notes:

CLEAR w_vbski.      
w_vbski-mandt = sy-mandt.
     
w_vbski-smart = 'F'.

CALL FUNCTION 'RV_INVOICE_CREATE'

            EXPORTING  
              delivery_date = w_pdate
  
              invoice_date  = w_invoidate
    
              invoice_type  = w_intype

              pricing_date  = w_pdate

              vbsk_i        = w_vbski

              with_posting  = 'C'
        
              select_date   = w_pdate

           IMPORTING    
              vbsk_e        = w_vbske

           TABLES  
               xkomfk        = t_fk
  
               xkomv         = t_komv
    
               xthead        = t_head
        
               xvbfs         = t_vbfs

               xvbpa         = t_vbpa

               xvbrk         = t_vbrk

               xvbrp         = t_vbrp

               xvbss         = t_vbss

               xkomfkgn      = t_fkgn

               xkomfkko      = t_komv.

t_fkgn and t_fk are filled. The referenced document is an 'order'.

Coding for credit/debit notes:

CLEAR w_vbski.      
w_vbski-mandt = sy-mandt.

CALL FUNCTION 'RV_INVOICE_CREATE'

            EXPORTING  
              delivery_date = w_pdate
  
              invoice_date  = w_invoidate
    
              invoice_type  = w_intype

              pricing_date  = w_pdate

              vbsk_i        = w_vbski

              with_posting  = 'X'
        
              select_date   = w_pdate

           IMPORTING    
              vbsk_e        = w_vbske

           TABLES  
               xkomfk        = t_fk
  
               xkomv         = t_komv
    
               xthead        = t_head
        
               xvbfs         = t_vbfs

               xvbpa         = t_vbpa

               xvbrk         = t_vbrk

               xvbrp         = t_vbrp

               xvbss         = t_vbss

               xkomfkgn      = t_fkgn

               xkomfkko      = t_komv.

t_komv and t_fk are filled. The referenced document is a delivery note'. In t_komv the items to be billed will be offered. In t_fkgn only the delievery note number will be offered, not the item number.

Regárds

Norbert

Message was edited by: Thomas Zloch

1 REPLY 1
Read only

Former Member
0 Likes
2,835

Hi,

for credit note it is working now but for delivery notes with several items the FM is still creating not one invoice with several items. It is creating for each item one invoice. The relevant spilt criteria will be the same for all items because they are sub items of one delivery main item.

I also tried to create invoices via VF01 BTCI but I can not mark several items in BatchInput. BAPI_BILLINGDOC_CREATE will also not help.

I don't have any idea how to solve.

Regards

Norbert