Fonction SAP BAPI_WRF_MATGRP_CREATE - BAPI_WRF_MATGRP_CREATE

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
DESCRIPTION_HIERARCHY BAPI_WRF_DESC_CR_HIER_TTY h 43 BAPI CREATE Structure: Article Hierarchy Description
DESCRIPTION_STRUCTURE BAPI_WRF_DESC_CR_STRUC_TTY h 119 BAPI CREATE Structure: Hierarchy Node Description
EXTENSION_IN BAPI_WRF_EXTENSION_TTY h 990 Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
HIERARCHY_DATA BAPI_WRF_HIER_CREATE_HEAD u 12 BAPI CREATE Structure: Article Hierarchy Header
HIERARCHY_STRUCTURE BAPI_WRF_HIER_CR_STRUC_TTY h 48 BAPI CREATE Structure: Article Hierarchy Structure
TESTRUN BAPI_WRF_TESTRUN_STY u 1 Simulation (X or Space)

Paramètre Reférence Type Long. Description
RETURN BAPI_WRF_RETURN_TTY h 548 Return Parameter(s)

Functionality
Initial creation of structure data of an article hierarchy.
With this BAPI you can build up a hierarchy in a SAP System for eachcall-up. The new hierarchy to be created receives the status "planned".By way of the interface parameter HIERARCHY_DATA, the header data of anarticle hierarchy is transferred. The important field of the importparameter is the hierarchy ID to which the following tables refer. Intable HIERARCHY_STRUCURE, the data for creation of the article hierarchynodes are shown. Nodes and parent nodes are the elementary fields of thetable. Language-dependent descriptions of the hierarchy and the nodesare transferred in tables DESCRIPTION_HIERARCHY andDESCRIPTION_STRUCTURE.
The parameter test run is used in order to test the structure beforeactually creating the hierarchy in the database. Creation of thehierarchy is only simulated and the data is not updated.

Description
In order that the BAPI can record all possible error situations andclassify them appropriately, the parameter Return is created via whichmessages concerning exception or success situations can be returned tothe calling program. Error messages, such as MESSAGE, for example, areto be avoided. In particular, a termination may not be generated or adialog screen output. Instead, all messages must be captured internallyand in the parameter Return, returned to the calling application.Otherwise the BAPI is not processed correctly and there is no guaranteethat the control is returned to the calling program.
Fields of the parameter:
TYPE
The possible message types are exported with this. The following typesare defined:
S is a success message
E is an Error message
W is a Warning message
I is an Information message
A is an Abort message
ID
The indicator stands for the message class to which a message belongs.
NUMBER
Message number
MESSAGE
Complete message text from the message table.
LOG_NO
Number of the application log.
LOG_MSG_NO
Sequential number of the message in the application log.
MESSAGE_V1, MESSAGE_V2, MESSAGE_V3, MESSAGE_V4
Fields for the variable texts of the message that is identified in thefields ID and NUMBER .
PARAMETER
Parameter in which the incorrect value is to be found.
ROW
Row number of the data record in which the incorrect value is to befound.
FIELD
Field in which the incorrect value is to be found.
SYSTEM
System (logical system) in which the message was generated
DESCRIPTION_HIERARCHY
Table DESCRIPTION_HIERARCHY contains the language-dependent names of thearticle hierarchy. On creation of the article hierarchy via the BAPIinterface, provision of the name is not necessary. However, iflanguage-dependent texts are created, then the following parameters arealso mandatory fields.
Fields of the parameter
LANGU, LANGU_ISO
Language keys. On import of the language-dependent data into the BAPI,LANGU_ISO is only considered if no value has been entered in the fieldLANGU. However, one of the parameters must be full.
DESCRIPTION_STRUCTURE


Table DESCRIPTION_STRUCTURE contains the language-dependent names of thehierarchy nodes. On creation of the article hierarchy via the BAPIinterface, provision of the name is not necessary. However, iflanguage-dependent texts are created, then the following parameters arealso mandatory fields.
Fields of the parameter
NODE
The hierarchy node to which the name is assigned. In this parameter, thenode ID is transferred from the external application.
LANGU, LANGU_ISO
Language keys. On import of the language-dependent data into the BAPI,LANGU_ISO is only considered if no value has been entered in fieldLANGU. One of the parameters must be full.
NODE_DESCRIPTION
The short text that can be assigned to the hierarchy node.
NODE_DESCRIPTION_L
The long text that can be assigned to the hierarchy node.
EXTENSION_IN
In order to enable customer extensions of the BAPI withoutmodifications, the BAPI BAPI_WRF_MATGRP_CREATE has an Extension_Inparameter for the data import. Extensions are passed to the BAPI in acontainer and can be processed within the BAPI function module. TheExtension_In parameter is based on the structure BAPIPAREX. The data istransferred to the BAdI in a table.
Fields of the parameter
The format of the individual data records of this table is determined bystructure BAPIPAREX. This contains multiple data record fields(VALUEPART1, VALUEPART2, ...) and also a field for the name of a helpstructure (STRUCTURE). Since for each data record, the data is writtenbit by bit in a row in the data record fields available, a helpstructure is required to interpret the data.
HIERARCHY_DATA
The structure HIERARCHY_DATA contains the header data of the articlehierarchy.
HIER_ID
Specifies the ID with which the article hierarchy to be created is to beidentified. This is a mandatory field. This indicator is assignedexternally.
SALESORG, DISTR_CHAN
The combination of sales organization and distribution channel is thedistribution chain. The data model of the article hierarchy enables youto define hierarchies both dependent on (VLA) and independent of thedistribution chain (VLUA).
BW_FLAG
The BW flag designates an active hierarchy as update-relevant. If theflag is set, the hierarchy data is updated to the extract tables. Thisparameter is optional on call-up.
HIERARCHY_FLAG
The hierarchy flag designates a hierarchy as "application-relevant".Plausibility checks on activating the article hierarchy check that nomore than one distribution-chain-independent hierarchy can be flagged oronly hierarchies that have different distribution chains. This parameteris optional on call-up.
MULTIPLE_FLAG
The assignment of an article within the article hierarchy is controlledby way of the flag "Multiple Assignment". If this flag is set, then thesame article can be assigned to multiple nodes of different categories.This parameter is optional on call-up.
DATE_FLAG
By setting the flag "Scheduling", you can schedule structure changes,that is, the change becomes effective on reaching the "Valid From"date.If the flag is not set, then structure changes to an articlehierarchy become operationally valid immediately. This parameter isoptional on call-up.
LOG_FLAG
If the return messages using the parameter Return are not sufficient,errors can be logged in the application log. A new application logobject WRF_MATGRP is generated for this. The application log allows anapplication or object-related logging of events. Each log is recordedfor an object and for the subobjects STRUCTURE and ARTICLE that belongto this object. Evaluation of the logs also occurs by object and bysubobject.
HIERARCHY_STRUCTURE
The table HIERARCHY_STRUCTURE contains the structure data of the articlehierarchy to be created with reference to the fieldHIERARCHY_DATA-HIER-ID.
Fields of the parameter
NODE
Is the external node ID. Depending on the setting of the number range,the node ID is checked against a number range interval or newlyassigned. This is a mandatory field.
PARENT
This is the external node ID of the parent to which the new structureobject is to be assigned. This field is, apart from the first level tobe created, a mandatory field.
DATE_FROM
Validity start of a node assignment to an article hierarchy. If thescheduling of an article hierarchy is deactivated, the "Valid From" dateis filled with the current date, in the active case with the transferreddate. If no date is transferred, the "Valid From" date in the activecase is filled with the current date. This parameter is optionaldepending on the Customizing setting.
DATE_TO
Validity end of a node assignment to an article hierarchy. If thescheduling of an article hierarchy is deactivated, the "Valid To" dateis set to 12.31.9999, in the active case with the transferred date. Ifno date is transferred, in the active case, the "Valid To" date is setto 12.31.9999. This parameter is optional.

Description
TESTRUN
The parameter TESTRUN is used to control the simulation function.
Creation of the hierarchy is only simulated here and the data is notupdated (posted).