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: 

bapi sample code

Former Member
0 Kudos
3,914

can any one please give me the sample code for

BAPI_BILLINGDOC_CREATEMULTIPLE

both header and item data

regards,

v@sap

1 ACCEPTED SOLUTION

Former Member
0 Kudos
1,254

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.

5 REPLIES 5

former_member156446
Active Contributor
0 Kudos
1,254
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 

0 Kudos
1,254

thank you jay

is it necessary two or three excel files

Edited by: v@sap on Jun 17, 2008 9:45 AM

Former Member
0 Kudos
1,255

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.

0 Kudos
1,254

CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'

  • EXPORTING

  • CREATORDATAIN =

  • TESTRUN =

  • POSTING =

TABLES

BILLINGDATAIN = billingdata

  • CONDITIONDATAIN =

  • CCARDDATAIN =

  • TEXTDATAIN =

  • ERRORS =

RETURN = bapiret

SUCCESS = succ

except BILLINGDATAIN

CONDITIONDATAIN

CCARDDATAIN

what are the exporting parameters we have to pass??

0 Kudos
1,254