[ABAP] Daten zum Material anzeigen

* siehe auch Report RMMMTREE
PARAMETERS: p_mat TYPE matnr.

START-OF-SELECTION.

* Allgemeine Materialdaten
  SELECT
    FROM mara
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_mara).

* Werksdaten zum Material
  SELECT
    FROM marc
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_marc).

  IF lines( it_marc ) > 0.
* Lagerortdaten zum Material
    SELECT
      FROM mard AS m
      FIELDS *
      FOR ALL ENTRIES IN @it_marc
      WHERE m~matnr EQ @p_mat
        AND m~werks EQ @it_marc-werks
      ORDER BY PRIMARY KEY
      INTO TABLE @DATA(it_mard).
  ENDIF.

* Materialkurztexte
  SELECT
    FROM makt
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_makt).

* STXD SAPscript Text-Datei Header
  SELECT
    FROM stxh
    FIELDS *
    WHERE tdobject EQ 'MATERIAL'
      AND tdname EQ @( |{ p_mat WIDTH = 18 ALPHA = IN }| )
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_stxh).
      
* Reservierung/Sekundärbedarf
  SELECT
    FROM resb
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_resb).

* Bestellanforderung
  SELECT
    FROM eban
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_eban).

* Einkaufsbelegposition
  SELECT
    FROM ekpo
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_ekpo).

  IF lines( it_ekpo ) > 0.
* Einkaufsbelegkopf
    SELECT
      FROM ekko AS e
      FIELDS *
      FOR ALL ENTRIES IN @it_ekpo
      WHERE e~ebeln EQ @it_ekpo-ebeln
      ORDER BY PRIMARY KEY
      INTO TABLE @DATA(it_ekko).
  ENDIF.

* Materialstamm: Standardfelder und spezielle Retail-Felder
  SELECT
    FROM maw1
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_maw1).

  IF lines( it_makt ) > 0.
* Materialstamm-Texte je Mengeneinheit und Text-Id
    SELECT
      FROM mamt AS m
      FIELDS *
      FOR ALL ENTRIES IN @it_makt
      WHERE m~matnr EQ @p_mat
        AND m~spras EQ @it_makt-spras
      ORDER BY PRIMARY KEY
      INTO TABLE @DATA(it_mamt).
  ENDIF.

* Mengeneinheiten zum Material
  SELECT
    FROM marm
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_marm).

  IF lines( it_marm ) > 0.
* Europäische Artikelnummern zum Material
    SELECT
      FROM mean AS m
      FIELDS *
      FOR ALL ENTRIES IN @it_marm
      WHERE m~matnr EQ @p_mat
        AND m~meinh EQ @it_marm-meinh
      ORDER BY PRIMARY KEY
      INTO TABLE @DATA(it_mean).

* Zuordnung von Layoutbausteinen zu Materialien
    SELECT
      FROM malg AS m
      FIELDS *
      FOR ALL ENTRIES IN @it_marm
      WHERE matnr EQ @p_mat
        AND m~meinh EQ @it_marm-meinh
      ORDER BY PRIMARY KEY
      INTO TABLE @DATA(it_malg).
  ENDIF.

* Verkaufsdaten zum Material
  SELECT
    FROM mvke
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_mvke).

* Materialbewertung
  SELECT
    FROM mbew
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_mbwe).

* Materialdaten pro Lagernummer
  SELECT
    FROM mlgn
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_mlgn).

  IF lines( it_mlgn ) > 0.
* Materialdaten pro Lagertyp
    SELECT
      FROM mlgt AS m
      FIELDS *
      FOR ALL ENTRIES IN @it_mlgn
      WHERE m~matnr EQ @p_mat
        AND m~lgnum EQ @it_mlgn-lgnum
      ORDER BY PRIMARY KEY
      INTO TABLE @DATA(it_mlgt).
  ENDIF.

* Einkaufsinfosatz - allgemeine Daten
  SELECT
    FROM eina
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_eina).

  IF lines( it_eina ) > 0.
* Einkaufsinfosatz - Einkaufsorganisationsdaten
    SELECT
      FROM eine AS e
      FIELDS *
      FOR ALL ENTRIES IN @it_eina
      WHERE e~infnr EQ @it_eina-infnr
      ORDER BY PRIMARY KEY
      INTO TABLE @DATA(it_eine).
  ENDIF.

* Materialstammstatus
  SELECT
    FROM msta
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_msta).

* noch offene Materialstaemme
  SELECT
    FROM moff
    FIELDS *
    WHERE matnr EQ @p_mat
      ORDER BY statm
      INTO TABLE @DATA(it_moff).

* Planauftrag
  SELECT
    FROM plaf
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_plaf).

* Kopfsatz für Bedarfssummensätze im MRP
  SELECT
    FROM rqhd
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_rqhd).

* Positionssatz für Bedarfssummensätze im MRP
  SELECT
    FROM rqit
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_rqit).

* Material (Konditionssätze)
  SELECT
    FROM a004
    FIELDS *
    WHERE matnr EQ @p_mat
    ORDER BY PRIMARY KEY
    INTO TABLE @DATA(it_a004).

  IF lines( it_a004 ) > 0.
* Konditionen (Kopf)
    SELECT
      FROM konh
      FIELDS *
      FOR ALL ENTRIES IN @it_a004
      WHERE knumh EQ @it_a004-knumh
      ORDER BY PRIMARY KEY
      INTO TABLE @DATA(it_konh).

* Konditionen (Position)
    SELECT
      FROM konp
      FIELDS *
      FOR ALL ENTRIES IN @it_a004
      WHERE knumh EQ @it_a004-knumh
      ORDER BY PRIMARY KEY
      INTO TABLE @DATA(it_konp).
  ENDIF.

  cl_demo_output=>next_section( 'Materialstamm' ).
  cl_demo_output=>write_data( value = it_mara name = 'MARA (Allgemeine Materialdaten)' ).
  cl_demo_output=>write_data( value = it_marc name = 'MARC (Werksdaten zum Material)' ).
  cl_demo_output=>write_data( value = it_mard name = 'MARD (Lagerortdaten zum Material)').
  cl_demo_output=>next_section( 'Texte' ).
  cl_demo_output=>write_data( value = it_makt name = 'MAKT (Materialkurztexte)').
  cl_demo_output=>write_data( value = it_stxh name = 'STXH (STXD SAPscript Text-Datei Header)').
  cl_demo_output=>next_section( 'Einkauf' ).
  cl_demo_output=>write_data( value = it_resb name = 'RESB (Reservierung/Sekundärbedarf)').
  cl_demo_output=>write_data( value = it_eban name = 'EBAN (Bestellanforderung)').
  cl_demo_output=>write_data( value = it_ekko name = 'EKKO (Einkaufsbelegkopf)').
  cl_demo_output=>write_data( value = it_ekpo name = 'EKPO (Einkaufsbelegposition)').
  cl_demo_output=>next_section( 'Infosatz' ).
  cl_demo_output=>write_data( value = it_eina name = 'EINA (Einkaufsinfosatz - allgemeine Daten)').
  cl_demo_output=>write_data( value = it_eine name = 'EINE (Einkaufsinfosatz - Einkaufsorganisationsdaten)').
  cl_demo_output=>next_section( 'Konditionen' ).
  cl_demo_output=>write_data( value = it_a004 name = 'A004 (Material (Konditionssätze)').
  cl_demo_output=>write_data( value = it_konh name = 'KONH (Konditionen (Kopf))').
  cl_demo_output=>write_data( value = it_konp name = 'KONP (Konditionen (Position))').
  cl_demo_output=>next_section( 'Bewertung' ).
  cl_demo_output=>write_data( value = it_mbwe name = 'MBEW (Materialbewertung)').
  cl_demo_output=>next_section( 'Verkaufsdaten' ).
  cl_demo_output=>write_data( value = it_mvke name = 'MVKE (Verkaufsdaten zum Material)').
  cl_demo_output=>next_section( 'Mengeneinheiten' ).
  cl_demo_output=>write_data( value = it_marm name = 'MARM (Mengeneinheiten zum Material)').
  cl_demo_output=>next_section( 'Materialdaten' ).
  cl_demo_output=>write_data( value = it_mlgn name = 'MLGN (Materialdaten pro Lagernummer)').
  cl_demo_output=>write_data( value = it_mlgt name = 'MLGT (Materialdaten pro Lagertyp)').
  cl_demo_output=>next_section( 'Planaufträge' ).
  cl_demo_output=>write_data( value = it_plaf name = 'PLAF (Planauftrag)').
  cl_demo_output=>next_section( 'MRP' ).
  cl_demo_output=>write_data( value = it_rqhd name = 'RQHD (Kopfsatz für Bedarfssummensätze im MRP)').
  cl_demo_output=>write_data( value = it_rqit name = 'RQIT (Positionssatz für Bedarfssummensätze im MRP)').
  cl_demo_output=>next_section( 'Materialstammstatus' ).
  cl_demo_output=>write_data( value = it_msta name = 'MSTA (Materialstammstatus)').
  cl_demo_output=>write_data( value = it_moff name = 'MOFF (noch offene Materialstaemme)').
  cl_demo_output=>next_section( 'Sonstges' ).
  cl_demo_output=>write_data( value = it_maw1 name = 'MAW1 (Materialstamm: Standardfelder und spezielle Retail-Felder)').
  cl_demo_output=>write_data( value = it_mamt name = 'MAMT (Materialstamm-Texte je Mengeneinheit und Text-Id)').
  cl_demo_output=>write_data( value = it_mean name = 'MEAN (Europäische Artikelnummern zum Material)').
  cl_demo_output=>write_data( value = it_malg name = 'MALG (Zuordnung von Layoutbausteinen zu Materialien)').

*   HTML-Code vom Demo-Output holen
  DATA(lv_html) = cl_demo_output=>get( ).

*   Daten im Inline-Browser im SAP-Fenster anzeigen
  cl_abap_browser=>show_html( EXPORTING title       = 'Material'
                                        html_string = lv_html
                                        container   = cl_gui_container=>default_screen ).

* leere Standard-Toolbar ausblenden
  cl_abap_list_layout=>suppress_toolbar( ).

* cl_gui_container=>default_screen erzwingen
  WRITE: space.

[ABAP] KPRO: Prüfen, ob Verbindung zum Content-Repository eingerichtet ist

CONSTANTS: c_none TYPE string VALUE '0 '.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE title.
* CR
  SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (17) lbl1 FOR FIELD p_crep.
    PARAMETERS: p_crep TYPE scms_crep MATCHCODE OBJECT h_crep_http.
  SELECTION-SCREEN END OF LINE.
* 'N'
  SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (17) lbl2 FOR FIELD p_rbs1.
    PARAMETERS: p_rbs1 RADIOBUTTON GROUP rbg DEFAULT 'X'.
  SELECTION-SCREEN END OF LINE.
* 'S'
  SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (17) lbl3 FOR FIELD p_rbs2.
    PARAMETERS: p_rbs2 RADIOBUTTON GROUP rbg.
  SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.

INITIALIZATION.

  title = 'Auswahl'.
  lbl1 = 'Content Repository:'.
  lbl2 = 'Security (N):'.
  lbl3 = 'Security (S):'.

START-OF-SELECTION.
* CREP_HTTP (KPRO CMS: Content-Repositories (HTTP))
  SELECT SINGLE
    FROM crep_http
    FIELDS crep_id,
           http_serv,
           http_port,
           http_sport,
           http_scrpt,
           version
    WHERE crep_id = @p_crep
    INTO @DATA(lv_crep).

  IF sy-subrc EQ 0.
    IF NOT lv_crep-http_port CO c_none OR lv_crep-http_sport CO c_none.

      DATA(lv_sec) = 'N'.

* Security-Typ unterscheiden
      CASE abap_true.
        WHEN p_rbs1.
          lv_sec = 'N'.
        WHEN p_rbs2.
          lv_sec = 'S'.
      ENDCASE.

* CMS: HTTP Verbindungstest
      CALL FUNCTION 'SCMS_HTTP_PING'
        EXPORTING
          crep_id    = lv_crep-crep_id
          http_serv  = lv_crep-http_serv
          http_port  = lv_crep-http_port
          http_sport = lv_crep-http_sport
          http_scrpt = lv_crep-http_scrpt
          version    = lv_crep-version
          security   = lv_sec
        EXCEPTIONS
          error_http = 1
          OTHERS     = 2.

      IF sy-subrc = 0.
        WRITE: / |{ lv_crep-crep_id } ok.|.
      else.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO DATA(lv_msg).
        WRITE: / lv_msg.
      ENDIF.
    ELSE.
      WRITE: / 'No port.'.
    ENDIF.
  ELSE.
    WRITE: / 'No CS.'.
  ENDIF.

[SAP] Screen Personas

Transaktionen

/PERSONAS/ADMIN (Administration SAP Screen Personas)

  • im Abschnitt „Health Checks“ prüfen, dass keine Fehler auftreten

/PERSONAS/ANALYTICS (Personas – Analyse)
/PERSONAS/FLAVORS (Personas – Flavors)
/PERSONAS/HEALTH (Personas Health Check)
/PERSONAS/LAUNCH (Personas Flavor Launcher)
/PERSONAS/LIBRARY (MIME Object Library)
/PERSONAS/RESOURCES (Resource Maintenance)
/PERSONAS/ROLES (Role Maintenance)
/PERSONAS/SE (Slipstream Engine starten)
/PERSONAS/SETTINGS (Personas – Globale Einstellungen)
/PERSONAS/TEMPLATES (Templates Maintenance)
/PERSONAS/THEMES (Theme Maintenance)
/PERSONAS/TRANSPORTS (Transports UI)
/PERSONAS/USERS (User Maintenance)
RZ11 (Pflege der Profilparameter)

  • Systemparameter em/global_area_MB sollte >= 1GB sein

Aufruf

  • Service Pfad
    SICF
    Service Pfad: /default_host/sap/bc/personas (SAP Screen Personas 3.0)
    Rechtsklick + Service testen.
    
  • URL
    https://host.domain:port/sap/bc/personas
    
  • Slipstream Engine
    https://host.domain:port/sap/bc/se/m
    

SICF-Services

/default_host/sap/bc/personas (SAP Screen Personas 3.0 Vorkonfigurierte SAP GUI for HTML mit aktivem SAP Screen Personas 3.0.)
/default_host/sap/bc/personas3 (/PERSONAS/CL_MIME_ZIP_HANDLER)
/default_host/sap/bc/gui/sap/its/webgui (SAP GUI for HTML)
/default_host/sap/public/bc/ui5_ui5 (SAPUI5-Bibliothek über HTTP aus MIME-Repository aufgerufen)
/default_host/sap/bc/se/ (Slipstream-Root-Service)
/default_host/sap/bc/se/m (Wurzelknoten für SE-Quellen)
/default_host/sap/bc/se/proxy (Proxy-Service für Slipstream Engine)
/default_host/sap/bc/se/rg (Einfacher ITS-Rest-GUI-Handler)

Vorkonfigurerte Rollen

/PERSONAS/ADMIN_ROLE (umfassende Berechtigungen für alle SAP-Screen-Personas-Funktionen)
/PERSONAS/CONSUMER_ROLE (Standardbenutzer mit der Berechtigung, Flavors zu verwalten)
/PERSONAS/EDITOR_ROLE (Geschäftsbenutzer mit Berechtigungen für eine vollständige Bearbeitung)

Links

[CDS-Views] Virtuelle Elemente: Aufruf von ABAP-Coding aus CDS-Views heraus

Virtuelle Elemente bieten Möglichkeiten Berechnungs- und Verarbeitungslogik von Feldwerten mittels ABAP-Klassen durchzuführen:

Links