Ansicht
Dokumentation
CSAP_DOC_BOM_CREATE - NOTRANSL: API Stücklisten: Dokumentstückliste anlegen
General Data in Customer Master Vendor Master (General Section)This documentation is copyright by SAP AG.
Functionality
You can use this module to create simple document structures.
You cannot extend a variant document structure with this module.
(Transaction CV11)
Restrictions:
- Long texts are not yet supported.
The structure is only saved if no errors occur.
Please note:
- Fields that are not available for entry according to the field selection are initialized. The log does not currently contain information on initialized fields.
- As in dialog mode, the control data for default values and the user-specific defaults are read.
- Default values that are usage-dependent (for example, the indicator for relevancy to production, and so on) are not read.
Example
*---- Feldleiste Stücklistenkopfdaten
data: begin of tstko.
include structure stko_api01.
data: end of tstko.
*---- Tabelle Stücklistenpositionen
data: begin of tstpo occurs 0.
include structure stpo_api01.
data: end of tstpo.
data: flg_warning like capiflag-flwarning.
*- 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.
*- Kopfdaten füllen
tstko-base_quan = '1.000'.
tstko-bom_text = 'Stücklistentext'.
*- Positionsdaten füllen
* 1. Position (Textposition)
clear tstpo.
tstpo-item_no = '0010'.
tstpo-item_categ = 'T'. "Mußeingabe
tstpo-item_text1 = 'Positionstext'. "Mußeingabe
append tstpo.
* 2. Position (Dokumentposition)
clear tstpo.
tstpo-item_no = '0020'.
tstpo-item_categ = 'D'. "Mußeingabe
tstpo-document = 'DOK2'. "Mußeingabe
tstpo-doc_type = 'DRW'. "Mußeingabe
tstpo-doc_part = '001'.
tstpo-doc_vers = '01'.
tstpo-comp_qty = '1.000'.
tstpo-comp_unit = 'ST'.
append tstpo.
* 3. Position (Dokumentposition)
clear tstpo.
tstpo-item_no = '0030'.
tstpo-item_categ = 'D'. "Mußeingabe
tstpo-document = 'DOK3'. "Mußeingabe
tstpo-doc_type = 'DRW'. "Mußeingabe
tstpo-doc_part = '001'.
tstpo-doc_vers = '01'.
tstpo-comp_qty = '1.000'.
tstpo-comp_unit = 'ST'.
append tstpo.
*- Dokumentstückliste anlegen
call function 'CSAP_DOC_BOM_CREATE'
exporting
document = 'DOC1'
doc_type = 'DRW'
valid_from = '01.01.1996'
i_stko = tstko
importing
fl_warning = flg_warning
tables
t_stpo = tstpo
exceptions
error = 1.
if sy-subrc eq 1.
* Fehler aufgetreten (Stückliste kann nicht angelegt werden)
* 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
CHANGE_NODOCUMENT
DOC_PART
DOC_TYPE
DOC_VERS
FL_CAD
FL_COMMIT_AND_WAIT
FL_DEFAULT_VALUES
FL_NO_CHANGE_DOC
FL_RECURSIVE
FL_WARNING
I_STKO
REVISION_LEVEL
T_LTX_LINE
T_STPO
VALID_FROM
Exceptions
ERRORFunction Group
CSAPSUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up General Data in Customer Master
This documentation is copyright by SAP AG.
Length: 4206 Date: 20240523 Time: 093626 sap01-206 ( 38 ms )