Skip to Content
author's profile photo Former Member
Former Member

creating billing doc from sales data

Hi Gurus,

I have all sales document data. From 3 rd party system I have to call SAP thro BAPI to create credit memo(Billing Document) . If any BAPI exists, Pl. Indicate.

Full points are assured for helpful answers.

Thanks,

USR

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 11:35 AM

    Hi,

    Please check these below fm:In reference document you can provide vbeln(Sales Document Number).

    1) BAPI_BILLINGDOC_CREATEFROMDATA

    2) BAPI_BILLINGDOC_CREATEMULTIPLE

    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

    Regards,

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 11:42 AM

    Hi,

    For creating Credit Memos you can use BAPI 'BAPI_ACC_DOCUMENT_POST'

    or

    you can also use BAPI 'BAPI_ACC_INVOICE_RECEIPT_POST for vendor postings'

    Regards,

    Gaurav

    *Reward points

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.