SAP Function BAPI_REQUIREMENTS_CREATE - Planned Independent Requirements: Create Planned Independent Reqmts

Parameter Reference Type Length Default Optional Text
DO_COMMIT BAPISPARAM-DO_COMMIT C 1 'X' X Control Parameters for Planned Independent Requirements
PROFILID BAPISPARAM-PROFILID N 12 SPACE X Name of planning profile
REFER_TYPE BAPISPARAM-REFER_TYPE C 1 SPACE X Control Parameters for Planned Independent Requirements
REQUIREMENTS_ITEM BAPISITEMR u 131 Item data
REQUIREMENT_PARAM CM60R u 14 X Requirements parameters
UPDATE_MODE BAPISPARAM-UPDATE_MODE C 1 'X' X Control Parameters for Planned Independent Requirements

Parameter Reference Type Length Text
MATERIAL BAPISITEMR-MATERIAL C 18
MATERIAL_EVG BAPIMGVMATNR u 82 Long Material Number
MRP_AREA BAPISITEMR-MRP_AREA C 10 MRP Area
PLANT BAPISITEMR-PLANT C 4
REQMTSPLANNUMBER BAPISITEMR-REQ_NUMBER C 10
REQUIREMENTSTYPE BAPISITEMR-REQU_TYPE C 4
VERSION BAPISITEMR-VERSION C 2

Parameter Reference Length Optional Text
REQUIREMENTS_CHAR_IN BAPISCHARR 80 X Configuration data input
REQUIREMENTS_SCHEDULE_IN BAPISSHDIN 31 Schedule line data input
RETURN BAPIRETURN1 470 Return parameter

Functionality
This method can be used to create planned independent requirements
.
To do this, you must transfer at least the item data and the scheduleline data. For configurable materials, you can also define configurationsupporting points for the schedule lines.
The item data is transferred back after the successful creationof a planned independent requirement.
Any errors that occur are returned in the parameter RETURN.

Notes
The authorization object C_PPBD with theactivity H (add) is checked.
The command COMMIT WORK is entered within the BAPI. You canprevent this by setting the parameter DO_COMMIT with initialvalue.
In this case, you call up methodBapiService.TransactionCommitto write the planned independent requirements to the database.
If you have created a planning profile for a configurable material,you can define configuration supporting points for theschedule lines as follows:

  • Select a planning profile using parameterPROFILID.

  • Define the usage probabilities using
  • parameter REQUIREMENTS_CHAR_IN.
    • The requirements date of the configuration supporting point (

    • REQUIREMENTS_CHAR_IN-REQU_DATE) must correspond to therequirements date of the schedule line(REQUIREMENTS_SCHEDULE_IN-REQ_DATE).
      Do not create any schedule lines on non-working days,as these will be automatically moved to a workday.

      Further information

      Additional methods:

      • PlannedIndepReqmt.Change

      • PlannedIndepReqmt.GetDetail

      • BapiService.TransactionCommit
      • Description
        For information on the material number, see the data elementdocumentation: Material.

        Description
        Parameter for the long material number
        This parameter can be used to transfer long material numbers. Thesenumbers can be up to 40 characters long.
        To be able to use this parameter you must activate the switch for thebusiness function LAMA (long material number) in the system.
        The business function LAMA is available as a component of the businessfunction set for DIMP.

        Value range
        None

        Default
        None

        Description
        For information on the MRP area, see the data element documentation:MRP Area.

        Description
        For information on the plant, see the data element documentation:Plant.

        Description
        For information on the requirements plan number, see the data elementdocumentation:Requirements Plan Number.

        Description
        For information on the requirements type see thedate element documentation: Requirements Type.

        Description
        For information on the version number, see the data elementdocumentation: Version Number
        .

        Description
        You use this parameter to define whether the commandCOMMIT WORK is entered within the method.

        Value range

        • X: A COMMIT WORK is entered

        • Initial: No COMMIT WORK is entered
        • Default
          X: A COMMIT WORK is entered

          Description
          You use this parameter to define the planning profile for whichconfiguration data should be created.
          Multiple planning profiles can be created for onematerial.
          If the parameter contains the initial value, the system selects theplanning profile for which the update of the Sales Information System isactivated.

          Default
          Blank (initial).

          Description
          For information on the reference type, see the data elementdocumentation: Reference Type.
          The reference type is saved in the database table of the item data forthe independent requirements (PBIM-UEBKZ or PBID-UEBKZ).
          With this BAPI, you can use this field to identify created plannedindependent requirements.

          Value range
          The following values are already used:

          • 1: Copy requirements plan

          • 2: Copy forecast

          • 3: Copy original plan

          • 4: Copy sales plan

          • 5: Copy production plan

          • 6: Copy part of demand plan

          • 7: Copy part of rough-cut plan

          • 8: Copy product group members

          • 9: Copy material from information structure

          • D: Copy dependent requirements

          • P: Individual project planning
          • Default
            Blank character (initial)

            Description
            You use this parameter to define the item for which the plannedindependent requirements are created.
            INCLUDE BAPI_DATAELEMENT
            The following fields are required:

            • MATERIAL

            • PLANT

            • VERSION

            • If you wish to create independent requirements for arequirements plan, specify the requirements plan in theREQ_NUMBER field.
              You use the REQU_TYPE field to define the requirementstype. Note the following:
              • If the field is blank, the requirements type is derived from the
              • planning strategy in the material master.
                • If an invalid requirements type is transferred, the system issues an
                • error message depending on the Customizing setting (transactionOMPJ).
                  • If no requirements type can be determined, the system issues an error
                  • message.
                    This occurs if the requirements type is not transferred or derivedfrom the planning strategy in the material master.
                    The MRP_AREA field should only be filled if theMRP areas are active. In this case, you can create plannedindependent requirements for an MRP area. Note the following:
                    • The MRP area must be assigned to the material (field MATERIAL) in
                    • its material master.
                      • The planned independent requirements are created automatically for the
                      • plant MRP area when MRP areas are blank.

                        Description
                        As a rule, this parameter is not evaluated and should not beused.

                        Description
                        You use this parameter to determine whether the BAPI is executed in thesimulation mode.

                        Value range

                        • X: The planned independent requirements that have been created
                        • are posted
                          • Initial: No database changes are carried out (Simulation)
                          • Default
                            X: The planned independent requirements that have been created
                            are posted

                            Description
                            This parameter is used to create configuration supporting points for planned independent requirements.
                            The following fields must be filled:

                            • REQU_DATE: Requirements date of the configuration supporting
                            • point
                              • CH_QTY: Usage probability of the characteristics combination in
                              • percent
                                • PT_NUMBER: Planning table number

                                • PT_LINE: Planning table line

                                • For each configuration supporting point to be created, create entriesfor the characteristics combinations to which usage probabilitiesare to be assigned.
                                  A characteristics combination is uniquely determined via the planningtable number and the planning table line. Using the example reportbelow, you can display the values for the characteristics combinationsthat are used.
                                  The fields INT_CHAR and CHAR_VALUE should no longerbe used.

                                  Example Report
                                  You can use the example report Z_DISPLAY_PT_DATA to displaythe data required for maintaining configuration supporting points.
                                  The report issues the following data for aplanning profile:

                                  • Internal number (parameter PROFILID)

                                  • Internal planning table number (PT_NUMBER)

                                  • Planning table line (PT_LINE) of individual characteristics
                                  • combinations
                                    If you call the report with the indicator PL_REL set, only theplanning-relevant characteristics combinations are displayed.
                                    REPORT Z_DISPLAY_PT_DATA.
                                    TABLES: tphvp, tplvp, tpsvp, cuvtab.
                                    DATA: lv_comb_key TYPE atplb,
                                    lv_profilid LIKE tphvp-profilid,
                                    lv_pt_name LIKE cuvtab-vtnam.
                                    PARAMETERS material LIKE tphvp-objekt.
                                    PARAMETERS prof_txt LIKE tphvp-proftxt.
                                    PARAMETERS pl_rel TYPE xfeld.
                                    SELECT SINGLE profilid FROM tphvp INTO lv_profilid
                                    WHERE objekt EQ material
                                    AND proftxt EQ prof_txt.
                                    CHECK sy-subrc EQ 0.
                                    WRITE: / material, / prof_txt, / 'PROFILID:', lv_profilid, /.
                                    SELECT * FROM tplvp
                                    WHERE profilid EQ lv_profilid.
                                    SELECT SINGLE vtnam FROM cuvtab INTO lv_pt_name
                                    WHERE vtint EQ tplvp-clint.
                                    ULINE.
                                    WRITE: / 'PT_NUMBER:', tplvp-clint, '(', lv_pt_name, ')'.
                                    SELECT * FROM tpsvp
                                    WHERE profilid EQ lv_profilid
                                    AND CLINT EQ tplvp-clint.
                                    IF pl_rel EQ 'X'
                                    AND tpsvp-pl_rel NE 'X'.
                                    CONTINUE.
                                    ENDIF.
                                    CALL FUNCTION 'M60V_COMBINATION_DISPLAY'
                                    EXPORTING
                                    TABLE_LINE = tpsvp-lnpos
                                    TABLE_NUMBER = tpsvp-clint
                                    IMPORTING
                                    STRING = lv_comb_key.
                                    WRITE: /, 'PT_LINE:', tpsvp-lnpos, lv_comb_key.
                                    ENDSELECT.
                                    ENDSELECT.

                                    Description
                                    You use this parameter to define schedule lines that are to becreated.
                                    INCLUDE BAPI_DATAELEMENT
                                    The following fields are required:

                                    • DATE_TYPE

                                    • REQ_DATE

                                    • REQ_QTY
                                    • Value range
                                      You can use the following values for theperiod indicator DATE_TYPE:

                                      • 1: Day

                                      • 2: Week

                                      • 3: Month

                                      • 4: Posting period (if defined in material master)

                                      • 5: Planning calendar (if defined in material master)
                                      • Description
                                        This parameter contains messages about errors that have occurred.

103822Automatically splitting dates with zero quantities
825202BAPI_REQUIREMENTS_CREATE w/ configuration data (consulting)
331696MS64 Incorrect quantities for withdrawal quantity
528481COMMIT WORK in FUNCTION BAPI_REQUIREMENTS_CHANGE