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

BAPI_NETWORK_MAINTAIN released network

SimoneMilesi
Active Contributor
0 Likes
880

HI all!

I'm using the BAPI_NETWORK_MAINTAIN to update DURATION_NORMAL and WORK_ACTIVITY in our network.

It works fine if network is new, but when we release the network and try to update them, the system do not update anything, while doing this operation via transaction works fine.


LOOP AT it_vals.

        MOVE lt_vals-vornr TO i_activity-activity
        MOVE lt_vals-kstar_k TO i_activity-cost_elem.


        i_activity-duration_normal = ( tot_days * lt_vals-z_durata ) /
        100.
        ADD i_activity-duration_normal TO add_days.

        i_activity-work_activity = ( tot_days * lt_vals-z_lavoro ) /
        100.
        ADD i_activity-work_activity TO add_work.

        MOVE    'X'     TO i_activity_update-activity.
        MOVE    'X'     TO i_activity_update-cost_elem.
        MOVE    'X'     TO i_activity_update-duration_normal.
        MOVE    'X'     TO i_activity_update-work_activity.

        APPEND i_activity.
        APPEND i_activity_update.


      ENDLOOP.   

    CHECK i_activity[] IS NOT INITIAL.

    LOOP AT i_activity.
      CONCATENATE i_activity-network
                  i_activity-activity
                  INTO v_objkey.
      ADD 1 TO l_refnum.

      imethod-objecttype = 'NetworkActivity'.
      imethod-method = 'Update'.
      imethod-refnumber = l_refnum.
      imethod-objectkey = v_objkey.
      APPEND imethod. CLEAR imethod.
    ENDLOOP.
    imethod-method = 'Save'.
    APPEND imethod.
    CLEAR imethod.

    CLEAR e_message_table[].
    CALL FUNCTION 'BAPI_NETWORK_MAINTAIN'
      TABLES
        i_method_project                  = imethod
       i_activity                         = i_activity
       i_activity_update                  = i_activity_update
       e_message_table                   = e_message_table

.

3 REPLIES 3
Read only

RaymondGiuseppi
Active Contributor
0 Likes
738

Which error(s) do you receive in RETURN and E_MESSAGE_TABLE ?

Regards,

Raymond

Read only

0 Likes
738

No one

i see in the bottom bar "cost calculation" while executing the bapi, but message table is empty.

Read only

0 Likes
738

The problem is on function 'MAP2I_BAPI_ACTIVITY_TO_AFVGD' that not manage the field OFMNW in update structure AFVGD