2006 Jun 16 3:56 PM
Hi ,
I need to TECO an order at WBS element level(CJ02-Edit Status-Close Techinically) as part of an user-exit . I have the order number.
I have been looking for a BAPI/Function module that would do this when I supply the Order number/OBJNR as the input.
I could not find a BAPI or a Function module.
Does anyone have any ideas on this.
Thanks in Advance.
Mala
Hi ,
I need to TECO an order at WBS element level(CJ02-Edit Status-Close Techinically) as part of an user-exit . I have the order number.
I have been looking for a BAPI/Function module that would do this when I supply the Order number/OBJNR as the input.
I could not find a BAPI or a Function module.
Does anyone have any ideas on this.
Thanks in Advance.
Mala
2006 Jun 16 4:30 PM
To TECO a production order use BAPI_PRODORD_COMPLETE_TECH
Regards
Sridhar
2006 Jun 16 4:43 PM
This is not a production Order.
The order Number is on the Project systems side -Project Definition /Workbreak down structure(PROJ/PRPS tables).
The status is changed to TECO using transaction code
CJ02(change project)>>WBS ELEMENT Overview.
I need to do this as part of a user exit. Doing this using BDC is very cumbersome so I wanted to use a BAPI/Function Module.
Thanks
Mala
2006 Jun 16 4:45 PM
Hi Kaushik,
Have you looked this FM <b>STATUS_CHANGE_FOR_ACTIVITY</b>?
Hope this will help.
Regards,
Ferry Lianto
2006 Jun 16 7:26 PM
Hi Lianto,
I tried the FM STATUS_CHANGE_FOR_ACTIVITY using various import parameters.
This does not update the status although SAP does use this in CJ02 to update the status.
Maybe we cannot use this in standalone mode and it may of internal use by SAP only.
Thanks
Mala
2006 Jun 17 6:50 AM
check this program <b>LCJWBUXX</b> u will get list of FMs , and search in the CJ02 program for more FMS validations / Substitutions.
Regards
Prabhu
2006 Jun 22 7:53 PM
Prabhu,
Thanks for the update.
I tried a lot of FMs based on the Include program that you gave me and the FMs used in CJ02.
I narrowed down to about 3 to 4 of them and when I try it in standalone mode it does not update .(eg STATUS_CHANGE_FOR_ACTIVITY )
Thanks
Mala
2006 Jun 22 8:35 PM
Hi Kaushik,
Please check this FM <b>I_CHANGE_STATUS</b>
and to get status, you can use FM <b>I_STATUS_SELECT</b>.
CALL FUNCTION 'I_STATUS_SELECT'
EXPORTING
objnr = diaufk-objnr
sent_user_status = p_ustat
IMPORTING
selected = g_answer
current_user_status = current_status
next_user_status = next_status
user_status_profile = ustat_profile
TABLES
syst_status_incl = so_syinc
syst_status_excl = so_syexc
user_status_incl = so_usinc
user_status_excl = so_usexc.
CALL FUNCTION 'I_CHANGE_STATUS'
EXPORTING
OBJNR = T_TASKS-OBJNR
ESTAT_INACTIVE = CURRENT_STATUS
ESTAT_ACTIVE = NEXT_STATUS
STSMA = USTAT_PROFILE
EXCEPTIONS
CANNOT_UPDATE = 1
OTHERS = 2.
Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful.
2014 Mar 19 4:02 PM
2014 Mar 20 10:21 AM
Try using function module STATUS_CHANGE_INTERN.
Let us know how you get on.
2014 Mar 20 10:49 AM
FYI.
You will not see a status change if you use transaction SE37 to test the function module because a commit is required. However if you create a simple program it should work fine. You will need the internal code for the system status which starts with "I" followed by 4 numbers.
2014 Mar 20 11:00 AM
You can also use test sequence in SE37 to call both function modules in your test. Then you will see a status change to your object without having to program anything.
2014 Mar 20 11:09 AM
That's another option and easier to do a quick test.
Thanks.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |