Code: Alles auswählen.
*&---------------------------------------------------------------------*
*& Report ZMM_DRUMATNR_BB
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zmm_drumatnr_bb.
DATA:
it_mara TYPE TABLE OF mara,
wa_mara TYPE mara,
it_makt TYPE TABLE OF makt,
wa_makt TYPE makt.
DATA:
g_zaehler TYPE i.
*** S E L E K T I O N S B I L D ****************************************
SELECTION-SCREEN BEGIN OF BLOCK selektion WITH FRAME TITLE text-001.
SELECT-OPTIONS:
so_matnr FOR wa_mara-matnr OBLIGATORY.
SELECTION-SCREEN END OF BLOCK selektion.
*** H A U P T V E R A R B E I T U N G **********************************
START-OF-SELECTION.
CLEAR: it_mara,
it_makt.
SELECT * FROM mara INTO TABLE it_mara
WHERE matnr IN so_matnr.
SELECT * FROM makt INTO TABLE it_makt
WHERE matnr IN so_matnr.
IF sy-subrc <> 0.
MESSAGE ID 'ZBLOSCHAN' TYPE 'I' NUMBER 000.
ELSE.
* open print job
CALL FUNCTION 'OPEN_FORM'
EXPORTING
device = 'PRINTER'
form = 'ZMM_DRUMATNR_BB'
dialog = 'X'
EXCEPTIONS
canceled = 1
device = 2
form = 3
OPTIONS = 4
unclosed = 5
OTHERS = 6.
IF sy-subrc <> 0.
WRITE 'Error in open_form'(001).
EXIT.
ENDIF.
LOOP AT it_mara INTO wa_mara.
LOOP AT it_makt INTO wa_makt.
IF wa_mara-matnr = wa_makt-matnr.
* WRITE: / wa_mara-matnr, wa_makt-maktx, wa_mara-brgew, wa_mara-ntgew, wa_mara-volum, wa_mara-meins.
* Kopf
CALL FUNCTION 'START_FORM'
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
WRITE 'Error in start_form'(002).
EXIT.
ENDIF.
* Main
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'HEADING'
function = 'SET'
type = 'TOP'
window = 'MAIN'
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
WRITE 'Error in write_form printing top element of main'(003).
EXIT.
ENDIF.
* Fuss
CALL FUNCTION 'END_FORM'
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
WRITE 'Error in end_form'(006).
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
g_zaehler = g_zaehler + 1.
ENDLOOP.
WRITE: / g_zaehler.
* close print job
CALL FUNCTION 'CLOSE_FORM'
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
WRITE 'Error in close_form'(007).
EXIT.
ENDIF.
ENDIF.
Wo folgt denn das? Ich seh keins. Reinkopieren vergessen?muggel hat geschrieben:Hi, folgendes Coding
Oder Hartnäckigkeit - so war es bei meinem ersten Formularmuggel hat geschrieben:wenn du die Daten mittels SAPscript ausgeben sollst
brauchst du zumindest einen 2-tägigen Überlick-Kurs.
Ihr direkt das komplizierteste Formular, was die SAP mitliefert, aufs Auge zu drücken, finde ich nicht ganz fairmuggel hat geschrieben:Ein Beispiel für den Bestelldruck ist Formular "ZMEDRUCK".
Den kannst du dir ja mal "reinziehen".