Skip to Content
0
Former Member
Jan 08, 2011 at 11:54 AM

Item Texts Is Not Being Created in BAPI_BILLINGDOC_CREATEMULTIPLE

161 Views

Hi.

I am Using Bapi TO Create Invoice, Every thing is created successfully , but item text is not being created. Code is as below.

DATA: s_vbap TYPE vbap,
            t_billing TYPE STANDARD TABLE OF bapivbrk WITH HEADER LINE,
            t_datain TYPE STANDARD TABLE OF bapikomfktx WITH HEADER LINE,
            t_return TYPE STANDARD TABLE OF bapireturn1 WITH HEADER LINE,
            t_success TYPE STANDARD TABLE OF bapivbrksuccess WITH HEADER LINE.


      SELECT SINGLE * FROM likp
      WHERE vbeln = v_del_doc_no.

      SELECT SINGLE * FROM lips WHERE
      vbeln = v_del_doc_no.

      t_billing-salesorg = likp-vkorg.
      t_billing-ref_doc = likp-vbeln.
      t_billing-ref_item = lips-posnr.
      t_billing-doc_number = v_del_doc_no.
      t_billing-itm_number = lips-posnr.

*      SELECT SINGLE fkarv FROM tvak
*            INTO  t_billing-ordbilltyp
*            WHERE auart EQ zsoa_so_header-auart.
      SELECT SINGLE auart FROM vbak
                  INTO  t_billing-ordbilltyp
                  WHERE vbeln EQ order_num.

      t_billing-price_date = sy-datum.
      t_billing-ref_doc_ca = likp-vbtyp.
      t_billing-material = lips-matnr.
      t_billing-plant = lips-werks.

      APPEND t_billing.
      BREAK-POINT.
      CLEAR: t_datain.
     t_datain-ref_doc = v_del_doc_no.
      t_datain-ref_item = '000010'.
      t_datain-applobject = 'VBBP'.
      t_datain-text_id    = '0001'.
      t_datain-langu      = sy-langu.
      t_datain-format_col = '*'.
      t_datain-text_line  = 'FSG 2829'.
      APPEND t_datain.







      CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
        TABLES
          billingdatain = t_billing
          textdatain    = t_datain
          return        = t_return
          success       = t_success.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.

      LOOP AT t_return.
        itab_msg-type = t_return-type.
        itab_msg-msg =  t_return-message.
        APPEND itab_msg.
        CLEAR  itab_msg.
      ENDLOOP.

      READ TABLE t_success INDEX 1.
      p_i_bill_doc = t_success-bill_doc.

    ENDIF.

  ENDIF.


  CLEAR: itab_so_items, itab_so_items[] , delivery_no , itab_return[].

So Text FSG 2829 is not being created in Item Text.....