CSAP_MAT_BOM_CREATE\CSAP_MAT_BOM_MAINTAIN

SAPiens,
We are using the above mentioned RFMs to pass material bill of materials data in to SAP from an external system. These RFMs are not providing meaningful errors upon data failure. For example, if we pass a Change Order number which is not existing in SAP, these RFMs simply says, Error, thats all. In our scenario, we have choosen CSAP_MAT_BOM_MAINTAIN since we have to send delta BOM changes (only changes, not the complete BOM).
Please suggest is there any way to derive meaningful error log by using any other function module in conjunction with CSAP_MAT_BOM_MAINTAIN. OR is there any other RFM which carries only BOM changes and  at the same time give some meaningful errors?
Thanks so much in Advance
Aman

Aman,
Try BAPI mentioned in attached link. There is a sample code too.
http://sap.ittoolbox.com/code/archives.asp?d=2270&a=s
ashish

Similar Messages

  • Error while creating BOM with FM CSAP_MAT_BOM_MAINTAIN

    Hi All,
    While creating the bom with the FM "CSAP_MAT_BOM_MAINTAIN" using change number i am getting the below error message.
    " Processing of this object is not supported with change number."
    Please help me out.
    Regards
    Suresh

    call function 'CSAP_MAT_BOM_MAINTAIN'
      exporting
        material                 = material
        plant                    = plant
        bom_usage                = usage
        alternative              = alternat
        valid_from               = y_date
    *   CHANGE_NO                =                   "<----Have u used this field for creating ?
    *   REVISION_LEVEL           =
        i_stko                   = l_stko
    *   FL_NO_CHANGE_DOC         = ' '
        fl_commit_and_wait       = 'X'
        fl_bom_create            = 'X'
        fl_new_item              = ' '
        fl_complete              = ' '
    * IMPORTING
    *   FL_WARNING               =
    *   O_STKO                   =
    CSAP_MAT_BOM_CREATE would be an ideal one for creation and CSAP_MAT_BOM_MAINTAIN for change
    Regards,
    Mithun Shetty.

  • Error in Creating a BOM / CSAP_MAT_BOM_MAINTAIN

    hi,
    i need to create multiple bom alternatives in my development. i try using CSAP_MAT_BOM_MAINTAIN for this purpose.
    even after i give all the inputs and flags necessary for creating a new bom, i am getting an error stating that bom already exist for....when i go and check MAST table, for the same material, plant and bom usage... no such alternative exist.
    i am unable to proceed further. can anyone help me in this regard? thanks in advance.

    friend... you are right.
    CSAP_MAT_BOM_MAINTAIN is used to create only one alternative bom. but this can be any number from 01 to 99. if any alternative bom exist for the same combination of material, plant and bom usage... then you cannot create any more alternative bom for the above mentioned combination. this is because... this function module checks MAST table before proceeding with creation. while checking MAST, it considers only material, plant and bom usage. alternative bom is left out here. but the real fact is... alternative bom should be also considered for uniqueness of bom while checking MAST. all these issues are only during bom creation, but the same function module works perfect during bom maintenance.
    CSAP_MAT_BOM_CREATE is also used to create only one alternative bom. but this can be only one number - 01 (default). but, you cannot maintain a bom using this function module. you need to use CSAP_MAT_BOM_MAINTAIN for bom maintenance.
    to create any number of alternative bom for a material, plant and bom usage combination... you need to use the function module BAPI_MATERIAL_BOM_GROUP_CREATE. but... you cannot maintain any bom or create object dependencies for line items using this function module.
    summary:
    to create a bom.. use BAPI_MATERIAL_BOM_GROUP_CREATE
    to read a bom.. use CSAP_MAT_BOM_READ
    to maintain a bom.. use CSAP_MAT_BOM_MAINTAIN.
    to create object dependency.. use CSAP_MAT_BOM_OPEN , CSAP_BOM_ITEM_MAINTAIN , CSAP_MAT_BOM_CLOSE.

  • Msg id and msg no : End of processing in API: CSAP_MAT_BOM_MAINTAIN

    hi.... i went execute CSAP_MAT_BOM_MAINTAIN, i get the following information message.
    >>> End of processing in API: CSAP_MAT_BOM_MAINTAIN
    can anyone help me with the message id and message number used by SAP to give this error?
    thanks in advance.

    Hi karthik raja spic,
    the ability to read is widely regarded as a clear advantage.
    The documentation of function module CSAP_MAT_BOM_MAINTAIN notes that you shall use FM CSAP_MAT_BOM_CREATE.
    Regards,
    Clemens

  • Create Bom with alternative using CSAP_MAT_BOM_MAINTAIN

    Hi all,
    I am trying to create a new alternative BOM and thought I had to use the function CSAP_MAT_BOM_MAINTAIN. Creating new BOMs with CSAP_MAT_BOM_CREATE works as well as maintaining them with CSAP_MAT_BOM_MAINTAIN, but I fail in creating a new alternative BOM. In the function
    CS_DI_HEADER_OBJECT_CHECK (called within the maintain-function ) it says (close to the failure )
    "*Anlegen von Alternativen über CSAP nicht erlaubt"
    "creation of alternative using csap not allowed" ....
    Well, sounds like I am using the wrong function, but which should I use instead ???
    Thanx in advance,
    Karsten

    Hi,
    Use : CS_BI_BOM_CREATE_BATCH_INPUT1 To Create a new BOM or New Alt. BOM.
    Use : CS_BC_BOM_CHANGE_BATCH_INPUT to maintain the BOM.

  • "CSAP_MAT_BOM_MAINTAIN" can read material which is created without commit?

    hi:
      i want to create a material first with "BAPI_MATERIAL_SAVEDATA",then i want to add this material as a component
      to a existing BOM with "CSAP_MAT_BOM_MAINTAIN".
      1 I create the material using "BAPI_MATERIAL_SAVEDATA" without "BAPI_TRANSACTION_COMMIT".
      2 I use "CSAP_MAT_BOM_MAINTAIN" to add the material to a existing BOM.
      Before this test,i think "CSAP_MAT_BOM_MAINTAIN" will raise an exception:
      "The material XXX does not exist or is not activated"
      But the result is:Material is created successfully and the BOM is added a component with a commit implicitly.
      How can "CSAP_MAT_BOM_MAINTAIN" read the material which is not committed to the DB?
      BTW:Even if "CSAP_MAT_BOM_MAINTAIN" raise a exception,i can use "BAPI_TRANSACTION_COMMIT" to rollback both the
      created material and the changed BOM.
      I am confused!!
      Following is the sample code of this case:
    *& Report  Z_TESTYM23
    REPORT  z_testym23.
    DATA mat LIKE bapimathead-material VALUE '000000000000002814'.   "created material no
    DATA bom LIKE csap_mbom-matnr VALUE '000000000000002794'.
    DATA change_no LIKE aenrb-aennr.
    create ECN in sap
    PERFORM ecn_create.
    create material without commit
    PERFORM mat_create.
    *-- maintain BOM
    PERFORM maintain_bom.
    *&      Form  MAT_CREATE
          CREATE MATERIAL
    FORM mat_create .
      DATA headdata LIKE bapimathead.
      DATA clientdata LIKE bapi_mara.
      DATA clientdatax LIKE bapi_marax.
      DATA itab_makt LIKE TABLE OF bapi_makt.
      DATA wa_makt LIKE bapi_makt.
      DATA return LIKE bapiret2.
      headdata-material = mat.
      headdata-ind_sector = 'A'.
      headdata-matl_type = 'ROH'.
      headdata-basic_view = 'X'.
      clientdata-base_uom = '2X'.
      clientdatax-base_uom = 'X'.
      wa_makt-langu = sy-langu.
      wa_makt-matl_desc = 'TEST'.
      APPEND wa_makt TO itab_makt.
      CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
        EXPORTING
          headdata            = headdata
          clientdata          = clientdata
          clientdatax         = clientdatax
        IMPORTING
          return              = return
        TABLES
          materialdescription = itab_makt.
      CHECK return-type <> 'S'.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      MESSAGE  return-message TYPE 'E'.
    ENDFORM.                    " MAT_CREATE
    *&      Form  MAINTAIN_BOM
          Maintain BOM
    FORM maintain_bom .
      DATA i_datum(10).
      DATA i_stko TYPE stko_api01.
      DATA t_stpo LIKE TABLE OF stpo_api03.
      DATA w_stpo LIKE stpo_api03..
      WRITE  sy-datum TO i_datum.
      w_stpo-item_categ = 'L'.
      w_stpo-component = mat.
      w_stpo-comp_qty = '2'.
      APPEND w_stpo TO t_stpo.
      CALL FUNCTION 'CSAP_MAT_BOM_MAINTAIN'
        EXPORTING
          material    = bom
          bom_usage   = '1'
          valid_from  = i_datum
          change_no   = change_no   "correct no:'500000000053';incorrect no:'500000000153'
          i_stko      = i_stko
          fl_complete = 'X'
        TABLES
          t_stpo      = t_stpo
        EXCEPTIONS
          error       = 1
          OTHERS      = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.   "Rollback BOM and material
      ELSE.
        CALL FUNCTION 'BUFFER_REFRESH_ALL'.          "Remained process of function:BAPI_TRANSACTION_COMMIT
        WRITE: / 'Everything is OK',
               / 'CHANGE_NO: ',change_no,
               / 'MATERIAL NO: ',mat,
               / 'BOM: ', bom.
      ENDIF.
    ENDFORM.                    " MAINTAIN_BOM
    *&      Form  ECN_CREATE
          Create ECN
    FORM ecn_create .
      DATA change_header LIKE aenr_api01.
      DATA object_bom LIKE aenv_api01.
      change_header-status = '01'.
      change_header-valid_from = '2007/06/01'.
      change_header-descript = 'test'.
      object_bom-active = 'X'.
      CALL FUNCTION 'CCAP_ECN_CREATE'
        EXPORTING
          change_header            = change_header
          object_bom               = object_bom
          FL_COMMIT_AND_WAIT        = 'X'
         FL_NO_COMMIT_WORK        = 'X'
        IMPORTING
          change_no                = change_no
        EXCEPTIONS
          change_no_already_exists = 1
          error                    = 2
          OTHERS                   = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " ECN_CREATE 
      Regards
      Ming

    I did another test as following:
    *& Report  Z_TESTYM23
    REPORT  z_testym23.
    DATA mat LIKE bapimathead-material VALUE '000000000000002816'.   "created material no
    create material without commit
    PERFORM mat_create.
    *&      Form  MAT_CREATE
          CREATE MATERIAL
    FORM mat_create .
      DATA headdata LIKE bapimathead.
      DATA clientdata LIKE bapi_mara.
      DATA clientdatax LIKE bapi_marax.
      DATA itab_makt LIKE TABLE OF bapi_makt.
      DATA wa_makt LIKE bapi_makt.
      DATA return LIKE bapiret2.
      headdata-material = mat.
      headdata-ind_sector = 'A'.
      headdata-matl_type = 'ROH'.
      headdata-basic_view = 'X'.
      clientdata-base_uom = '2X'.
      clientdatax-base_uom = 'X'.
      wa_makt-langu = sy-langu.
      wa_makt-matl_desc = 'TEST'.
      APPEND wa_makt TO itab_makt.
      CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
        EXPORTING
          headdata            = headdata
          clientdata          = clientdata
          clientdatax         = clientdatax
        IMPORTING
          return              = return
        TABLES
          materialdescription = itab_makt.
    CALL FUNCTION 'MARA_SINGLE_READ'
       EXPORTING
        KZRFB                   = ''
        MAXTZ                   = 0
         matnr                   = mat
        SPERRMODUS              = ' '
        STD_SPERRMODUS          = ' '
        OUTPUT_NO_MESSAGE       =
      EXCEPTIONS
        lock_on_material        = 1
        lock_system_error       = 2
        wrong_call              = 3
        not_found               = 4
        OTHERS                  = 5.
    IF sy-subrc <> 0.
       CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
       MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
      SELECT COUNT(*) FROM MARA WHERE MATNR = MAT.
      WRITE SY-DBCNT.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      WRITE return-message.
    ENDFORM.                    " MAT_CREATE
    SY-DBCNT = 1 and i can alse rollback the material

  • Program to update BOM by CSAP_MAT_BOM_CREATE as error KEY_INCOMPLETE coming

    Hi to all,
    Can any one provide me sample program to update BOM via Function Module CSAP_MAT_BOM_CREATE.
    As i already have created the program , but run time error is coming KEY_INCOMPLETE for CSAP_MAT_BOM_CREATE.
    as i have already search the SDN , but cant get any specific answer for that.
    Note: itab_bom_header and itab_bom_item_details are of same line type as
      i_stko and t_stpo  with data.     
    DATA: wa_bom_header  TYPE     zia_str_bom_header,
          wa_itab_bom_item_details TYPE zia_str_bom_item_details.
    IF  itab_bom_header[] IS  NOT INITIAL .
      READ TABLE  itab_bom_header INTO wa_bom_header INDEX 1 .
    ENDIF.
    *---- BOM header data structure
    DATA: BEGIN OF tstko OCCURS 0.
            INCLUDE STRUCTURE stko_api01.
    DATA: END OF tstko.
    DATA: wa_tstko  LIKE LINE OF tstko.
    *---- BOM items table
    DATA: BEGIN OF tstpo OCCURS 0.
            INCLUDE STRUCTURE stpo_api01.
    DATA: END OF tstpo.
    DATA: wa_tstpo LIKE LINE OF tstpo.
    **---- Object dependencies table
    Basis data
    *data: begin of tdep_data occurs 0.
    *include structure csdep_dat.
    *data: end of tdep_data.
    Description
    *data: begin of tdep_descr occurs 0.
    *include structure csdep_desc.
    *data: end of tdep_descr.
    Source
    *data: begin of tdep_source occurs 0.
    *include structure csdep_sorc.
    *data: end of tdep_source.
    Sequence
    *data: begin of tdep_order occurs 0.
    *include structure csdep_ord.
    *data: end of tdep_order.
    Documentation
    *data: begin of tdep_doc occurs 0.
    *include structure csdep_doc.
    *data: end of tdep_doc.
    CALL FUNCTION 'CALO_INIT_API'
    EXPORTING
      FLAG_DB_LOG_ON                 = 'X'
      FLAG_MSG_ON                    = 'X'
      FLAG_API_API_CALL_ON           = ' '
      FLAG_COLLECT_MSG_ON            = ' '
      EXTERNAL_LOG_NO                = 'API'
      DEL_LOG_AFTER_DAYS             = '10'
      DATA_RESET_SIGN                = '!'
    EXCEPTIONS
       LOG_OBJECT_NOT_FOUND           = 1
       LOG_SUB_OBJECT_NOT_FOUND       = 2
       OTHERS                         = 3
    LOOP AT itab_bom_header INTO wa_bom_header.
    wa_tstko-BASE_QUAN =  wa_bom_header-base_qty.
    wa_tstko-BASE_UNIT  =  wa_bom_header-BASE_UOM.
    wa_tstko-BOM_STATUS  = wa_bom_header-BOM_STATUS.
    ENDLOOP.
    LOOP AT  itab_bom_item_details INTO  wa_itab_bom_item_details.
      wa_tstpo-item_categ   = wa_itab_bom_item_details-item_category.
      wa_tstpo-item_no      = wa_itab_bom_item_details-bom_itm_number.
      wa_tstpo-component    = wa_itab_bom_item_details-component.
      wa_tstpo-comp_unit = wa_itab_bom_item_details-uom.
      wa_tstpo-comp_qty = '10'.
      wa_tstpo-valid_from   = wa_itab_bom_item_details-valid_from.
      wa_tstpo-itm_ident    =  wa_itab_bom_item_details-item_id  .
      APPEND wa_tstpo TO tstpo .
    ENDLOOP.
    FM to create BOM
    CALL FUNCTION 'CSAP_MAT_BOM_CREATE'
      EXPORTING
        material               =   wa_bom_header-material
        plant                  =   wa_bom_header-plant
        bom_usage              =   wa_bom_header-bom_usage
        VALID_FROM             =   wa_bom_header-VALID_FROM
      CHANGE_NO                =
      REVISION_LEVEL           =
      i_stko                   =    tstko  " bom header
      FL_NO_CHANGE_DOC         = ' '
      FL_COMMIT_AND_WAIT       = ' '
      FL_CAD                   = ' '
      fl_default_values        = 'X'
    IMPORTING
    fl_warning               =  fl_warning
    bom_no                   =  bom_no
    TABLES
    t_stpo                    =  tstpo   " bom item
      T_DEP_DATA               = tdep_data
      T_DEP_DESCR              = tdep_descr
      T_DEP_ORDER              = tdep_source
      T_DEP_SOURCE             = tdep_order
    T_DEP_DOC                 =  tdep_doc
      T_LTX_LINE               =
      T_STPU                   =
    EXCEPTIONS
    error                    = 1
      OTHERS                   = 2
    IF sy-subrc <> 1.
      WRITE 'error'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF fl_warning EQ 'X'.
      WRITE 'done'.
    ENDIF.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT          =
    IMPORTING
      RETURN        =
    please can any one provide me the solution for that.
    i shall be thankfull to you for this.
    Regards
    Pavneet Rana
    Edited by: pavneet rana on Aug 18, 2011 3:01 PM

    Thanks for reply,
    i have debug my program and found that run time error is coming at GET_MAST function module.
    but  i have already checked that     MATNR and STLNR  is already filled before reaching to that FM.
    GET_MAST
    IF NOT SET IS INITIAL.
          IF     WA-MATNR IS INITIAL
             AND WA-STLNR IS INITIAL.
             RAISE KEY_INCOMPLETE.
          ENDIF.
          IF     WA-MATNR <> SPACE
             AND WA-STLNR <> SPACE.
             RAISE KEY_INVALID.
          ENDIF.
    please can any one provide me the solution for that.
    Regards
    Pavneet Rana

  • BOM Update using a function module - 'CSAP_MAT_BOM_MAINTAIN'

    Hi,
    I have problem in updating the item status for a BOM using a function module - 'CSAP_MAT_BOM_MAINTAIN'.
    My goal is reset the Checkbox for 'Indicator: item relevant to production'. When i pass the value ' '[Space] to the structure field 'T_STPO-REL_PROD' it doen't work.
    Do let me know if you come across such problem & what needs to passed as input to reste the checkbox in the BOM.
    Thanks & Regards,
    Bhargava

    PLM wants to manipulate the Indicators u2013 u201CBulk Materialu201D & u201CCost Relevancyu201D in BOM.
    Note: The 2 indicators [u201CBulk Materialu201D & u201CCost Relevancyu201D] are interlinked with each other for a business functionlity given by SAP. So, if we try to set both indicators we get the below SAP standard error.
    E 29127 Bulk material not allowed for items relevant to costing
    SAP Field Name                             RFC Tag       SAP values    PLM values  Meaning for SAP field
    Indicator: bulk material                   BULK_MAT   Space             !                   No
    Indicator: bulk material                   BULK_MAT    X                   X                  Yes
    Indicator: item relevant to costing  REL_COST    Space            !                    Not relevant to costing
    Indicator: item relevant to costing  REL_COST     1                   1                   Not relevant to costing
    Indicator: item relevant to costing  REL_COST     2                   2                   Packaging operation
    Indicator: item relevant to costing  REL_COST     3                   3                   Packaging material
    Indicator: item relevant to costing  REL_COST     X                   X                  Relevant to costing
    To achieve the clear/reset/set value for 2 indicators [u201CBulk Materialu201D & u201CCost Relevancyu201D] from PLM, only eitheir of indicators status needs to sent [i.e 1 indicator status @ a time].

  • IDoc with error when trying to update two materials with FM: CSAP_MAT_BOM_MAINTAIN.

    Hi
    In my current project I am facing the below issue.
    In client MDM team is creating the master data. The BOM master data also creating through MDM only. The function module used is  CSAP_MAT_BOM_MAINTAIN. When user trying to update the two extra BOM line items getting an error " Error while saving the BOM."
    In SLG1 transaction we observed that the IDOC is trying to change the header level data. After analyzing  I got some conclusion that
    while BOM creation header level material and all components are created with change number reference. When the user trying to update two extra line items with new change number system giving error msg as idoc trying to change header level data. As my knowledge with  FM:CSAP_MAT_BOM_MAINTAIN no changes possible for header. I came to conclusion as header is updated with a change number while creation and when we changing second time with new change number, system not able to replace the old change number with new change number.
    To correct this IDOC what steps i can perform? Is it possible to reprocess this IDOC by changing any field values like MSGFN.
    Please suggest what solution we can provide to reprocess this IDOC.
    Regards
    Kesava

    Hi Rupesh
    Thanks for the replay.
    Here the user created the BOM with the same FM:CSAP_MAT_BOM_MAINTAIN  but he created with change number refernce. This change number is updated in header. Later he wants to add some extra components to this BOM with the same FM:CSAP_MAT_BOM_MAINTAIN and he entered new change number second time to do the change. Then system giving an error status for this IDOC.Then if we check in SLG1 the error message is we are trying to change header fields which is not possible " The BOM header can only be displayed, Your entries were ingored". How can we reprocess this IDOC.
    Regards
    Kesava

  • How to use CSAP_MAT_BOM_MAINTAIN for deleting / changing sub-items?

    I'm trying to use CSAP_MAT_BOM_MAINTAIN for BOM create / change / delete.
    Issue: This Function module is not working when I'm trying to delete / change sub-items of a BOM. I'm getting update termination (ABAP/4 processor: SAPSQL_ARRAY_INSERT_DUPREC) during BOM post.
    Is there a way to fix this?
    (1) BOM creation part is working fine
    (2) BOM item (without any sub-item change) change / delete is also working

    hi
    The following parameter are important parameter and mandatory
    Matnr ;  Enter the material Number
    BOM_USAGE : Ther many BOM available that is sales BOM and Production BOM etc  here you need to mention usage of BOM that is for sales or production
    I_STKO : Enter the BOM Header information  . Note : Ask your Functional consultand
    Apart form this parameter, all are optional so do worry
    regards
    anand kumar

  • Problem in function module 'CSAP_MAT_BOM_CREATE'

    Hi
    I am using CSAP_MAT_BOM_CREATE to create BOM i passing the following values
    CALL FUNCTION 'CSAP_MAT_BOM_CREATE'
    EXPORTING
    material = lv_matnr
    plant = lv_werks
    bom_usage = lv_stlan
    i_stko = wa_stko
    TABLES
    t_stpo = it_stpo
    EXCEPTIONS
    error = 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.
    To create the BOM.But I am getting error as 'data is in complete' AND i am getting sy-subrc value as 1.
    Please give me inputs

    maybe you are not filling all the mandatory fields you need.
    Please, let we know how do you fill your structures, otherwise is almost impossibile help you.
    The message is clear: you are missing some mandatory (for the FM) field.

  • CSAP_MAT_BOM_MAINTAIN does not update records in 3.0 Version ??

    Dear Friends,
    I am working on 3.0F Version.I have a requirement where when there is an update in the BOM from the 3rd party system, that changed field or quantity should be updated in the BOM.
    I tried using CSAP_MAT_BOM_MAINTAIN and when I enter the material Number,Plant and BOM Usage...the FM goes to a Short Dump....
    '' ABAP/4 runtime error   CALL_FUNCTION_CONFLICT_LENG
    The call to the function module "CSAP_MAT_BOM_MAINTAIN" is incorrect:
    In the function module interface, you can specify only
    fields of a specific type and length under "T_STPO".
    Although the currently specified field
    "%_OT_STPO[]" is the correct type, its length is incorrect.''
    But I've tried to use the same Function Module in ECC 5.0 and it works perfectly fine and I am able to update the records.
    Did anybody face a similar problem with 3.0 Version ??How to rectify this ??
    Is there any other alternative or a solution for my problem ??
    Please share your thoughts.
    Warm Regards,
    Lakshmi

    HI,
    I know it's a old subject but i just find the solution so to update long text feel the field
    object_id in the table typed csltx_line for all the line you want to put in the header
    with the below value:
    * object_id = 0: Stücklistentext (STZU)  (-> CS_DI_BOM_UPDATE)
    *           = 1: Alternativentext (STKO)
    *           = 2: Positionstext (STPO)
    Regards

  • It did not insert the materials in the BOM using 'CSAP_MAT_BOM_MAINTAIN'

    Hi!
      We developed a ABAP technical maintenance BOM.
      In the program.
      Before, we got current BOM and eliminated all related items.
      Routine below.
         LOOP AT INTO it_stpo wa_stpo.
           MOVE-CORRESPONDING TO wa_stpo wa_stpo_i.
           wa_stpo_i-id_itm_ctg = wa_stpo-item_categ.
           wa_stpo_i-id_item_no = wa_stpo-item_no.
           wa_stpo_i-id_comp = wa_stpo-component.
           wa_stpo_i-fldelete = 'X'.
           APPEND TO wa_stpo_i it_stpo_i.
         ENDLOOP.
         CALL FUNCTION 'CSAP_MAT_BOM_MAINTAIN'
           EXPORTING
             Stuff = pv_matnr
             plant = p_werks
             bom_usage = p_tplis
             Alternative = p_altlis
             VALID_FROM = v_valid_from
             i_stko = pv_wa_stko
            TABLES
              t_stpo = it_stpo_i.
    After , we inserted new materials in the BOM using the same function .
    routine below
       LOOP AT INTO it_tab_i wa_tab_i ins_up_del WHERE = '1 ' OR
                                               ins_up_del = '2 ' .
            wa_stpo_i - item_categ = ' L' .
            wa_stpo_i -component = wa_tab_i - matnr_pri .
            v_menge_i = wa_tab_i - menge ( 9 ) .
            v_menge = v_menge_i / 1000 .
            WRITE TO v_menge wa_stpo_i - comp_qty .
            wa_stpo_i - comp_unit = " KG " .
            wa_stpo_i - issue_loc = " COS " .
            APPEND TO wa_stpo_i it_stpo_i .
          ENDLOOP .
    * Including new materials in the BOM .
          CALL FUNCTION ' CSAP_MAT_BOM_MAINTAIN '
            EXPORTING
              Stuff = pv_matnr
              plant = p_werks
              bom_usage = p_tplis
              Alternative = p_altlis
              VALID_FROM = v_valid_from
              i_stko = pv_wa_stko
            IMPORTING
              fl_warning = v_fl_warning
            TABLES
              t_stpo = it_stpo_i
            EXCEPTIONS
              error = 1
              OTHERS = 2 .
    But the new materials were not inserted.
    Could you help me what is missing in the routine ?
    Thanks.

    Hi!
    We found the problem.
    The problem was in the fields ID_ITM_CTG, ID_ITEM_NO and ID_COMP.
      They were not cleaned when we were inserting  the new materials in the BOM.

  • Issues while processing the BOMs using fm ''CSAP_MAT_BOM_MAINTAIN'

    Hi Group,
    we are facing issues while processing the BOMs using the basic type(Z-idoc type) for standard type BOMMAT04.
    thing is that the segment 'E1STPOM' is defined to contain 1 to 99999 records in it.
    when an Idoc is run(say with 150/200 segments of 'E1STPOM'), there was a standard error with error message id PIC01(number : 004) when the Idoc is processed with the Standard function module 'CSAP_MAT_BOM_MAINTAIN'.
    the error says 'Error reading material FING_005 . Exception: 0' and Check whether the material number is blocked. but when checked, the Material seems not blocked.
    kindly advise how to overcome this error and proceed further.
    Regards,
    Vishnu

    Checj the material status, while its transfer from one server to another server the status should be different

  • Create BOM , CSAP_MAT_BOM_CREATE

    Hi,
    i have some problems with the call function mentioned above.
    First let me show the code:
    *- Kopfdaten füllen
      wa_tstko-base_quan = '1'.
      wa_tstko-bom_text = text-t11.   "'Stücklistentext'.
      APPEND wa_tstko TO xt_tstko.
    hilfsfeld für Stücklistenposition
      DATA: lh_item1(4) TYPE c VALUE '0000'
          , lh_item(4) TYPE c.
      LOOP AT xt_hstb WHERE box = 'X'.
    *- Positionsdaten füllen
        ADD 10 TO lh_item1.
        SHIFT lh_item1 LEFT DELETING LEADING space.
        CONCATENATE '00' lh_item1 INTO lh_item.
        CLEAR xt_tstpo.
        wa_tstpo-item_no    = lh_item.
        wa_tstpo-item_categ = 'L'.                      "Mußeingabe
        wa_tstpo-component  = xt_hstb-n_matnr.          "Mußeingabe
        wa_tstpo-comp_qty   = xt_hstb-menge.            "Mußeingabe
        wa_tstpo-comp_unit  = xt_hstb-mmein.
        wa_tstpo-item_text1 = xt_hstb-ojtxb.
        APPEND wa_tstpo TO xt_tstpo.
      ENDLOOP.
    CALL FUNCTION 'CALO_INIT_API'.
      CALL FUNCTION 'CSAP_MAT_BOM_CREATE'
        EXPORTING
          material                 = xl_matnr
          plant                    = xp_werks
          bom_usage                = 'L'
         valid_from               = xl_datuv
      CHANGE_NO                =
      REVISION_LEVEL           =
          i_stko                   = xt_tstko
      FL_NO_CHANGE_DOC         = ' '
      FL_COMMIT_AND_WAIT       = ' '
      FL_CAD                   = ' '
      FL_DEFAULT_VALUES        = 'X'
    IMPORTING
      FL_WARNING               =  xh_flg_warning
       bom_no                   = xh_stlnr
       TABLES
         t_stpo                   = xt_tstpo
       EXCEPTIONS
         error                          = 1
         OTHERS                   = 2
    i always get following dump.
    exception: ..... KEY_INCOMPLETE....
    Does anybody have some answers for that problem?
    thx
    Thomas

    Give a example.
    this program can create bom succcess.but add stpu(subitem) ,have some problem.
    REPORT  ZPDM_CREATEBOM                          .
    DATA: i_stko  like STKO_API01.
    data: T_STPO  like table of STPO_API01 WITH HEADER LINE.
    data: T_STPU  like table of STPU_API01 WITH HEADER LINE.
    data: BOM_HEADER like BICSK.
    DATA: return TYPE char100,
          return2 TYPE char100.
    i_stko-BASE_QUAN = 1.
    T_STPO-ITEM_CATEG = 'L'.
    T_STPO-ITEM_NO = '0010'.
    T_STPO-COMPONENT = '52008022702'.
    T_STPO-COMP_QTY = '10'.
    APPEND T_STPO.
    T_STPO-ITEM_CATEG = 'L'.
    T_STPO-ITEM_NO = '0020'.
    T_STPO-COMPONENT = '52008022701'.
    T_STPO-COMP_QTY = '20'.
    APPEND T_STPO.
    T_STPU-POINTER = 20.
    T_STPU-UPOSZ = '0001'.
    T_STPU-EBORT = 'A1'.
    T_STPU-UPMNG = '10'.
    APPEND T_STPU.
    T_STPU-POINTER = 20.
    T_STPU-UPOSZ = '0002'.
    T_STPU-EBORT = 'A2'.
    T_STPU-UPMNG = '10'.
    APPEND T_STPU.*
    CALL FUNCTION 'CSAP_MAT_BOM_CREATE'
      EXPORTING
        material                 = 'FERT005'
       PLANT                    = '1000'
        bom_usage                = '1'
      VALID_FROM               =
       CHANGE_NO                = 'ECO200909096'
      REVISION_LEVEL           =
        i_stko                   = i_stko
      FL_NO_CHANGE_DOC         = ' '
      FL_COMMIT_AND_WAIT       = ' '
      FL_CAD                   = ' '
      FL_DEFAULT_VALUES        = 'X'
    IMPORTING
      FL_WARNING               =
      BOM_NO                   =
    TABLES
       T_STPO                   =   T_STPO
      T_DEP_DATA               =
      T_DEP_DESCR              =
      T_DEP_ORDER              =
      T_DEP_SOURCE             =
      T_DEP_DOC                =
      T_LTX_LINE               =
       T_STPU                   = T_STPU
    EXCEPTIONS
       ERROR                    = 1
       OTHERS                   = 2

Maybe you are looking for