Skip to Content
0
Jun 14, 2018 at 01:01 PM

Archiving Dunning (Object BKPF)

494 Views Last edit Jun 15, 2018 at 08:35 AM 2 rev

Hello,

I'am using BTE 1040 for archiving dunning letters.

At the Standard SAP is using FI_OPT_ARCHIVE_DUNNING_NOTICE and the OBJECT KNB1 and LFB1.

I want to use Object BKPF because the Dunning should be available in the FB5LN

The problem is that there are several Bills for each reminder.

I think I'm not the only one with this problem.

If a Dunning is only for one document, the logic works.

     TOA_DARA-FUNCTION = 'DARA'.
      TOA_DARA-MANDANT = SY-MANDT.
      TOA_DARA-SAP_OBJECT = 'BKPF'.
      TOA_DARA-AR_OBJECT = 'FIODUNNING'.
      TOA_DARA-RESERVE(6) = 'COMMIT'.
      TOA_DARA-NOTIZ = 'Dunning'.
      C_ARCHIVE_INDEX = TOA_DARA.

  SELECT * FROM mhnd
    INTO CORRESPONDING FIELDS OF  TABLE lt_mhnd
    WHERE  laufd = I_MHNK-laufd
       AND laufi = I_MHNK-laufi
       AND bukrs = I_MHNK-bukrs
       AND kunnr = I_MHNK-kunnr.

DESCRIBE TABLE lt_mhnd LINES lv_lines.

IF lv_lines = 1. 
  READ TABLE lt_mhnd into ls_mhnd INDEX 1.
  CONCATENATE ls_mhnd-bukrs ls_mhnd-belnr ls_mhnd-gjahr into TOA_DARA-OBJECT_ID.

else.

LOOP AT lt_mhnd into ls_mhnd. " Hier haben wir ein Problem!
  ?????????????????????????????????????????????????????

ENDLOOP.

endif.

The "ELSE" is my Problem.

Thank

Julia