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: 

PP - Routing Upload

Former Member
0 Kudos

Hi Guru's,

I am uploading routing data through 'BAPI_ROUTING_CREATE', in test run data is going correct. But in Porgram it is throwing error message

' Inspection Char can not be uniquely assigned to one operation'.

Except this data related to Routing, Operations, Component Allocation is going correct.

With Regards,

Pravin

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

Hi Praveen,

Here is an excerpt from the FM documentation.

see if it helps.

"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."

Regards,

Ravi

6 REPLIES 6

former_member181962
Active Contributor
0 Kudos

Hi Praveen,

Here is an excerpt from the FM documentation.

see if it helps.

"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."

Regards,

Ravi

Former Member
0 Kudos

Hi,

Please check the parameters passed for the Ins.char in BAPI, and also go thro' the documentation provided by SAP, it is quite self explanatory, this might answer your query regarding routing.

Rgds,

0 Kudos

Hi,

i already did all corrections, as i am telling that in test mode data is going proper but when i amtrying through my prog it is giving error.

Pravin

Former Member
0 Kudos

i just to use BAPI_ROUTING_CREATE ,but i can not successful ,can u help me , pls send me some code to my

email: xtihige@163.com,3ks!

Former Member
0 Kudos

Hi Pravin ,

Here is the complete code for PP01 -

&----


*

*& Report ZCPROUT1 *

*& *

&----


*& CREATING ROUTING. *

*& *

&----


*Subrountine created : 1. UPLOAD_DATA_OPEN_GROUP

  • 2. PROCESS_DATA_CLOSE_GROUP

  • 3. FILL_BDC_TAB USING

  • 4. GET_ROUTING_INFO

*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  • PROGRAM CREATED BY : NAND KISHOR HEDA ( LnT INFOTECH )

*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  • 31 AUGUST 2004

*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

REPORT ZRPROUT1 .

*

    • Internal Tables **

DATA : T_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE .

*This internal table will have the material's for which routing is

*already exists because Transaction flow will be different in this case

  • D A T A

***********************************************************************

DATA: BEGIN OF IT_MAPL OCCURS 0,

MATNR LIKE MAPL-MATNR,

WERKS LIKE MAPL-WERKS,

PLNTY LIKE MAPL-PLNTY,

PLNNR LIKE MAPL-PLNNR,

PLNAL LIKE MAPL-PLNAL,

END OF IT_MAPL.

*This Internal Table will have records from flat file to create routing

DATA : BEGIN OF I_TABLE OCCURS 0,

MATNR LIKE RC27M-MATNR,

WERKS LIKE RC27M-WERKS,

VERWE LIKE PLKOD-VERWE,

STATU LIKE PLKOD-STATU,

VORNR LIKE PLPOD-VORNR,

ARBPL LIKE PLPOD-ARBPL,

STEUS LIKE PLPOD-STEUS,

LTXA1 LIKE PLPOD-LTXA1,

VGW01(13) TYPE C ,

VGW02(13) TYPE C ,

VGW03(13) TYPE C ,

VGW04(13) TYPE C ,

VGE01 LIKE PLPOD-VGE01,

VGE02 LIKE PLPOD-VGE02,

VGE03 LIKE PLPOD-VGE03,

VGE04 LIKE PLPOD-VGE04,

FLAG TYPE C,

  • FLAG will decide which recording to use,depends upon presence of

*routing

END OF I_TABLE.

*This table will be used to populate all Operations and corresponding

*values on the screen

DATA: WA_TABLE LIKE I_TABLE.

DATA: I_TABLE2 LIKE I_TABLE OCCURS 0 WITH HEADER LINE.

    • Accumulators **

  • S T A R T O F S E L E C T I O N

***********************************************************************

*

START-OF-SELECTION.

PERFORM UPLOAD_DATA_OPEN_GROUP.

PERFORM GET_ROUTING_INFO.

PERFORM PROCESS_DATA_CLOSE_GROUP .

***********************************************************************

*

  • E N D O F S E L E C T I O N

***********************************************************************

*

END-OF-SELECTION.

FORM UPLOAD_DATA_OPEN_GROUP.

CALL FUNCTION 'UPLOAD'

EXPORTING

FILENAME = 'C:\ROUTER_BDC.TXT'

FILETYPE = 'DAT'

TABLES

DATA_TAB = I_TABLE.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT I_TABLE INTO wa_table.

TRANSLATE wa_table-matnr TO UPPER CASE .

wa_table-matnr = wa_table-matnr .

MODIFY I_TABLE FROM wa_table .

ENDLOOP .

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

GROUP = 'ZRPROUT1'

  • HOLDDATE = FILLER8

KEEP = 'X'

USER = SY-UNAME

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. " UPLOAD_DATA

*&----


*

*& Form PROCESS_DATA_CLOSE_GROUP

*&----


*

*In this subroutine first we will fill the table T_BDCDATA and then

*will insert the transaction in the session and finally close the BDC

*session

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM PROCESS_DATA_CLOSE_GROUP.

SORT I_TABLE BY MATNR .

SORT I_TABLE2 BY MATNR VORNR .

  • TAB_INDEX = 1.

I_TABLE2[] = I_TABLE[].

DELETE ADJACENT DUPLICATES FROM I_TABLE COMPARING MATNR.

LOOP AT I_TABLE .

PERFORM FILL_BDC_TAB USING:

'1' 'SAPLCPDI' '1010',

' ' 'RC27M-MATNR' I_TABLE-MATNR,

' ' 'RC27M-WERKS' I_TABLE-WERKS,

' ' 'BDC_OKCODE' '/00'.

                                                                                      • NEXT SCREEN

CLEAR IT_MAPL.

READ TABLE IT_MAPL WITH KEY MATNR = I_TABLE-MATNR.

  • THIS CONDITION IS TO CHECK WHETHER A ROUTING ALREADY EXISTS

  • IF SO A SCREEN COMES IN BETWEEN WE'L ADD THAT HERE

IF SY-SUBRC = 0.

PERFORM FILL_BDC_TAB USING:

'1' 'SAPLCPDI' '1200',

' ' 'BDC_CURSOR' 'RC27X-ENTRY_ACT',

' ' 'BDC_OKCODE' '=ANLG'.

  • ' ' 'RC27X-ENTRY_ACT' '1'

ENDIF.

PERFORM FILL_BDC_TAB USING:

'1' 'SAPLCPDA' '1200',

' ' 'PLKOD-VERWE' I_TABLE-VERWE,

' ' 'PLKOD-STATU' I_TABLE-STATU,

' ' 'BDC_OKCODE' '=VOUE',

                                                                                      • NEXT SCREEN

'1' 'SAPLCPDI' '1400'.

LOOP AT I_TABLE2 WHERE MATNR = I_TABLE-MATNR.

PERFORM FILL_BDC_TAB USING:

' ' 'BDC_OKCODE' '=EINF',

' ' 'BDC_CURSOR' 'PLPOD-VORNR(01)' ,

' ' 'PLPOD-VORNR(01)' I_TABLE2-VORNR,

' ' 'PLPOD-ARBPL(01)' I_TABLE2-ARBPL,

' ' 'PLPOD-STEUS(01)' I_TABLE2-STEUS,

' ' 'PLPOD-LTXA1(01)' I_TABLE2-LTXA1,

' ' 'PLPOD-VGW01(01)' I_TABLE2-VGW01,

' ' 'PLPOD-VGW02(01)' I_TABLE2-VGW02,

' ' 'PLPOD-VGW03(01)' I_TABLE2-VGW03,

' ' 'PLPOD-VGW04(01)' I_TABLE2-VGW04,

' ' 'PLPOD-VGE01(01)' I_TABLE2-VGE01,

' ' 'PLPOD-VGE02(01)' I_TABLE2-VGE02,

' ' 'PLPOD-VGE03(01)' I_TABLE2-VGE03,

' ' 'PLPOD-VGE04(01)' I_TABLE2-VGE04,

'1' 'SAPLCPDI' '1400' .

  • ' ' 'BDC_OKCODE' '=EINF'

ENDLOOP.

PERFORM FILL_BDC_TAB USING:

' ' 'BDC_OKCODE' '/00',

' ' 'BDC_OKCODE' '=BU'.

****************************************

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'CA01'

TABLES

DYNPROTAB = T_BDCDATA.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

*WRITE:/ 'EROOR WHILE INSERTING THE TRANSACTION' .

ENDIF.

REFRESH T_BDCDATA.CLEAR T_BDCDATA.

ENDLOOP.

CALL FUNCTION 'BDC_CLOSE_GROUP'

  • EXCEPTIONS

  • NOT_OPEN = 1

  • QUEUE_ERROR = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. " PROCESS_DATA_CLOSE_GROUP

*&----


*

*& Form fILL_BDC_TAB

*&----


*

  • Filling the table T_BDCDATA .

*----


*

  • -->P_0121 text

  • -->P_0122 text

  • -->P_0123 text

*----


*

FORM FILL_BDC_TAB USING VALUE(P_FLAG)

VALUE(P_V1)

VALUE(P_V2).

CLEAR T_BDCDATA.

IF P_FLAG = '1'.

T_BDCDATA-PROGRAM = P_V1 .

T_BDCDATA-DYNPRO = P_V2.

T_BDCDATA-DYNBEGIN = 'X' .

ELSE.

T_BDCDATA-FNAM = P_V1.

T_BDCDATA-FVAL = P_V2.

ENDIF.

APPEND T_BDCDATA.

ENDFORM. " fILL_BDC_TAB

*************************************************

*&----


*

*& Form get_routing_info

*&----


*

  • Retrieving the material for which routing already exists ,

*Transaction

  • flow will be different for these material .

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM GET_ROUTING_INFO.

  • TRANSLATE i_table-matnr TO UPPER CASE .

SELECT MATNR WERKS PLNTY PLNNR PLNAL

FROM MAPL

INTO CORRESPONDING FIELDS OF TABLE IT_MAPL

FOR ALL ENTRIES IN I_TABLE

WHERE

MATNR = I_TABLE-MATNR AND

  • MATNR = 'services' AND

WERKS = I_TABLE-WERKS AND

PLNTY = 'N'. "this is for selecting only routings

SORT IT_MAPL BY MATNR .

ENDFORM. " get_routing_info

Former Member
0 Kudos

hi,

PRAVIN MISHRA ,i used th FM 'BAPI_ROUTING_CREATE'

,I have the same problem ,how did u solve the problem?