Skip to Content
avatar image
Former Member

getting error in bapi BAPI_ACC_DOCUMENT_REV_POST

Hi Experts,

  I am getting error while applying BAPI: BAPI_ACC_DOCUMENT_REV_POST.

  kindly guide me.

Errors:--

E RW 609 Error in document: BKPF 00400000000110002012 MEDCLNT200 E RW 632 Document BKPF 00400000000110002012 MEDCLNT200 cannot be reversed E RW 628 Incorrect entry in field OBJ_TYPE: BKPF

  Code i have been written for this are as follows:----

rev-obj_type = 'BKPF'.

rev-obj_key = '00400000000110002012'.

rev-obj_key_r = '00400000000110002012'.

rev-obj_sys = 'MEDCLNT200'.

rev-reason_rev = '01'.

CALL FUNCTION 'BAPI_ACC_DOCUMENT_REV_POST'

   EXPORTING

     reversal = rev

     bus_act  = 'RFBU'

   IMPORTING

     obj_type = gv_obj_type

     obj_key  = gv_obj_key

     obj_sys  = gv_obj_sys

   TABLES

     return   = gt_return.

Regards,

Rishi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Aug 06, 2013 at 10:46 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 06, 2013 at 01:54 PM

    Hi Rishi!

    Which Object Type has the Document you whant to reverse.

    BKPF-AWTYP?

    regards,

    Stefan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 06, 2013 at 02:53 PM

    Hi ,

    Plz check BDC or Rev FM:You may need to cover cross company/ normal one in BDC but i believe FM covers both .

    * Normal one reversal sample is given below ..Cross company tcode differs

    PERFORM sub_populat_bdc_data USING:
                               'SAPMF05A' '0105' c_x,
                               'BDC_CURSOR' 'RF05A-GJAHS' ' ',
                               'BDC_OKCODE' '/00' ' ',
                               'RF05A-BELNS'  docno ' ',
                               'BKPF-BUKRS' header-ccode ' ',
                               'RF05A-GJAHS' header-fyear ' ',
                               'BSIS-BUDAT'  postingdate ' ',            
                               'UF05A-STGRD' postingreason ' ',
                               'SAPMF05A' '0105' c_x,
                               'BDC_CURSOR' 'RF05A-BELNS' ' ',
                               'BDC_OKCODE' '=BU' ' ',
                               'RF05A-BELNS' docno ' ',
                               'BKPF-BUKRS' header-ccode ' ',
                               'RF05A-GJAHS' header-fyear ' ',
                               'UF05A-STGRD' reason ' '.

      
          CALL TRANSACTION 'FB08'
               USING  bdcdata
               MODE  mode
               MESSAGES INTO t_bdcmsgcoll.


    OR

    **--BAPI for FI document reversal


        CALL FUNCTION 'BAPI_ACC_GL_POSTING_REV_POST'
          EXPORTING
            reversal = header
          IMPORTING
            obj_type = header-obj_type
            obj_key  = header-obj_key
            obj_sys  = header-obj_sys
          TABLES
            return   = y_return.


    Hope this helps.

    Thanks!

    Add comment
    10|10000 characters needed characters exceeded