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 Function?????

rahul_srivastava3
Participant
0 Kudos

HI Experts,

Can anyone plz. tell me the the process to use the Bapi for Bill/Invoice Creation.

Bapi is<b> BAPI_BILLINGDOC_CREATEMULTIPLE</b>.

Actually i want to know the coding for passing the values in this BAPI. What exactly i have to code to get the billing done using this BAPI.

Also , i want to know whether all those messages will come using this BAPI what comes using VF01 TCode while creating a Bill.

Plz. reply as soon as possible. Its Urgent.

Thanks in Advance .

Regards,

Rahul

1 REPLY 1

Former Member
0 Kudos

Hi

U can try this:

CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'

EXPORTING

POSTING = ''

TABLES

BILLINGDATAIN = TI_BILLINGDATAIN

ERRORS = TI_ERRORS

RETURN = TI_RETURN2

SUCCESS = TI_SUCCESS.

  • Check error

LOOP AT TI_RETURN WHERE TYPE = 'E' OR

TYPE = 'A'.

EXIT.

ENDLOOP.

IF SY-SUBRC <> 0.

REFRESH TI_RETURN2.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = TI_RETURN2.

  • Check error

LOOP AT TI_RETURN WHERE TYPE = 'E' OR

TYPE = 'A'.

EXIT.

ENDLOOP.

IF SY-SUBRC <> 0.

  • Search the bill

SELECT SINGLE VBELN

INTO W_FACTURA

FROM VBFA

WHERE VBELV = W_PEDIDO.

ENDIF.

ENDIF.

<b>Reward points</b>

Regards