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

Test Sequences - BAPI_TRANSACTION_COMMIT doesn't do anything

Former Member
0 Likes
699

Hi all,

I wish to test BAPI_ALM_ORDER_MAINTAIN.

I tried a Test Sequence with this BAPI and then BAPI_TRANSACTION_COMMIT but nothing happens.

I triend to chane Planner Group and marked it for Update.

Any idea ?!

Best regards,

Amos.

4 REPLIES 4
Read only

Former Member
0 Likes
585

Hi,

I am pasting a part of the code here, look at the BOLD one ... you need to write the SAVE in a method.

CLEAR wa_methods.

MOVE 000001 TO wa_methods-refnumber.

MOVE 'PARTNER' TO wa_methods-objecttype.

MOVE 'CREATE' TO wa_methods-method.

MOVE tabla_orden-equnr TO wa_methods-objectkey.

APPEND wa_methods TO it_methods.

CLEAR wa_methods.

MOVE 000001 TO wa_methods-refnumber.

MOVE 'TEXT' TO wa_methods-objecttype.

MOVE 'CHANGE' TO wa_methods-method.

  • MOVE tabla_orden-equnr TO wa_methods-objectkey.

CONCATENATE tabla_orden-equnr '0010' INTO wa_methods-objectkey.

  • MOVE tabla_orden-equnr TO wa_methods-objectkey.

APPEND wa_methods TO it_methods.

<b>

CLEAR wa_methods.

wa_methods-method = 'SAVE'.

append wa_methods to it_methods.</b>

  • Llenado del Interlocutor

MOVE tabla_orden-equnr TO wa_partner-orderid.

MOVE 'PR' TO wa_partner-partn_role.

MOVE zproveedor TO wa_partner-partner.

APPEND wa_partner TO it_partner.

  • Fin Interlocutor

  • Llenado Interlocutor UP

  • wa_partner_up-orderid = 'X'.

wa_partner_up-orderid = tabla_orden-equnr.

wa_partner_up-partn_role = 'X'.

wa_partner_up-partner = 'X'.

APPEND wa_partner_up TO it_partner_up.

  • Fin Interlocutor UP

Llenado IT_TEXT_HEADER

MOVE tabla_orden-equnr TO wa_text_header-orderid.

MOVE '0010' TO wa_text_header-activity.

  • MOVE 'S' TO wa_text_header-langu.

MOVE sy-langu TO wa_text_header-langu.

MOVE '00000001' TO wa_text_header-textstart.

  • MOVE '00000002' TO wa_text_header-textend.

MOVE '00000003' TO wa_text_header-textend.

APPEND wa_text_header TO it_text_header.

  • Fin IT_TEXT_HEADER

CLEAR wa_text.

APPEND wa_text TO it_text.

Llenado IT_TEXT_LINES

MOVE '*' TO wa_text-tdformat.

MOVE 'LINEA 1' TO wa_text-tdline.

APPEND wa_text TO it_text.

MOVE '*' TO wa_text-tdformat.

MOVE 'LINEA 2' TO wa_text-tdline.

APPEND wa_text TO it_text.

Fin IT_TEXT_LINES

  • Llamada a la BAPI

*

CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'

TABLES

it_methods = it_methods

it_header = it_header

it_header_up = it_header_up

  • IT_HEADER_SRV =

  • IT_HEADER_SRV_UP =

it_userstatus = it_user_status

it_partner = it_partner

it_partner_up = it_partner_up

it_operation = it_operation

it_operation_up = it_operation_up

  • IT_RELATION =

  • IT_RELATION_UP =

it_component = it_component

it_component_up = it_comp_up

  • it_text = it_text_header

  • it_text_lines = it_text

  • EXTENSION_IN =

return = it_return.

  • et_numbers = et_numbers.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

Read only

Former Member
0 Likes
585

Hi Sudheer,

Thanks for the answer.

I already did it, but no success.

Can it be that because I have a message in Return from the first BAPI ("BAPI control was ended"), the Commit doesn't work ?!

I only put Order ID, Planner Group, Planner Group Update check (=X) & Save method. Maybe I miss something like Object ID or so ?

Thanks, Amos.

Read only

0 Likes
585

Amos

Please check below extract from the documentation of the BAPI, this should help you understand the portion highlighted by Sudheer.

<b>A BAPI_TRANSACTION_COMMIT without SAVE method terminates processing in the update to ensure that no inconsistent data is written to the database</b>. The processor who called up the BAPI does not receive any confirmation for the termination of the update in the target system. This logic is necessary as the order data was flagged for updating with BAPI_TRANSACTION_COMMIT through the SAVE method. However, the status information was already flagged for updating when the BAPI was called up. <b>A BAPI_TRANSACTION_COMMIT without SAVE method then just saves the status information and would generate inconsistent orders, if the updating was not terminated</b>.

Regards

Eswar

Read only

Former Member
0 Likes
585

Hi Eswar,

I did put the SAVE method but still doesn't change nothing in the order.

1) I tried to run only BAPI_ALM_ORDER_MAINTAIN with SAVE - No success.

2) I tried to run sequence BAPI_ALM_ORDER_MAINTAIN + BAPI_TRANSACTION_COMMIT with SAVE - No success.

3) I tried to run sequence BAPI_ALM_ORDER_MAINTAIN + BAPI_TRANSACTION_COMMIT without SAVE - No success.

Any idea ?

Thanks, Amos.