Skip to Content
0
Jan 18, 2012 at 12:13 PM

using bapi condition values are not creating billing document

237 Views

Hi

I am using bapi BAPI_BILLINGDOC_CREATEMULTIPLE but it is not creating conditions

in new billing document.

data : it_header type STANDARD TABLE OF BAPIVBRK,

ls_header type BAPIVBRK.

data : it_cond type STANDARD TABLE OF BAPIKOMV,

ls_cond type BAPIKOMV,

IT_RETURN TYPE STANDARD TABLE OF BAPIRET1,

IT_SUCCESS TYPE STANDARD TABLE OF BAPIVBRKSUCCESS,

IT_ERRORS TYPE STANDARD TABLE OF BAPIVBRKERRORS.

DATA : GV_CREATE TYPE BAPICREATORDATA.

START-OF-SELECTION.

LS_header-sold_to = '0001200086'.

LS_header-salesorg = '1002'.

LS_header-DISTR_CHAN = 'RS'.

LS_header-DIVISION = '00'.

LS_header-DOC_TYPE = 'ZDST'.

LS_header-ORDBILLTYP = 'L2'.

LS_header-PRICE_DATE = sy-datum.

LS_header-PLANT = 'R007'.

LS_header-BILL_DATE = sy-datum.

LS_header-material = 'R0070C0801M0'.

LS_header-req_qty = '1'.

append LS_header TO IT_HEADER.

LS_cond-COND_TYPE = 'ZDEB'.

LS_COND-COND_VALUE = '1.00'.

LS_COND-COND_P_UNT = '1'.

LS_COND-COND_D_UNT = 'FT2'.

LS_COND-DATA_INDEX = '1'.

append LS_COND TO IT_COND.

LS_cond-COND_TYPE = 'ZDB1'.

LS_COND-COND_VALUE = '27555.69'.

LS_COND-COND_P_UNT = '1'.

LS_COND-COND_D_UNT = 'FT2'.

LS_COND-DATA_INDEX = '1'.

append LS_COND TO IT_COND.

LS_cond-COND_TYPE = 'ZDB2'.

LS_COND-COND_VALUE = '0.97'.

LS_COND-COND_P_UNT = '1'.

LS_COND-COND_D_UNT = 'FT2'.

LS_COND-DATA_INDEX = '1'.

append LS_COND TO IT_COND.

LS_cond-COND_TYPE = 'ZSRT'.

LS_COND-COND_VALUE = 1.

LS_COND-DATA_INDEX = '1'.

append LS_COND TO IT_COND.

LS_cond-COND_TYPE = 'ZSRP'.

LS_COND-COND_VALUE = 1.

LS_COND-DATA_INDEX = '1'.

append LS_COND TO IT_COND.

CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'

EXPORTING

CREATORDATAIN = GV_CREATE

  • TESTRUN =

  • POSTING =

TABLES

billingdatain = it_header

CONDITIONDATAIN = it_cond

  • CCARDDATAIN =

  • TEXTDATAIN =

  • ERRORS = IT_ERRORS

return = IT_RETURN

success = IT_SUCCESS.

WRITE :/ 'SSS'.