sap abap function I_CHANGE_STATUS 的使用方法
时间: 2023-09-20 15:11:01 浏览: 240
"SAP ABAP function I_CHANGE_STATUS" is used to change the status of an object in the SAP system. Here are the steps to use this function:
1. First, you need to create an instance of the I_CHANGE_STATUS function module by using the CREATE_OBJECT statement.
2. Then, you need to set the relevant parameters for the function module. The main parameters are:
- OBJTYPE: The type of the object whose status you want to change (for example, BUS1001 for a business partner).
- OBJKEY: The key of the object whose status you want to change (for example, the business partner number).
- NEWSTATUS: The new status you want to set for the object.
3. Finally, you need to call the function module by using the CALL_METHOD statement.
Here is an example code snippet that demonstrates the usage of I_CHANGE_STATUS function module:
```
DATA: lo_object TYPE REF TO cl_swf_cnt,
lo_change_status TYPE REF TO object.
CREATE OBJECT lo_object
EXPORTING
object_type = 'BUS1001'
object_key = '123456'.
lo_change_status = lo_object->get_status_changer( ).
lo_change_status->objtype = 'BUS1001'.
lo_change_status->objkey = '123456'.
lo_change_status->newstatus = 'Z001'.
CALL METHOD lo_change_status->i_change_status.
```
In this example, we are changing the status of a business partner with a key of '123456' to status 'Z001'. You will need to adjust the values of the parameters based on your specific use case.
阅读全文