07-02-2007 6:29 AM
Hi All,
What are all the parameters that we need to give in BAPI_REQUIREMENTS_CREATE to create a new requirment?
Thanks,
Rakesh.
07-02-2007 7:59 AM
Hi
See the following doc of this BAPI and use accordingly
<b>BAPI_REQUIREMENTS_CREATE</b>
Planned Independent Requirements: Create Planned Independent Reqmts
This method can be used to create planned independent requirements.
To do this, you must transfer at least the item data and the schedule line data. For configurable materials, you can also define configuration supporting points for the schedule lines.
The item data is transferred back after the successful creation of a planned independent requirement.
Any errors that occur are returned in the parameter RETURN.
Notes
The authorization object C_PPBD with the activity H (add) is checked.
The command COMMIT WORK is entered within the BAPI. You can prevent this by setting the parameter DO_COMMIT with initial value.
In this case, you call up method BapiService.TransactionCommit to 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 the schedule 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 the requirements 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
Parameters
REQUIREMENTS_ITEM
REQUIREMENT_PARAM
DO_COMMIT
UPDATE_MODE
REFER_TYPE
PROFILID
MATERIAL
PLANT
REQUIREMENTSTYPE
VERSION
REQMTSPLANNUMBER
MRP_AREA
MATERIAL_EVG
REQUIREMENTS_SCHEDULE_IN
REQUIREMENTS_CHAR_IN
RETURN
<b>Reward points for useful Answers</b>
Regards
Anji
07-02-2007 8:02 AM
Dear rakesh,
Read the Function module documentation of this BAPI,se37-> BAPI name-> Function module documentation(button in Application toolbar)
If you need further help, let me know.
regards
Antony Thomas
07-02-2007 8:06 AM
Hi,
Please check this sample codes.
...
data: begin of i_requirements_schedule_in occurs 0.
include structure bapisshdin.
data: end of i_requirements_schedule_in.
data: i_bapireturn1 like bapireturn1 occurs 0,
w_bapireturn1 like bapireturn1.
data: w_bapisitemr like bapisitemr.
constants: c_version type bapisitemr-version value '00',
c_vers_activ type bapisitemr-vers_activ value 'X',
c_reqmtsplannumber type bapisitemr-req_number value '',
c_unit type meins value 'EA',
c_day type prgrs value '1'.
...
clear i_requirements_schedule_in.
refresh i_requirements_schedule_in.
perform populate_requirements_item.
perform populate_requirements_schedule.
call function 'BAPI_REQUIREMENTS_CREATE'
exporting
requirements_item = w_bapisitemr
tables
requirements_schedule_in = i_requirements_schedule_in
return = i_bapireturn1.
loop at i_bapireturn1 into w_bapireturn1.
write: / w_bapireturn1-message.
endloop.
...
form populate_requirements_item.
clear w_bapisitemr.
w_bapisitemr-material = w_matnr.
w_bapisitemr-plant = w_werks.
w_bapisitemr-requ_type = w_bedae.
w_bapisitemr-version = c_version.
w_bapisitemr-vers_activ = c_vers_activ.
w_bapisitemr-req_number = c_reqmtsplannumber.
endform.
form populate_requirements_schedule.
i_requirements_schedule_in-date_type = c_day.
i_requirements_schedule_in-req_date = i_zctforwk-lfdat.
i_requirements_schedule_in-req_qty = i_zctforwk-menge.
i_requirements_schedule_in-unit = c_unit.
append i_requirements_schedule_in.
endform.
Refer to the documentation available with the BAPI.
Goto SE37-> put your name of BAPI-> DISPLAY and see the documentation
Hope this will help.
<b>Reward points</b>
Regarsd