Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8557

Re: BAPI or FM to remove ACF status for a given WBS number

$
0
0

I am not familiar with that status but here is code I have used to change the status of a WBS.

 

 

*&---------------------------------------------------------------------*

*&      Form  CHANGE_STATUS

*&---------------------------------------------------------------------*

form change_status  changing p_out type ty_out.

  data:   lt_return type table of bapiret2,

          ls_return type bapiret2,

          ls_return1 type bapireturn1,

          l_undo_status type bapi_user_status-user_status,

          l_set_status type bapi_user_status-user_status,

          lt_result type table of bapi_status_result.

 

 

      l_undo_status = p_out-proj_status.

      l_set_status = 'CMPL'.

 

 

  call function 'BAPI_PS_INITIALIZATION'.

 

 

  call function 'BAPI_BUS2001_SET_STATUS'

    exporting

      project_definition = p_out-pspid

      set_user_status    = l_set_status

    importing

      return             = ls_return1

    tables

      e_result           = lt_result.

 

 

  refresh lt_return.

  call function 'BAPI_PS_PRECOMMIT'

    tables

      et_return = lt_return.

  read table lt_return into ls_return with key type = 'E'. "No binary search due to if statement below.

  if sy-subrc = 0.

    p_out-message = ls_return-message.

    read table lt_return into ls_return index 2.

    if sy-subrc = 0. "Reset message if this line exists.

      p_out-message = ls_return-message.

    endif.

  else.

 

 

    commit work and wait.

    call function 'BUFFER_REFRESH_ALL'.

 

 

    call function 'BAPI_TRANSACTION_COMMIT'

      exporting

        wait = 'X'.

    p_out-proj_status = l_set_status.


Viewing all articles
Browse latest Browse all 8557

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>