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: 

BAPI_ALM_ORDER_MAINTAIN release multiple

Former Member
0 Kudos

Hi everybody!

I am new here and i hope to learn new things 

I'm trying to release several orders (similar to IW38) using a function that uses the  BAPI_ALM_ORDER_MAINTAIN

As it frees one at a time, I am in a loop of a table of orders to be released, and calls with each of the function, filling methods as follows:

* Prepare data to call the BAPI

lw_methods-ObjectType = space.

lw_methods-method = 'SAVE'.

Lw_methods APPEND TO lt_methods.

CLEAR lw_methods.

lw_methods-REFNUMBER = 1.

lw_methods-ObjectType = 'HEADER'.

lw_methods-method = 'RELEASE'.

lw_methods-OBJECTKEY = lv_aufnr.

Lw_methods APPEND TO lt_methods.

The problem is that if i try to  release more than one, the first are released ok and the others release strip error (C2 009), as if I release one and release another. I have to exit and re-enter the program to release another order. 

I appreciate suggestions!

already thank you!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

you could try this, display all the orders that you want to release in a ALV grid. Allow user to select a row and then you click the release button. Here you call the BAPI. Commit work and then refersh the ALV grid, remove the released order to avoid confusion. Then allow to release the next order. Need to check if selecting multiple and doing the BAPI call works fine.

Let me know if this helps.

Best Regards,

Swanand

5 REPLIES 5

Former Member
0 Kudos

Hello,

you could try this, display all the orders that you want to release in a ALV grid. Allow user to select a row and then you click the release button. Here you call the BAPI. Commit work and then refersh the ALV grid, remove the released order to avoid confusion. Then allow to release the next order. Need to check if selecting multiple and doing the BAPI call works fine.

Let me know if this helps.

Best Regards,

Swanand

0 Kudos

Thanks Swanand !

I am already  displaying an ALV and delete the rows, but the problem is the same. I am debugging the bapi , and I detect that the problem is that in a moment is activated a flag "flag_no_release" in the perform PERM_ISSUE_CHECK.

I think that there are any blocked or not correctly clean, But I didn´t find it.

PD: sorry about my english , is not very good

0 Kudos

Well, I finally find the problem. There are a flag that is not cleaned after each call to the bapi.

I found a function which cleans it:

CALL FUNCTION 'PERMIT_INIT_AFTER_POST'.

I now call that function after each loop´s iteration, and it works ok.

I hope that it will be util to someone else

Regards!

0 Kudos

Hi,

I am trying to release already created single process order but I am getting error "No maintenance activity type could be determined".

Please help.

       REFRESH : it_methods .
       CLEAR wa_methods.
       wa_methods-refnumber = c_000000 .
       wa_methods-objecttype = c_header .
       wa_methods-method = c_release .
       wa_methods-objectkey = process_order .
       APPEND wa_methods TO it_methods .


       CLEAR wa_methods.
       wa_methods-refnumber = c_000000 .
       wa_methods-objecttype = c_order .
       wa_methods-method = c_save .
       wa_methods-objectkey = process_order .
       APPEND wa_methods TO it_methods .

CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
         TABLES
           it_methods              = it_methods[]
           return                  = it_bapiret2[]
               .

0 Kudos

Hello Former Member!

I think that in save line , the object type and should be empty, and the object key too.

lw_methods-ObjectType = space.

lw_methods-method = 'SAVE'.

Lw_methods APPEND TO lt_methods.

I hope it will be helpful

Regards!