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

bapi sample code

can any one please give me the sample code for

BAPI_BILLINGDOC_CREATEMULTIPLE

both header and item data

regards,

v@sap

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 07:48 AM

    Hi,

    Direct extract from SE37 documentation.

    FU BAPI_BILLINGDOC_CREATEMULTIPLE

    ____________________________________________________

    Short Text

    Create Individual Customer Billing Document

    Functionality

    This method can be used to create billing documents.

    As input parameters, you are expected to enter information on the items to be processed in the table BILLING_DATA_IN. This data is processed and produces a batch of billing documents. You also have the option of transferring information for entry in the input structure CREATOR_DATA_IN. If this information is already determined, this is transferred into each billing document header. You can also enter optional conditions for the individual items to be processed in the input table CONDITION_DATA_IN, as well as means of payment information in the table CCARD_DATA_IN.

    This method can be used in the simulation run (TESTRUN = 'X') and also in the update run including the update (TESTRUN = ' '). Both execution variants deliver errors that may have occurred back to the output table RETURN. Information on successful processing is sent back in the output table SUCCESS. This output table delivers the document numbers of the billing documents created in particular.

    Notes

    1. Required entries :

    BILLING_DATA_IN-SALESORG

    BILLING_DATA_IN-DISTR_CHAN

    BILLING_DATA_IN-DIVISION

    BILLING_DATA_IN-DOC_TYPE

    BILLING_DATA_IN-ORDBILLTYP

    BILLING_DATA_IN-SOLD_TO

    BILLING_DATA_IN-ITEM_CATEG

    BILLING_DATA_IN-REQ_QTY

    BILLING_DATA_IN-SALES_UNIT

    BILLING_DATA_IN-CURRENCY

    If a material is billed for which a material master needs to be

    determined (BILLING_DATA_IN-NO_MATMAST = ' '), you must make the

    following entries :

    BILLING_DATA_IN-PLANT

    BILLING_DATA_IN-MATERIAL

    If, on the other hand, a material is billed for which no material

    master is to be determined (BILLING_DATA_IN_NO_MATMAST = 'X'), you

    must make the following entries :

    BILLING_DATA_IN-COUNTRY

    BILLING_DATA_IN-MATERIAL

    BILLING_DATA_IN-TAXCL_1MAT

    2. COMMIT control :

    In the update run (TESTRUN = ' ') the update is carried out by COMMIT

    WORK as part of the method available.

    Parameters

    CREATORDATAIN

    TESTRUN

    POSTING

    BILLINGDATAIN

    CONDITIONDATAIN

    CCARDDATAIN

    TEXTDATAIN

    ERRORS

    RETURN

    SUCCESS

    Thanks,

    Sriram Ponna.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 17, 2008 at 07:24 AM
    GT_BILLINGDATAIN-REF_DOC = G_VBELN.
    GT_BILLINGDATAIN-REF_DOC_CA = 'J'.
    APPEND GT_BILLINGDATAIN.
    
    *header condition type
    GT_CONDITIONDATAIN-DATA_INDEX = '0'.
    GT_CONDITIONDATAIN-COND_TYPE = 'ZB01'.
    GT_CONDITIONDATAIN-COND_VALUE = 10.
    GT_CONDITIONDATAIN-COND_CURR = G_CURRENCY.
    APPEND GT_CONDITIONDATAIN.
    
    *item condition type
    GT_CONDITIONDATAIN-DATA_INDEX = '1'.
    GT_CONDITIONDATAIN-COND_TYPE = 'ZD01'.
    GT_CONDITIONDATAIN-COND_VALUE = 15.
    GT_CONDITIONDATAIN-COND_CURR = G_CURRENCY.
    APPEND GT_CONDITIONDATAIN.
    
    CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
    TABLES
    BILLINGDATAIN = GT_BILLINGDATAIN
    CONDITIONDATAIN = GT_CONDITIONDATAIN
    RETURN = GT_RETURN
    SUCCESS = GT_SUCCESS 
    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.