<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Component Allocation in BAPI_ROUTING_CREATE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813257#M917151</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't get it to work. So after creating the route I used the direct input function module CP_BD_DIRECT_INPUT_PLMZ to assign the components. It's probably not the best way but it worked. Check it out, maybe you can try it that way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  copy_mat_routing_plmz
*&amp;amp;---------------------------------------------------------------------*
*       Kopieren der Komponentenzuordnung via Direct-Input
*----------------------------------------------------------------------*
form copy_mat_routing_plmz tables $t_prot             type dt_prot
                                  $t_bom_copy         type dt_bom_copy
                            using value($w_plnnr)     like mapl-plnnr
                                  value($w_plnal)     like mapl-plnal
                                  value($w_mapl)      type d_mat_mapl
                                  value($w_color_old) structure t_colors
                                  value($w_color_new) structure t_colors
                                  value($w_matnr_new) like mara-matnr
                                  $w_prot             type d_prot
                                  $w_counter          type d_count.

  data: %w_rc271              like rc271_di,
        %w_rc27m              like rc27m_di,
        %w_save               like save_di,
        %w_plnnr              type rc271-plnnr,
        %w_acttyp             type acttyp.

  data: %w_plmz               type plmz,
        %w_plpo               type plpo.

  data: %t_plmz_di            type plmz_di    occurs 0 with header line,
        %t_obj_null_field     type obj_nfield occurs 0 with header line,
        %t_error_di           type error_di   occurs 0 with header line,
        %t_error              type cmfmsg     occurs 0 with header line,
        %t_error_tmp          type cmfmsg     occurs 0 with header line.

  data: %t_plmz               like plmz       occurs 0 with header line.

* Es muss eine neue Stückliste angelegt worden sein
  check not ( %w_prot_marc_bom-stlnr is initial ).

* Arbeitsplan muss vorhanden sein
  select count(*) into sy-dbcnt from plko
                 where plnty eq 'N'
                   and plnnr eq $w_plnnr
                   and plnal eq $w_plnal.

  if sy-dbcnt gt 0.

*   Es dürfen noch keine Zuordnungen vorhanden sein
    select count(*) into sy-dbcnt from plmz
                   where plnty eq 'N'
                     and plnnr eq $w_plnnr
                     and plnal eq $w_plnal.

*   Löschen der aktuellen Daten vorbereiten
    if sy-dbcnt eq 0.

*     Aktivitätstyp
      %w_acttyp = 'H'.

*     Einstiegsstruktur
      clear %w_rc271.
      %w_rc271-tcode = 'CA02'.
      %w_rc271-sttag = p_stich.
      %w_rc271-plnnr = $w_plnnr.
      %w_rc271-plnal = $w_plnal.

*     Arbeitsplan-Material
      clear %w_rc27m.
*      %w_rc27m-matnr = $w_matnr_new.
*      %w_rc27m-werks = $w_mapl-mapl-werks.

*     Save-Informationen
      clear %w_save.
      %w_save-syn_save = v_yes.
      %w_save-no_save  = p_test.

*     Übergabedaten aufbereiten
*     ...Komponentenzuordnung
      _initt %t_plmz_di.
      loop at $w_mapl-plmz into %w_plmz.
        read table $w_mapl-plpo into %w_plpo
              with key plnkn = %w_plmz-plnkn.
        check sy-subrc eq 0.
        %w_plmz-plnnr = $w_plnnr.
        %w_plmz-datuv = p_stich.
        perform get_new_stlnr tables $t_prot
                                     $t_bom_copy
                               using $w_color_new
                                     %w_plmz-stlnr
                                     %w_plmz-stlnr.
        perform get_new_stlnr tables $t_prot
                                     $t_bom_copy
                               using $w_color_new
                                     %w_plmz-stlnr_w
                                     %w_plmz-stlnr_w.
        clear %t_plmz_di.
        move-corresponding %w_plmz to %t_plmz_di.
        %t_plmz_di-acttyp = %w_acttyp.
        %t_plmz_di-vorkn  = %w_plpo-plnkn.
        %t_plmz_di-vornr  = %w_plpo-vornr.
        %t_plmz_di-werks  = $w_mapl-mapl-werks.
        select idnrk into %t_plmz_di-matnr from stpo
                    where stlty eq %t_plmz_di-stlty
                      and stlnr eq %t_plmz_di-stlnr
                      and stlkn eq %t_plmz_di-stlkn.
        endselect.
        select matnr stlan into (%t_plmz_di-bomat, %t_plmz_di-stlan)
                     from mast
                    where stlnr eq %t_plmz_di-stlnr_w.
        endselect.
        append %t_plmz_di.
      endloop.

*     Fehlertabellen intialisieren
      _initt: %t_error_di, %t_error.

*     Plangruppe initialisieren
      _initt %t_error_tmp.
      call function 'CP_BD_DIRECT_INPUT_PLNGR'
        exporting
          rc271_di_imp = %w_rc271
          rc27m_di_imp = %w_rc27m
        tables
          error_tab    = %t_error_tmp.
      append lines of %t_error_tmp to %t_error.

*     Anlegen eines Arbeitsplans
      _initt %t_error_tmp.
      call function 'CP_BD_DIRECT_INPUT_PLMZ'
        tables
          plmz_di_tab    = %t_plmz_di
          null_field_tab = %t_obj_null_field
          error_di_tab   = %t_error_di
          error_tab      = %t_error_tmp
        exceptions
          no_inz         = 1
          others         = 2.
      append lines of %t_error_tmp to %t_error.

*     Sichern der Zuordnung
      _initt %t_error_tmp.
      call function 'CP_BD_DIRECT_INPUT_SAVE'
        exporting
          save_di_imp = %w_save
        tables
          error_tab   = %t_error_tmp
        exceptions
          no_inz      = 1
          others      = 2.
      append lines of %t_error_tmp to %t_error.

    endif.

  endif.

endform.                    " copy_mat_routing_plmz
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Aug 2008 08:25:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-07T08:25:55Z</dc:date>
    <item>
      <title>Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813249#M917143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a BOM with more than one level. Now I want to create a routing with the function module BAPI_ROUTING_CREATE. I can allocate operations to components/materials of the top level of the BOM without problems. But when I want to allocate operations to components/materials that are deeper in the BOM structure I get the message: "The component to be assigned has not been completely specified" (CPCC_DT No. 206).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table componentallocation has the following information:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPERATION_ID: the operation number from table OPERATION (alphanumeric)&lt;/P&gt;&lt;P&gt;BOM_NO: BOM number of top material as well as the subordinate BOM numbers&lt;/P&gt;&lt;P&gt;ITEM_ID: the BOM position number as in table STPO&lt;/P&gt;&lt;P&gt;BOM_NO_ROOT: the top BOM number&lt;/P&gt;&lt;P&gt;PATH: the value KANTE as in table STPO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 21:04:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813249#M917143</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T21:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813250#M917144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Stefen,&lt;/P&gt;&lt;P&gt;Try this code :&lt;/P&gt;&lt;P&gt;*&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**&amp;amp; Author            :                          *&lt;/P&gt;&lt;P&gt;**&amp;amp; Create date       : 2007/04/03                          *&lt;/P&gt;&lt;P&gt;**&amp;amp; Program type      : Report                              *&lt;/P&gt;&lt;P&gt;**&amp;amp; Report name       : ZPPPR_ROUTING_INPUT                 *&lt;/P&gt;&lt;P&gt;**&amp;amp; Description       : ROUTING_INPUT                       *&lt;/P&gt;&lt;P&gt;**&amp;amp; FINISH ON         :                                     *&lt;/P&gt;&lt;P&gt;**&amp;amp; TRANSPROT REQUEST :                                     *&lt;/P&gt;&lt;P&gt;*&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  zpppr_routing_input MESSAGE-ID zmc95&lt;/P&gt;&lt;P&gt;       NO STANDARD PAGE HEADING  "输出的报表不使用标准的页标题&lt;/P&gt;&lt;P&gt;       LINE-SIZE 500.            "输出的报表每页的字符宽度.&lt;/P&gt;&lt;P&gt;*----&amp;gt;define table-&amp;gt;bapi&lt;/P&gt;&lt;P&gt;DATA:   group               TYPE bapi1012_tsk_c-task_list_group,&lt;/P&gt;&lt;P&gt;        group_counter       TYPE bapi1012_tsk_c-group_counter,&lt;/P&gt;&lt;P&gt;        sequence_no         TYPE bapi1012_opr_c-sequence_no,&lt;/P&gt;&lt;P&gt;        task_list_usage     TYPE bapi1012_tsk_c-task_list_usage,&lt;/P&gt;&lt;P&gt;        task_list_status    TYPE bapi1012_tsk_c-task_list_status,&lt;/P&gt;&lt;P&gt;        lot_size_from       TYPE bapi1012_tsk_c-lot_size_from,&lt;/P&gt;&lt;P&gt;        lot_size_to         TYPE bapi1012_tsk_c-lot_size_to,&lt;/P&gt;&lt;P&gt;        task_measure_unit   TYPE bapi1012_tsk_c-task_measure_unit,&lt;/P&gt;&lt;P&gt;        application         TYPE bapi1012_control_data-application,&lt;/P&gt;&lt;P&gt;        testrun             TYPE bapiflag,&lt;/P&gt;&lt;P&gt;        profile             TYPE bapi1012_control_data-profile,&lt;/P&gt;&lt;P&gt;        bomusage            TYPE bapi1012_control_data-bom_usage,&lt;/P&gt;&lt;P&gt;        task                TYPE bapi1012_tsk_c OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        materialtaskallocation TYPE bapi1012_mtk_c OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        sequence            TYPE bapi1012_seq_c   OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        operation           TYPE bapi1012_opr_c   OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        suboperation        TYPE bapi1012_sub_opr_c OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        referenceoperation  TYPE bapi1012_ref_opr_c OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        workcenterreference TYPE bapi1012_wc_ref_opr_c OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        componentallocation TYPE bapi1012_com_c  OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        productionresource  TYPE bapi1012_prt_c  OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        inspcharacteristic  TYPE bapi1012_cha_c  OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        textallocation      TYPE bapi1012_txt_hdr_c OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        text                TYPE bapi1012_txt_c     OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        return              TYPE bapiret2   OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        bapi_retn_info      LIKE bapiret2 OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;*----&amp;gt;message table&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF t_error OCCURS 0.&lt;/P&gt;&lt;P&gt;DATA  material LIKE bapi1012_mtk_c-material.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE bapiret2.&lt;/P&gt;&lt;P&gt;DATA: END OF t_error.&lt;/P&gt;&lt;P&gt;*----&amp;gt;inner table&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab1 OCCURS 0 ,&lt;/P&gt;&lt;P&gt;       material      LIKE bapi1012_mtk_c-material,&lt;/P&gt;&lt;P&gt;       plant         LIKE bapi1012_mtk_c-plant,&lt;/P&gt;&lt;P&gt;       description1  LIKE bapi1012_tsk_c-description,&lt;/P&gt;&lt;P&gt;       activity      LIKE bapi1012_opr_c-activity,&lt;/P&gt;&lt;P&gt;       work_cntr     LIKE bapi1012_opr_c-work_cntr,&lt;/P&gt;&lt;P&gt;       control_key   LIKE bapi1012_opr_c-control_key,&lt;/P&gt;&lt;P&gt;       description   LIKE bapi1012_opr_c-description,&lt;/P&gt;&lt;P&gt;       base_quantity LIKE bapi1012_opr_c-base_quantity,&lt;/P&gt;&lt;P&gt;       std_value_01  LIKE bapi1012_opr_c-std_value_01,&lt;/P&gt;&lt;P&gt;       std_value_02  LIKE bapi1012_opr_c-std_value_02,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      max_no_of_splits     LIKE bapi1012_opr_c-max_no_of_splits,&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       FJS(2) TYPE C,&lt;/P&gt;&lt;P&gt;       ind_splitting_reqrd  LIKE bapi1012_opr_c-ind_splitting_reqrd,&lt;/P&gt;&lt;P&gt;       required_overlapping LIKE bapi1012_opr_c-required_overlapping,&lt;/P&gt;&lt;P&gt;       min_send_ahead_qty   LIKE bapi1012_opr_c-min_send_ahead_qty,&lt;/P&gt;&lt;P&gt;       ext_proc_with_subcontract_ind LIKE bapi1012_opr_c-ext_proc_with_subcontract_ind,&lt;/P&gt;&lt;P&gt;       info_rec   LIKE bapi1012_opr_c-info_rec,&lt;/P&gt;&lt;P&gt;       purch_org  LIKE bapi1012_opr_c-purch_org,&lt;/P&gt;&lt;P&gt;       cost_elem  LIKE bapi1012_opr_c-cost_elem,&lt;/P&gt;&lt;P&gt;       COST_RELEVANT like bapi1012_opr_c-COST_RELEVANT,&lt;/P&gt;&lt;P&gt;      END OF itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab OCCURS 0 ,&lt;/P&gt;&lt;P&gt;       material      LIKE bapi1012_mtk_c-material,&lt;/P&gt;&lt;P&gt;       plant         LIKE bapi1012_mtk_c-plant,&lt;/P&gt;&lt;P&gt;       description1  LIKE bapi1012_tsk_c-description,&lt;/P&gt;&lt;P&gt;       activity      LIKE bapi1012_opr_c-activity,&lt;/P&gt;&lt;P&gt;       work_cntr     LIKE bapi1012_opr_c-work_cntr,&lt;/P&gt;&lt;P&gt;       control_key   LIKE bapi1012_opr_c-control_key,&lt;/P&gt;&lt;P&gt;       description   LIKE bapi1012_opr_c-description,&lt;/P&gt;&lt;P&gt;       base_quantity LIKE bapi1012_opr_c-base_quantity,&lt;/P&gt;&lt;P&gt;       std_value_01  LIKE bapi1012_opr_c-std_value_01,&lt;/P&gt;&lt;P&gt;       std_value_02  LIKE bapi1012_opr_c-std_value_02,&lt;/P&gt;&lt;P&gt;       max_no_of_splits     LIKE bapi1012_opr_c-max_no_of_splits,&lt;/P&gt;&lt;P&gt;       ind_splitting_reqrd  LIKE bapi1012_opr_c-ind_splitting_reqrd,&lt;/P&gt;&lt;P&gt;       required_overlapping LIKE bapi1012_opr_c-required_overlapping,&lt;/P&gt;&lt;P&gt;       min_send_ahead_qty   LIKE bapi1012_opr_c-min_send_ahead_qty,&lt;/P&gt;&lt;P&gt;       ext_proc_with_subcontract_ind LIKE bapi1012_opr_c-ext_proc_with_subcontract_ind,&lt;/P&gt;&lt;P&gt;       info_rec   LIKE bapi1012_opr_c-info_rec,&lt;/P&gt;&lt;P&gt;       purch_org  LIKE bapi1012_opr_c-purch_org,&lt;/P&gt;&lt;P&gt;       cost_elem  LIKE bapi1012_opr_c-cost_elem,&lt;/P&gt;&lt;P&gt;      END OF itab.&lt;/P&gt;&lt;P&gt;DATA : gt_itab LIKE itab OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA : lv_cancel(1) TYPE c. &lt;/P&gt;&lt;P&gt;*----&amp;gt;upload&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'UPLOAD'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    filename                = 'C:\Documents and Settings\Administrator\Desktop\工艺路线.txt'&lt;/P&gt;&lt;P&gt;    filetype                = 'DAT'&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    cancel                  = lv_cancel&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    data_tab                = itab1&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    conversion_error        = 1&lt;/P&gt;&lt;P&gt;    invalid_table_width     = 2&lt;/P&gt;&lt;P&gt;    invalid_type            = 3&lt;/P&gt;&lt;P&gt;    no_batch                = 4&lt;/P&gt;&lt;P&gt;    unknown_error           = 5&lt;/P&gt;&lt;P&gt;    gui_refuse_filetransfer = 6&lt;/P&gt;&lt;P&gt;    OTHERS                  = 7.&lt;/P&gt;&lt;P&gt;IF lv_cancel EQ 'X'.&lt;/P&gt;&lt;P&gt;  LEAVE PROGRAM.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0 .&lt;/P&gt;&lt;P&gt;  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ELSEIF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;  SORT itab1 BY  material plant activity.&lt;/P&gt;&lt;P&gt;  LOOP AT ITAB1.&lt;/P&gt;&lt;P&gt;   MOVE-CORRESPONDING ITAB1 TO ITAB.&lt;/P&gt;&lt;P&gt;   CONDENSE ITAB1-FJS NO-GAPS.&lt;/P&gt;&lt;P&gt;   ITAB-max_no_of_splits = ITAB1-FJS.&lt;/P&gt;&lt;P&gt;   APPEND ITAB.&lt;/P&gt;&lt;P&gt;   ENDLOOP.&lt;/P&gt;&lt;P&gt;   SORT ITAB BY MATERIAL PLANT.&lt;/P&gt;&lt;P&gt;  LOOP AT itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        input  = itab-material&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        output = itab-material.&lt;/P&gt;&lt;P&gt;    MOVE itab TO gt_itab.&lt;/P&gt;&lt;P&gt;    APPEND gt_itab.&lt;/P&gt;&lt;P&gt;*-----〉item-sequence&lt;/P&gt;&lt;P&gt;*operation-group_counter = '1'.&lt;/P&gt;&lt;P&gt;    operation-activity = itab-activity.&lt;/P&gt;&lt;P&gt;    operation-control_key = itab-control_key.&lt;/P&gt;&lt;P&gt;    operation-work_cntr = itab-work_cntr.&lt;/P&gt;&lt;P&gt;    operation-description = itab-description.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    operation-plant = itab-plant.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; operation-operation_measure_unit = 'EA'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    operation-denominator = 1.&lt;/P&gt;&lt;P&gt;    operation-nominator = 1.&lt;/P&gt;&lt;P&gt;    operation-base_quantity = itab-base_quantity.&lt;/P&gt;&lt;P&gt;    operation-std_value_01 = itab-std_value_01.&lt;/P&gt;&lt;P&gt;    operation-std_value_02 = itab-std_value_02.&lt;/P&gt;&lt;P&gt;    operation-ind_splitting_reqrd = itab-ind_splitting_reqrd." 'X'."分解&lt;/P&gt;&lt;P&gt;    operation-max_no_of_splits = itab-max_no_of_splits."'1'."分解数&lt;/P&gt;&lt;P&gt;    operation-required_overlapping  = itab-required_overlapping."'X'."要求重叠&lt;/P&gt;&lt;P&gt;    operation-min_send_ahead_qty = itab-min_send_ahead_qty."'10'."最小发送数量&lt;/P&gt;&lt;P&gt;    operation-ext_proc_with_subcontract_ind = itab-ext_proc_with_subcontract_ind."'X'.&lt;/P&gt;&lt;P&gt;    operation-info_rec = itab-info_rec.&lt;/P&gt;&lt;P&gt;    operation-purch_org = itab-purch_org.&lt;/P&gt;&lt;P&gt;    operation-cost_elem = itab-cost_elem.&lt;/P&gt;&lt;P&gt;    operation-COST_RELEVANT = 'X'."成本核算标示&lt;/P&gt;&lt;P&gt;    APPEND operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AT END OF material.&lt;/P&gt;&lt;P&gt;*-----〉header&lt;/P&gt;&lt;P&gt;      task-task_list_usage = '1'.&lt;/P&gt;&lt;P&gt;      task-task_list_status = '4'.&lt;/P&gt;&lt;P&gt;**----&amp;gt;ｕｎｉｔ&lt;/P&gt;&lt;P&gt;      select single MEINS into task-task_measure_unit&lt;/P&gt;&lt;P&gt;             from mara&lt;/P&gt;&lt;P&gt;             where matnr = gt_itab-material.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     task-task_measure_unit = 'EA'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      task-description = gt_itab-description1."'TEST ROUTING'.&lt;/P&gt;&lt;P&gt;      task-plant = gt_itab-plant.&lt;/P&gt;&lt;P&gt;      task-valid_from = sy-datum.&lt;/P&gt;&lt;P&gt;      task-valid_to_date = '99991231'.&lt;/P&gt;&lt;P&gt;      APPEND task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      materialtaskallocation-material = gt_itab-material.&lt;/P&gt;&lt;P&gt;      materialtaskallocation-plant = gt_itab-plant.&lt;/P&gt;&lt;P&gt;      task-valid_from = sy-datum.&lt;/P&gt;&lt;P&gt;      task-valid_to_date = '99991231'.&lt;/P&gt;&lt;P&gt;      APPEND materialtaskallocation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_ROUTING_CREATE'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          testrun                = testrun&lt;/P&gt;&lt;P&gt;          profile                = profile&lt;/P&gt;&lt;P&gt;          bomusage               = bomusage&lt;/P&gt;&lt;P&gt;          application            = application&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          group                  = group&lt;/P&gt;&lt;P&gt;          groupcounter           = group_counter&lt;/P&gt;&lt;P&gt;        TABLES&lt;/P&gt;&lt;P&gt;          task                   = task&lt;/P&gt;&lt;P&gt;          materialtaskallocation = materialtaskallocation&lt;/P&gt;&lt;P&gt;          sequence               = sequence&lt;/P&gt;&lt;P&gt;          operation              = operation&lt;/P&gt;&lt;P&gt;          suboperation           = suboperation&lt;/P&gt;&lt;P&gt;          referenceoperation     = referenceoperation&lt;/P&gt;&lt;P&gt;          workcenterreference    = workcenterreference&lt;/P&gt;&lt;P&gt;          componentallocation    = componentallocation&lt;/P&gt;&lt;P&gt;          productionresource     = productionresource&lt;/P&gt;&lt;P&gt;          inspcharacteristic     = inspcharacteristic&lt;/P&gt;&lt;P&gt;          textallocation         = textallocation&lt;/P&gt;&lt;P&gt;          text                   = text&lt;/P&gt;&lt;P&gt;          return                 = return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      REFRESH task.&lt;/P&gt;&lt;P&gt;      REFRESH GT_ITAB.&lt;/P&gt;&lt;P&gt;      REFRESH materialtaskallocation.&lt;/P&gt;&lt;P&gt;      REFRESH operation.&lt;/P&gt;&lt;P&gt;      LOOP AT return.&lt;/P&gt;&lt;P&gt;        IF return-type EQ 'E' OR return-type EQ 'A'.&lt;/P&gt;&lt;P&gt;          t_error-material = materialtaskallocation-material.&lt;/P&gt;&lt;P&gt;          t_error-message = return-message.&lt;/P&gt;&lt;P&gt;          APPEND t_error.&lt;/P&gt;&lt;P&gt;        ELSE.&lt;/P&gt;&lt;P&gt;          COMMIT WORK.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;      LOOP AT t_error.&lt;/P&gt;&lt;P&gt;        WRITE:/ t_error-material,t_error-message.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;模板&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Link for this code is : &lt;A href="http://silverw0396.javaeye.com/blog/90495http://silverw0396.javaeye.com/blog/monthblog/2007-04?show_full=true" target="test_blank"&gt;http://silverw0396.javaeye.com/blog/90495http://silverw0396.javaeye.com/blog/monthblog/2007-04?show_full=true&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; or &lt;/P&gt;&lt;P&gt;try this thread logic :&lt;/P&gt;&lt;P&gt;use FM  BAPI_MATERIAL_BOM_GROUP_CREATE&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="823425"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this answers your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Greetson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 21:28:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813250#M917144</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T21:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813251#M917145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greetson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help. Unfortunately that code wouldn't work for me. I think that I need to have the table COMPONENTALLOCATION filled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you ever try the function module CP_BD_DIRECT_INPUT_PLAN? It is mentioned in the thread that you sent me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and best regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 21:44:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813251#M917145</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T21:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813252#M917146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;    I didn't try that FM . If you fill COMPONENTALLOCATION it will work ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Greetson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 21:54:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813252#M917146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T21:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813253#M917147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greetson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's exactly my problem. I don't know how the table COMPONENTALLOCATION has to be filled. All the operations that I try to allocate to a structure that are not on the top level of the BOM create the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I debugged the function module BAPI_ROUTING_CREATE and found out that only the top BOM is read in internal tables. My hope is that I can make the function module to read the complete BOM structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have a hint?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 22:02:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813253#M917147</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T22:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813254#M917148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stefen,&lt;/P&gt;&lt;P&gt;             Give a try by sending only the top level BOM to the FM and see what happens..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 22:05:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813254#M917148</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T22:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813255#M917149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greetson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already tried that. It works perfectly. The allocation of operations to components of BOM substructures is the only problem that I have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 22:12:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813255#M917149</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T22:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813256#M917150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi  ,Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have the similar question with you in the funtion &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_ROUTING_CREATE in the component allocation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; here i only need to allocate the top bom, but it dosn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the source code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;componentallocation-sequence_no = '000000'.&lt;/P&gt;&lt;P&gt;componentallocation-valid_from = sy-datum.&lt;/P&gt;&lt;P&gt;componentallocation-valid_to_date = '99991230'.&lt;/P&gt;&lt;P&gt;componentallocation-activity = '0010'.&lt;/P&gt;&lt;P&gt;*componentallocation-OPERATION_ID = 'A0000001'.&lt;/P&gt;&lt;P&gt;componentallocation-material = 'R10-10'.&lt;/P&gt;&lt;P&gt;componentallocation-BACKFLUSH = 'X'.&lt;/P&gt;&lt;P&gt;componentallocation-plant = '1000'.&lt;/P&gt;&lt;P&gt;componentallocation-bom_no = '00000007'.&lt;/P&gt;&lt;P&gt;componentallocation-alternative_bom = '1'.&lt;/P&gt;&lt;P&gt;componentallocation-bom_type = 'M'.&lt;/P&gt;&lt;P&gt;componentallocation-COMP_QTY = '1'.&lt;/P&gt;&lt;P&gt;componentallocation-COMP_UNIT = 'EA'.&lt;/P&gt;&lt;P&gt;componentallocation-item_id = '00000001'.&lt;/P&gt;&lt;P&gt;componentallocation-item_no = '0010'.&lt;/P&gt;&lt;P&gt;componentallocation-bom_type_root = '1'.&lt;/P&gt;&lt;P&gt;componentallocation-bom_no_root =  '00000007'.&lt;/P&gt;&lt;P&gt;*componentallocation-alternative_bom_root = '1'.&lt;/P&gt;&lt;P&gt;APPEND componentallocation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; could you share me your code ?  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you in advance &lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: xia chen on Aug 7, 2008 7:18 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2008 05:17:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813256#M917150</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-07T05:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813257#M917151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't get it to work. So after creating the route I used the direct input function module CP_BD_DIRECT_INPUT_PLMZ to assign the components. It's probably not the best way but it worked. Check it out, maybe you can try it that way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  copy_mat_routing_plmz
*&amp;amp;---------------------------------------------------------------------*
*       Kopieren der Komponentenzuordnung via Direct-Input
*----------------------------------------------------------------------*
form copy_mat_routing_plmz tables $t_prot             type dt_prot
                                  $t_bom_copy         type dt_bom_copy
                            using value($w_plnnr)     like mapl-plnnr
                                  value($w_plnal)     like mapl-plnal
                                  value($w_mapl)      type d_mat_mapl
                                  value($w_color_old) structure t_colors
                                  value($w_color_new) structure t_colors
                                  value($w_matnr_new) like mara-matnr
                                  $w_prot             type d_prot
                                  $w_counter          type d_count.

  data: %w_rc271              like rc271_di,
        %w_rc27m              like rc27m_di,
        %w_save               like save_di,
        %w_plnnr              type rc271-plnnr,
        %w_acttyp             type acttyp.

  data: %w_plmz               type plmz,
        %w_plpo               type plpo.

  data: %t_plmz_di            type plmz_di    occurs 0 with header line,
        %t_obj_null_field     type obj_nfield occurs 0 with header line,
        %t_error_di           type error_di   occurs 0 with header line,
        %t_error              type cmfmsg     occurs 0 with header line,
        %t_error_tmp          type cmfmsg     occurs 0 with header line.

  data: %t_plmz               like plmz       occurs 0 with header line.

* Es muss eine neue Stückliste angelegt worden sein
  check not ( %w_prot_marc_bom-stlnr is initial ).

* Arbeitsplan muss vorhanden sein
  select count(*) into sy-dbcnt from plko
                 where plnty eq 'N'
                   and plnnr eq $w_plnnr
                   and plnal eq $w_plnal.

  if sy-dbcnt gt 0.

*   Es dürfen noch keine Zuordnungen vorhanden sein
    select count(*) into sy-dbcnt from plmz
                   where plnty eq 'N'
                     and plnnr eq $w_plnnr
                     and plnal eq $w_plnal.

*   Löschen der aktuellen Daten vorbereiten
    if sy-dbcnt eq 0.

*     Aktivitätstyp
      %w_acttyp = 'H'.

*     Einstiegsstruktur
      clear %w_rc271.
      %w_rc271-tcode = 'CA02'.
      %w_rc271-sttag = p_stich.
      %w_rc271-plnnr = $w_plnnr.
      %w_rc271-plnal = $w_plnal.

*     Arbeitsplan-Material
      clear %w_rc27m.
*      %w_rc27m-matnr = $w_matnr_new.
*      %w_rc27m-werks = $w_mapl-mapl-werks.

*     Save-Informationen
      clear %w_save.
      %w_save-syn_save = v_yes.
      %w_save-no_save  = p_test.

*     Übergabedaten aufbereiten
*     ...Komponentenzuordnung
      _initt %t_plmz_di.
      loop at $w_mapl-plmz into %w_plmz.
        read table $w_mapl-plpo into %w_plpo
              with key plnkn = %w_plmz-plnkn.
        check sy-subrc eq 0.
        %w_plmz-plnnr = $w_plnnr.
        %w_plmz-datuv = p_stich.
        perform get_new_stlnr tables $t_prot
                                     $t_bom_copy
                               using $w_color_new
                                     %w_plmz-stlnr
                                     %w_plmz-stlnr.
        perform get_new_stlnr tables $t_prot
                                     $t_bom_copy
                               using $w_color_new
                                     %w_plmz-stlnr_w
                                     %w_plmz-stlnr_w.
        clear %t_plmz_di.
        move-corresponding %w_plmz to %t_plmz_di.
        %t_plmz_di-acttyp = %w_acttyp.
        %t_plmz_di-vorkn  = %w_plpo-plnkn.
        %t_plmz_di-vornr  = %w_plpo-vornr.
        %t_plmz_di-werks  = $w_mapl-mapl-werks.
        select idnrk into %t_plmz_di-matnr from stpo
                    where stlty eq %t_plmz_di-stlty
                      and stlnr eq %t_plmz_di-stlnr
                      and stlkn eq %t_plmz_di-stlkn.
        endselect.
        select matnr stlan into (%t_plmz_di-bomat, %t_plmz_di-stlan)
                     from mast
                    where stlnr eq %t_plmz_di-stlnr_w.
        endselect.
        append %t_plmz_di.
      endloop.

*     Fehlertabellen intialisieren
      _initt: %t_error_di, %t_error.

*     Plangruppe initialisieren
      _initt %t_error_tmp.
      call function 'CP_BD_DIRECT_INPUT_PLNGR'
        exporting
          rc271_di_imp = %w_rc271
          rc27m_di_imp = %w_rc27m
        tables
          error_tab    = %t_error_tmp.
      append lines of %t_error_tmp to %t_error.

*     Anlegen eines Arbeitsplans
      _initt %t_error_tmp.
      call function 'CP_BD_DIRECT_INPUT_PLMZ'
        tables
          plmz_di_tab    = %t_plmz_di
          null_field_tab = %t_obj_null_field
          error_di_tab   = %t_error_di
          error_tab      = %t_error_tmp
        exceptions
          no_inz         = 1
          others         = 2.
      append lines of %t_error_tmp to %t_error.

*     Sichern der Zuordnung
      _initt %t_error_tmp.
      call function 'CP_BD_DIRECT_INPUT_SAVE'
        exporting
          save_di_imp = %w_save
        tables
          error_tab   = %t_error_tmp
        exceptions
          no_inz      = 1
          others      = 2.
      append lines of %t_error_tmp to %t_error.

    endif.

  endif.

endform.                    " copy_mat_routing_plmz
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2008 08:25:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813257#M917151</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-07T08:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813258#M917152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Stefen,&lt;/P&gt;&lt;P&gt;I have got it work about the BOM component allocation with more than one level,but there are still some problems that I'm not sure it will be very useful for you.Please check it out by yourself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I created routing with the function module BAPI_ROUTING_CREATE and allocated the component with the direct input function module CP_BD_DIRECT_INPUT_PLMZ you supplied.When allocating the component which on more than one level in BOM,there are two fields in the structure plmz_di you should pay attention to.THAT is STLST and STLWG. This two fields are used to locate the component in the BOM.IF you assign the two fields correctly,the work will be done.And we can observe this two fields in T-CODE cs03-&amp;gt;component allocation.But I haven't found how to confirm this two fields or the corresponding sap table they were stored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it is helpful for you.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Leslie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2008 01:55:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813258#M917152</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-07T01:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813259#M917153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for resurrecting an old thread, but has anyone figured out how to programmatically identify the level and path (STLST and STLWG) for a component?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2010 19:58:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813259#M917153</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-21T19:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813260#M917154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I have a requirement to assign the component allocation  for routing.. used bapi_routing_create but its giving error..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls if you have coding for this let me know..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ramesh Manoharan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jan 2010 13:42:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813260#M917154</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-30T13:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813261#M917155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The COMPONENTALLOCATION-PATH field needs to be populated with the STPF-KANTE_K value for the component to be allocated.  Unfortunately the STPF table isn't populated until the first time you try to allocate a component.  If you call BAPI_ROUTING_CREATE once with COMPONENTALLOCATION-PATH blank you'll get an error but it will populate STPF.  Then you can look up the KANTE_K value and call BAPI_ROUTING_CREATE again and it should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 15:35:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813261#M917155</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-01T15:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813262#M917156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you populated the MATERIALTASKALLOCATION table?? I have seen at CA02 that without having a material(Here a BOM) allocated to an Operation, you cant allocate the components... Please check &amp;amp; let me know...&lt;/P&gt;&lt;P&gt;~Guru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Nov 2010 10:36:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813262#M917156</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-15T10:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813263#M917157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how could I download Your program text ? I have a similar problem and 'd like to try it .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KR  Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2011 13:17:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813263#M917157</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-09-01T13:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Component Allocation in BAPI_ROUTING_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813264#M917158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greetson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how could I download Your program text ? I have a similar problem and 'd like to try it .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KR Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2011 15:30:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/component-allocation-in-bapi-routing-create/m-p/3813264#M917158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-09-01T15:30:29Z</dc:date>
    </item>
  </channel>
</rss>

