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: 

What is the bapi to create billing document?

Former Member
0 Kudos

What is the bapi to create billing using

VBELN(Sales and Distribution Document Number)?

5 REPLIES 5

Former Member
0 Kudos

Hi,

BAPI_SALESORDER_CREATEFROMDAT2

check out this

Hope this help u

Reward points if useful

Regards,

Sreenivas

Former Member
0 Kudos

Hi,

check this bapi this will be usefull to you

BAPI_BILLINGDOC_CREATEFROMDATA

regards,

siva chalasani.

Former Member
0 Kudos

hi,

Please check these below fm:In reference document you can provide vbeln.

1) BAPI_BILLINGDOC_CREATEFROMDATA

2) BAPI_BILLINGDOC_CREATEMULTIPLE

Regds

Sivaparvathi

Please reward points if helpful..

Edited by: Siva Parvathi on Dec 28, 2007 12:48 PM

0 Kudos

Hi siva,

Your reply was very helpful.. I have further clarification, is it possible to create the billing docu with BAPI_BILLINGDOC_CREATEFROMDATA using sales document (reference document) alone or i need to pass any other values to it?

Thanks & Regrd,

Jawahar

Former Member
0 Kudos

Hi

TRy this code

----


  • Form billing_create *

----


  • To create billing document *

----


  • --> p1 text *

  • <-- p2 text *

----


FORM billing_create using p_delnum type VBELN .

----


  • Constants Declaration *

----


CONSTANTS:

C_F TYPE C VALUE 'F', " Group type

C_J TYPE C VALUE 'J', " Sales type

C_D TYPE C VALUE 'D'. " Billing type

----


  • Field-string declaration *

----


DATA:

  • Field-string for SD collective processing header import

LFS_VBSK TYPE VBSK,

  • Field-string for internal table lt_xfomfk

LFS_XFOMFK TYPE KOMFK,

  • Field-string for internal table lt_xvbss

LFS_XVBSS TYPE VBSS,

  • Field-string for internal table lt_xvbfs

LFS_XVBFS TYPE VBFS.

----


  • Internal table declaration *

----


DATA:

  • Internal table for Billing Communications Table

LT_XKOMFK TYPE TABLE OF KOMFK,

  • Internal table for Collective Processing: Sales Documents

LT_XVBSS TYPE TABLE OF VBSS,

  • Internal table for Error Log for Collective Processing

LT_XVBFS TYPE TABLE OF VBFS,

  • Internal table for Price Determination Communications-Condition Record

LT_XKOMV TYPE TABLE OF KOMV,

  • Internal table for SAPscript: text header

LT_XTHEAD TYPE TABLE OF THEADVB,

  • Internal table for Sales Document: Partner

LT_XVBPA TYPE TABLE OF VBPAVB,

  • Internal table for Billing: Header Data

LT_XVBRP TYPE TABLE OF VBRPVB,

  • Internal table for Billing: Item Data

LT_XVBRK TYPE TABLE OF VBRKVB.

  • Filling the local variables

LFS_VBSK-SMART = C_F.

LFS_XFOMFK-VBELN = P_DELNUM.

LFS_XFOMFK-VBTYP = C_J.

APPEND LFS_XFOMFK TO lt_xkomfk.

  • Function module to create invoice.

CALL FUNCTION 'RV_INVOICE_CREATE'

EXPORTING

VBSK_I = LFS_VBSK

WITH_POSTING = C_D

TABLES

XKOMFK = LT_XKOMFK

XKOMV = LT_XKOMV

XTHEAD = LT_XTHEAD

XVBFS = LT_XVBFS

XVBPA = LT_XVBPA

XVBRK = LT_XVBRK

XVBRP = LT_XVBRP

XVBSS = LT_XVBSS.

IF lt_xvbfs[] is initial.

LOOP AT lt_xvbfs INTO lfs_xvbfs.

clear fs_disp.

WRITE:/ TEXT-006,

LFS_XVBFS-MSGV1,

LFS_XVBFS-MSGV2,

LFS_XVBFS-MSGV3,

LFS_XVBFS-MSGV4.

ENDLOOP. " Loop at lt_xvbss

ELSE.

loop at lt_xvbss into lfs_xvbss.

FS_DISP-TEXT = TEXT-006.

FS_DISP-NUMBER = lfs_xvbss-vbeln.

APPEND FS_DISP TO IT_DISP.

ENDLOOP. " Loop at lt_xvbss

ENDIF. " If sy-subrc eq 0.

ENDFORM. " Billing_create

if u found it is help to u plzz reward

plzz dont forget to reward