Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function module to TECO an order at WBS element level

Former Member
0 Likes
3,354

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

12 REPLIES 12
Read only

sridhar_k1
Active Contributor
0 Likes
2,671

To TECO a production order use BAPI_PRODORD_COMPLETE_TECH

Regards

Sridhar

Read only

0 Likes
2,671

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

Read only

Former Member
0 Likes
2,671

Hi Kaushik,

Have you looked this FM <b>STATUS_CHANGE_FOR_ACTIVITY</b>?

Hope this will help.

Regards,

Ferry Lianto

Read only

0 Likes
2,671

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

Read only

Former Member
0 Likes
2,671

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

Read only

0 Likes
2,671

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

Read only

Former Member
0 Likes
2,671

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.

Read only

0 Likes
2,671

Works for User status only.

Read only

Former Member
0 Likes
2,671

Try using function module STATUS_CHANGE_INTERN.

Let us know how you get on.

Read only

0 Likes
2,671

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.

Read only

0 Likes
2,670

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.

Read only

0 Likes
2,670

That's another option and easier to do a quick test.

Thanks.