Csap_mat_bom_read

Hi All,
In a report i am using csap_mat_bom_read fm for getting associated BOMs but the fm is unable to pick some phantom materials.
the material number i am passing is from s226-mcomp field.
Could anyone please tell me where i will get phantom material in which the material is used?
Thanks in Advance.
Viswam
Message was edited by:
        viswam

Hi All,
In a report i am using csap_mat_bom_read fm for getting associated BOMs but the fm is unable to pick some phantom materials.
the material number i am passing is from s226-mcomp field.
Could anyone please tell me where i will get phantom material in which the material is used?
Thanks in Advance.
Viswam
Message was edited by:
        viswam

Similar Messages

  • Function module to replace CSAP_MAT_BOM_READ

    Hi
       I have a requirement in which I use the function module CSAP_MAT_BOM_READ to read the material BOM. The problem is that there is a huge chunk of data and for each record it calls the function module which is causing a performance issue.
       I tried to replace the funtion module with a join on STKO, STPO . But the problem is that in the funtion module there is some logic in which it checks the validity date which comes from Change Number.
      Is there any function module which I can replace the existing one or any logic which can be implemented in the join condition?
    Regards,
    Ajith

    Hi Ajith,
    I'm not sure if this helps but here's a suggestion:-
    Table <b>MAST</b> (Material to BOM Link) contains the BOM number for each material.
    Tables <b>STPO</b> and <b>STKO</b> gives the information regarding BOM components.
    Consequently:
    Table <b>STKO</b> (BOM Header) can be linked to
    Table <b>STAS</b> (BOMs - Item Selection) via:
    <i>STLNR</i> (Bill of material) and
    <i>STLAL</i> (Alternative BOM).
    From this join you can then connect to the relevant entry in Table <b>STPO</b> (BOM item) via:
    <i>STLNR</i> (Bill of material) and
    <i>STLKN</i> (BOM item node number).
    Within table <b>STKO</b> there is a field <i>DATUV</i> (Valid-from date) that can be used if you want to restrict the values based on validity date.
    I hope this helps.
    Hafeez

  • Number format, eg CSAP_MAT_BOM_READ

    Hi,
    I hope this forum will be the correct one ...
    I want to get a Bill Of Materials from a remote system, for this I use the Function "CSAP_MAT_BOM_READ" with an RFC-destination.  This works correct, except that the numbers are returned in a different way. 
    In the system I'm using a decimal number is normally given with a comma as separator for the decimal part ; so numbers come in the format 1,000 for representing the number 1. 
    This format is also used in the function, but when the BOM is read with a RFC-Destination, the decimal separator is a point. 
    Is there a way to change a setting that it uses the comma as well ? 
    (The system where the BOM is coming from uses the comma as well, so it isn't the basic setting of the remote system which causes this)
    Thanks,
    Alain

    Solved by correcting the user parameters for this ...
    The RFC-user didn't use the comma ... now he (she? it?) does...

  • DM DMU_MAT_BOM_READ and CSAP_MAT_BOM_READ have a contradiction

    We are in the process of testing a recent upgrade from 4.6C to ECC6.0.
    In a custom program we have use the FM DMU_MAT_BOM_READ which takes material (length 18) as input.
    This standard FM then calls another FM CSAP_MAT_BOM_READ which takes material (length 40). This material is the same variable which is exported to the first FM. This causes a conflict in length and thus a dump.
    What is the way to resolve this standard contradiction. I could not find any related SAP note in serive marketplace.
    I am thinking of creating a 'Z' function module as a copy of DMU_MAT_BOM_READ but would prefer a standard solution.

    We are in the process of testing a recent upgrade from 4.6C to ECC6.0.
    In a custom program we have use the FM DMU_MAT_BOM_READ which takes material (length 18) as input.
    This standard FM then calls another FM CSAP_MAT_BOM_READ which takes material (length 40). This material is the same variable which is exported to the first FM. This causes a conflict in length and thus a dump.
    What is the way to resolve this standard contradiction. I could not find any related SAP note in serive marketplace.
    I am thinking of creating a 'Z' function module as a copy of DMU_MAT_BOM_READ but would prefer a standard solution.

  • CSAP_MAT_BOM_READ Call

    Hi all,
    Have a query regarding the "CSAP_MAT_BOM_READ" call
    CALL FUNCTION 'CSAP_MAT_BOM_READ'
    EXPORTING
    material = wa_mast-matnr(For Example : 123456)
    plant = wa_mast-werks
    bom_usage = wa_mast-stlan
    alternative = wa_mast-stlal
    valid_from = v_fdate
    valid_to = v_tdate
    TABLES
    t_stpo = itab1
    t_stko = itab2
    EXCEPTIONS
    error = 1
    OTHERS = 2.
    For Example if I pass meaterial number '123456' into the above FM as input parameter.
    Does stko-BOM_NO give me 123456(The root BOM).if not which is the field to get the root meaterial number.
    Does stpo-COMPONENT give me the child meaterial Number.What does stpo-BOM_NO give me.
    if the above is not true,which is the stpo field which give me the child meaterial number.
    Does t_stko abd t_stpo have to be passed with itab parameters.
    Is that also so to understand that in stko itab there will be only 1 entry corresponding to the root BOM and
    stpo itab conatins as many rows or entries as there are child componenets from the root BOM.
    Thanks
    P

    Hi,
    Here is the code
    T_STPO and T_STKO are empty currently data will get filled once the function modules gets executed
    CALL FUNCTION 'CSAP_MAT_BOM_READ'
          EXPORTING
            MATERIAL             = IT_MAST-MATNR -> material number
            PLANT                = IT_DATA-WERKS -> Plant
            BOM_USAGE            = '1' -> production bom
            ALTERNATIVE          = '01' -> Alternative BOM
          VALID_FROM           =
          VALID_TO             =
          CHANGE_NO            =
          REVISION_LEVEL       =
          FL_DOC_LINKS         =
          FL_DMU_TMX           =
        IMPORTING
          FL_WARNING           =
      TABLES
           T_STPO               = T_STPO -> BOM items (Contains multiple lines)
           T_STKO               = T_STKO -> BOM headers (contains single line)
          T_DEP_DATA           =
          T_DEP_DESCR          =
          T_DEP_ORDER          =
          T_DEP_SOURCE         =
          T_DEP_DOC            =
          T_DOC_LINK           =
          T_DMU_TMX            =
          T_LTX_LINE           =
          T_STPU               =
        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.
        LOOP AT T_STPO.
          CLEAR IT_MAST1.
          MOVE IT_MAST-STLNR TO IT_MAST1-STLNR. -> BOM
          MOVE IT_MAST-MATNR TO IT_MAST1-MATNR. -> Material Number
          IT_MAST1-IDNRK = T_STPO-COMPONENT . -> Plant
          CLEAR QTY.
          QTY = T_STPO-COMP_QTY. -> Component Quantity
          IT_MAST1-MENGE = QTY.
          MOVE T_STPO-COMP_UNIT TO IT_MAST1-MEINS. - > Component unit of measure
          READ TABLE T_STKO INDEX 1.
          IF SY-SUBRC = 0.
            IT_MAST1-BASE_QUAN = T_STKO-BASE_QUAN. -> Base quantity
          ENDIF.
          APPEND  IT_MAST1.
          CLEAR IT_MAST1.
    ENDLOOP.
    Hope this solves your query on what fileds contain which data.
    If u need more details please let me know.
    Regards
    Hiren K.Chitalia

  • BOM Explosion for Multiple Process Orders

    Hi,
    I hope someone can assist me with the following: Is there a report I can run or transaction I can do to have BOM explosion for multiple Process Orders? I would like to input process orders for a week and see the BOM details per PO.
    Thanks

    Dear Sukendar,
    1.For this requirement you have to go for a Z report and you can give the Functional Spec's to prepare
    this report to your ABAP consultant.Prepare the input format,logic of the program and the output format.
    In the logic part you can make use of this Functional Modules's CSAP_MAT_BOM_READ or 
    CSEP_MAT_BOM_READ  or CS_BOM_EXPLOSION   or CS_BOM_EXPL_MAT_V2 .
    2.Using CEWB helps you to identify all the material that's having the BOM,but here the report does not
    shows you the level by level by BOM for a FERT.
    Check and revert back.
    Regards
    Mangalraj.S

  • BOM Explosions for Materials and Plant

    I am looking for the same functionality as in CS15 where I can check if a component within a BOM is part of another BOM.
    How can I achieve this?
    I have tried the FM: CS_BOM_EXPLOSION or CS_BOM_EXPL_MAT_V2, but I can not get these to work as I wish.
    I have material number and plant as a selection criteria as well as BOM usage.
    Does anyone have a good solution to this?
    Please help out as soon as possible, since I am stuck.
    Rgds,
    /Fredrik.

    Hi Fredrik,
    in the past i used FM CSEP_MAT_BOM_SELECT_WHERE_USED  (and afterwards CSAP_MAT_BOM_READ to get details).
    Also you could have a look at FM CS_WHERE_USED_MAT - it should be like CS15.
    Hope it helps,
    BR,
    Sebastian

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

  • Components of Production Order

    Hi experts,
    Does anyone know the table / function module where the components of a production order are stored?
    I am talking about when you go to CO03 transaction / Overviews / Components (F6). Here you get the components of the production order. I need to obtain these exact components in a program... Does anyone know if there's a specific dictionary table where these are stored? Or if there is a FM I could use to obtain these exact components?
    I tried with CSAP_MAT_BOM_READ, CS_BOM_EXPL_MAT_V2, but these don't retrieve the same records I'm getting in the transaction.
    As for CUKO_COMPONENTS_OF_ORDER_BOM, this is not retrieving anything.
    I also tried debugging the transaction, and saw that there's a FM being used called: CO_IT_OBJ_ITAB_CREATE. However when I try to use it in a program I don't get any information...
    Thanks in advance! Points shall be rewarded for good solutions...

    Here are the tables for the production orders with details.
    AUFK          Production order headers
    AFIH          Maintenance order header
    AUFM          Goods movement for prod. order
    AFKO          Order header data PP orders
    AFPO          Order item
    RESB          Order componenten     
    For BOM check STPO amd PLMZ.
    Regards
    TAJUDDIN

  • Function module to get BOM which WOULD be created if I open a production

    Is there a function module to get the BOM which WOULD be created if I open a production order?
    note that I don't have the produciton order created.
    I already tried with the FM CS_BOM_EXPL_MAT_V2 and CSAP_MAT_BOM_READ.
    I debuged the CO01, but I did not find it.
    This BOM should include materials which are under a phantom component.
    Edited by: Rodrigo Pelos on Jul 20, 2011 6:55 PM

    Hi Greetson Shunmugasundaram,
    thanks for the reply, but for the FMs CO_SD_RESB_FROM_BOM_CREATE and CO_SD_NEW_BOM_ASSIGNEMENT it's necessay to have an production order but I don't have it. And with CS_ALT_SELECT_COUPLED_PRODUCT I could not get a BOM.
    Let me explain in more details how I'm going to use this information, I think I was not clear in my post.
    I'm creating a report to compare the BOM of a production order with BOM which would be created today if I open a production order.
    Then I can check if there was changes in the reservation (RESB) of the production order. If this changes happened, how many pieces. I'll check also if there was differences in consumption, because during the production order confirmation it is possible to make changes.
    I would not like to make the BOM explosion "manually" because there are too many variables in the BOM like phantom, alternative, scrap and so on, but I don't know if the function module that I'd like to use exists.

  • Name of the table where can get the two fields Valid-From and Valid-to for

    Hi gurus
    I want name of the table where I can get the two fields Valid-From and Valid-To and their relation ship with the header table in BOM
    Regards
    Kaisar

    You can only get the Valid from date from the table STKO.
    To get the valid to date, you have to take one day less than the valid-from date of the next record for the same BOM.
    Alternatively use the Function module:
    CSAP_MAT_BOM_READ
    It will give both valid from and valid to dates in the tables parameter: T_STKO
    Regards,
    Ravi
    Edited by: Ravi Kanth Talagana on Jul 2, 2008 4:37 PM

  • Long Text in BOM

    Hi,
    I have a BOM with some text items. I have some long text maitained for these text items through tab whenI go to that text item and "Status/long txt" tab.
    I need to know the table and field where tihs long text is stored as STPO stores the item text 2 line and not the long text.
    Rg,
    Vipul

    Hi Vipul,
    You can get the long texts using the following function module:
    'CSAP_MAT_BOM_READ'
    (All the tables parameters recieve values..)
    All the long texts will be available in TABLES parameter 't_ltx_line'
    Please let me know if you have further doubts...
    Regards,
    Arun B

  • Function Modules related to BOM

    Hi BW Gurus,
    I am having a requirement to extract data from the function module for the PP module for the standard BOM.
    I found out some function modules for my requirement csap_mat_bom_read and my problem here when i am trying to create a generic data source on using this function module it displays a error msg " The specified table  does not exist ".
    I am working first on function modules please let me know whether these function modules useful to fetch data in BW or not.
    Give me your input of how to proceed further.
    Regards,
    Syed

    Hi Shahid
    You cannot create a generic datasource directly on a SAP standard function module, you should either create a custom FM and use the standard FM to get the data to a internal table and pass the values to a structure of datasource. Or use SAP tables to extract data to ITAB.
    Rahul

  • Relationship between mara and mast table

    Hi gurus i have to get the components of one material for example
    if the material is paper i need to know the components of this paper (cellulose)
    any idea?
    i know all materials are in mara table but i find the transaction  cs03 i put a trace and i can see that this transaction uses de mast table but i dont know how to relate the mast table with mara table

    Pass the material and plant to function module CSAP_MAT_BOM_READ, this fm is used in CS03.
    Note: This will will only give you the immediate level, so again pass the material obtained from fm to the same fm to get the next level.
    Is you requirement to only get the child components of a FERT part ?

  • How to check Audit-Messages ?

    Hi Experts,
    I want to check/read an ALEAUD IDoc in my Source System (into ABAP Program).
    Tables : EDIDC and EDID4.
    I send a BOMMAT IDoc, I receive the ALEAUD Message and want to read/check it to know if the BOMMAT IDoc has been saved into the Target System.
    How can I know which ALEAUD IDoc is the good one (for the BOMMAT IDoc) ? If I send many BOMMAT IDocs, I receive a lot of ALEAUD IDocs...
    Regards,
    David

    @ Julius: thanks for the info.
    @ Gordon: here is the coding.
    We want to send entire BOMs from Client A to Client B.
    1. Open the BOM in Client 1 using CSAP_MAT_BOM_READ using recursivity.
    2. Send the MATMAS IDoc for the BOM.
    3. For each Positions, generate a MATMAS IDoc and send it directly.
    4. For each Positions with modification, generate a ECMMAS IDoc and send it directly.
    5. Send the first BOM (the first version) for all BOM's positions.
    6. Send the BOM History of all BOM's positions.
    FORM create_idoc_material
            USING value(lp_matnr) LIKE it_matkeypack-matnr
            CHANGING p_rcode TYPE sy-subrc.
      DATA: BEGIN OF bdcdata OCCURS 5000.
              INCLUDE STRUCTURE bdcdata.
      DATA: END OF bdcdata.
      DATA: created_comm_idocs   LIKE sy-tabix,
            lv_result            TYPE p,
            lv_matnr             LIKE mast-matnr.
      DATA: program     LIKE sy-repid,
            wa_bdcdata  TYPE bdcdata.
      DATA: t_matkey    LIKE bdimarakey
                        OCCURS 0 WITH HEADER LINE.
      CHECK lp_matnr >< ' '.
      idoc_typ = 'mat'.
    * Output-Konvertierung für Materialnummer
      CALL FUNCTION 'CONVERSION_EXIT_MATN2_INPUT'
        EXPORTING
          input  = lp_matnr
        IMPORTING
          output = lv_matnr.
      MOVE sy-mandt TO t_matkey-mandt.
      MOVE lv_matnr TO t_matkey-matnr.
      APPEND t_matkey.
    * Erzeugen Masteridoc MATMAS
      CALL FUNCTION 'MASTERIDOC_CREATE_REQ_MATMAS'
        EXPORTING
          rcvpfc                      = space
          rcvprn                      = receiver_prn
          rcvprt                      = receiver_prt
          sndpfc                      = space
          sndprn                      = space
          sndprt                      = space
          message_type                = 'ZMATMAS'
          check_mat                   = 'X'
          sendconfig                  = space
          iv_ignore_distribution_lock = p_dlign
        IMPORTING
          created_comm_idocs          = created_comm_idocs
        TABLES
          marakey                     = t_matkey.
      IF sy-subrc <> 0.
        MOVE 'ZMATMAS-IDOC Fehler !!!' TO result_matmas.
      ENDIF.
      p_rcode = sy-subrc.
      IF created_comm_idocs <> 0 AND p_rcode EQ 0.
        sum_of_mat_idocs = sum_of_mat_idocs + created_comm_idocs.
      ENDIF.
    * Commit (after 50 created IDocs)
      lv_result = sum_of_mat_idocs MOD 50.
      IF lv_result = 0 AND sum_of_mat_idocs GT 0.
        COMMIT WORK.
        CALL FUNCTION 'DEQUEUE_ALL'
          EXCEPTIONS
            OTHERS = 0.
        CLEAR sum_of_mat_idocs.
      ENDIF.
      PERFORM nachricht USING idoc_typ.
      REFRESH bdcdata.
      CLEAR idoc_typ.
    ENDFORM.                    " create_idoc_material
    FORM create_idoc_modif
            USING lp_aennr LIKE aenr-aennr
            CHANGING p_rcode TYPE sy-subrc.
      DATA: BEGIN OF bdcdata OCCURS 5000.
              INCLUDE STRUCTURE bdcdata.
      DATA: END OF bdcdata.
      DATA: program     LIKE sy-repid,
            wa_bdcdata  TYPE bdcdata.
      DATA: created_comm_idocs   LIKE sy-tabix.
      DATA: lt_aennr LIKE STANDARD TABLE OF aenr,
            ls_aennr LIKE aenr.
      CHECK lp_aennr >< ' '.
      idoc_typ = 'aen'.
      CLEAR wa_bdcdata.
      wa_bdcdata-program  = 'RCCSEECM'.
      wa_bdcdata-dynpro   = '1000'.
      wa_bdcdata-dynbegin = 'X'.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam   = 'BDC_CURSOR'.
      wa_bdcdata-fval   = 'P_LOGSYS'.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam   = 'BDC_OKCODE'.
      wa_bdcdata-fval   = '/00'.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam   = 'PS_ECMNR-LOW'.
      wa_bdcdata-fval   = lp_aennr.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam   = 'P_MESTYP'.
      wa_bdcdata-fval   = 'ECMMAS'.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam   = 'P_MESCOD'.
      wa_bdcdata-fval   = 'CRE'.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam   = 'P_LOGSYS'.
      wa_bdcdata-fval   = receiver_prn.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
      wa_bdcdata-program  = 'RCCSEECM'.
      wa_bdcdata-dynpro   = '1000'.
      wa_bdcdata-dynbegin = 'X'.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam   = 'BDC_CURSOR'.
      wa_bdcdata-fval   = 'P_LOGSYS'.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam   = 'BDC_OKCODE'.
      wa_bdcdata-fval   = '=ONLI'.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam   = 'PS_ECMNR-LOW'.
      wa_bdcdata-fval   = lp_aennr.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam   = 'P_MESTYP'.
      wa_bdcdata-fval   = 'ECMMAS'.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam   = 'P_MESCOD'.
      wa_bdcdata-fval   = 'CRE'.
      APPEND wa_bdcdata TO bdcdata.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam   = 'P_LOGSYS'.
      wa_bdcdata-fval   = receiver_prn.
      APPEND wa_bdcdata TO bdcdata.
      CALL TRANSACTION 'CC92'
            USING bdcdata MODE 'N' UPDATE 'S'
                          MESSAGES INTO messtab.
      IF sy-subrc <> 0.
        MOVE 'ECMMAS-IDOC Fehler !!!' TO result_ecmmas.
      ENDIF.
      p_rcode = sy-subrc.
      PERFORM nachricht USING idoc_typ.
      REFRESH bdcdata.
      CLEAR idoc_typ.
    ENDFORM.                    " create_idoc_modif
    FORM create_idoc_stueli-historie
            USING value(p_matnr)
                  value(p_stlnr)
            CHANGING p_rcode TYPE sy-subrc.
      DATA: BEGIN OF bdcdata OCCURS 5000.
              INCLUDE STRUCTURE bdcdata.
      DATA: END OF bdcdata.
      DATA: program     LIKE sy-repid,
            wa_bdcdata  TYPE bdcdata,
            msg_txt(30).
      DATA: created_comm_idocs   LIKE sy-tabix,
            control_comm_idoc    TYPE STANDARD TABLE OF edidc,
            lv_result            TYPE p.
      DATA: lv_matnr             LIKE mast-matnr,
            lv_datuv             TYPE datuv,
            lv_datuv_aenr        TYPE datuv,
            lv_aennr             LIKE stpo-aennr,
            lv_bk_aennr          LIKE stpo-aennr.
      DATA: lt_stpo     TYPE STANDARD TABLE OF stpo,
            ls_stpo     LIKE LINE OF gt_stpo.
      DATA: lv_mescod   LIKE edidc-mescod,
            lv_lines    TYPE i.
      DATA: lv_datv LIKE bapi1080_bom_c-valid_from_date,
            lv_datb LIKE bapi1080_bom_c-valid_from_date,
            wa_von  LIKE sy-datum.
      CHECK p_matnr >< ' '.
      idoc_typ = 'stl'.
      CLEAR: lv_datuv, lv_datv, lv_datb, created_comm_idocs.
    * Datum-Von, Datum-Bis
      SELECT SINGLE datuv FROM stko INTO lv_datuv
             WHERE stlnr = p_stlnr
             AND   stlty = 'M'.
      IF sy-subrc EQ 0.
        lv_datv = lv_datuv.
        lv_datb = lv_datuv.
      ENDIF.
    * Prüfen ob Stückliste existiert (in Zielsysteme)
      PERFORM bom_exist  USING p_matnr
                               lv_datuv
                               lv_datuv
                      CHANGING lg_rcode.
      IF lg_rcode <> 1.
    *   Verarbeitung aller selektierten IDocs
    *    SUBMIT rseout00  USING SELECTION-SET 'BOMMAT'
    *                     AND RETURN.
      ELSE.
    * BOM Versions
    * Creation of all BOM's versions
    *   Output-Konvertierung für Materialnummer
        CALL FUNCTION 'CONVERSION_EXIT_MATN2_INPUT'
          EXPORTING
            input  = p_matnr
          IMPORTING
            output = lv_matnr.
        CLEAR lv_bk_aennr.
    *   Alle Stücklistenänderungen lesen und verteilen
        tab_aen2[] = tab_aen[].
        SORT tab_aen2 BY change_no valid_from.
        DELETE tab_aen2 WHERE bom_no <> p_stlnr.
        DESCRIBE TABLE tab_aen2 LINES lv_lines.
        LOOP AT tab_aen2 INTO wa_aen WHERE change_no <> ''.
          CONCATENATE wa_aen-valid_from+6(4)
                      wa_aen-valid_from+3(2)
                      wa_aen-valid_from(2)
                      INTO wa_von.
          CHECK wa_von              > lv_datuv.
          CHECK lv_bk_aennr        <> wa_aen-change_no.
          MOVE wa_aen-change_no    TO lv_bk_aennr.
          MOVE wa_von              TO lv_datuv_aenr.
    *     ALE Ausgangsverarbeitung Materialstückliste mit Änderung
          CALL FUNCTION 'MASTER_IDOC_CREATE_BOMMAT'
            EXPORTING
              matnr               = lv_matnr
              stlan               = d_bomusage
              datuv               = lv_datuv_aenr
              ale_datuv           = lv_datuv_aenr
              ale_aennr           = wa_aen-change_no
              rcvprn              = receiver_prn
              mescod              = 'CNG'
              smd_tool            = ' '
              message_type        = 'BOMMAT'
            IMPORTING
              created_comm_idocs  = created_comm_idocs
            EXCEPTIONS
              general_bom_failure = 1
              no_bom_found        = 2
              general_ale_failure = 3
              distribution_lock   = 4
              customer_error      = 5
              OTHERS              = 6.
          IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          CASE sy-subrc.
            WHEN 1. MESSAGE i012(29) WITH lv_matnr.
            WHEN 2.
              CONCATENATE lv_matnr '3'
                          INTO msg_txt
                          SEPARATED BY '/'.
              MESSAGE i014(bom) WITH msg_txt sy-datum.
            WHEN 3.
              MESSAGE i303(b1) WITH ''.
            WHEN 4. MESSAGE i015(bom).
          ENDCASE.
          p_rcode = sy-subrc.
          IF created_comm_idocs <> 0 AND p_rcode EQ 0.
            COMMIT WORK.
            CALL FUNCTION 'DEQUEUE_ALL'
              EXCEPTIONS
                OTHERS = 0.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " create_idoc_stueli-historie

Maybe you are looking for

  • In this report i have marked one line..if this width 30,i need to multiply by a number 0.3 and if the width =30,it multiplies by 0.37...how to use this logic here..??? anyone can help??

    In this report i have marked one line..if this width < 30,i need to multiply by a number 0.3 and if the width >=30,it multiplies by 0.37...how to use this logic here..??? anyone can help?? Declare @FromDate Datetime Declare @ToDate Datetime Declare @

  • Passing Parameter from report to form

    I have a report, link, and form developed. They all work just fine execpt that when the form comes up it is not linked to he record that it was called from. I have read the links on passing parameters and still do not understand what I have to do. He

  • Can I use a slimline card in a p6240f

    I am looking to upgrade my card, currently using a pny, Nvidia 6200 gt.  I am having a lot of problems with excess heat.  I was wondering if I could use a slimline card, and if it would help with heat dissipation.  I have a 600 w power supply.

  • Badi IDOC_DATA_MAPPER

    Hi everybody. Im trying to manipulate data of idocs in a implementation of IDOC_DATA_MAPPER: I want to change a field but I can´t get it. Does anyone knows how this badi works to can change the data???? Thanks a lot. Regards

  • Data filter

    I would like to make a suggestion to the development team. Would it be possible to add to the Data Viewer windows a filter to allow a range of data to be selected? Otherwise the usefulness of the tool is limited as potentially thousands/millions of r