Application Development 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: 

Error In BAPI 'BAPI_ALM_ORDER_MAINTAIN'- Order cant be saved

dipak_khatavkar
Participant
0 Kudos

Hi All,

I am getting error " Order %00000001 cannt be saved, since no operation is mainatained " while creating work order using BAPI ' BAPI_ALM_ORDER_MAINTAIN'. i have tried to passed operation table to bapi but facing same issue.

So please suggest!!!!

Thanks in Advance,

Dipak.

14 REPLIES 14

ramkumar007
Participant
0 Kudos

hi,

When i am debugging this BAPI, there are 2 errors in the parameter RETURN:

1 E IWO_BAPI2 118 Order 000000000001 cannot be saved, since no operation is maintained

2 E IWO_BAPI2 113 Error during processing of BAPI methods

.

Hence every first settlement rule is not applied to the order. When i try it a second time, the BAPI errors are still seen in debugger, but the settlement rule is applied.

OK, the problem with the settlement rules seems to be solved, but there is no operation created.

I am not able to create both -settlement rule and operation- together.

dipak_khatavkar
Participant
0 Kudos

Please Help!!

0 Kudos

Hi

Can you please paste your sample code...? Are you passing operation detail?

Nabheet

0 Kudos

Hi nabheet,

I tried to added operation method but getting dump.

here is my sample code:

     

i_methods-refnumber = '000001'.
          i_methods-objecttype = 'HEADER'.
          i_methods-method = 'CREATE'.
          i_methods-objectkey = '%00000000001'.
          APPEND i_methods.

            i_methods-refnumber = '000001'.
          i_methods-objecttype = 'OPERATION'.
          i_methods-method = 'CREATE'.
          i_methods-objectkey = '%00000000001'.
          APPEND i_methods.

          i_methods-refnumber = '000001'.
          i_methods-objecttype = ' '.
          i_methods-method = 'SAVE'.
          i_methods-objectkey = '%00000000001'.
          APPEND i_methods.

          i_header-orderid = '%00000000001'.
          i_header-order_type = 'PM01'.
          i_header-planplant = lv_werk.
          i_header-priority  = '3'.
          i_header-mn_wk_ctr = i_header-mn_wk_ctr. 
          i_header-start_date = sy-datum.

       
            i_header-notif_type  = 'M7'.
      

      
          i_header-short_text = l_viqmel-qmtxt.
         i_header-funct_loc   = l_viqmel-tplnr.
          i_header-equipment   = l_viqmel-equnr.

          APPEND i_header.

          i_operation-activity = '10'.
          i_operation-CONTROL_KEY = 'PM01'.
           i_operation-WORK_CNTR = i_header-mn_wk_ctr.
           i_operation-plant = lv_werk.

           APPEND i_operation.

          CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
            TABLES
              it_methods   = i_methods
              it_header    = i_header
              IT_OPERATION = i_operation
              return       = i_return
              et_numbers   = i_numbers.



Then Commit.....

Please suggest!!!

0 Kudos

remove this  i_header-orderid = '%00000000001'. Plus do a where used list of this BAPI to understand some smaple code.

0 Kudos

Nabheet,

I have added operation method and also removed Orderid from Header Getting dump like   Runtime

 

Short text of error message:
   Runtime error: FAILED_COMMIT_REGISTRATION  (" " " " " ")

   Long text of error message:
    Diagnosis
        Due to an unanticipated situation, runtime error
        FAILED_COMMIT_REGISTRATION occurred:
        Further information for error analysis:
    System Response
        Processing of the object or transaction is terminated.
    Procedure
        Search for notes on the above runtime error in the online service
        system. If necessary, limit your search to the name of the
        transaction or report used.
        If no note exists that will solve the problem, send a problem
        message to SAP.

0 Kudos

Hi Dipak

One thing i think i told you in incorrect way.. If you look at the documentation of BAPI it provides you how to fill all the details.

In your method where you are appending SAVE along with id remove that id. Have the order id which i asked you to delete.

 

CLEAR: ls_methods.
ls_methods-refnumber =
'000001'.
ls_methods-objecttype =
''.
ls_methods-
method = 'SAVE'.
ls_methods-objectkey = ls_seltab-aufnr.
APPEND ls_methods TO lt_methods.

Then use BAPI_TRANSACTION_COMMIT

0 Kudos

Nabheet,

Ok but I have aready used this code. could you plz check my sample code?

Object key  = '%00000000001'

Object key is correct one or not?

What should i put in Object key field?

Thanks.

0 Kudos

Key i believe is correct but for SAVE method it shoudl be blank..Seconldy  check also in documentation you will find the correct way

Former Member
0 Kudos

Hi ,

Maintain these two tabular parameter along with existing tabular parameters.

IT_HEADER_UP

IT_OPERATION_UP

also check this link Using BAPI_ALM_ORDER_MAINTAIN method CREATETONOTIF - ERP Operations - SCN Wiki

Regard's

Smruti

dipak_khatavkar
Participant
0 Kudos

Problem not solved yet!!

0 Kudos

Please paste your current code with error which is thrown

Nabheet

0 Kudos

Hi,

Sorry for late reply:)

Same error throwing while creating work order.

same code as above as i have already posted. Just trying to run without adding operation method.

Thanks.

Former Member
0 Kudos

Hi. To solved this error you need pass this parametres in BAPI:

CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'

     TABLES

       it_methods         = it_methods

       it_header            = it_header

       it_header_up     = it_header_up

       it_operation        = it_operation

       it_operation_up = it_operation_up

       return                   = lt_return.

And in  it-methods, include this:

   wa_methods-refnumber  = '000001'.

   wa_methods-objecttype = 'HEADER'.

   wa_methods-method = 'CREATE'.

   wa_methods-objectkey  = '%00000000001'.

   APPEND wa_methods TO it_methods. CLEAR wa_methods.

   wa_methods-refnumber  = '000001'.

   wa_methods-objecttype = 'OPERATION'.

   wa_methods-method = 'CREATE'.

   wa_methods-objectkey  = '%00000000001'.

   APPEND wa_methods TO it_methods. CLEAR wa_methods.

   wa_methods-refnumber = '000001'.

   wa_methods-objecttype = ''.

   wa_methods-method = 'SAVE'.

   wa_methods-objectkey = '%00000000001'.

   APPEND wa_methods TO it_methods. CLEAR wa_methods.

All code are below

.......................................................................................................................................................

   DATA:

     it_methods      TYPE STANDARD TABLE OF bapi_alm_order_method,

     wa_methods      LIKE LINE OF it_methods,

     it_header       TYPE STANDARD TABLE OF bapi_alm_order_headers_i,

     wa_header       LIKE LINE OF it_header,

     it_operation    TYPE STANDARD TABLE OF bapi_alm_order_operation,

     wa_operation    LIKE LINE OF it_operation,

     it_operation_up TYPE STANDARD TABLE OF bapi_alm_order_operation_up,

     wa_operation_up LIKE LINE OF it_operation_up,

     it_header_up    TYPE bapi_alm_order_headers_up OCCURS 0 WITH HEADER LINE,

     wa_header_up    LIKE LINE OF it_header_up,

     lt_return       TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.

   wa_header-orderid = '%00000000001'.

   wa_header-order_type = 'ZENG'.

   wa_header-equipment = '000000000100000004'.

   wa_header-short_text = 'TESTE EUCLIDES'.

   wa_header-plangroup = '100'.

   wa_header-planplant = '1001'.

   wa_header-plant = '1001'.

   wa_header-pmacttype = '100'.

   wa_header-priority = '4'.

   wa_header-start_date = sy-datum.

   wa_header-finish_date = sy-datum.

   wa_header-mn_wk_ctr = 'TESTE'.

   APPEND wa_header TO it_header.

   wa_header_up-orderid = '%00000000001'.

   wa_header_up-equipment = 'X'.

   wa_header_up-short_text = 'X'.

   wa_header_up-plangroup = 'X'.

   wa_header_up-plant = 'X'.

   wa_header_up-pmacttype = 'X'.

   wa_header_up-priority = 'X'.

   wa_header_up-start_date = 'X'.

   wa_header_up-finish_date = 'X'.

   wa_header_up-mn_wk_ctr = 'X'.

   APPEND wa_header TO it_header_up.

   wa_operation-activity = '10'.

   wa_operation-control_key = 'PM01'.

   wa_operation-work_cntr = 'TESTE'.

   wa_operation-plant = '1001'.

   wa_operation-description = 'TESTE EUCLIDES'.

   wa_operation-langu = 'P'.

   APPEND wa_operation TO it_operation.

   wa_operation_up-activity = 'X'.

   wa_operation_up-control_key = 'X'.

   wa_operation_up-work_cntr = 'X'.

   wa_operation_up-plant = 'X'.

   wa_operation_up-description = 'X'.

   wa_operation_up-langu = 'X'.

   APPEND wa_operation_up TO it_operation_up.

   wa_methods-refnumber  = '000001'.

   wa_methods-objecttype = 'HEADER'.

   wa_methods-method = 'CREATE'.

   wa_methods-objectkey  = '%00000000001'.

   APPEND wa_methods TO it_methods. CLEAR wa_methods.

   wa_methods-refnumber  = '000001'.

   wa_methods-objecttype = 'OPERATION'.

   wa_methods-method = 'CREATE'.

   wa_methods-objectkey  = '%00000000001'.

   APPEND wa_methods TO it_methods. CLEAR wa_methods.

   wa_methods-refnumber = '000001'.

   wa_methods-objecttype = ''.

   wa_methods-method = 'SAVE'.

   wa_methods-objectkey = '%00000000001'.

   APPEND wa_methods TO it_methods. CLEAR wa_methods.

   CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'

     TABLES

       it_methods   = it_methods

       it_header    = it_header

       it_header_up = it_header_up

       "it_partner      = it_partner

       "it_partner_up   = it_partner_up

       it_operation    = it_operation

       it_operation_up = it_operation_up

       return       = lt_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

ENDFUNCTION.