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

how to use componenet allocation in BAPI_ROUTING_CREATE

Former Member
0 Likes
2,331

Hi Experts,

I am creating routing using bapi BAPI_ROUTING_CREATE. In that i am passing header,operation and componenet

allocation level but its giving error as 'operation has to be assigned is not completely specified'. Kindly anyone help me regarding this..

Thanks

Ramesh Manoharan

Edited by: ramesh.manoharan on Jan 30, 2010 4:10 PM

hello if the problem is with operation...then pass the below data for header and operation it creates routing i have verified.....

Populate BAPI_ROUTING_CREATE .....using following structures and fields

BOMUSAGE 1

TASK

GROUP_COUNTER 1

TASK_LIST_USAGE 1

TASK_LIST_STATUS 4

TASK_MEASURE_UNIT EA

LOT_SIZE_FROM 190

LOT_SIZE_TO 300

DESCRIPTION TEST123

OPERATION

GROUP_COUNTER 1

ACTIVITY 0010(operation number)

CONTROL_KEY PP01

PLANT 0001

DESCRIPTION TEST

OPERATION_MEASURE_UNIT EA

DENOMINATOR 1

NOMINATOR 1

BASE_QUANTITY 12

after this dont forget to use BAPI_TRANSACTION_COMMIT ( go to se37 ..test-test sequences---enter BAPI_ROUTING_CREATE and BAPI_TRANSACTION_COMMIT)

and execute ..i have tested this it works perfet..create routing with 1 opeartion 0010...

for componenet allocation i am looking..but i have some access problems ......as u said u have error in opeartin that means what ever data you are using for COMPONENETALLOCATION is correct.

first create one routing with header and one operation only using data i have specified...if it works then for next routing u can add fields into componenent allocation and test.....remember for componenet allocation..BOM needs to be there for that material assigned.

hope i am able to clear some of your confusion..cheers....

-


Abhijeet

6 REPLIES 6
Read only

Former Member
Read only

0 Likes
1,346

Hi,

The link which you have been sent is not helping for me .. In that program the component allocation structure has not been

populated. I want to know the details about each field in structure of component allocation... kindly help me regarding this.

Thanks

Ramesh Manoharan

Read only

0 Likes
1,346

hello ramesh,

i will provide you the field and structures which should be populated to create routing through BAPI_ROUTING_CREATE

in few minutes for sure.cause i am checking it.

till the time i can give you a hint..try this hint....

go to CA01 (create routing) create routing through this ....with header,one operation and one componenet allocation.....

ask any of the functional consultant to create this if its not possible for you as a ABAPER....

then take that routing number and go to BAPI_ROUTING_DISPLAY.....provide that number to this BAPI and execute...

what ever export structures you will be getting for header,operation and componenet allocation..pass the same

structures and values to BAPI_ROUTING_CREATE...so by that means u will be able to create routing....

here few things are important...

materail creation in the plant specified...

as you are getting error in opeartion check work center........

and for componenet alllocation BOM should have been in the system for that material.....

Read only

0 Likes
1,346

hello if the problem is with operation...then pass the below data for header and operation it creates routing i have verified.....

Populate BAPI_ROUTING_CREATE .....using following structures and fields

BOMUSAGE 1

TASK

GROUP_COUNTER 1

TASK_LIST_USAGE 1

TASK_LIST_STATUS 4

TASK_MEASURE_UNIT EA

LOT_SIZE_FROM 190

LOT_SIZE_TO 300

DESCRIPTION TEST123

OPERATION

GROUP_COUNTER 1

ACTIVITY 0010(operation number)

CONTROL_KEY PP01

PLANT 0001

DESCRIPTION TEST

OPERATION_MEASURE_UNIT EA

DENOMINATOR 1

NOMINATOR 1

BASE_QUANTITY 12

after this dont forget to use BAPI_TRANSACTION_COMMIT ( go to se37 ..test-test sequences---enter BAPI_ROUTING_CREATE and BAPI_TRANSACTION_COMMIT)

and execute ..i have tested this it works perfet..create routing with 1 opeartion 0010...

for componenet allocation i am looking..but i have some access problems ......as u said u have error in opeartin that means what ever data you are using for COMPONENETALLOCATION is correct.

first create one routing with header and one operation only using data i have specified...if it works then for next routing u can add fields into componenent allocation and test.....remember for componenet allocation..BOM needs to be there for that material assigned.

hope i am able to clear some of your confusion..cheers....

-


Abhijeet

Read only

0 Likes
1,346

Hi

Thanks for the reply .. I am getting error in component level. I have tested for only header and operation level it is working fine.

but when i pass component structure to bapi it is giving error as 'The component to be assigned has not been completely

specified'. Could you describe about each field in component allocation level..

Thanks

Ramesh Manoharan

Read only

Former Member
0 Likes
1,346

The error you are getting is coming from component allocation.

Ensure that the structure and internal table for component allocation (passed to BAPI) is cleared before being populated.

          componentallocation-valid_from     

          componentallocation-valid_to_date '.

          "make sequence 6 characters

          COMPONENTALLOCATION-SEQUENCE_NO     = lv_sequence.

          COMPONENTALLOCATION-ALTERNATIVE_BOM = gs_stko-stlal.

          COMPONENTALLOCATION-BOM_NO          = gs_stko-stlnr.

          COMPONENTALLOCATION-BOM_TYPE        = gs_stko-STLTY.

          COMPONENTALLOCATION-bom_type_root   = gs_stko-STLTY.

          COMPONENTALLOCATION-BOM_NO_ROOT     = gs_stko-stlnr.

          COMPONENTALLOCATION-ITEM_ID         = gs_stpo-STLKN.

          componentallocation-activity        = VORNR.

          componentallocation-item_no         = POSNR.

          COMPONENTALLOCATION-PLANT           = WERKS.

          COMPONENTALLOCATION-MATERIAL        = MATNR.

          COMPONENTALLOCATION-COMP_QTY        = gs_stpo-MENGE.

          COMPONENTALLOCATION-COMP_UNIT       = gs_stpo-MEINS.

This should help. It is working for me.