Equipmentstückliste lesen

Lesen einer Equipmentstückliste mithilfe der SAP-Standardbausteine

Alternative 1

DATA ls_bom_head  TYPE bicsk.
DATA ls_bom_zub   TYPE stzub.
DATA lt_bom_items TYPE STANDARD TABLE OF bicsp.

PARAMETERS p_equnr TYPE equnr.

START-OF-SELECTION.

*** Lesen der Stückliste
  CALL FUNCTION ‘CS_CI_BOM_READ’
    EXPORTING
      estlan         = ‘4’
      ewerks         = ‘ ‘
      estlty         = ‘E’
      eequnr         = p_equnr
    IMPORTING
      abicsk         = ls_bom_head
      astzub         = ls_bom_zub
    TABLES
      bom_items      = lt_bom_items
    EXCEPTIONS
      alt_invalid    = 1
      alt_not_exist  = 2
      bom_invalid    = 3
      bom_not_exist  = 4
      foreign_lock   = 5
      no_auth        = 6
      system_failure = 7
      OTHERS         = 8.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

Alternative 2

  DATA lt_stb TYPE STANDARD TABLE OF stpox.
  DATA lt_cat TYPE STANDARD TABLE OF cscmat.

  CALL FUNCTION ‘CS_BOM_EXPL_EQU_V2’
    EXPORTING
      capid                 = space
      datuv                 = sy-datum
      eqnrv                 = p_equnr
      stlan                 = ‘4’
      werks                 = space
    TABLES
      stb                   = lt_stb
      matcat                = lt_cat
    EXCEPTIONS
      alt_not_found         = 1
      call_invalid          = 2
      equipment_not_found   = 3
      missing_authorization = 4
      no_bom_found          = 5
      no_plant_data         = 6
      no_suitable_bom_found = 7
      OTHERS                = 8.

Anmerkungen

Wenn es sich um keine Konzernstückliste handelt, muss natürlich das Werk angegeben werden.

Enno Wulff
Letzte Artikel von Enno Wulff (Alle anzeigen)

Leave a Comment