SAP Jobsuche bei DV-Treff


Suchen
Nautilus
  • Nautilus
  • SAP Forum - Neuling Thema Starter
vor 18 Jahre
Hallo, ich habe ein Problem mit einem Report.

Und zwar soll ich für einen Kunden einen Report erstellen, welcher nach Eingabe der Komponentennummer die Materialien und den Materialkurztext anzeigt, die die vorgegebene Komponente beinhalten.

Ich wollte das mit der logischen Datenbank PNM selektieren. Soweit schon mal kein Problem.

Ich hole mir mit Hilfe des "GET"-Befehls die Daten aus der PLKOD, PLPOD und der PLMZD.

Womit ich dann auch schon bei meinem Fehler wäre.

Wenn ich die PLMZD nämlich mit benutze, so funktioniert, die ganze Abfrage nicht. Sogar ein "BREAK-POINT" Befehl, welcher nach dem Befehl stand, wurde nicht beachtet. Sprich: Alle Befehle zwischen "GET PLMZD" und "END-OF-SELECTION" werden nicht berücksichtigt. Erst danach funktioniert die Ausgabe wieder.

Ich habe den Quelltext mal als Anhang mit bei gepackt.

Vielleicht habt Ihr ja eine Idee, warum das nicht funktioniert. Die PLMZD muss ja nach Ausführung der Selektion auf die logische Datenbank alle entsprechenden Daten enthalten.

Gibt es evtl. noch eine andere Möglichkeit, die Materialien anhand der Komponentennummer, des Arbeitsplatzes, Status des Arbeitsplans, Status der Stückliste zu selektieren? Gibt es ggf. Funktionsbausteine? Ich habe nämlich keine entsprechenden gefunden.

Für eine Hilfe, oder einen Wink mit dem zaunpfahl wäre ich sehr dankbar.

Christian

Nautilus
  • Nautilus
  • SAP Forum - Neuling Thema Starter
vor 18 Jahre
Hier ist der Code:

<br><br>REPORT ZPTARBPLDAT001.<br><br>TABLES: PLMZD,<br> &nbsp; &nbsp; &nbsp; &nbsp;PLKOD,<br> &nbsp; &nbsp; &nbsp; &nbsp;PLPOD,<br> &nbsp; &nbsp; &nbsp; &nbsp;STKO.<br><br><br>* Deklaration der internen Tabelle für die Daten.<br> TYPES: BEGIN OF TYP_DATEN,<br> &nbsp; &nbsp; &nbsp;MATNR LIKE MARA-MATNR, &nbsp; &nbsp; &nbsp; &nbsp; &quot;Materialnummer<br> &nbsp; &nbsp; &nbsp;MAKTX LIKE MAKT-MAKTX, &nbsp; &nbsp; &nbsp; &nbsp; &quot;Materialkurztext<br> &nbsp; &nbsp; &nbsp;ARBPL LIKE PLKOD-ARBPL, &nbsp; &nbsp; &nbsp; &nbsp;&quot;Arbeitsplatz<br> &nbsp; &nbsp; &nbsp;PLNSTATU LIKE PLKOD-STATU, &nbsp; &nbsp; &quot;Status Plan<br> &nbsp; &nbsp; &nbsp;KOMPO LIKE PLMZD-BOMAT, &nbsp; &nbsp; &nbsp; &nbsp;&quot;Komponente<br> &nbsp; &nbsp; &nbsp;STCKLST LIKE PLMZD-STLNR, &nbsp; &nbsp; &nbsp;&quot;Stücklistennummer<br> &nbsp; &nbsp; &nbsp;STCKSTAT LIKE STKO-STLST, &nbsp; &nbsp; &nbsp; &quot;Status Stückliste<br>END &nbsp; OF TYP_DATEN.<br><br><br>DATA: INT_DATEN TYPE TYP_DATEN OCCURS 10 WITH HEADER LINE.<br><br><br>SELECTION-SCREEN BEGIN OF BLOCK DATEN WITH FRAME TITLE TEXT-001.<br> &nbsp;PARAMETERS: ARBPL LIKE PLPOD-ARBPL OBLIGATORY.<br> &nbsp;PARAMETERS: PLSTATUS LIKE PLKOD-STATU DEFAULT 'K' OBLIGATORY.<br> &nbsp;SELECT-OPTIONS KOMPON FOR PLMZD-BOMAT OBLIGATORY.<br> &nbsp;PARAMETERS: STSTATUS LIKE STKO-STLST.<br>SELECTION-SCREEN END OF BLOCK DATEN.<br><br>* Plantyp N wird als Default und<br>* das aktuelle Datum als Stichtag gesetzt<br>INITIALIZATION.<br> &nbsp;PN_PLNTY = 'N' .<br> &nbsp;PN_DATUV = SY-DATUM.<br> &nbsp;PN_WERKS-LOW = '0001'.<br><br><br>* Ausblenden einiger Eingabefelder der log. DB PNM<br>AT SELECTION-SCREEN OUTPUT.<br> &nbsp;LOOP AT SCREEN.<br> &nbsp; &nbsp;IF SCREEN-NAME = 'PN_PLNTY' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_PLNTY_%_APP_%-TEXT' OR<br>* &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_MATNR_%_APP_%-OPTI_PUSH' OR<br>* &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_MATNR_%_APP_%-VALU_PUSH' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_WERKS_%_APP_%-OPTI_PUSH' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_WERKS_%_APP_%-VALU_PUSH' OR<br><br>* &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_MATNR_%_APP_%-TEXT' OR<br>* &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_MATNR-LOW' OR<br><br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_WERKS_%_APP_%-TEXT' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_WERKS-LOW' OR<br><br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_DATUV_%_APP_%-TEXT' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_DATUV' OR<br><br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_PLNNR_%_APP_%-TEXT' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_PLNNR_%_APP_%-OPTI_PUSH' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_PLNNR-LOW' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_PLNNR_%_APP_%-TO_TEXT' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_PLNNR-HIGH' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_PLNNR_%_APP_%-VALU_PUSH' OR<br><br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_PLNAL_%_APP_%-TEXT' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_PLNAL_%_APP_%-OPTI_PUSH' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_PLNAL-LOW' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_PLNAL_%_APP_%-TO_TEXT' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_PLNAL-HIGH' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%_PN_PLNAL_%_APP_%-VALU_PUSH' OR<br><br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_WERKS-HIGH' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'MAT' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%CP05008_1000' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_ALL' &nbsp; &nbsp; &nbsp; &nbsp;OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%CP01013_1000' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_ALT' &nbsp; &nbsp; &nbsp; &nbsp;OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%CP02018_1000' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%CP03023_1000' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_CAP' &nbsp; &nbsp; &nbsp; &nbsp;OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%CP04030_1000' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'NOT_MAT' &nbsp; &nbsp; &nbsp; OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%CP06037_1000' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_MEHRS' &nbsp; &nbsp; &nbsp;OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = '%CP07042_1000' OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_STLAL' &nbsp; &nbsp; &nbsp;OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_STLAN' &nbsp; &nbsp; &nbsp;OR<br> &nbsp; &nbsp; &nbsp; SCREEN-NAME = 'PN_CAPID'.<br><br>* &nbsp; &nbsp; &nbsp;SCREEN-NAME = 'PN_MATNR-HIGH'.<br> &nbsp; &nbsp; &nbsp;SCREEN-INVISIBLE = '1'.<br> &nbsp; &nbsp; &nbsp;SCREEN-INPUT = '0'.<br> &nbsp; &nbsp; &nbsp;SCREEN-OUTPUT = '0'.<br> &nbsp; &nbsp; &nbsp;MODIFY SCREEN.<br> &nbsp; &nbsp;ENDIF.<br> &nbsp;ENDLOOP.<br><br>START-OF-SELECTION.<br><br><br>GET PLKOD.<br> &nbsp;CLEAR INT_DATEN.<br> &nbsp;CHECK PLKOD-STATU EQ PLSTATUS.<br> &nbsp;MOVE PLKOD-STATU TO INT_DATEN-PLNSTATU.<br> &nbsp;MOVE PLKOD-STLNR TO INT_DATEN-STCKLST.<br><br> &nbsp;GET PLPOD.<br> &nbsp; &nbsp;CHECK PLPOD-ARBPL EQ ARBPL.<br> &nbsp; &nbsp; &nbsp;MOVE PLPOD-ARBPL TO INT_DATEN-ARBPL.<br><br> &nbsp; &nbsp;GET PLMZD.<br> &nbsp; &nbsp; &nbsp;CHECK PLMZD-BOMAT IN KOMPON.<br> &nbsp; &nbsp; &nbsp; &nbsp;MOVE PLMZD-BOMAT TO INT_DATEN-KOMPO.<br><br>APPEND INT_DATEN.<br><br>END-OF-SELECTION.<br><br>* Falls der Status der Stückliste gegeben ist, so wird die Auswahl auf<br>* diese beschränkt.<br>IF STSTATUS NE ''.<br> &nbsp;LOOP AT INT_DATEN.<br> &nbsp; &nbsp;SELECT SINGLE STLST FROM STKO INTO INT_DATEN-STCKLST WHERE STLNR EQ<br> &nbsp; &nbsp;INT_DATEN-STCKSTAT.<br><br> &nbsp;ENDLOOP.<br><br> &nbsp;DELETE INT_DATEN WHERE STCKSTAT =''.<br>ENDIF.<br><br> &nbsp;WRITE: / 'Ausgabe der Daten:'.<br> &nbsp;SKIP.<br> &nbsp;LOOP AT INT_DATEN.<br>* &nbsp; &nbsp;BREAK-POINT.<br> &nbsp; &nbsp;WRITE: / INT_Daten-MATNR, &nbsp; &nbsp; &quot;Materialnummer<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT_DATEN-MAKTX, &nbsp; &nbsp; &quot;Materialkurztext<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT_DATEN-KOMPO, &nbsp; &nbsp; &quot;Komponente<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT_DATEN-PLNSTATU, &nbsp;&quot;Planstatus<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT_DATEN-ARBPL. &nbsp; &nbsp; &quot;Arbeitsplatz<br> &nbsp;ENDLOOP.<br><br>* Nun müssen die Materialkurztexte hinzugelesen werden...<br><br>LOOP AT INT_DATEN.<br> &nbsp;SELECT SINGLE MAKTX FROM MAKT INTO INT_DATEN-MAKTX WHERE MATNR EQ<br> &nbsp;INT_DATEN-KOMPO.<br>ENDLOOP.<br><br>