SAP Function Modules

BAPI_REQUIREMENTS_CHANGE SAP Function module - Planned independent requirement: Change planned independent reqmt







BAPI_REQUIREMENTS_CHANGE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name BAPI_REQUIREMENTS_CHANGE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: 3027
Released Date: 02.06.1998
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM BAPI_REQUIREMENTS_CHANGE - BAPI REQUIREMENTS CHANGE





CALL FUNCTION 'BAPI_REQUIREMENTS_CHANGE' "Planned independent requirement: Change planned independent reqmt
  EXPORTING
    material =                  " bapisitemr-material  Material
    plant =                     " bapisitemr-plant  Plant
    requirementstype =          " bapisitemr-requ_type  Requirements Type
    version =                   " bapisitemr-version  Version
    reqmtsplannumber =          " bapisitemr-req_number  Requirements Plan Number
    vers_activ =                " bapisitemr-vers_activ  Version active
*   requirement_param =         " cm60r         Requirements Parameters
*   mrp_area =                  " bapisitemr-mrp_area  MRP Area
*   do_commit = 'X'             " bapisparam-do_commit  Control Parameters for Planned Independent Requirements
*   update_mode = 'X'           " bapisparam-update_mode  Control Parameters for Planned Independent Requirements
*   delete_old = 'X'            " bapisparam-delete_old  Control Parameters for Planned Independent Requirements
*   no_withdr = SPACE           " bapisparam-no_withdr  Control Parameters for Planned Independent Requirements
*   material_evg =              " bapimgvmatnr  Long Material Number
  IMPORTING
    requirement_item_out =      " bapisitemr    Item data output
  TABLES
*   requirements_schedule_in =   " bapisshdin   Schedule line data input
*   requirements_char_in =      " bapischarr    Configuration data input
    return =                    " bapireturn1   Return Parameter
    .  "  BAPI_REQUIREMENTS_CHANGE

ABAP code example for Function Module BAPI_REQUIREMENTS_CHANGE





The ABAP code below is a full code listing to execute function module BAPI_REQUIREMENTS_CHANGE including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_requirement_item_out  TYPE BAPISITEMR ,
it_requirements_schedule_in  TYPE STANDARD TABLE OF BAPISSHDIN,"TABLES PARAM
wa_requirements_schedule_in  LIKE LINE OF it_requirements_schedule_in ,
it_requirements_char_in  TYPE STANDARD TABLE OF BAPISCHARR,"TABLES PARAM
wa_requirements_char_in  LIKE LINE OF it_requirements_char_in ,
it_return  TYPE STANDARD TABLE OF BAPIRETURN1,"TABLES PARAM
wa_return  LIKE LINE OF it_return .


DATA(ld_material) = some text here

DATA(ld_plant) = some text here

DATA(ld_requirementstype) = some text here

DATA(ld_version) = some text here

DATA(ld_reqmtsplannumber) = some text here

DATA(ld_vers_activ) = some text here
DATA(ld_requirement_param) = 'Check type of data required'.

DATA(ld_mrp_area) = some text here

DATA(ld_do_commit) = some text here

DATA(ld_update_mode) = some text here

DATA(ld_delete_old) = some text here

DATA(ld_no_withdr) = some text here
DATA(ld_material_evg) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_requirements_schedule_in to it_requirements_schedule_in.

"populate fields of struture and append to itab
append wa_requirements_char_in to it_requirements_char_in.

"populate fields of struture and append to itab
append wa_return to it_return. . CALL FUNCTION 'BAPI_REQUIREMENTS_CHANGE' EXPORTING material = ld_material plant = ld_plant requirementstype = ld_requirementstype version = ld_version reqmtsplannumber = ld_reqmtsplannumber vers_activ = ld_vers_activ * requirement_param = ld_requirement_param * mrp_area = ld_mrp_area * do_commit = ld_do_commit * update_mode = ld_update_mode * delete_old = ld_delete_old * no_withdr = ld_no_withdr * material_evg = ld_material_evg IMPORTING requirement_item_out = ld_requirement_item_out TABLES * requirements_schedule_in = it_requirements_schedule_in * requirements_char_in = it_requirements_char_in return = it_return . " BAPI_REQUIREMENTS_CHANGE
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_requirement_item_out  TYPE BAPISITEMR ,
ld_material  TYPE BAPISITEMR-MATERIAL ,
it_requirements_schedule_in  TYPE STANDARD TABLE OF BAPISSHDIN ,
wa_requirements_schedule_in  LIKE LINE OF it_requirements_schedule_in,
ld_plant  TYPE BAPISITEMR-PLANT ,
it_requirements_char_in  TYPE STANDARD TABLE OF BAPISCHARR ,
wa_requirements_char_in  LIKE LINE OF it_requirements_char_in,
ld_requirementstype  TYPE BAPISITEMR-REQU_TYPE ,
it_return  TYPE STANDARD TABLE OF BAPIRETURN1 ,
wa_return  LIKE LINE OF it_return,
ld_version  TYPE BAPISITEMR-VERSION ,
ld_reqmtsplannumber  TYPE BAPISITEMR-REQ_NUMBER ,
ld_vers_activ  TYPE BAPISITEMR-VERS_ACTIV ,
ld_requirement_param  TYPE CM60R ,
ld_mrp_area  TYPE BAPISITEMR-MRP_AREA ,
ld_do_commit  TYPE BAPISPARAM-DO_COMMIT ,
ld_update_mode  TYPE BAPISPARAM-UPDATE_MODE ,
ld_delete_old  TYPE BAPISPARAM-DELETE_OLD ,
ld_no_withdr  TYPE BAPISPARAM-NO_WITHDR ,
ld_material_evg  TYPE BAPIMGVMATNR .


ld_material = some text here

"populate fields of struture and append to itab
append wa_requirements_schedule_in to it_requirements_schedule_in.

ld_plant = some text here

"populate fields of struture and append to itab
append wa_requirements_char_in to it_requirements_char_in.

ld_requirementstype = some text here

"populate fields of struture and append to itab
append wa_return to it_return.

ld_version = some text here

ld_reqmtsplannumber = some text here

ld_vers_activ = some text here
ld_requirement_param = 'Check type of data required'.

ld_mrp_area = some text here

ld_do_commit = some text here

ld_update_mode = some text here

ld_delete_old = some text here

ld_no_withdr = some text here
ld_material_evg = 'Check type of data required'.

SAP Documentation for FM BAPI_REQUIREMENTS_CHANGE


This method can be used to change planned independent requirements. ...See here for full SAP fm documentation

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name BAPI_REQUIREMENTS_CHANGE or its description.