Hallo,
wer kann hier mal drauf schauen. Es erfolgt immer eine Fehlermeldung an der Stelle des Smileys mit der Aussage, dass eine abweichende Parameterzahl in FORM und PERFORM (Routine: FILL_ITAB, Anzahl formaler Parameter: 1 , Anzahl aktueller Parameter: 2) existiert. Irgendwie gucke ich wahrscheinlich schon zu lange drauf...
Danke
dello
REPORT ZBC400_51_FORMS.
*Def. Konstante zur Übergabe von sy-subrc zurück an Rahmenprogramm,denn
*Berechtigungsprüfung findet im U-Prog. statt und der Wert muß zurück
*ins Rahmenprogramm, denn dort wird entschieden über IF was passiert
*wenn sy-subrc=0
constants activate_disp TYPE activ_auth VALUE '03'.
DATA: itab_flight TYPE sbc400_t_sbc400focc.
DATA: subrc LIKE sy-subrc.
PARAMETERS: pa_car TYPE s_carr_id.
START-OF-SELECTION.
PERFORM auth_check USING pa_car
activate_disp
CHANGING subrc.
IF subrc = 0.
PERFORM ???fill_itab USING pa_car
CHANGING itab_flight.
SORT itab_flight BY percentage.
PERFORM write_itab USING itab_flight.
ENDIF.
*&---------------------------------------------------------------------*
*& Form FILL_ITAB
*&---------------------------------------------------------------------*
FORM fill_itab USING VALUE(iv_carrid) TYPE S_CARR_ID.
CHANGING ct_flight TYPE sbc400_t_sbc400focc.
DATA ls_flight TYPE sbc400focc. " local structure
SELECT carrid connid fldate seatsmax seatsocc FROM sflight INTO
CORRESPONDING FIELDS OF TABLE ct_flight WHERE carrid = iv_carrid.
IF sy-subrc = 0.
LOOP AT ct_flight INTO ls_flight.
* Berechnung der prozentualen Flugauslastung
ls_flight-percentage = ls_flight-seatsocc * 100 /
ls_flight-seatsmax.
MODIFY ct_flight FROM ls_flight INDEX sy-tabix
TRANSPORTING percentage.
ENDLOOP.
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form WRITE_ITAB
*&---------------------------------------------------------------------*
FORM write_itab USING it_flight TYPE sbc400_t_sbc400focc.
DATA: ls_flight TYPE sbc400focc.
ULINE.
*Ausgabe Listenüberschriften
write: /1(10) 'Fluggesellschaft' COLOR Col_NORMAL,
19(12) 'Flugnummer' COLOR Col_KEY,
31(7) 'Datum' COLOR Col_TOTAL,
46(12) 'Sitze(max.)' COLOR Col_POSITIVE,
61(13) 'Sitze(geb.)' COLOR Col_NEGATIVE,
74(16) 'Flugauslastung' COLOR Col_GROUP,
90(3) '%' COLOR Col_BACKGROUND.
SKIP.
ULINE.
*Ausgabe in einer Liste mit Berechnungsfeld und Prozentangabe
LOOP AT it_flight INTO ls_flight.
WRITE AT: /1(10) ls_flight-carrid COLOR COL_Key,
19(12) ls_flight-connid COLOR COL_Key,
31(7) ls_sflight-fldate COLOR COL_Key,
38(12) ls_sflight-seatsmax,
52(13) ls_sflight-seatsocc,
68(12) ls_sflight-percentage,
90(3) '%'.
ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form AUTHORITY_SCARRID
*&---------------------------------------------------------------------*
FORM auth_check USING VALUE(iv_carrid) TYPE S_CARR_ID
VALUE(iv_actvt) TYPE activate_disp
CHANGING cv_return LIKE sy-subrc.
AUTHORITY-CHECK OBJECT 'S_CARRID'
ID 'carrid' FIELD 'iv_carrid'
ID 'ACTVT' FIELD 'iv_actvt'.
cv_return = sy-subrc.
IF sy-subrc ne 0.
MESSAGE E003(ZBC400_51) WITH pa_car.
ENDIF.
ENDFORM.