Ansicht
Dokumentation

/DSCSAG/DOC_BOM_READ3 - @PLM++ 4.5: Like the CDESK_SRV_GET_STRUCTURE

/DSCSAG/DOC_BOM_READ3 - @PLM++ 4.5: Like the CDESK_SRV_GET_STRUCTURE

rdisp/max_wprun_time - Maximum work process run time   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

Function module CSAP_DOC_BOM_MAINTAIN is used to process simple document structures.
This function module is primarily for changing structures, but can also be used to create structures.

If you only want to create structures, use function module CSAP_DOC_BOM_CREATE.

Restrictions:

  • You can currently process one variant only.
  • Changes to header data are not currently supported.

Please note:

  • There are two ways of identifying the item you want to change:
  • Enter the item category, item number, sort string, and object fields (depending on the item category, this can be material, document, or class data).
    The field names of these fields start with ID_ and are in structure CSIDENT_02, which is part of structure STPO_API03.
    You can select any fields to identify your item, but you must ensure that your entries identify one item only. Otherwise, you see an error message because no item can be found.

  • Enter the node and item counter.
    These fields are only known if you have already read the structure.

  • You may see an error message in the log, telling you that the item cannot be changed. Either:
    - the item is not yet valid of the valid-from date
    - the item has been processed with another change number on the
    valid-from date
  • You cannot change the item category of an existing item.
  • If you want to delete an item, identify the item in one of the ways described above and set the deletion indicator.
  • FL_BOM_CREATE (Default ' ')
    If you set this indicator to 'X', a new document structure is created if the structure you want to change is not found and no other error occurs.
    You can only add items if the data is available.
    Items with a deletion indicator are ignored when you create a document structure.
  • FL_NEW_ITEM (Default ' ')
    If you set this indicator to 'X', you create a new item if the item you enter is not found.
    Items with a deletion indicator are ignored.

Example

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

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.

*- Positionsdaten füllen
* Annahme: Positionen können über die Positionsnummer eindeutig iden-
* tifiziert werden
* 1. Position 0010 löschen
clear tstp3.
tstp3-id_item_no = '0010'. "Identifizierung Pos.
tstp3-fldelete = 'X'.
append tstp3.
* 2. Position 0020: Dokument ändern
clear tstp3.
tstp3-id_item_no = '0020'. "Identifizierung Pos.
tstp3-document = 'DOK3'
append tstp3.
*- 3. Neue Position 0040 (Dokumentposition)
* Für neue Positionen sind die ID_ Felder und Stücklistenknoten und
* Stücklistenpositionszähler initial, es sei denn sie arbeiten mit
* FLG_NEW_ITEM
clear tstp3.
tstp3-item_no = '0040'.
tstp3-document = 'DOK2'. "Mußeingabe
tstp3-doc_type = 'DRW'. "Mußeingabe
tstp3-doc_part = '002'.
tstp3-doc_vers = '01'.
tstp3-comp_unit = 'ST'.
tstp3-item_categ = 'D'.
tstp3-comp_qty = '1'.
append tstp3.
* 4. Neue Position 0050 (Textposition)
* Für neue Positionen sind die ID_ Felder und Stücklistenknoten und
* Stücklistenpositionszähler initial, es sei denn sie arbeiten mit
clear tstpo.
tstp3-item_no = '0050'.
tstp3-item_categ = 'T'. "Mußeingabe
tstp3-item_text1 = 'Positionstext'. "Mußeingabe
append tstp3.

*- Stückliste ändern
call function 'CSAP_DOC_BOM_MAINTAIN'
exporting
document = 'DOC1'
doc_type = 'DRW'
valid_from = '15.10.1996'
fl_bom_create = ' '
fl_new_item = ' '
i_stko = tstko
importing
fl_warning = flg_warning
o_stko = tstk2
tables
t_stpo = tstp3
exceptions
error = 1.

if sy-subrc eq 1.
*---- Fehler aufgetreten
* Bitte Protokoll auswerten
endif.
if flg_warning eq 'X'.
*---- Bitte Protokoll auswerten. Dieses enthält Informationen, War-
* nungen und Erfolgsmeldungen
Endif.

Notes

Further information





Parameters

ET_BOM_ITEM_DOC_ID_KEY
ET_BOM_RETURNS
ET_INST_METADATA
ET_INST_TMX
ET_STKO
ET_STPO
IV_CHANGE_NO
IV_CLIENT_VERSION
IV_DOCUMENTNUMBER
IV_DOCUMENTPART
IV_DOCUMENTTYPE
IV_DOCUMENTVERSION
IV_GET_INSTANCE
IV_USE_LAST_VALID_FROM
IV_VALID_FROM
IV_VALID_TO
RETURN
RUNTIME
VERSION_ID

Exceptions

Function Group

SAG/SAPLDOCUMENT2

ROGBILLS - Synchronize billing plans   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 6173 Date: 20240416 Time: 090207     sap01-206 ( 54 ms )