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_ALM_ORDER_MAINTAIN with multiple components creating duplicate entries

arpita_churi3
Active Participant
0 Likes
8,666

Hi All,

we are using BAPI : BAPI_ALM_ORDER_MAINTAIN to create the multiple components  with different materials , it is creating components with same material , same item number , same details repeated twice  in the components tab in the Order.

passing below details to bapi: lt_methods:

000001HEADERCREATE%00000000001
000001COMPONENTCREATE%000000000010010
000001COMPONENTCREATE%000000000010020
000001TASKLISTADD%00000000001
000000SAVE

passing lt_componets as :

materail  , stge_loc , item_Cat  ,

item_number as : 0010 , 0020  , activity as : 0010 , 0020 , requirement_quantity  . and passing same parameter to it_components_up aswell.

CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'

     TABLES

       it_methods      = lt_methods

       it_header       = lt_header

       it_header_up    = lt_header_up             

       it_component    = lt_component

       it_component_up = lt_component_up      

       it_tasklists    = lt_tasklist

       return          = lt_return

       et_numbers      = lt_et_numbers.


even though we are passing different materials  and item numbers  still it is creating with one material only in components .


kindly help us on this.



regards,

Arpita

1 ACCEPTED SOLUTION
Read only

Ashg1402
Contributor
0 Likes
5,723

Hi,

You are adding 2 components and giving same reference number in method table. The reference number should be in increasing order for components.

Give the values in method table as -

000001     COMPONENT     CREATE     %000000000010010

000002     COMPONENT     CREATE     %000000000010020

Try this. It will work.

Regards

Ashish

8 REPLIES 8
Read only

Ashg1402
Contributor
0 Likes
5,724

Hi,

You are adding 2 components and giving same reference number in method table. The reference number should be in increasing order for components.

Give the values in method table as -

000001     COMPONENT     CREATE     %000000000010010

000002     COMPONENT     CREATE     %000000000010020

Try this. It will work.

Regards

Ashish

Read only

0 Likes
5,723

Thanks Ashish.

I tried the same. see below screen shot og LT_METHODS[].

1000001HEADERCREATE%00000000001
2000001COMPONENTCREATE%000000000010010
3000002COMPONENTCREATE%000000000010020
4000001TASKLISTADD%00000000001
5000000

SAVE

But I am getting below error in LT_RETURN[]

Type =  'E'

Message = 'Operation number 0020 does not exist (check entry)'

Thanks,

Arpita

Read only

0 Likes
5,723

Hi,

It's giving this error due to the key which you have given in method table for component,

i.e. - %000000000010020.

There is no need of giving it. Just give the key as %00000000001 and pass the operation number in ACTIVITY field of component table. Remove the 0010 and 0020.

and try again.

Read only

0 Likes
5,723

Hi Ashish,

can you please eloborate what you mean in the above thread.

i tried removing the  %00000000001010 and %0000000000120 to below

1000001HEADERCREATE%00000000001
2000001COMPONENTCREATE%0000000000100
3000002COMPONENTCREATE%0000000000100
4000001TASKLISTADD%00000000001
5000000SAVE
______________________________

\and also  do you mean i need to pass ACTIVITY as 0010 , 0020 and remove item number?what need to pass as operation number in activity?

thanks

Arpita

Read only

0 Likes
5,723

Hi,

  Are you creating any operation in your order.?

In the components table of BAPI there are fields for ACTIVITY, ITEM NUMBER. Pass the operation number in activity, if you are creating any operation and to which operation you want to pass the component.

Fill the method table in this way -

1          000001   HEADER            CREATE  %00000000001

2          000001  COMPONENT    CREATE  %00000000001

3          000002  COMPONENT    CREATE  %00000000001

4          000001  TASKLIST            ADD      %00000000001

5          000000              SAVE

Remove the 0010 , 0020 from %00000000001, the key value which you are passing for components.

Read only

0 Likes
5,723

Hi Ashish ,

thank you , it  is working now.

i am not creating operations , so i have passed activity as blank.

regards,

Arpita

Read only

0 Likes
5,723

Nice,

That's what I was asking about operation.

Regards

Ashish

Read only

Former Member
0 Likes
5,723

Hi ,

I am completely new to PM Module.

I need to create Work Order in Mass using BAPI_ALM_ORDER_MAINTAIN. please let me know the step by step procedure to do it. what input to pass to Create Order number, get Task List Details related to operation.

All in creation mode. Sample code will be much helpful.

Please reply