Problem while creation of Routing using BAPI "BAPI_ROUTING_CREATE"

Hi.
I am trying to create routing using the BAPI "BAPI_ROUTING_CREATE", when I execute I get the group number and the group counter number in the Export parameters. But it is not saved in the database, when we look at CA03 using the group number system says routing not found.
I am passing "Space" to Bapiflag and i am passing input to tables TASK, MATERIAL ALLOCATON and OPERATION as follows:-
MATERIALTASKALLOCATION-MATERIAL
MATERIALTASKALLOCATION-PLANT
TASK-TASK_LIST_USAGE
TASK-PLANT
TASK-TASK_LIST_STATUS
TASK-TASK_MEASURE_UNIT
OPERATION-ACTIVITY
OPERATION-CONTROL_KEY
OPERATION-WORK_CNTR                    
OPERATION-PLANT
OPERATION-DESCRIPTION
OPERATION-NUMERATOR
OPERATION-DENOMENATOR
OPERATION-BASE_QUANTITY
OPERATION-STD_UNIT_01
OPERATION-STD_VALUE_01
OPERATION-STD_UNIT_02
OPERATION-STD_VALUE_02
OPERATION-STD_UNIT_03
OPERATION-STD_VALUE_03
OPERATION-STD_UNIT_04
OPERATION-STD_VALUE_04
OPERATION-STD_UNIT_05
OPERATION-STD_VALUE_05
OPERATION-STD_UNIT_06
OPERATION-STD_VALUE_06
Appreciate your replies.
Regards.
Anand Ghawade.

Use BAPI_TRANSACTION_COMMIT after you call the BAPI_ROUTING_CREATE

Similar Messages

  • Problem while creating sales order using BAPI

    Hi all,
    i am creating a sales order from the purchase order data.
    when my client will send a PO in EDI format, my 3rd party edi tool will convert that edi formatted PO to text format. then i will upload that text formatted PO to my program then i will create a SO from those uploaded PO data using BAPI BAPI_SALESORDER_CREATEFROMDAT2.
      but,no sales order is being created.& also i am not getting any return message.by debugging also, i am not getting the error.plz suggest where i am doing mistake.below is the coding.
    DATA:
      gfilename LIKE rlgrap-filename.
    *--Internal tables
    DATA: BEGIN OF i_item OCCURS 50.    "Create Material Document Item
            INCLUDE STRUCTURE BAPISDITM .
    DATA: END OF i_item .
    DATA: BEGIN OF i_partner OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE BAPIPARNR.
    DATA: END OF i_partner.
    DATA: BEGIN OF i_schedule OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE BAPISCHDL .
    DATA: END OF i_schedule.
    DATA: BEGIN OF i_cond OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE BAPICOND .
    DATA: END OF i_cond.
    DATA: BEGIN OF i_part OCCURS 0,     " Internal table for split data
            part(20),
          END OF i_part.
    DATA: BEGIN OF i_return OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF i_return.
    *-- Work areas
    DATA: BEGIN OF wa_header .       "sales Document Header Data
            INCLUDE STRUCTURE BAPISDHD1.
    DATA: END OF wa_header .
    *DATA: BEGIN OF wa_return .       "Output Structure
           INCLUDE STRUCTURE BAPIRET2.
    *DATA: END OF wa_return .
    DATA: begin of sorder.
         INCLUDE STRUCTURE BAPIVBELN.
    DATA: end of sorder.
    data:begin of t_upload,
         ebeln(10),  "PO no(seagate)
         aedat like sy-datum , "PO date
         bsart(4) , "PO type
         vdatu like sy-datum , "requested delivery date
         kunnr(10) , "customer no-sold-to-party
        kunak like vbak-kunnr, "bill-to-party
         name1_s(20), "name1 of sold-to-party
         name2_s(15), "name2 of sold-to-party
         land1_s(3), "country
         ort01_s(10),  "city
         regio_s(3), "region(state/province)
         pstlz_s(10), "postal code
         adrnr_s(10), "address
         bstkd_e(10), "end customer purchase order
         posex(6),     "end customer PO line no(item no)
         kdmat(18),     "end customer material no(part no)
         kunag(10),     "ship-to-party
         name1_c(20),   "name1 of ship-to-party
         name2_c(15),   "name2 of ship-to-party
         land1_c(3),   "country
         ort01_c(10),    "city
         regio_c(3),   "region(state/province)
         pstlz_c(10),   "postal code
         adrnr_c(10),   "address
         posnr(6), "item no(seagate PO line no)
         pstyv(4), "item category
         matnr(18), "material no(seagate 9 digit part no)
         zmeng(13), "Target quantity in sales unit
        vrkme like vbap-vrkme, "sales unit
         meins(3), "UOM
        posnr_tot like vbap-posnr,"Total no. of line items
         werks(4), "plant
        vstel like vbap-vstel, "shipping point
         empst(10), "receiving point
         shtyp(4), "shipment type
         route(6), "route
         vsbed(2), "shipping conds
        rkfkf like vbap-rkfkf, "method of billing for co/ppc orders
         zterm(4), "terms of payment key
         inco1(3), "F.O.B inco term1
         inco2(3), "F.O.B inco term2
         end of t_upload.
    Data: wa_upload like t_upload,
           i_upload like standard table of t_upload.
    Data:v_kunnr like kna1-kunnr,
          v_posnr like vbap-posnr,
          v_matnr like vbap-matnr,
          v_zmeng like vbap-zmeng,
          v_kunag like kna1-kunnr.
    *---Constants
    CONSTANTS: c_comma TYPE c VALUE ',',   " For splitting data at commas
               c_01(2) TYPE c VALUE '01',  " For movement code in Bapi
               c_b     TYPE c VALUE 'B',   " For mvt. Indicator in Bapi
               c_creat(5) TYPE c VALUE 'CREAT', " For button text
               c_clear(5) TYPE c VALUE 'CLEAR', " For clear button
               c_mvmt(4) TYPE c VALUE 'MVMT',
               c_ok(2)   TYPE c VALUE 'OK',
               c_error(5) TYPE c VALUE 'Error'.
    *--SELECTION SCREEN DESIGN--
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
    PARAMETERS:     
                p_auart LIKE vbak-auart, " order type
                p_vkorg LIKE vbak-vkorg, " sales org
                p_vtweg LIKE vbak-vtweg, " dist channel
                p_spart LIKE vbak-spart, " division
                p_vkgrp LIKE vbak-vkgrp, " sales group
                p_vkbur LIKE vbak-vkbur, "sales office
                p_file(256) default 'c:/saleorder.txt'.         "File name
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN PUSHBUTTON 15(10) v_create USER-COMMAND creat.
    SELECTION-SCREEN PUSHBUTTON 40(10) v_clear USER-COMMAND clear.
      INITIALIZATION -
    INITIALIZATION.
      v_create = c_creat .
      v_clear = c_clear.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    PERFORM selectfile USING p_file.
    *--AT SELECTION_SCREEN--
    AT SELECTION-SCREEN .
      IF sy-ucomm = c_clear.
        PERFORM f_clear.
    ELSE.
       IF sy-ucomm <> c_mvmt.
    **--- Validating the input data.
         PERFORM f_check_inputs.
        ELSEif sy-ucomm = c_creat.
    *--- Validating the input data.
          PERFORM f_check_inputs.
    *-- Uploading the PO data.
          PERFORM f_PO_upload.
    *---checking the PO data
         PERFORM f_check_upload_data.
    *---create sales order from PO data
        PERFORM f_Sales_order_create.
        ENDIF.
    FORM f_PO_upload.
    gfilename = p_file.
      CALL FUNCTION 'WS_UPLOAD'
           EXPORTING
                filename                = gfilename
                filetype                = 'DAT'
           TABLES
                data_tab                = i_upload
           EXCEPTIONS
                conversion_error        = 1
                file_open_error         = 2
                file_read_error         = 3
                invalid_type            = 4
                no_batch                = 5
                unknown_error           = 6
                invalid_table_width     = 7
                gui_refuse_filetransfer = 8
                customer_error          = 9
                OTHERS                  = 10.
      IF sy-subrc <> 0.
        MESSAGE i398(00) WITH '(WS_UPLOAD)'
        ' Errors occured with exception '
         sy-subrc.
      ENDIF.
    ENDFORM.                    " f_PO_upload
    *&      Form  selectfile
          text
         -->P_P_FILE  text
    FORM selectfile CHANGING value(filename) TYPE c.
    CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                def_filename     = gfilename
                def_path         = 'C:\'
                mask             = ',*.txt.'
                mode             = 'O'
                title            = 'Select File Name'
           IMPORTING
                filename         = filename
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
    ENDFORM.                    " selectfile
    FORM f_Sales_order_create.
      PERFORM f_fill_header.
      PERFORM f_fill_partner.
      PERFORM f_fill_item.
      PERFORM f_call_BAPI.
    ENDFORM.                    " f_Sales_order_create
    *&      Form  f_fill_header
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_header.
    move p_auart to wa_header-doc_type.
    move p_vkorg to wa_header-sales_org.
    move p_vtweg to wa_header-distr_chan.
    move p_spart to wa_header-division.
    move p_vkgrp to wa_header-sales_grp.
    move p_vkbur to wa_header-sales_off.
    Read table i_upload into wa_upload index 1.
    move wa_upload-ebeln to wa_header-purch_no_c.
    move wa_upload-aedat to wa_header-purch_date.
    move wa_upload-bsart to wa_header-po_method.
    move wa_upload-vdatu to wa_header-req_date_h.
    move wa_upload-bstkd_e to wa_header-purch_no_s.
    *move wa_upload-route to wa_header-route.
    move wa_upload-vsbed to wa_header-ship_cond.
    move wa_upload-empst to wa_header-rec_point.
    move wa_upload-shtyp to wa_header-ship_type.
    move wa_upload-zterm to wa_header-pmnttrms.
    move wa_upload-inco1 to wa_header-incoterms1.
    move wa_upload-inco2 to wa_header-incoterms2.
    ENDFORM.                    " f_fill_header
    *&      Form  f_fill_partner
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_partner.
    if not wa_upload-kunnr is initial.
    select single kunnr from kna1 into v_kunnr
                where kunnr = wa_upload-kunnr.
    if sy-subrc <> 0.
    Message E014 with 'customer does not exist'.
    else.
    move 'AG' to i_partner-partn_role.
    move wa_upload-kunnr to i_partner-partn_numb.
    move wa_upload-land1_s to i_partner-country.
    move wa_upload-name1_s to i_partner-name.
    move wa_upload-name2_s to i_partner-name_2.
    move wa_upload-ort01_s to i_partner-city.
    move wa_upload-regio_s to i_partner-region.
    move wa_upload-pstlz_s to i_partner-postl_code.
    move wa_upload-adrnr_s to i_partner-address.
    append i_partner.
    endif.
    endif.
    if not wa_upload-kunag is initial.
    select single kunnr from kna1 into v_kunag
                where kunnr = wa_upload-kunag.
    if sy-subrc <> 0.
    Message E015 with 'end customer does not exist'.
    else.
    move 'WE' to i_partner-partn_role.
    move wa_upload-kunag to i_partner-partn_numb.
    move wa_upload-land1_c to i_partner-country.
    move wa_upload-name1_c to i_partner-name.
    move wa_upload-name2_c to i_partner-name_2.
    move wa_upload-ort01_c to i_partner-city.
    move wa_upload-regio_c to i_partner-region.
    move wa_upload-pstlz_c to i_partner-postl_code.
    move wa_upload-adrnr_c to i_partner-address.
    append i_partner.
    endif.
    endif.
    ENDFORM.                    " f_fill_partner
    *&      Form  f_fill_item
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_item.
    loop at i_upload into wa_upload.
    if not wa_upload-matnr is initial.
    select single  maramatnr msegmenge into (v_matnr, v_zmeng) from
                       mara inner join mseg on maramatnr = msegmatnr
                       where mara~matnr = wa_upload-matnr.
    if sy-subrc <> 0.
    Message E016 with 'material no does not exist'.
    elseif v_zmeng LT wa_upload-zmeng.
    Message E017 with 'order quantity is greater than the quantity present'.
      endif.
    endif.
    move wa_upload-posnr to i_item-itm_number.
    move wa_upload-pstyv to i_item-item_categ.
    move wa_upload-matnr to i_item-material.
    move wa_upload-zmeng to i_item-target_qty.
    move wa_upload-meins to i_item-target_qu.
    move wa_upload-werks to i_item-plant.
    *move wa_upload-meins to wa_vbap-meins.
    *move wa_upload-posnr_tot to wa_vbap-posnr_tot.
    move wa_upload-posex to i_item-po_itm_no.
    move wa_upload-kdmat to i_item-cust_mat22.
    move wa_upload-inco1 to i_item-incoterms1.
    move wa_upload-inco2 to i_item-incoterms2.
    move wa_upload-zterm to i_item-pmnttrms.
    move wa_upload-empst to i_item-rec_point.
    move wa_upload-shtyp to i_item-ship_type.
    move wa_upload-route to i_item-route.
    append i_item.
    PERFORM f_fill_schedule_line.
    PERFORM f_fill_conditions.
    ENDLOOP.
    ENDFORM.                    " f_fill_item
    *&      Form  f_fill_schedule_line
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_schedule_line.
    move wa_upload-matnr to i_schedule-itm_number.
    move sy-datum to i_schedule-req_date.
    move wa_upload-zmeng to i_schedule-req_qty.
    append i_schedule.
    ENDFORM.                    " f_fill_schedule_line
    *&      Form  f_fill_conditions
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_conditions.
    move wa_upload-matnr to i_cond-itm_number.
    move sy-datum to i_cond-conpricdat.
    append i_cond.
    ENDFORM.                    " f_fill_conditions
    *&      Form  f_clear
          text
    -->  p1        text
    <--  p2        text
    FORM f_clear.
    clear:p_auart,
          p_vkorg,
          p_vtweg,
          p_spart,
          p_vkgrp,
          p_vkbur.
    ENDFORM.                    " f_clear
    *&      Form  f_call_BAPI
          text
    -->  p1        text
    <--  p2        text
    FORM f_call_BAPI.
    clear:i_item,i_partner,i_schedule.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
      SALESDOCUMENTIN               =
        ORDER_HEADER_IN               = wa_header
      ORDER_HEADER_INX              =
      SENDER                        =
      BINARY_RELATIONSHIPTYPE       =
      INT_NUMBER_ASSIGNMENT         =
      BEHAVE_WHEN_ERROR             =
      LOGIC_SWITCH                  =
      TESTRUN                       =
      CONVERT                       = ' '
    IMPORTING
       SALESDOCUMENT                  = sorder
      TABLES
      RETURN                        =
       ORDER_ITEMS_IN                 = i_item
      ORDER_ITEMS_INX               =
        ORDER_PARTNERS                = i_partner
       ORDER_SCHEDULES_IN             = i_schedule
      ORDER_SCHEDULES_INX           =
      ORDER_CONDITIONS_IN            = i_cond.
      ORDER_CFGS_REF                =
      ORDER_CFGS_INST               =
      ORDER_CFGS_PART_OF            =
      ORDER_CFGS_VALUE              =
      ORDER_CFGS_BLOB               =
      ORDER_CFGS_VK                 =
      ORDER_CFGS_REFINST            =
      ORDER_CCARD                   =
      ORDER_TEXT                    =
      ORDER_KEYS                    =
      EXTENSIONIN                   =
      PARTNERADDRESSES              =
    if not ( sorder-vbeln is initial ).
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    write: /'Order number:', sorder.
    else.
    loop at i_return.
    write: / i_return-id, i_return-number, i_return-message(80).
    endloop.
    *write: /'Error'.
    endif.
    *loop at i_return.
    *write: / i_return-id, i_return-number, i_return-message(80).
    *endloop.
    ENDFORM.                    " f_call_BAPI

    HI
      Pricing will be carried basing on the pricing
    procedure.
    Case1: Prices will be carried out automatically if
    necessary condition records are maintained for the
    condition type.
      For this you can go to Sales Order-> Item Conditions
    In the screen you can click on command button Analysis,
    which gives you the list of condition types associated
    to the pricing procedure. By clicking on the condition
    type you can know the action that has taken place.
    Case2: Manually forcing prices for Items.
      To do this, you have to populate ORDER_CONDITIONS_IN &
    ORDER_CONDITIONS_INX. Also note to identify the item
    numbers, you manually pass the item number for each item
    in the sales order, use the same item number for
    populating conditions.
      Parameters required:
    ORDER_CONDITIONS_IN:
      ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
    ORDER_CONDITIONS_INX:
      ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
       Hope the above info helps you. Do revert back if you
    need more info.
    Kind Regards
    Eswar

  • Creation of routing using BAPI_ROUTING_CREATE

    Hi,
    I need to create routing using BAPI. I am using BAPI_ROUTING_CREATE. My routing is not saved. I am using BAPI_TRANSACTION_COMMIT  also when message type is 'S', after Routing is created. But Still my routing is not saved. I can see successfull message as N/50003801/01 is created .
    I already spent lot of time on this, and gone thru coding available in google search, still no use. I debug BAPI couple if timings but didnot find anything.
    I even tried using SE37 directly by Sequence execution of both BAPI_ROUTING_CREATE & BAPI_TRANSACTION_COMMIT, no use. i tried different combinations like by giving input values to INPUT PARAMETERS OF BAPI_ROUTING_CREATE giving BOM usage, without BOM usage, TESTRUN value as 'X' and as SPACE.
    I even gone thru this Func. Module /SAPMP/BAPI_ROUTING_PROCESS which directly calls BAPI_ROUTING_CREATE inside it, but no use. I see many people is giving solution as BAPI_TRANSACTION_COMMIT, but I really think that is not problem.
    Does any one have any idea on this issue.
    Thanks in Advance

    Hi Cthota,
    Indeed, TESTRUN must be equal to space. And BAPI_TRANSACTION_COMMIT is needed, as stated in the doc's.
    Could you please check all messages in RETURN table? Very likely there is something not correct in the parameters, that do not prevent the system to assign routing numbering, but that may affect saving.
    Just let us known...
    Bye,
    flavio

  • Problem with creation of routing

    Dear All,
    I use below BAPI for creation of routing. BAPI is succeddful but when i go to CS03 and display, work center, plant, control key information is not filled.  But header details are filled. Do you have any idea why it happens ? Am i not filling some parameters ?
    Please let me know.
    CLEAR : LR_BAPIRET2,
          LT_BAPIRET2.
    CLEAR LT_TASK.
    LR_TASK-VALID_FROM = SY-DATUM.
    LR_TASK-VALID_TO_DATE = '99991231'.
    LR_TASK-TASK_LIST_USAGE = '1'.
    LR_TASK-PLANT = '1830'.
    LR_TASK-TASK_LIST_STATUS = '4'.
    LR_TASK-TASK_MEASURE_UNIT = 'PC'.
    LR_TASK-DESCRIPTION = 'TEST1'.
    LR_TASK-LOT_SIZE_FROM = '0.000'.
    LR_TASK-LOT_SIZE_TO = '0.000'.
    APPEND LR_TASK TO LT_TASK.
    CLEAR : LR_MATERIALTASKALLOCATION,
          LT_MATERIALTASKALLOCATION.
    LR_MATERIALTASKALLOCATION-MATERIAL = 'TEST-0008'.
    LR_MATERIALTASKALLOCATION-PLANT = '1830'.
    LR_MATERIALTASKALLOCATION-VALID_FROM = SY-DATUM.
    APPEND LR_MATERIALTASKALLOCATION TO LT_MATERIALTASKALLOCATION.
    CLEAR : LR_OPERATION,
          LT_OPERATION.
    LR_OPERATION-WORK_CNTR = 'HCPA001'.
    LR_OPERATION-PLANT = '1830'.
    LR_OPERATION-CONTROL_KEY = 'PP01'.
    LR_OPERATION-BASE_QUANTITY = '1.000'.
    LR_OPERATION-VALID_FROM = SY-DATUM.
    LR_OPERATION-SEQUENCE_NO = '0'.
    LR_OPERATION-OBJ_ID = '00000000'.
    *LR_OPERATION-ACTIVITY = '0010'.
    LR_OPERATION-DESCRIPTION = 'TEST'.
    APPEND LR_OPERATION TO LT_OPERATION.
    CALL FUNCTION 'BAPI_ROUTING_CREATE'
    EXPORTING
      TESTRUN                      = ' '
      PROFILE                      =
      BOMUSAGE                     = 'X'
      APPLICATION                  =
    IMPORTING
      GROUP                        =
      GROUPCOUNTER                 =
      TABLES
        TASK                         = LT_TASK
        MATERIALTASKALLOCATION       = LT_MATERIALTASKALLOCATION
        SEQUENCE                     = LT_SEQUENCE
        OPERATION                    = LT_OPERATION
      SUBOPERATION                 =
      REFERENCEOPERATION           =
      WORKCENTERREFERENCE          =
      COMPONENTALLOCATION          =
      PRODUCTIONRESOURCE           =
      INSPCHARACTERISTIC           =
      TEXTALLOCATION               =
      TEXT                         =
        RETURN                       = LT_BAPIRET2
    LOOP AT LT_BAPIRET2 INTO LR_BAPIRET2 WHERE TYPE = 'E' OR
                                           TYPE = 'A'.
      LF_ROUTING_ERROR = 'X'.
    ENDLOOP.
    IF LF_ROUTING_ERROR NE 'X'.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            WAIT          =
          IMPORTING
            RETURN        =
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
        IMPORTING
          RETURN        =
    ENDIF.

    Sorry.
    CLEAR : LR_BAPIRET2,
          LT_BAPIRET2.
    CLEAR LT_TASK.
    LR_TASK-VALID_FROM = SY-DATUM.
    LR_TASK-VALID_TO_DATE = '99991231'.
    LR_TASK-TASK_LIST_USAGE = '1'.
    LR_TASK-PLANT = '1830'.
    LR_TASK-TASK_LIST_STATUS = '4'.
    LR_TASK-TASK_MEASURE_UNIT = 'PC'.
    LR_TASK-DESCRIPTION = 'TEST1'.
    LR_TASK-LOT_SIZE_FROM = '0.000'.
    LR_TASK-LOT_SIZE_TO = '0.000'.
    APPEND LR_TASK TO LT_TASK.
    CLEAR : LR_MATERIALTASKALLOCATION,
          LT_MATERIALTASKALLOCATION.
    LR_MATERIALTASKALLOCATION-MATERIAL = 'TEST-0008'.
    LR_MATERIALTASKALLOCATION-PLANT = '1830'.
    LR_MATERIALTASKALLOCATION-VALID_FROM = SY-DATUM.
    APPEND LR_MATERIALTASKALLOCATION TO LT_MATERIALTASKALLOCATION.
    *CLEAR : LR_SEQUENCE,
    *      LT_SEQUENCE.
    *LR_SEQUENCE-SEQUENCE_NO = '0'.
    *LR_SEQUENCE-SEQUENCE_CATEGORY = '0'.
    *LR_SEQUENCE-ALIGNMENT_KEY_FOR_SCHEDULING = '2'.
    *APPEND LR_SEQUENCE TO LT_SEQUENCE.
    CLEAR : LR_OPERATION,
          LT_OPERATION.
    LR_OPERATION-WORK_CNTR = 'HCPA001'.
    LR_OPERATION-PLANT = '1830'.
    LR_OPERATION-CONTROL_KEY = 'PP01'.
    LR_OPERATION-BASE_QUANTITY = '1.000'.
    LR_OPERATION-VALID_FROM = SY-DATUM.
    LR_OPERATION-SEQUENCE_NO = '0'.
    LR_OPERATION-OBJ_ID = '00000000'.
    *LR_OPERATION-ACTIVITY = '0010'.
    LR_OPERATION-DESCRIPTION = 'TEST'.
    APPEND LR_OPERATION TO LT_OPERATION.
    CALL FUNCTION 'BAPI_ROUTING_CREATE'
    *  EXPORTING
    *   TESTRUN                      = ' '
    *   PROFILE                      =
    *   BOMUSAGE                     = 'X'
    *   APPLICATION                  =
    * IMPORTING
    *   GROUP                        =
    *   GROUPCOUNTER                 =
      TABLES
        TASK                         = LT_TASK
        MATERIALTASKALLOCATION       = LT_MATERIALTASKALLOCATION
        SEQUENCE                     = LT_SEQUENCE
        OPERATION                    = LT_OPERATION
    *   SUBOPERATION                 =
    *   REFERENCEOPERATION           =
    *   WORKCENTERREFERENCE          =
    *   COMPONENTALLOCATION          =
    *   PRODUCTIONRESOURCE           =
    *   INSPCHARACTERISTIC           =
    *   TEXTALLOCATION               =
    *   TEXT                         =
        RETURN                       = LT_BAPIRET2
    LOOP AT LT_BAPIRET2 INTO LR_BAPIRET2 WHERE TYPE = 'E' OR
                                           TYPE = 'A'.
      LF_ROUTING_ERROR = 'X'.
    ENDLOOP.
    IF LF_ROUTING_ERROR NE 'X'.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *       EXPORTING
    *         WAIT          =
    *       IMPORTING
    *         RETURN        =
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
    *     IMPORTING
    *       RETURN        =
    ENDIF.

  • Create a new routing with BAPI BAPI_ROUTING_CREATE via JCo

    I try to create a new routing with BAPI BAPI_ROUTING_CREATE via JCo.
    I filled all necessary parameters. I also realized a commit_work. I get in the RETURN parameter of the BAPI the Message "S 000 Routing N/50001641/01". But the routing isn't in the database. Other JCo programs I wrote (create material master or costumer order) are working very well.
    Have anyone an idea?
    Thanks Jörg
    Here's my coding:
    public void createArbeitsplan() {
              doLogin();
    //          connectionAttributes();
              Plan plan = new Plan();
              for (int i = 0; i < planList.size(); i++)
                   plan = (Plan) planList.get(i);
                   //Ein Function-Objekt erzeugen
                   String bapi = "BAPI_ROUTING_CREATE";
                   JCO.Function savePlan = null;          
                   try { savePlan = this.createFunction(bapi); }
                   catch(Exception ex) { ex.printStackTrace(); System.exit(1); }
                   if(savePlan == null) { System.err.println(bapi + " not found in SAP"); System.exit(1); }
                   //Import und Tabellen füllen
                   // Plankopf
                   JCO.Table headData = savePlan.getTableParameterList().getTable("TASK");
                   headData.appendRow();
                   headData.setValue(plan.kurztext,"DESCRIPTION");
                   headData.setValue("1","TASK_LIST_USAGE");
                   headData.setValue(werks,"PLANT");
                   headData.setValue("4","TASK_LIST_STATUS");
                   headData.setValue("ST","TASK_MEASURE_UNIT");
                   headData.setValue("001","RESP_PLANNER_GROUP");
                   headData.setValue("20070101","VALID_FROM");
                   headData.setValue("20991231","VALID_TO_DATE");
                   headData.setValue("1","LOT_SIZE_FROM");
                   headData.setValue("99999999","LOT_SIZE_TO");
                   // Materialzuordnung
                   JCO.Table materialAlloc = savePlan.getTableParameterList().getTable("MATERIALTASKALLOCATION");
                   materialAlloc.appendRow();
                   materialAlloc.setValue(plan.material,"MATERIAL");
                   materialAlloc.setValue(werks,"PLANT");
                   materialAlloc.setValue("20070101","VALID_FROM");
                   materialAlloc.setValue("20991231","VALID_TO_DATE");
                   materialAlloc.setValue("1","GROUP_COUNTER");
                   // Vorgänge
                   JCO.Table operationData = savePlan.getTableParameterList().getTable("OPERATION");
                   for (int j = 0; j < plan.getAnzahl(); j++) {
                        operationData.appendRow();
                        operationData.setValue(plan.getVorgang(j).vorgang,"ACTIVITY");
                        operationData.setValue(plan.getVorgang(j).steuschl,"CONTROL_KEY");
                        operationData.setValue(plan.getVorgang(j).arbplatz,"WORK_CNTR");
                        operationData.setValue("1111","WORK_CNTR");
                        operationData.setValue(plan.getVorgang(j).text,"DESCRIPTION");
                        operationData.setValue(plan.getVorgang(j).basismenge,"BASE_QUANTITY");
                        operationData.setValue(plan.getVorgang(j).vw1,"STD_VALUE_01");
                        operationData.setValue(plan.getVorgang(j).vw2,"STD_VALUE_02");
                        operationData.setValue(plan.getVorgang(j).vw3,"STD_VALUE_03");
                        operationData.setValue(plan.getVorgang(j).ze1,"STD_UNIT_01");
                        operationData.setValue(plan.getVorgang(j).ze2,"STD_UNIT_02");
                        operationData.setValue(plan.getVorgang(j).ze3,"STD_UNIT_03");
                        operationData.setValue("1","DENOMINATOR");
                        operationData.setValue("1","NOMINATOR");
                        operationData.setValue("20070101","VALID_FROM");
                        operationData.setValue("20991231","VALID_TO_DATE");
                        operationData.setValue("ST","OPERATION_MEASURE_UNIT");
                   // Testflag
                   JCO.Structure test = savePlan.getImportParameterList().getStructure("TESTRUN");
                   test.setValue(" ","BAPIFLAG");
                   //BAPI ausführen (incl. Commit)
                   mConnection.execute(savePlan);
                   JCO.Function commit = null;
                   try {commit = this.createFunction("BAPI_TRANSACTION_COMMIT"); }
                   catch (Exception ex) { ex.printStackTrace();System.exit(1); }
                   JCO.ParameterList input = commit.getImportParameterList();
                   input.setValue("X","WAIT");
                   mConnection.execute(commit);
                   //Messages vom SAP-System holen
                   JCO.Table jcoReturn = savePlan.getTableParameterList().getTable("RETURN");
                   for (int k = 0; k < jcoReturn.getNumRows(); k++)
                        jcoReturn.setRow(i);
    //                    System.out.println(jcoReturn.getField("MESSAGE").getValue());
                        System.out.println(jcoReturn.getField("TYPE").getValue());
                        System.out.println(jcoReturn.getField("NUMBER").getValue());
                        System.out.println(jcoReturn.getField("MESSAGE_V1").getValue());
                        System.out.println(jcoReturn.getField("MESSAGE_V2").getValue());
                        System.out.println(jcoReturn.getField("MESSAGE_V3").getValue());
                        System.out.println(jcoReturn.getField("MESSAGE_V4").getValue());
                   JCO.Structure output = commit.getExportParameterList().getStructure("RETURN");;
                   System.out.println(output.getString("MESSAGE"));
                   System.out.println(output.getString("TYPE"));
                   System.out.println(output.getString("NUMBER"));
                   System.out.println(output.getString("MESSAGE_V1"));
              closeConnectionToSAP();
              System.exit(1);

    Hi,
    perhaps you could use
    BAPI_HRMASTER_SAVE_REPL_MULT
    Regards
    Bernd

  • Problem while updating Item category using Bapi_salesorder_change

    Hi,
    Iam facing a probelm while updating item category using bapi Bapi_salesorder_change
    In the Return table iam getting the folowing mesages.
    Inforation mesage : Field 'PSTYV' cannot be changed, VBAPKOM 000010  ready for input
    Error Message : Item 000010 cannot be processed.
    Please find the code below
    CLEAR wa_bapisdh1x.
      wa_bapisdh1x-updateflag = 'U'.
      CLEAR wa_order_item_inx.
      wa_order_item_inx-itm_number = wa_vbap-posnr.
      wa_order_item_inx-item_categ = 'X'.
      wa_order_item_inx-UPDATEFLAG = 'U'.
      APPEND  wa_order_item_inx TO it_order_item_inx.
      CLEAR wa_order_item_inx.
      CLEAR wa_order_item_in.
      wa_order_item_in-itm_number = wa_vbap-posnr.
      wa_order_item_in-item_categ = 'ABC'.
      APPEND wa_order_item_in TO it_order_item_in.
      CLEAR wa_order_item_in.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = w_vbeln
          order_header_inx = wa_bapisdh1x
        TABLES
          return           = it_return
          order_item_in    = it_order_item_in
          order_item_inx   = it_order_item_inx
    How can i correct it..
    Regards
    Kumar

    Actually iam facing a strange problem here.
    When i copy the program into another sample program and execute it iam able to change both the item catgegory and delivery block for particular sales order and item number.
    But in my main program i have BDC for MB1B transaction to create the material document.
    Once the material document is created succesfully iam using BAPI Sales_order_change to change the item category and delivery block..
    In my main program iam not to change the item catgeory getting an error field PSTYV cannot be changed.
    But the same code is running percfectly in the copied one..
    How can i correct that..
    Regards
    Kumar

  • Unable to capture error message while creating an SO using bapi

    Hi,
    Can anybody suggest how to capture the error message while creating a SO using BAPI.
    I have developed a customeized BAPI and using the BDC format to create the SO.
    Note: i am using a call transaction method for the BDC.
    I am sending the message into message1.
    but i am unable to send the same into an internal table
    shyam.

    Hi Shyam
    If my understanding is correct, you are performing BDC process within the customized BAPI...
    And you want to collect the messages from BDC to an internal table and pass to the output.
    Proceed as below:
    1. While calling BDC, use CALL TRANSACTION .... with addition: <b>MESSAGES INTO itab</b>. The structure of itab should be like <b>BDCMSGCOLL</b>.
    2. Now the messages will be collected in ita.
    3. Prepare the messages using FM: <b>FORMAT_MESSAGE</b>
    4. Collect to the returning table.
    Hope this helps...
    Though i could not understand the reason of creating a BDC within BAPI, you can opt for loading orders via BAPI's like: BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2.
    Kind Regards
    Eswar

  • Error while creating activity by using BAPI

    Hi,
    While creating activity by using BAPI Im getting error as follows,
    Start processing of refference object handle generated.
    Integrity rule a d0008 broken
    business partner with function from vbkakom not vbpakom
    Integrity rule a d0008 broken
    edit all incomplete field .
    Please help me for solving this issue.
    Regards,
    Suresh

    Not received any proper reply Closing the issue.

  • Document Splitting problem while posting asset acquisition using F-90

    Hi,
    We are using ECC 6.0 with document splitting functionality and are facing problem while posting asset acquisition using F-90.
    The transaction entry details are as below:
    Document Type - KR
    Vendor Line Item PKey - 31
    Amount - 10000
    Asset Line Item with PKey - 70, Transaction Type - 100
    Amount - 10000
    The Document Splitting Rule - 0000000012 is used and the Field Status Group for the Vendor Reconciliation Account and Asset Reconciliation account have Cost Center, Profit Center and Segment as "Optional" field.
    The Balance Sheet Item - Asset Reconciliation Account has been created as
    Secondary Cost Element - 90.
    The Profit Center and Segment field have been made mandatory and zero balancing is also set in the settings for Document Splitting.
    While posting asset acquisition using F-90, we are getting the error message - "Balancing Field "Profit Center" in line item 001 not filled"
    The first line refers to the Vendor Line item.
    Please let me know how to overcome this error.
    Regards,
    Ramanand

    Please follow the below path and do config :-
    IMG>FA>Asset Accounting>Integration with the General Ledger>Additional Account Assignment Objects>Specify Account Assignment Types for Account Assignment Objects
    here you have to put KOSTL (Cost center) for both against APC and Dep run for each Dep area.
    Thanks
    Pyare

  • Create Excise invoice(J1IIN) document while creating billing document using bapi BAPI_BILLINGDOC_CREATEMULTIPLE

    Dear Experts,
    My scenario is:
    We have batch split scenario, where the parent line item of billing document has 0 quantity and its subsequent item (item with batch number) holds actual quantity data.
    When we create billing document using VF01 against delivery document, system creates billing document along with excise invoice document (J1IIN Document). And in excise document contain same number of line items that of billing document. Please see the below attachment: 
    Biiling document screen shot:
    While creating billing document, the J1IIN Document created automatically. Below is the screen-shot for the same.
    Now the issue is:
    When we create billing document using BAPI: BAPI_BILLINGDOC_CREATEMULTIPLE system creating only billing document and not creating excise invoice document.
    When we create excise document manually using J1IIN the zero quantity line items are excluded in excise invoice document.
    Please see the below screen-shot for the same; The z quantity line items are missing.
    We want excise document to be created while creating billing document using BAPI BAPI_BILLINGDOC_CREATEMULTIPLE. Or is there any other BAPI for the same purpose.
    Customization is also maintained for creating excise invoice document automatically.
    Regards,
    Rajesh Sadula.

    HI
      Pricing will be carried basing on the pricing
    procedure.
    Case1: Prices will be carried out automatically if
    necessary condition records are maintained for the
    condition type.
      For this you can go to Sales Order-> Item Conditions
    In the screen you can click on command button Analysis,
    which gives you the list of condition types associated
    to the pricing procedure. By clicking on the condition
    type you can know the action that has taken place.
    Case2: Manually forcing prices for Items.
      To do this, you have to populate ORDER_CONDITIONS_IN &
    ORDER_CONDITIONS_INX. Also note to identify the item
    numbers, you manually pass the item number for each item
    in the sales order, use the same item number for
    populating conditions.
      Parameters required:
    ORDER_CONDITIONS_IN:
      ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
    ORDER_CONDITIONS_INX:
      ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
       Hope the above info helps you. Do revert back if you
    need more info.
    Kind Regards
    Eswar

  • How to convert values in tcode CA01 - while creation of Routing

    Hi Group,
    I have a requirement to load data for Routings using tcode 'CA01' using the LSMW with BAPI using idoc type 'ROUTING_CREATE01'.
    the issue is while creating the Routing operations directly through tcode 'CA01', there were certain Unit of measures such as 'SETUP', 'Machine' and etc., for the value of hours when I input 1 and press enter, the value is getting changed to '1,0' and my legacy file will come with a value '1'(say) then the Idoc is failing. is there any function module which is doing this?
    kindly provide your inputs.
    Regards,
    Vishnu

    Hi Vishnu,
    Please check the settings in user profile.
    Regards,
    Madhu.

  • USE BAPI  BAPI_ROUTING_CREATE

    HI ,
    THIS IS FIRST TIME I AM USING BAPI FOR CREATING ROUTING .
    I NEED HELP REGARDING DATA DECLERATION THAT I NEED TO TRANSFER TO THE FUNCTION MODULE,
    A HELP IS NEEDED SO THAT I CAN START.PLEASE TELL ME HOW TO PROCEDE TO UPLOAD DATA USING BAPI.
    PLEASE HELP ME.

    HI
    vijay here
    ******DECLARATION*******
    DATA : path TYPE string.
    DATA : flag type c.
    data: count(2) TYPE n.
    DATA : intern TYPE TABLE OF alsmex_tabline,
           wa_intern TYPE alsmex_tabline.
    DATA :
    testrun      TYPE    bapiflag,
    profile      TYPE    PROFID_STD,  "bapi1012_control_data-profile,
    bomusage     TYPE    STLAN ,      "bapi1012_control_data-bom_usage,
    application  TYPE    CAPID.      " bapi1012_control_data-application.
    internal tables declaration.
    DATA :
            it_task                    TYPE TABLE OF    bapi1012_tsk_c,
            it_materialtaskallocation  TYPE TABLE OF    bapi1012_mtk_c,
            it_operation               TYPE TABLE OF    bapi1012_opr_c,
            it_COMPONENTALLOCATION     TYPE TABLE OF    BAPI1012_COM_C,
    *text                    TYPE TABLE OF    bapi1012_txt_c,
            return                     TYPE TABLE OF    bapiret2,
            it_return                  TYPE TABLE OF    bapiret2.
    Work area declaration.
    DATA :
            wa_items_task           TYPE bapi1012_tsk_c ,
            wa_item_materailtask    TYPE bapi1012_mtk_c,
            wa_item_operation       TYPE bapi1012_opr_c,
            wa_item_componentallocation  TYPE BAPI1012_COM_C,
           wa_item_text            TYPE bapi1012_txt_c,
            wa_return               TYPE return.
    DATA : v_group          TYPE bapi1012_tsk_c-task_list_group,
           v_groupcounter   TYPE bapi1012_tsk_c-group_counter.
    DATA : filename TYPE string.
    *************INTERNAL TABLE DECLARATION***************
    TYPES: BEGIN OF routing,
             valid_from1             TYPE datuv,              "TASK(HEADER)
             valid_todate1           TYPE datub,
             usage                   TYPE pln_verwe ,
             werkstask(6),
             status                  TYPE plnst,
             task_measure_unit(3)    TYPE c,
             lot_size_from(010),
             lot_size_to(020),
             matnr(010),                                      " MATERIAL ALLOCATION(INITIAL SCREEN)
             werks2(006),
             valid_from2             TYPE datuv,
             valid_todate2           TYPE datub,
             valid_from3             TYPE datuv,
             valid_todate3           TYPE datub,
             optno                   TYPE VORNR,
             controlkey(004),
             work_cntr(006),
             werks3(006),
            description(20),
             denominator,
             quant(20),
             setup           TYPE      vgwrt,
             machine         TYPE      vgwrt,
             labor           TYPE      vgwrt,
              reqsplit        TYPE      splittung,
              noofsplits      TYPE      dec03,
              unitmax         TYPE      vgwrteh,
              maxwaittime     TYPE      dzlmax,
              unitstd         TYPE      vgwrteh,
              stdqtime        TYPE      dzwnor,
              unitmin         TYPE      vgwrteh,
              minqtime        TYPE      dzwmin,
              unitstdmove     TYPE      vgwrteh,
              stdmovetime     TYPE      dztnor,
              unitminmove     TYPE      vgwrteh,
              minmovetime     TYPE      dztmin,
              palnnedel           TYPE dec03,                   " IF CONTROL KEY PP02
              netprice(20)        TYPE c,
              priceunit           TYPE pack3,
              COSTELEMENT        TYPE KSTAR,
              currency            TYPE waers,
              purchorg(4)         TYPE c,
              purchgrp(3)         TYPE c,
              matgrp(9)           TYPE c ,
              subcontracting(1)   TYPE c,
              valid_from4         TYPE datuv,                   " COMPONENT ALLOCATION
              valid_todate4       TYPE datub,
              optno1(5),
              itemno(5),
              TEXT                TYPE TDLINE,
    END OF routing.
    DATA: it_record TYPE STANDARD TABLE OF record1.
    DATA: record TYPE record1.
    PARAMETERS : fname TYPE rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR fname .
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          program_name  = syst-repid
          dynpro_number = syst-dynnr
        CHANGING
          file_name     = fname
        EXCEPTIONS
          mask_too_long = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    START OF SLECTION*************
    START-OF-SELECTION.
      filename = fname.
    UPLOADING DATA***************
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = filename
          filetype                = 'ASC'
          has_field_separator     = 'X'
          read_by_line            = 'X'
        TABLES
          data_tab                = it_record
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      SORT it_record BY  matnr.
      LOOP AT it_record INTO record.
      at new matnr.
            flag = 'X'.
      endat.
      if flag = 'X'.
      count = 1.
        bomusage           = '1'.
        application        = 'PP01'.
        REFRESH: task , materialtaskallocation , operation   ,   COMPONENTALLOCATION .
    *********HEADER DATA**********************
          wa_items_task-valid_from               = record-valid_from1.
          wa_items_task-valid_to_date            = record-valid_todate1.
          wa_items_task-task_list_usage          = record-usage.
          wa_items_task-plant                    = record-werkstask.
          wa_items_task-task_list_status         = record-status.
          wa_items_task-task_measure_unit        = record-task_measure_unit.
          wa_items_task-lot_size_from            = record-lot_size_from.
          wa_items_task-lot_size_to              = record-lot_size_to.
          APPEND wa_items_task TO task.
    *************INITIAL SCREEN DATA*************
          wa_item_materailtask-material      = record-matnr.
          wa_item_materailtask-plant         = record-werks2.
          wa_item_materailtask-valid_from               = record-valid_from2.
          wa_item_materailtask-valid_to_date           = record-valid_todate2.
          APPEND wa_item_materailtask TO materialtaskallocation.
      flag = ' '.
      endif.
      IF count = 20.
       count = 1.
      ENDIF.
    **************OPERATION DATA*******************
          wa_item_operation-valid_from               = record-valid_from3.
          wa_item_operation-valid_to_date            = record-valid_todate3.
          wa_item_operation-activity               = record-optno.
          wa_item_operation-control_key            = record-controlkey.
          wa_item_operation-work_cntr              = record-work_cntr.
          wa_item_operation-plant                  = record-werks3.
         wa_item_operation-description            = record-description.
          wa_item_operation-denominator            = record-denominator.
          wa_item_operation-base_quantity          = record-quant.
          wa_item_operation-std_value_01           = record-setup.
          wa_item_operation-std_value_02            = record-machine.
          wa_item_operation-std_value_03            = record-labor.
          wa_item_operation-ind_splitting_reqrd       = record-reqsplit .
          wa_item_operation-max_no_of_splits          = record-noofsplits.
          wa_item_operation-max_wait_time_unit        = record-unitmax.
          wa_item_operation-max_wait_time             = record-maxwaittime.
          wa_item_operation-standard_queue_time_unit  = record-unitstd.
          wa_item_operation-standard_queue_time       = record-stdqtime.
          wa_item_operation-min_queue_time_unit       = record-unitmin.
          wa_item_operation-min_queue_time            = record-minqtime.
          wa_item_operation-standard_move_time_unit   = record-unitstdmove.
          wa_item_operation-standard_move_time        = record-stdmovetime.
          wa_item_operation-min_move_time_unit        = record-unitminmove.
          wa_item_operation-min_move_time             = record-minmovetime.
    ************SUBCONTRACTING DATA********************
          wa_item_operation-plnd_delry                      = record-palnnedel.
          wa_item_operation-info_rec_net_price             = record-netprice.
          wa_item_operation-price_unit                      = record-priceunit.
          wa_item_operation-COST_ELEM                       = RECORD-COSTELEMENT.
          wa_item_operation-currency                        = record-currency.
          wa_item_operation-purch_org                       = record-purchorg.
          wa_item_operation-purch_group                     = record-purchgrp.
          wa_item_operation-matl_group                      = record-matgrp.
          wa_item_operation-ext_proc_with_subcontract_ind   = record-subcontracting.
         APPEND wa_item_operation TO operation.
    *****************COMPONENT ALLOCATION****************
          wa_item_componentallocation-valid_from      = record-valid_from4.
          wa_item_componentallocation-valid_to_date   = record-valid_todate4.
          wa_item_componentallocation-activity        = record-optno1.
          wa_item_componentallocation-item_no         = record-itemno.
          APPEND wa_item_componentallocation TO componentallocation.
    TEXT************************************
       wa_item_text-TEXT_LINE = RECORD-TEXT.
       APPEND wa_item_text TO TEXT.
          count = count + 1.
    AT END OF MATNR.
    ****************CALLING FUNCTION MODULE**************
      CALL FUNCTION 'BAPI_ROUTING_CREATE'
      EXPORTING
        bomusage                     = bomusage
        application                  = application
      IMPORTING
        group                        = group
        groupcounter                 = groupcounter
        TABLES
         task                        = task
         materialtaskallocation      = materialtaskallocation
        SEQUENCE                   =
         operation                   = operation
       SUBOPERATION                =
       REFERENCEOPERATION          =
       WORKCENTERREFERENCE         =
        componentallocation          =  componentallocation
       PRODUCTIONRESOURCE          =
       INSPCHARACTERISTIC          =
       TEXTALLOCATION              =
        text                        = text
         return                      = return.
    loop at return into wa_return.
    write: / 'message type:' ,wa_return.
    endloop.
    COMMIT WORK.
      WRITE:/ 'GROUP:', group.
      WRITE:/ 'GROUPCOUNTER:', groupcounter.
    ENDAT.
    ENDLOOP.
    this will help u
    @vijji

  • Facing problem while redistributing RIP routes in BGP

      Hi All,
    we are facing some problems while redistributing the RIP routes into BGP.
    Scenario is like we are using RIP between My site and client router and we are redistributing some of the routes learned via RIP into the BGP ( we are using BGP to take clients routes inside our network)
    We are using a route-Map in which we have allowed the rip routes that we want to install in our bgp table,but the problem is we are not able to install only one subnet out of many that we have allowed in the access-list , all the routes that we have allowed in ACL are there in the routing table,for the workaround we have advertise this subnet by using the network command in bgp and now we can see the routes in the BGP table.
    can anyone help me out on this why we are not able to see only one subnet in our BGP table by using the redistribution.

    hi, please find the same
    sh ip route 199.67.210.0 255.255.255.0
    Routing entry for 199.67.210.0/24
      Known via "rip", distance 120, metric 1
      Redistributing via bgp 65533, rip
      Advertised by bgp 65533 metric 100 route-map RIP-BGP
      Last update from 169.189.164.185 on GigabitEthernet0/0, 00:00:27 ago
      Routing Descriptor Blocks:
      * 169.189.164.185, from 169.189.164.185, 00:00:27 ago, via GigabitEthernet0/0
          Route metric is 1, traffic share count is 1
    =============================
    sh ip bgp 199.67.210.0 255.255.255.0
    BGP routing table entry for 199.67.210.0/24, version 1456
    Paths: (1 available, best #1, table Default-IP-Routing-Table)
      Advertised to update-groups:
         1
      Local
        169.189.164.185 from 0.0.0.0 (169.189.164.187)
          Origin IGP, metric 1, localpref 100, weight 32768, valid, sourced, local, best
    WBPO-Southwest-RTR#
    =========================================
    sh ip rip database 199.67.210.0 255.255.255.0
    199.67.210.0/24
        [1] via 169.189.164.185, 00:00:09, GigabitEthernet0/0 sh ip rip database 199.67.210.0 255.255.255.0
    199.67.210.0/24
        [1] via 169.189.164.185, 00:00:09, GigabitEthernet0/0
    ====================================
    we have removed the enrty from the ACL because we are not able to see the entry for this in bgp table despite allowing this in the acl.

  • Problem while creating WBS elements using LSMW

    Hello experts,
    I am able to create Project Definitions using LSMW. (using recording)
    But there is a problem while creating WBS elements.
    Tcode CJ20 has table control and that will become problem for multiple rows (levels).
    Can anyone suggest a solution to mass upload WBS elements?
    Thanks for your valuable advice.

    Hi,
    Instead of using "BAPI_PROJECT_MAINTAIN", use following solution. We are using this solution and it is working pretty good.
    If the WBS element is already created and you want to create one more with same data, first get the WBS related information using BAPI_PROJECT_GETINFO as you are doing currently.
    I am using different sets of BAPIs to create project, create / change WBS element.
    I use function module from Function group CJ2001 ( Project related BAPIs ), CJ2054 ( WBS related BAPIs ) and PS_BAPI ( pre/post processing BAPIs ). There are specific order in which you need to execute these BAPIs.
    For example if you want to create / change the WBS element, the BAPIs sequence is:
    <b>1. BAPI_PS_INITIALIZATION
    2. BAPI_BUS2054_CREATE_MULTI ( to create  WBS )
             or
    2. BAPI_BUS2054_CHANGE_MULTI ( to change WBS )
    3. BAPI_PS_PRECOMMIT
    4. BAPI_TRANSACTION_COMMIT</b>
    Check the documentation of BAPI "BAPI_BUS2054_CREATE_MULTI " to see how these function modules work.
    Let me know if you need further information.
    Regards,
    RS

  • Setting user specific contract data while creating sales order using BAPI

    Hi all,
    I am creating sales order using BAPI - BAPI_SALESORDER_CREATEFROMDAT2.
    Now my problem is that there is no structure for contract data (i.e. VEDA), system automatically set contract data using customization values.
    I am doing some validations on cotract data in MV45AFZZ which fails, because these validations are performed on standard values, user specific values r not set.
    How to handle this issue, your small clue may help a lot.
    Regards,
    S@meer

    HI
      Pricing will be carried basing on the pricing
    procedure.
    Case1: Prices will be carried out automatically if
    necessary condition records are maintained for the
    condition type.
      For this you can go to Sales Order-> Item Conditions
    In the screen you can click on command button Analysis,
    which gives you the list of condition types associated
    to the pricing procedure. By clicking on the condition
    type you can know the action that has taken place.
    Case2: Manually forcing prices for Items.
      To do this, you have to populate ORDER_CONDITIONS_IN &
    ORDER_CONDITIONS_INX. Also note to identify the item
    numbers, you manually pass the item number for each item
    in the sales order, use the same item number for
    populating conditions.
      Parameters required:
    ORDER_CONDITIONS_IN:
      ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
    ORDER_CONDITIONS_INX:
      ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
       Hope the above info helps you. Do revert back if you
    need more info.
    Kind Regards
    Eswar

Maybe you are looking for

  • Please could somebody tell me how I can get an iMovie from my ipad2 on to a disc...?

    I really am struggling with this one and would be most grateful if somebody could help! I have created an iMovie on my ipad2 and I am trying desperately to get it onto a dics. The iMovie was created in HD and is taking up son,uh space on my ipad2 I c

  • External hard drive not mounting on desktop or being accessible - help!!!

    Hello, I use an Iomega 160GB external hardrive to store my iTunes and a load of video files as well as back up to but at the moment I can't get it to mount. It is visible in system profiler but I can't access any of the files. I tried verifying it an

  • Copying in Preview causes app to crash

    All of a sudden copying in Preview causes the app to hang briefly then exit. Anyone else having this problem and any ideas on a workaround for copying .pdf text?

  • Shortcuts/Quick dial on Nokia 5800

    I've recently purchased a Nokia 5800 and have set up 4 members of my family as the Quick Dial contact icons on the main screen. However, when I click on a particular contact and then on the Call icon I don't get any choice over which number the phone

  • Overloading PL/SQl functions

    HI Friends I have an Issue .I need to overload a function in PL/SQL by changing the no of arguments(like C++ or java) .As per oracle doc, it is possible to do with in a PACKAGE . Can anyone suggest me How to do with out using package as a standalone