There are fields in a condition table for listing/exclusion for which no check is made against the check table. The name is also not displayed from the corresponding text table.
The check has only been implemented for the fields contained in the standard system.
Note 12905 only applies to pricing and output conditions.
In a later release, this check and the procurement of the text will be carried out automatically. Until then, you need to make the following modification.
A new check routine must be programmed for the new field.
To complete this check routine, follow the steps of the example that follow.
Example : Field ZZPRO5 is chosen as a new field, of which the first 5 positions represent a product hierarchy.
- 1. Create a FORM routine KOMGG-ZZPRO5. This FORM routine is also included in MV130F0x. *---------------------------------------------------------------------*
* FORM KOMGG-ZZPRO5 *
*---------------------------------------------------------------------*
* Prüfen der Produkthierarchie (stelle 1 - 5 ) *
*---------------------------------------------------------------------*
* --> KV_ERROR : Fehlermeldung falls Prod.Hiera. nicht vorhanden *
* --> KV_SUBRC : Returncode, falls keine Fehlermeldung angefordert *
*---------------------------------------------------------------------*
FORM KOMGG-ZZPRO5 USING KP_ERROR KP_SUBRC.
* Reset Returncode
CLEAR KP_SUBRC.
* Löschen aktiv ?
PERFORM DELETE_INDICATOR_SET.
* Keine Prüfung beim Löschen
CHECK DELETE_INDICATOR = NO.
* Produkthierarchie gerade gelesen ?
IF KOMGG-ZZPRO5 = T179-PRODH(5) AND
T179-PRODH+5 = SPACE.
EXIT.
ENDIF.
* Initialisieren der Workarea
IF KOMGG-ZZPRO5 EQ SPACE.
CLEAR: T179, T179T.
EXIT.
ENDIF.
* Lesen der Kundengruppen-Tabelle
SELECT SINGLE * FROM T179 WHERE PRODH EQ KOMGG-ZZPRO5.
IF SY-SUBRC NE 0.
CLEAR: T179, T179T.
* Ausgabe einer Fehlermeldung ?
IF KP_ERROR = YES.
MESSAGE E033 WITH KOMGG-ZZPRO5.
ELSE.
KP_SUBRC = SY-SUBRC.
EXIT.
ENDIF.
ENDIF.
* Lesen der Bezeichnung
SELECT SINGLE * FROM T179T WHERE SPRAS EQ SY-LANGU
AND PRODH EQ KOMGG-ZZPRO5.
IF SY-SUBRC <> 0.
CLEAR T179T.
ENDIF.
ENDFORM.
- 2. Activate the check routine for the selection report
Insert the following code in include MV130F0x in the routine FELD_PRUEFUNG at the end of the CASE statement.
CASE VK_FIELDNAME.
...
...
WHEN 'ZZPRO5'. PERFORM KOMGG-ZZPRO5 USING FP_ERROR FP_SUBRC.
ENDCASE.
- 3. Add the text in the internal table
Insert the following code in include MV130F0x in the routine FILL_DEFAULT at the end of the CASE statement.
CASE FD_FIELD.
...
...
WHEN 'ZZPRO5'. MOVE T179T-VTEXT TO TEXT_DEFAULT-TEXT.
ENDCASE.
- 4. Transfer the text from the internal text table
Insert the following program code in Include MV130F0x in the routine GET_TEXT at the end of the CASE statement
CASE TEXT_ERFASSUNG.
...
...
WHEN 'ZZPRO5'. MOVE TEXT_DEFAULT-TEXT TO T179T-VTEXT.
ENDCASE.
- 5. Add the SPA/GPA parameter
This is only necessary if a parameter exists. It is assumed that ZZZ is the SPA/GPA parameter for field ZZPRO5. Insert the following program code in Include MV130F0x in the routine GET_PARAMETER at the end of the CASE statement
CASE GPF_FIELD.
...
...
WHEN 'ZZPRO5'.
* Parameter holen
IF KOMGG-ZZPRO5 IS INITIAL.
GET PARAMETER ID 'ZZZ' FIELD KOMGG-ZZPRO5.
ENDIF.
* Text zum Parameter lesen
IF NOT KOMGG-ZZPRO5 IS INITIAL.
PERFORM KOMGG-ZZPRO5 USING NO READ_SUBRC.
ENDIF.
ENDCASE.
Additional key words
Material listing
Material exclusion
No comments:
Post a Comment