24.1.11

SAP Note 18869 - Sorting the printing of dunning notices

Symptom:

Key words: Dunning, SAPF150D, F150,
The sorting of dunning notices is to be made with fields that are not contained in table MHNK.
The sorting is, for example, to be made according to the postal code (KNA1-PSTLZ) (possible in the standard system as of Release 3.0) or via the fields from table KNVV (sales and distribution data).

Cause and prerequisites

Customer request.

Solution

You have to make changes in two places:

    1. Customizing
      a) For Release 2.2*
      The table that contains the field must be allowed in Customizing. This can be achieved with a name extension in the DATA statement for TABKOnn. For table KNA1, this is as follows, for example:
      DATA: TABKO01(4) TYPE C VALUE 'MHNK',
      TABKO02(4) TYPE C VALUE 'MHNK',
      TABKO03(4) TYPE C VALUE 'KNA1', "<<<<<< mod
      ...
      b) For Release 3.0*:
      The table that contains the field must be allowed in Customizing. This can be achieved with an extension in the routine in program SAPMFKD0:

FORM TABTAB_FUELLEN USING
WOFUER TYPE C.
REFRESH: TABTAB.
CASE WOFUER.
WHEN 'BRIEF'.
TABTAB-TBNAM = 'MHNK'. APPEND TABTAB.
TABTAB-TBNAM = 'KNA1'. APPEND TABTAB. "<<<<<< mod
WHEN 'POSTEN'.
TABTAB-TBNAM = 'MHNK'. APPEND TABTAB.
TABTAB-TBNAM = 'MHND'. APPEND TABTAB.
ENDCASE.
ENDFORM.

    2. Dunning programs (for Releases 2.2 and 3.*):

The table must be read in the print program (Include F150DFM0), routine MAHNDATEN_LESEN:
FORM MAHNDATEN_LESEN.
SELECT SINGLE * FROM MAHNV
WHERE LAUFD = F150ID-LAUFD
AND LAUFI = F150ID-LAUFI.
IF SY-SUBRC NE 0.
MESSAGE S106 WITH F150ID-LAUFD F150ID-LAUFI.
STOP.
ENDIF.
SELECT * FROM MHNK INTO MHNK
WHERE LAUFD = F150ID-LAUFD
AND LAUFI = F150ID-LAUFI.
CHECK MHNK-MAHNS NE 0 "Mahnstufe ne 0
OR MHNK-GMVDT NE '00000000'. "oder Verklagte
** Insert the program code here
** for reading KNA1, for example.
IF MHNK-KOART = 'D'.
SELECT SINGLE * FROM KNA1 WHERE KUNNR = MHNK-KUNNR.
ENDIF.
** End of modification

PERFORM MAHNDATEN_VERARBEITEN.

Caution: Especially for the sorting according to postal code you have to make sure that the postal code which is printed in the address window (that is, the postal code of the major customer address or the postal code of the P.O. box) is entered in field PSTLZ. This may require source code, such as:
IF KNA1-PSTL2 NE SPACE.
KNA1-PSTLZ = KNA1-PSTL2.
ENDIF.

To be able to use the sorting also in the dunning list, the additional table in program RFMAHN01 must be read, before the sorting fields are assigned. Example
GET MHNK.
CHECK MHNK-MAHNS NE 0.
CHECK MHNK-MANSP EQ SPACE.
CHECK MHNK-XMFLG EQ 'X'.
SELECT SINGLE * FROM T047B
WHERE MAHNA = MHNK-MAHNA
AND MAHNS = MHNK-MAHNS.
* XMANSP = SPACE.
** Insert the corresponding source code at this point.
** To read KNA1, for example
IF MHNK-KOART = 'D'.
SELECT SINGLE * FROM KNA1 WHERE KUNNR = MHNK-KUNNR.
ENDIF.
** End of modification
PERFORM MAHNDATEN_VERARBEITEN.

Furthermore, you have to consider that the accesses programmed above will increase the runtime of the print program.

    3. For Release 4.*
    The solution is executed via customer Include and BTE interface:
      a) Implement structure (customer Include) with the desired fields.
      Activate table MHNK.
      b) Include new MHNK field in sort variant.
      c) BTE
      Create a customer module which has the interface of function module
      SAMPLE_PROCESS_00001050. Then you have to fill the new field with data in the customer module.
      Enter the module in the BTE Customizing. Process 00001050.
      Application FI-FI.

Additional key words

SAPF150D, RFMAHN01


No comments:

Post a Comment