RFC:Delete Requisitions  

 

DELETE REQUISITIONS: REQUISITION _LIST_DELETE

FUNCTION REQUISITION_LIST_DELETE.

*"----------------------------------------------------------------------

*"*"Local interface:

*" IMPORTING

*" VALUE(DELIVERY_DATE) LIKE EBAN-LFDAT DEFAULT SPACE

*" VALUE(CREATOR_NAME) LIKE EBAN-ERNAM DEFAULT SPACE

*" TABLES

*" REQUISITION_LIST STRUCTURE BAPIKEYLIS

*" BAPIRETURN STRUCTURE BAPIRETURN

*" EXCEPTIONS

*" NOT_CARRIED_OUT

*"----------------------------------------------------------------------

 

Use

REQUISITION_LIST_DELETE is used to delete a list of requisitions in R/3. Depending on the importing parameters, it finds the list of requisitions and deletes them. When an error occurs, the error message will be returned in BAPIRETURN and the function call becomes invalid (the database restores to the time before the function gets called).

The REQUISITION_LIST should pass the list of material and plant combination. The DELIVERY_DATE indicates the need-to-arrive date for the material in the purchasing requisition and the CREATOR_NAME for the name of the creator.

If both DELIVERY_DATE and CREATOR_NAME are empty but the REQUISITION_LIST contains material and plant information, the function module deletes all the requisitions with the same material in that plant. If the CREATOR_NAME has a value, the function module only deletes the ones with that CREATOR_NAME. And the same logic holds for DELIVERY_DATE. If both are not empty, the function module deletes the requisitions which satisfy all the importing parameters as well as the table parameters. This logic is designed to give the callers maximal amount of control.

Once again an error-handler may be required to use this function call more effectively. When errors occur, the function module may need to be recalled or errors need to be logged somewhere else. The content of error messages is contained in table BAPIRETURN.

Structure

Importing parameters:

DELIVERY_DATE: Date with form YYYYMMDD. Or empty.

CREATOR_NAME: External system name. Or empty.

REQUISITION_LIST

MATERIAL: Material number

PLANT: Plant number

If any error occurs after the call, exception NOT_CARRIED_OUT will be raised and the error message will be returned in BAPIRETURN.