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_TRANSACTION_COMMIT after BAPI_NETWORK_MANTAIN

Former Member
0 Likes
600

Dear,

sorry, I have a problem.....

1) I perform "BAPI_NETWORK_MANTAIN

2) I perform immediately the BAPI_TRANSACTION_COMMIT with WAIT = 'X' with file RETURN (return file is initial)

3) I perform immediately the BAPINETWORK_COMP_ADD

after point 2)

it is in error..... NETWORK already in elaboration

BAPI_TRANSACTION_COMMIT doesn't work... because it begins the process of the BAPINETWORK_COMP_ADD

but the process of the BAPI_NETWORK_MANTAIN is not ended yet.

I don't want to resolve with " WAIT UP TO 2 SECONDS"

I want to resolve in other normal way.

Best Regards

Marco Echino.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
532

Hi

First perform BAPI_NETWORK_MANTAIN , and check the message.

IF it is success

then perform BAPI_TRANSACTION_COMMIT & perform BAPINETWORK_COMP_ADD.

elseif error occur.

then do bapi_rollback.

perform BAPINETWORK_COMP_ADD.

ENDIF.

Regards,

Raghu

4 REPLIES 4
Read only

Former Member
0 Likes
532

Hi,

SAP uses Export and Import parameters for this BAPI BAPI_NETWORK_MANTAIN.

Please declare the below set variables which are being used for IMPORT and EXPORT and use FREE MEMORY.


DATA i_method_project
     LIKE bapi_method_project OCCURS 0 WITH HEADER LINE.
DATA i_network
     LIKE bapi_network OCCURS 0 WITH HEADER LINE.
DATA i_network_update
     LIKE  bapi_network_update OCCURS 0 WITH HEADER LINE.
DATA i_activity
     LIKE  bapi_network_activity  OCCURS 0 WITH HEADER LINE.
DATA i_activity_update
     LIKE  bapi_network_activity_up  OCCURS 0 WITH HEADER LINE.
DATA i_relation
     LIKE  bapi_network_relation  OCCURS 0 WITH HEADER LINE.
DATA i_relation_update
     LIKE  bapi_network_relation_up  OCCURS 0 WITH HEADER LINE.
DATA e_message_table
     LIKE  bapi_meth_message OCCURS 0 WITH HEADER LINE.
DATA return LIKE bapireturn1.
DATA i_activity_element
     LIKE bapi_act_element OCCURS 0 WITH HEADER LINE.
DATA i_activity_element_update
     LIKE bapi_act_element_upd OCCURS 0 WITH HEADER LINE.
DATA i_activity_milestone
     LIKE bapi_act_milestone OCCURS 0 WITH HEADER LINE.
DATA i_activity_milestone_update
     LIKE bapi_act_milestone_upd OCCURS 0 WITH HEADER LINE.
*
FREE:   MEMORY ID 'NW_MAIN_I_METHOD_PROJECT',
        MEMORY ID 'NW_MAIN_I_NETWORK',
        MEMORY ID 'NW_MAIN_I_NETWORK_UPDATE',
        MEMORY ID 'NW_MAIN_I_ACTIVITY',
        MEMORY ID 'NW_MAIN_I_ACTIVITY_UPDATE',
        MEMORY ID 'NW_MAIN_I_RELATION',
        MEMORY ID 'NW_MAIN_I_RELATION_UPDATE',
        MEMORY ID 'I_ACTIVITY_ELEMENT',
        MEMORY ID 'I_ACTIVITY_ELEMENT_UPDATE',
        MEMORY ID 'I_ACTIVITY_MILESTONE',
        MEMORY ID 'I_ACTIVITY_MILESTONE_UPDATE'.

Shiva

Read only

Former Member
0 Likes
533

Hi

First perform BAPI_NETWORK_MANTAIN , and check the message.

IF it is success

then perform BAPI_TRANSACTION_COMMIT & perform BAPINETWORK_COMP_ADD.

elseif error occur.

then do bapi_rollback.

perform BAPINETWORK_COMP_ADD.

ENDIF.

Regards,

Raghu

Read only

madhu_vadlamani
Active Contributor
0 Likes
532

Hi Echino,

Execute this bapi first BAPI_NETWORK_MANTAIN and check the return messages IF it is success then BAPI_TRANSACTION_COMMIT and then BAPI_NETWORK_COMP_ADD.

Regards,

Madhu.

Read only

Former Member
0 Likes
532

You need to check the success before you commit.

But before commit ends you cannot run the next function module.

I guess you will have to put wait time... to avoid any malfunctioning of the program.

Regards,

Lalit Mohan Gupta.