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

/AFS/BAPI_ROUTING_CREATE ?

Former Member
0 Likes
1,999

Hi all,

Any /AFS/BAPI for routing creation .

Tnx

KosalaW

5 REPLIES 5
Read only

Former Member
0 Likes
1,455

hi Kosala,

The following description might help u out..

Short Description

Creation of a routing

Function Module

BAPI_ROUTING_CREATE

Functionality

This method serves to create routings with all their subordinated objects. Here, you can generate a key date view as well as the complete history of a routing. The latter is particularly useful for data transfers from non-SAP systems.

Example

You want to create a routing with its sequences, operations and inspection characteristics on the key date 01.01.2000. You generate an entry for each object in the following table by always entering the date 01.01.2000 in the attribute VALID_FROM:

TASK

Enter the relevant task list header data here. The attributes TASK_LIST_GROUP and GROUP_COUNTER only have to be supplied if you work with external number assignment. For internal number assignment the task list group and the group counter are determined automatically.

SEQUENCE

Here, only entries for alternative or parallel sequences are allowed. The standard sequence of a routing is always generated automatically and therefore does not have to be entered. Here also, the attributes TASK_LIST_GROUP and GROUP_COUNTER need only be supplied in the case of external number assignment.

OPERATION

You generate an entry for each operation in this table. To identify the operations, you have to enter an external operation identifier in the field OPERATION_ID. This identifier has to contain at least one character that is not a number (such as VORG0010). This external identifier is used by the definition of the alternative or parallel sequences to identify the corresponding branch or return operation. You only have to supply the TASK_LIST_GROUP and GROUP_COUNTER in the case of external number assignment.

INSPCHARACTERISTIC

You generate an entry for each inspection characteristic in this table. To identify the inspection characteristics you have to enter an inspection characteristic number in the field INSPCHAR. You can create inspection characteristics with or without reference to a master inspection characteristic. In the field CHA_MASTER_IMPORT_MODUS (Modus for the reference to the master inspection characteristic) enter the reference to the master inspection characteristic: 'L' for reference. In this case, the master inspection characteristic has to be completely maintained. In the parameter INSPCHARACTERISTIC you only have to supply those fields that could not be copied from the master inspection characteristic; 'C' for copy the data from the master inspection characteristic into the inspection characteristic, 'N' for create a lockable and unlockable reference to the master inspection characteristic without a data transfer from the master inspection characteristic. In this case manually fill out all fields in the parameter INSPCHARACTERISTIC. You can either transfer the inspection characteristic control indicator directly from the master inspection characteristic, enter it individually or in the field PRESET_CTRL_INDS_KEY you enter a key for the control indicator if you have stored this key in Customizing. If you have individually entered a control indicator, note the following special features:

SCOPE_IND: Inspection scope. This indicator can have different

characteristics: You set " " for: Free inspection scope You set "<" for: Smaller inspection scope permitted You set ">" for: Larger inspection scope permitted You set "=" for: Defined inspection scope

RESULT_RECORDING_TYPE: Record entry type. This indicator can have different characteristics:

You set "-" for: No record entry You set "*" for: Classified record entry You set "+" for: Single record entry You set " " for: Summarized record entry

DOCU_REQU: Documentation required for check results. This indicator can

have different characteristics: You set " " for: No documention required You set "." for: Documentation for rejection You set "" for: Document all check results You set "" for: Document all check results.

CONFIRMATION_CATEGORY Characteristic category

You set " " for: Optional characteristic You set "+" for: Limited to the acceptance of the previous mandatory characteristic You set "-" for: Limited to the rejection of the previous mandatory characteristic

You set "X" for: Mandatory characteristic

PRINT_IND: Print control This indicator can have different characteristics: You set " " for: Print You set "x" for: Do not print You set "*" for: Do not print at skip If you want to assign an inspection equipment to the inspection characteristic in the field ITEM_NO_OF_PRODUCTION_RESOURCE, note that this has to be assigned to the operation in the PARAMETER PRODUCTIONRESOURCE.

Reward if helpful.

Thankyou,

Regards.

Read only

0 Likes
1,455

Tnx Dude, Solved Problem.

Read only

0 Likes
1,455

Hi RajKamal,

Still i got a error masseages.

Output :-

Export parameters Value

GROUP 50003626

GROUPCOUNTER 1

T ID NUM MESSAGE

E BAPI 001

E CP 745 Value 0 for denominator not defined (check entry)

S QP 504 Non-relevant fields will be initialized

E CPCL 203 Consistency check not successful when creating operation

-


REPORT ZKW_BAPI_ROUTING_CREATE .

DATA: bapi_group TYPE BAPI1012_TSK_C-TASK_LIST_GROUP,

bapi_groupcounter TYPE BAPI1012_TSK_C-GROUP_COUNTER.

DATA: BEGIN OF bapi_task occurs 100.

INCLUDE STRUCTURE BAPI1012_TSK_C.

DATA: END OF bapi_task.

DATA: BEGIN OF bapi_MATERIALTASKALLOCATION occurs 100.

INCLUDE STRUCTURE BAPI1012_MTK_C.

DATA: END OF bapi_MATERIALTASKALLOCATION.

DATA: BEGIN OF bapi_OPERATION occurs 100.

INCLUDE STRUCTURE BAPI1012_OPR_C.

DATA: END OF bapi_OPERATION.

DATA: BEGIN OF bapi_RETURN occurs 10.

INCLUDE STRUCTURE BAPIRET2.

DATA: END OF bapi_RETURN.

bapi_task-VALID_FROM = sy-datum.

bapi_task-TASK_LIST_USAGE = '1'.

bapi_task-PLANT = '1000'.

bapi_task-TASK_LIST_STATUS = '4'.

bapi_task-TASK_MEASURE_UNIT = 'EA'.

bapi_task-TASK_MEASURE_UNIT_ISO = 'EA'.

*bapi_task-LOT_SIZE_FROM = '0'.

*bapi_task-LOT_SIZE_TO = '99,999,999'.

APPEND bapi_task.

bapi_MATERIALTASKALLOCATION-MATERIAL = 'F1469RED'.

bapi_MATERIALTASKALLOCATION-PLANT = '1000'.

bapi_MATERIALTASKALLOCATION-VALID_FROM = sy-datum.

APPEND bapi_MATERIALTASKALLOCATION.

bapi_OPERATION-VALID_FROM = sy-datum.

bapi_OPERATION-ACTIVITY = '0010'.

*OPERATION_ID

bapi_OPERATION-CONTROL_KEY = 'PP03'.

bapi_OPERATION-WORK_CNTR = 'PAKNG'.

bapi_OPERATION-PLANT = '1000'.

bapi_OPERATION-STANDARD_TEXT_KEY = 'PACKING'.

*DESCRIPTION

APPEND bapi_OPERATION.

CALL FUNCTION 'BAPI_ROUTING_CREATE'

IMPORTING

GROUP = bapi_group

GROUPCOUNTER = bapi_groupcounter

TABLES

TASK = bapi_task

MATERIALTASKALLOCATION = bapi_MATERIALTASKALLOCATION

OPERATION = bapi_OPERATION

RETURN = bapi_RETURN.

loop at bapi_RETURN.

IF bapi_RETURN[] IS INITIAL.

commit work and wait.

WRITE: / bapi_group,

bapi_groupcounter.

ELSE.

if bapi_RETURN-type eq 'E'.

write:/'Error in function1', bapi_RETURN-message.

rollback work.

else.

commit work and wait.

write:/ bapi_RETURN-message.

endif.

ENDIF.

endloop.

Read only

Former Member
0 Likes
1,455

hi

good

BAPI_ROUTING_CREATE

thanks

mrutyun6

Read only

Former Member
0 Likes
1,455

Hi Alls,

LSMW - PO Creation

Business Object /AFS/B2012

Method CREATEFROMDATAAFS

Message Type /AFS/PORDCR

Basic Type /AFS/PORDCR01

In this LSMW, if im trying to execute "Start IDoc Generation", im getting following error

"LI&FUNG_NEW_MM_PURCHORDER2.lsmw.conv" File Has Not Been Accepted for Processing

What's the issues with my LSMW.