Ansicht
Dokumentation

CSAP_MAT_BOM_OPEN - NOTRANSL: API Stücklisten: Eröffnen Materialstückliste für Änderungen

CSAP_MAT_BOM_OPEN - NOTRANSL: API Stücklisten: Eröffnen Materialstückliste für Änderungen

Vendor Master (General Section)   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

The function modules CSAP_MAT_BOM_OPEN, CSAP_BOM_ITEM_MAINTAIN, and CSAP_MAT_BOM_CLOSE belong together as one unit.

Function module CSAP_MAT_BOM_OPEN opens a BOM so that you can make changes. The BOM is imported as it stands on the valid-from date you enter, and is locked for other users. You see a table of items and the BOM header data, unless an error occurs opening the BOM.

Provided that the BOM is opened without errors, you can then use function module CSAP_BOM_ITEM_MAINTAIN to edit individual items.

Once you have made your changes, use function module CSAP_MAT_BOM_CLOSE to exit BOM processing. Your changes are saved, and the BOM is unlocked.

Current restrictions:

  • You can only edit one alternative or variant at a time. You cannot enter an alternative for function module CSAP_MAT_BOM_OPEN, so you always see alternative 01.
  • There is no function module for making changes to header data.

Please note:

  • If you see the message 'Item cannot be changed' in the log, this means one of the following:
    - The item is not valid on the valid-from date you entered. The item
    becomes valid on a later date.
    - The item has been changed on the valid-from date you entered, using
    a different change number.
  • You cannot change the item category of an existing item.
  • If you want to delete an item, set the deletion indicator for the item.
  • You can only edit each item once from when you open the BOM until when you close the BOM.

Example

*---- Feldleiste Stücklistenkopfdaten
data: begin of tstk2.
include structure stko_api02.
data: end of tstk2.
*---- Tabelle Stücklistenpositionen
data: begin of tstp2 occurs 0.
include structure stpo_api02.
data: end of tstp2.

*---- Tabellen für Beziehungswissen:
* Basisdaten
data: begin of tdep2_data occurs 0.
include structure dep_data.
data: end of tdep2_data.
* Beschreibung
data: begin of tdep2_descr occurs 0.
include structure dep_descr.
data: end of tdep2_descr.
* Source
data: begin of tdep2_source occurs 0.
include structure dep_source.
data: end of tdep2_source.
* Reihenfolge
data: begin of tdep2_order occurs 0.
include structure dep_order.
data: end of tdep2_order.
* Dokumentation
data: begin of tdep2_doc occurs 0.
include structure dep_doc.
data: end of tdep2_doc.

data: flg_warning like capiflag-warning.


*- Datenbankprotokoll eröffnen
call function 'CALO_INIT_API'
exceptions
log_object_not_found = 1
log_sub_object_not_found = 2
other_error = 3
others = 4.

*- Eröffnen der Stückliste für Änderungen
call function 'CSAP_MAT_BOM_OPEN'
exporting
material = 'MAT100'
plant = '0001'
bom_usage = '1'
* valid_from = '20.12.1996'
change_no = 'AE001'
importing
o_stko = tstk2
fl_warning = flg_warning
tables
t_stpo = tstp2
exceptions
error = 1.

loop at tstp2.
clear: tdep2_data,
tdep2_source,
tdep2_descr,
tdep2_order,
tdep2_doc.
refresh: tdep2_data,
tdep2_source,
tdep2_descr,
tdep2_order,
tdep2_doc.
case tstp2-item_no.
*---- Löschen der Position 0020
when '0020'.
tstp2-fldelete = 'X'.
Perform item_maintain.
*---- Mengenänderung für Position 0050
when '0050'.
tstp2-comp_qty = '3'.
perform item_maintain.
*---- Sourceänderung am Beziehungswissen zu Position 0060
when '0060'.
tdep2_source-line_no = '1'.
tdep2_source-line = 'Farbe = ''blau'''.
append tdep2_source.
perform item_maintain.
endcase.
endloop.
*- Neue Position ITEM_NODE und ITEM_COUNT müssen initial sein
clear: tdep2_data,
tdep2_source,
tdep2_descr,
tdep2_order,
tdep2_doc.
refresh: tdep2_data,
tdep2_source,
tdep2_descr,
tdep2_order,
tdep2_doc.
tstp2-item_no = '0070'.
tstp2-item_categ = 'L'.
tstp2-component = 'MAT600'.
tstp2-comp_qty = '3,000'.
perform item_maintain.

call function 'CSAP_MAT_BOM_CLOSE'
importing
fl_warning = flg_warning
exceptions
error = 1.


*- Unterroutine
Form item_maintain.

call function 'CSAP_BOM_ITEM_MAINTAIN'
exporting
i_stpo = tstp2
importing
fl_warning = flg_warning
tables
t_dep_data =
t_dep_descr =
t_dep_order =
t_dep_source = tdep2_source
t_dep_doc =
exceptions
error = 1
others = 2.

endform.


Notes

Further information





Parameters

ALTERNATIVE
BOM_USAGE
CHANGE_NO
FL_NO_CHANGE_DOC
FL_WARNING
MATERIAL
O_STKO
PLANT
REVISION_LEVEL
T_DEP_DATA
T_DEP_DESCR
T_DEP_DOC
T_DEP_ORDER
T_DEP_SOURCE
T_STPO
VALID_FROM

Exceptions

ERROR

Function Group

CSAP

ABAP Short Reference   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.

Length: 6445 Date: 20240523 Time: 121121     sap01-206 ( 55 ms )