How to jump the profit center report KE5Z

The code comes from the profit center accounting document for tracking FB03 accounting voucher.

First stick to the code

    DATA:
      lw_awtyp     TYPE acchd-awtyp,
      lw_awref     TYPE acchd-awref,
      lw_aworg     TYPE acchd-aworg,
      lt_documents TYPE STANDARD TABLE OF acc_doc.

          lw_awtyp = 'BKPFF'.
          lw_awref = ls_alv-belnr.
          CONCATENATE ls_alv-rbukrs ls_alv-ryear INTO lw_aworg.
          CALL FUNCTION 'AC_DOCUMENT_RECORD'
            EXPORTING
              i_awtyp      = lw_awtyp
              i_awref      = lw_awref
              i_aworg      = lw_aworg
              x_dialog     = space
            TABLES
              t_documents  = lt_documents
            EXCEPTIONS
              no_reference = 1
              no_document  = 2
              OTHERS       = 3.
          READ TABLE lt_documents ASSIGNING FIELD-SYMBOL(<fs_documents>) WITH KEY awtyp = 'COPCA'.
          IF sy-subrc = 0.
            <fs_documents>-display = abap_true.
          ENDIF.
          CALL FUNCTION 'COPCA_DOCUMENT_RECORD'
            EXPORTING
              i_awtyp      = lw_awtyp
              i_awref      = lw_awref
              i_aworg      = lw_aworg
              i_awtyp_incl = 'COPCA'
            TABLES
              t_documents  = lt_documents.

The function AC_DOCUMENT_RECORD obtains all control vouchers, profit center vouchers, material account vouchers, and so on derived from all accounting vouchers.COPCA_DOCUMENT_RECORDIt is a demonstration of the profit center report.

 

Leave a Reply

Your email address will not be published. Required fields are marked *