Skip to Content
0

F-29 Downpayment Request BAPI

Jul 17, 2017 at 05:37 AM

69

avatar image

Hi Experts,

I have a requirement to use a BAPI for F-29(Downpayment Request). I have used 'BAPI_ACC_DOCUMENT_POST' and when I execute a BAPI it returns a "Document Posted Successfully" message But after I comit a message shows "Update was terminated"

Error info... F1 105: Document QST.


*In F-29 I have to select Document Numbers for clearing, but in the BAPI I cant find the field wherin I have to enter the Document Number that needs to be cleared.

DATA: lwa_bapi_docheader LIKE BAPIACHE09,
        lt_bapi_acctgl     LIKE BAPIACGL09 OCCURS 0 WITH HEADER LINE,
        lwa_bapi_acctgl    LIKE lt_bapi_acctgl,
        lt_bapi_acctrcv    LIKE BAPIACAR09 OCCURS 0 WITH HEADER LINE,
        lwa_bapi_acctrcv   LIKE lt_bapi_acctrcv,
        lt_currencyamount  LIKE BAPIACCR09 OCCURS 0 WITH HEADER LINE,
        lwa_currencyamount LIKE lt_currencyamount,
        lt_return          LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
   DATA: lv_amt TYPE BAPIWRBTR.

  lwa_bapi_docheader-obj_type    = 'BKPFF'.
  lwa_bapi_docheader-obj_key     = 'QST'.
  lwa_bapi_docheader-obj_sys     = 'CLNT102'.
  lwa_bapi_docheader-bus_act     = 'RFBU'.
  lwa_bapi_docheader-username    = sy-uname.
  lwa_bapi_docheader-header_txt  = 'HEADER TEXT BAPI'.
  lwa_bapi_docheader-comp_code   = 'SPRO'.
  lwa_bapi_docheader-doc_date    = sy-datum.
  lwa_bapi_docheader-pstng_date  = sy-datum.
  lwa_bapi_docheader-ref_doc_no  = 'REF DOC NO BAPI'.
  lwa_bapi_docheader-doc_type    = 'ZD'.

  CLEAR lwa_bapi_acctgl.
  lwa_bapi_acctgl-itemno_acc  = '001'.
  lwa_bapi_acctgl-gl_account  = '0000900000'.
  lwa_bapi_acctgl-comp_code   = 'SPRO'.
  lwa_bapi_acctgl-pstng_date  = sy-datum.
  lwa_bapi_acctgl-item_text   = 'ITEM TEXT BAPI'.
  APPEND lwa_bapi_acctgl TO lt_bapi_acctgl.

* Fill Account receivable for customer
  CLEAR lwa_bapi_acctrcv.
  lwa_bapi_acctrcv-itemno_acc = '2'.
  lwa_bapi_acctrcv-customer   = '0000710111'.
  lwa_bapi_acctrcv-item_text  = 'ITEM TEXT BAPI'.
  lwa_bapi_acctrcv-sp_gl_ind  = 'X'.
  lwa_bapi_acctrcv-pymt_cur_iso = 'PHP'.
  APPEND lwa_bapi_acctrcv TO lt_bapi_acctrcv.

* Fill amounts
  CLEAR lwa_currencyamount.
  lwa_currencyamount-itemno_acc = '1'. "'0000900000'.
  lwa_currencyamount-currency   = 'PHP'.
  lwa_currencyamount-amt_doccur = '10000.00'.
  APPEND lwa_currencyamount TO lt_currencyamount.


  CLEAR lwa_currencyamount.
  lwa_currencyamount-itemno_acc = '2'. "'0000900000'.
  lwa_currencyamount-currency   = 'PHP'.
  lwa_currencyamount-amt_doccur = '-10000.00'.
  APPEND lwa_currencyamount TO lt_currencyamount.

  CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
    EXPORTING
      documentheader    = lwa_bapi_docheader
    TABLES
      accountgl         = lt_bapi_acctgl
      accountreceivable = lt_bapi_acctrcv
      currencyamount    = lt_currencyamount
      return            = lt_return.

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    WAIT = 'X'.
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Muhammed Riyas Cheruparambil Jul 19, 2017 at 08:04 AM
0

Refer the below thread

https://archive.sap.com/discussions/thread/1204115

Regards,

Muhammed Riyas C

Share
10 |10000 characters needed characters left characters exceeded