Reg: Creation of BOM along with Alternative BOM

Hi Experts,
I have written the below code for creating BOM along with Alternative BOM, I'm getting the following error.
W BAPI1080             028
Error/warning when checking the structure of the BOM group with ID=
A BAPI1080             002
Basic data for (BOM) group available twice
A BAPI                 001
No instance of object type BOMGroup has been created. External reference:
W BAPI1080             028
Error/warning when checking the structure of the BOM group with ID=
A BAPI1080             002
Basic data for (BOM) group available twice
A BAPI                 001
No instance of object type BOMGroup has been created. External reference:
Please find the piece of code below.
  SORT it_bom01 BY matnr idnrk posnr ASCENDING.
  LOOP AT it_bom01 INTO wa_bom01.
    AT NEW matnr.
      CLEAR:
        it_bomgroup[],
        wa_bomgroup,
        it_variants[],
        wa_variants,
        it_items[],
        wa_items,
        it_matrel[],
        wa_matrel,
        it_itemas[],
        wa_itemas,
        it_return.
    ENDAT.
* Material BoM Group Header Data
    wa_bomgroup-bom_group_identification = 'IDENTIFICATION'.
    wa_bomgroup-object_type = 'BGR'.
    wa_bomgroup-object_id = 'ID'.
    wa_bomgroup-bom_usage = wa_bom01-stlan.
    wa_bomgroup-ltxt_lang = sy-langu.
    wa_bomgroup-technical_type = ' '.
*   wa_bomgroup-bom_text = .
    wa_bomgroup-created_in_plant = wa_bom01-werks.
    APPEND wa_bomgroup TO it_bomgroup.
* Header Details of the different variants
    wa_variants-bom_group_identification = 'IDENTIFICATION'.
    wa_variants-object_type = 'BOM'.
    wa_variants-object_id = 'ID'.
    wa_variants-alternative_bom = wa_bom01-stlal.
    wa_variants-bom_status = wa_bom01-stlst.
    wa_variants-base_qty = wa_bom01-bmeng.
    wa_variants-valid_from_date = wa_bom01-datuv.
    wa_variants-alt_text = wa_bom01-alt_text.
    wa_variants-function = 'NEW'.
    APPEND wa_variants TO it_variants.
* Details of the items of the variants
    wa_items-bom_group_identification = 'IDENTIFICATION'.
    wa_items-object_type = 'ITM'.
    wa_items-object_id = 'ID'.
    wa_items-item_no = wa_bom01-posnr.
    wa_items-item_cat = wa_bom01-postp.
    wa_items-component = wa_bom01-idnrk.
    wa_items-comp_qty = wa_bom01-menge.
    wa_items-valid_from_date = wa_bom01-datuv.
    APPEND wa_items TO it_items.
* Details of the materials of the different variants
    CLEAR it_matrel.
    wa_matrel-bom_group_identification = 'IDENTIFICATION'.
    wa_matrel-material = wa_bom01-matnr.
    wa_matrel-plant    = wa_bom01-werks.
    wa_matrel-bom_usage = wa_bom01-stlan.
    wa_matrel-alternative_bom = wa_bom01-stlal.
    APPEND wa_matrel TO it_matrel.
* Linking items to the corresponding variants
    CLEAR it_itemas.
    wa_itemas-bom_group_identification = 'IDENTIFICATION'.
    wa_itemas-sub_object_type = 'ITM'.
    wa_itemas-sub_object_id = 'ID'.
    wa_itemas-super_object_type = 'BOM'.
    wa_itemas-super_object_id = wa_bom01-matnr.
    wa_itemas-valid_from_date = wa_bom01-datuv.
    wa_itemas-function = 'NEW'.
    APPEND wa_itemas TO it_itemas.
    AT END OF matnr.
      CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
        EXPORTING
          all_error         = 'X'
        TABLES
          bomgroup          = it_bomgroup
          variants          = it_variants
          items             = it_items
          materialrelations = it_matrel
          itemassignments   = it_itemas
          return            = it_return.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      LOOP AT it_return.
        WRITE:/ it_return-type, it_return-id, it_return-number,
        it_return-message.
      ENDLOOP.
    ENDAT.
  ENDLOOP.
Thanks and Regards,
Abdur Rafique

Hi Sree,
I used your code, I removed the levels because, i have only one level 'the lineitems'. Please find the modified code below. I'm not able to create the BOM, it throws an error as "BOM is recursive". I checked the header and item contents before passing to FM, it is correct.
Please help me with the solution.
REPORT  zbom_sdn.
TYPE-POOLS: truxs.
DATA: bom_header     LIKE cad_bicsk,
      bom_item       TYPE TABLE OF  cad_bom_item WITH HEADER LINE,
      bom_sub_item   TYPE TABLE OF cssubitem WITH HEADER LINE,
      dms_class_data TYPE TABLE OF cls_charac  WITH HEADER LINE,
      sap_field_data TYPE TABLE OF rfcdmsdata  WITH HEADER LINE,
      e_return       LIKE cad_return-value,
      e_message      LIKE message-msgtx,
      e_message_len  LIKE cad_return-message_len.
DATA v_item  TYPE i.
TYPES : BEGIN OF ty_data,
         matnr TYPE cad_bicsk-matnr," Material
         werks TYPE csap_mbom-werks," Plant
         stlan TYPE csap_mbom-stlan," BOM Usage
         datuv TYPE csap_mbom-datuv," Valid From
*         posnr TYPE stpo_api03-item_no," Item Number
         idnrk TYPE stpo_api03-component," BOM Component
         postp TYPE stpo_api03-item_categ," Item category
         menge TYPE cad_bom_item-menge," Quantity
         bmeng TYPE stko_api01-base_quan," Base Qty
         stlst TYPE stko_api01-bom_status," BOM Status
         stlal TYPE csap_mbom-stlal," Alternative BOM
         alt_text TYPE stko_api01-alt_text," Alternative BOM text
        END OF ty_data.
DATA : it_data TYPE TABLE OF ty_data ,
       wa_data TYPE ty_data.
DATA:   wa_raw TYPE truxs_t_text_data.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
PARAMETER : p_file TYPE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
      program_name  = syst-repid
      dynpro_number = syst-dynnr
    CHANGING
      file_name     = p_file.
START-OF-SELECTION.
  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
       EXPORTING
*       I_FIELD_SEPERATOR          =
         i_line_header              = 'X'
         i_tab_raw_data             = wa_raw     " Work Table
         i_filename                 = p_file
       TABLES
         i_tab_converted_data       = it_data[]  " Actual Table
       EXCEPTIONS
        conversion_failed          = 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.
  CLEAR: bom_header, bom_item, bom_sub_item.
  REFRESH: bom_item, bom_sub_item.
  DATA : v_lineitem TYPE sposn VALUE '0000',
         v_slineitem TYPE sposn VALUE '0'.
  LOOP AT it_data INTO wa_data.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = wa_data-matnr
      IMPORTING
        output = wa_data-matnr.
* fill BOM header
    CLEAR  bom_header.
    bom_header-matnr = wa_data-matnr. "'000000000200000016'.
    bom_header-stlal = wa_data-stlal. " Alternative Bom
    bom_header-werks = wa_data-werks.                       "'1000'.
    bom_header-stlan = wa_data-stlan.                       "'3'.
    bom_header-bmeng = wa_data-bmeng.
    bom_header-cadkz = 'X'.
    bom_header-stktx = wa_data-alt_text.
*      bom_header-ztext = wa_data-text.
    bom_header-datuv = wa_data-datuv."'01.10.2010'.
* fill item
    v_lineitem = v_lineitem + 10.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = v_lineitem
      IMPORTING
        output = v_lineitem.
*    bom_item-upskz     = 'X'.     " If We hav the Sub items Enable it.
    bom_item-idnrk     = wa_data-matnr. "'000000000200000017'.
    bom_item-posnr     = v_lineitem.
    bom_item-postp     = wa_data-postp."'L'.
    bom_item-menge     = wa_data-menge.                     "'1'.
*    bom_item-fmeng     = wa_data-fqty.
    APPEND bom_item.
    CLEAR: bom_item.
    AT END OF matnr.
      CALL FUNCTION 'CAD_CREATE_BOM_WITH_SUB_ITEMS'
           EXPORTING
                i_bom_header   = bom_header
                i_auto_posnr   = ''
           IMPORTING
                e_return       = e_return
                e_message      = e_message
                e_message_len  = e_message_len
                e_bom_header   = bom_header
           TABLES
                bom_item       = bom_item
                bom_sub_item   = bom_sub_item
                dms_class_data = dms_class_data
                sap_field_data = sap_field_data
           EXCEPTIONS
                 OTHERS         = 1.
      REFRESH bom_item.
      WRITE : e_message.
    ENDAT.
    CLEAR wa_data.
  ENDLOOP.
Thanks and Regards,
Abdur Rafique

Similar Messages

  • BOM Report with Alternative Items

    Hello Experts,
    I am trying to write a query of BOM Report with the first Alternative Item (from OALI)
    Your help please..
    Thank You
    Meitalmo

    Then what is this report using for? Check this to start:
    SELECT T0.Father, CASE WHEN T1.OrigItem IS NULL THEN T0.Code ELSE T1.AltItem END as 'Item No.', Case WHEN T1.OrigItem IS NULL THEN T2.ItemName ELSE T3.ItemName END 'Item Description'
    FROM dbo.ITT1 T0
    LEFT JOIN dbo.OALI T1 ON T1.OrigItem = T0.Code
    LEFT JOIN dbo.OITM T2 ON T2.ItemCode = T0.Code
    LEFT JOIN dbo.OITM T3 ON T3.ItemCode = T1.AltItem
    WHERE T0.Father = '[%0\]'

  • Standard BOM with Alternative BOM

    Dear Experts,
    We are having a requirement of comparing Standard BOM with actual material consumption. We got Actual consumption. When we were trying to get the standard BOM component, standard Data source is not available. Then we searched in SDN and they are recommending to go with view option. We have created view with MAST,STKO and STPO tables. This view is not working when a plant is having alternative BOM. Further research on SDN reveals that we can use CSAP_MAT_BOM_READ functional module. When we executed this functional module, it is giving the standard BOM components and its Base Quantity. But we were not able to create Generic data source with this functional module.
    The requirement is urgent. Please help me with your experience.
    With Regards,
    Balachander.S

    when we were joining MAST, STKO and STPO, the alternative BOM was not taking care. Then we have linked STAS. It was sloved.
    With Regards,
    Balachander.S

  • Costing run for a material with alternative BOM

    Hi Friends,
    My requirement is to have product costing for a material with 3 different BOMs, in CK11N i can change the alternative BOM number to have costing run for 3 differesnt boms, but in ck24 how to proceed, My client requirement is such that the standard price should be the average price of the costing run from 3 different boms, and they are not interested in manual price change in MR21
    Regards,
    Arun Kumar R V

    Hi Arun,
    You can have a Standard cost estimate based on only one of the alternative BOM and Routing. This alternative is selected based on the business ie., whichever alternative is generally used in production frequently. This will be the std cost and whenever you do the production using the other alternatives, the difference in cost will be captured as Variance.
    There is no option of having average or cost estimate for each alternative at the same time.
    There is absolutely no use in maintaining price in MR21 for an in house produced material, since during Prod Order process the planned costs will be arrived at based on the quantity structure of BOM & Route only.
    Thanks & Regards,
    Vijaya Bhaskar A
    Edited by: Vijaya Bhaskar A on Jan 7, 2009 8:57 AM

  • Alternative BOM No Deletion

    Hi,
    I have one scenario in which previously there were 2 BOM's available for single material, i.e.
    1) 01
    2) 02
    After some days, first BOM was deleted by the user and when we try to see BOM detail using CS03
    by entering
    Material = XXX
    Plant = XXX
    BOM Usage = 1
    Alternative BOM = 02
    Then it gives BOM details but when we enter
    Material = XXX
    Plant = XXX
    BOM Usage = 1
    Alternative BOM = 01
    It gives Error Message "Inconsistent data (inform your system manager)" even though BOM does not exist
    So what is the solution for removing this above Error message

    Hi,
        As suresh said you need to delete the alternate 1 in the header level. After that if you want change that alternate 2 as1, Then again go to create mode and you can create the alternate 1 with the same components of alternate2. After that you can delete the header level of alternate 2 also. So that there will be only one alternate BOM for your material.
    Hope it will be helpful.
    Regards,
    Vijay.

  • Component Allocation LSMW not working for materials having alternative BOMs

    Hi Experts,
    I have a requirement in Component allocation LSMW.
    Component Allocation LSMW was created using a material which do not have an alternative BOM and the LSMW NOT working for materials having alternative BOMs. Currently iam using Batch Input Recording method in LSMW.Can any one suggest me is it possible by recording method in Lsmw. Because in transaction CA02 when we click the CompAlloc button in application tool bar we get a pop up screen with alternative BOM's, we have to choose any of them. If we choose any of the alternatie BOM in the pop up screen then it will be fixed always, but depending upon my flat file value of alternate BOM i need to pick the value. It is not static.
    Can any one suggest me is there any BAPI for this requirement.
    Your hel will be greatly appreciated.
    Thanks & Regards,
    Venkat.

    Use BDC instead of LSMW, that will solve your problem.

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

  • Alternative BOM creation problem in CS01

    Hi.
    I have created a BOM with CS01 with list of components. Now i want to create an alternative BOM for the same FG.
    When I am trying to create alternative BOM using CS01, I added the components, system is showing me in the header as Alternative BOM 2. But when i try to save this BOM system is giving me the error as "Alternative BOM cannot be created for this material".
    Can you please help me how to create alternative BOM for this FG.
    Regards,
    Padmavathi

    Dear Padma,
    If my understanding is correct,if the check box for multiple BOM inactive is set in OS27 means,you will not be allowed to even
    enter into the BOM item maintenance screen.
    It seems the system is allowing you to enter the second alternative BOM,but at the time of save the system is blocking from
    doing so.check what's the message and check whether by means of exit this check has been incorporated in the system.
    Check and revert back.
    Regards
    Mangalraj.S

  • Reg. Alternative BOM

    Hi All,
    I see few Alternative BOM has number as '0'. As I understand when we create alternative BOM for an Material by default it will take the Alt. BOM number as 01 for the first time. But here i notice few material has alternate bom number as 0. How it could got created? Even when we create BOM via LSMW also it will pick Alt. BOM as 01.
    Am I able to edit those Alt. BOM numbers? or How do we eliminate this in future?
    Please throw some lights.
    Regards,
    MBN.

    Hi
    While creating BOM with T code CS01, in alternate BOM if you give input as 0 for first alternate BOM system starts creating alternative BOM with Alt 0, Alt 1 etc.
    Or else if you leave blank that field then system will pick 1 as first alternate bom.
    Regards,
    Anupam Sharma

  • Process order creation with out BOM

    Hi
    I have an requirement...
    material A is finished good
    i create process order for material A
    but i dont use BOM... with out BOM can i create process order .
    after creating process order cani isuue components against  order ? is it possible please can any one help me in this issue
    but one condition : i craet process order material A 10 KG
    for this FG i used components  materia A used 8 kg  and material B used 2 kg
    is it possibel pls..could any one gude me in this issue
    Regards
    Sesi

    material A is finished good
    i create process order for material A
    but i dont use BOM... with out BOM can i create process order .
    yes, You can create a orderwith out BOM
    after creating process order cani isuue components against  order ? is it possible please can any one help me in this issue
    Yes, You can assign component  manually in component overview screen  or you can issue material directly for order with 261 movement, It will go to unplanned consumption
    but one condition : i craet process order material A 10 KG*
    for this FG i used components  materia A used 8 kg  and material B used 2 kg
    In The component overview screen of process order  assign the Material A with 8 kg ,
    & material B as 2 KG
    Regards,
    Sundaresan
    Edited by: Sundaresan . E. V on Oct 4, 2010 2:41 PM

  • How can I select alternative BOM when creating subcontract purchase order?

    In our business, a finish good material always has different production versions at the same time. Each of production versions has its own alternative BOM. When I create a planned order, I can select wanted BOM through specifying production version.
    But, when I creating subcontract purchase order, there is no field for me to specify the production version or which alternative BOM I prefer. In this case, I need to create a planned order at first. And then, convert the planned order to purchase. Only through this way, I can create a subcontract purchase order with my wanted BOM.
    So, I wonder if there is any way to select alternative BOM directly when creating subcontract purchase order.
    Thanks a lot!
    Regards
    Robbie

    Dear Mr. MM
    can you give me additional information about your solution?
    BUT I would not expect the sytem to offer you during the Purchasing cycle the different Production Versions as it is not meant to be. I remember having the same requirement some time ago and we solved it the way I described above, additionally we created a Pop up window with a user exit during the PO creation which offered the different production versions and if the one linked with the quota arrangement, the standard PV, is used in the PO.
    We also have the same problem, we activated businessfunction SCM_GEN_02 so that it is possible to have several production versions for one supplier, but unfortunatly it is not possible to change the production version in the purchase order. (business function does not seem to be very integrated)
    So i would be very interested in your solution because acually it seems that i have to modify the sap standard.
    Thank you and best regards
    Lisa

  • How to change the header of Material BOM in a program for alternative BOM ?

    Requirement: An Inbound IDOC creates /change/delete Alternative Material BOM. The Alternative Material BOM can have alternative values from 1 to 99.
    ISSUE: I am good with CREATE and DELETE BOM. The issue is with CHANGE of header Material BOM. The fields which we need to change in the header is the base quantity, BOM status, Lot Size from and Lot Size to. Please note that I am able to change the item details of the BOM with FM CSAI_BOM_MAINTAIN. I find no FM /BAPI which would change the header of a material BOM.
    Please NOTE that I am using BAPI_MATERIAL_BOM_GROUP_CREATE to create alternative Material BOM. This has a parameter in TABLES called "VARIANTS" which has a field CS_FUNCTION which can have value from NEW/CHG/DEL .Also ,there is another parameter in TABLES called "ITEMASSIGNMENTS" which has a field CS_FUNCTION which can have value from NEW/CHG/DEL which implies this FM will allow us to change the BOM. But this does not work when I use it for CHANGE scenario with CHG value. I debugged this BAPI and observed it requires a STNLR(Bill of Material) value . This field is not there in any of the structure. I am not sure if I am passing the right parameters to it.
    Let me know if the parameters are passed correctly for CHANGE scenario.
    Also let me know if there is any other way(FM/BAPI)  to update the Header of the Material BOM ?
    Here is the code I am using:
    *& Report  ZTEST_S_E
    REPORT  ZTEST_S_E.
    * This code will create a material BoM for the material
    * MAINMATERIAL with the components COMPON1 and COMPON2.
    * Data Declaration
    DATA:
    it_bomgroup LIKE bapi1080_bgr_c OCCURS 0 WITH HEADER LINE,
    it_variants LIKE bapi1080_bom_c OCCURS 0 WITH HEADER LINE,
    it_items LIKE bapi1080_itm_c OCCURS 0 WITH HEADER LINE,
    it_matrel LIKE bapi1080_mbm_c OCCURS 0 WITH HEADER LINE,
    it_itemas LIKE bapi1080_rel_itm_bom_c OCCURS 0 WITH HEADER LINE,
    it_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    * Fill the data
    * Material BoM Group Header Data
    CLEAR it_bomgroup.
    it_bomgroup-bom_group_identification = 'BAPI_SMP_COL1'.
    it_bomgroup-object_type = 'BOM'.
    it_bomgroup-object_id = 'SIMPLE1'.
    it_bomgroup-bom_usage = '1'. " YOU COULD CHANGE THE BOM USAGE TO YOUR
    *NEEDS
    it_bomgroup-ltxt_lang = sy-langu.
    it_bomgroup-technical_type = ' '.
    it_bomgroup-bom_text = 'Simple BoM - FM'.
    APPEND it_bomgroup.
    * Header Details of the different variants
    CLEAR it_variants.
    it_variants-CHANGE_NO  = '500000000349'.
    it_variants-bom_group_identification = 'BAPI_SMP_COL1'.
    it_variants-object_type = 'BOM'.
    it_variants-object_id = 'SIMPLE1'.
    it_variants-alternative_bom = '01'.
    it_variants-bom_status = '01'.
    it_variants-base_qty = '2.000'.
    it_variants-valid_from_date = sy-datum.
    it_variants-function = 'CHG'.
    APPEND it_variants.
    * Details of the items of the variants
    CLEAR it_items.
    it_items-bom_group_identification = 'BAPI_SMP_COL1'.
    it_items-object_type = 'ITM'.
    it_items-object_id = 'SIMPLE1'.
    it_items-item_no = '0010'.
    it_items-item_cat = 'L'.
    it_items-component = '030790490'.
    it_items-comp_qty = '2'.
    it_items-valid_from_date = sy-datum.
    APPEND it_items.
    CLEAR it_items.
    it_items-bom_group_identification = 'BAPI_SMP_COL1'.
    it_items-object_type = 'ITM'.
    it_items-object_id = 'SIMPLE1'.
    it_itemas-change_no = '500000000138'.
    it_items-item_no = '0020'.
    it_items-item_cat = 'L'.
    it_items-component = '030790490'.
    it_items-comp_qty = '3'.
    it_items-valid_from_date = sy-datum.
    APPEND it_items.
    * Details of the materials of the different variants
    CLEAR it_matrel.
    it_matrel-bom_group_identification = 'BAPI_SMP_COL1'.
    it_matrel-material = '030790490'.
    it_matrel-bom_usage = '1'.
    it_matrel-alternative_bom = '01'.
    APPEND it_matrel.
    * Linking items to the corresponding variants
    CLEAR it_itemas.
    it_itemas-bom_group_identification = 'BAPI_SMP_COL1'.
    it_itemas-sub_object_type = 'ITM'.
    it_itemas-sub_object_id = 'SIMPLE1'.
    it_itemas-super_object_type = 'BOM'.
    it_itemas-super_object_id = 'SIMPLE1'.
    it_itemas-valid_from_date = sy-datum.
    it_itemas-function = 'CHG'.
    APPEND it_itemas.
    * Create variants
    CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
    EXPORTING
    all_error = 'X'
    TABLES
    bomgroup = it_bomgroup
    variants = it_variants
    items = it_items
    materialrelations = it_matrel
    itemassignments = it_itemas
    return = it_return.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    LOOP AT it_return.
    WRITE:/ it_return-type, it_return-id, it_return-number,
    it_return-message.
    ENDLOOP.
    Let me know if the parameters are passed correctly for CHANGE scenario.
    Also let me know if there is any other way(FM/BAPI)  to update the Header of the Material BOM ?

    Try doing something like this:
    class MyJTextArea extends JTextArea {
        public boolean keyDown(Event evt,int key) {
            if(key == 13 || key == 10) { // or whatever ascii codes enter may have
                // move carret to next line
            } else {
                super.keyDown(evt, key);
    }which means you have got to catch the enter-key before the actutal JTextArea does this.
    p.s. look at my post, maybe you can help me, too.
    http://forum.java.sun.com/thread.jsp?forum=5&thread=465803&tstart=0&trange=100

  • 3rd Part Dropship Scenario with Sales BOM

    Hi
    We have a 3rd Party Dropshipment scenario with Sales BOM with susequent Debit
    Characteristics of Sales BOM
    Sales BOM is created
    Header Material is Valuated but non-inventorised (Accounting and costing view should exist)
    Component Material is Valuated and inventorised
    In Sales order, Pricing is done at the header material not at the components level
    During Billing we get the COGS for the header material (cost coming from VPRS)
    No VPRS exist at component level instead we have copy of VPRS just to capture the value in COPA for our reporting
    Process
    1. Sales Order created with Sales BOM exploded in sales order.
    2. At the Item level Purchase requisition is created.
    3. PR for the components is converted to PO
    4. Vendor Delivers the components to Customer.
    5. Statistical GR done in our system.
    6. Invoicing is done in MIRO
    7. We directly do the Billing. Billing is created at header level. Revenue and COGS is reported at Header level only.
    We are stuck when we are doing the Subsequent Debit (can be for any unplanned cost). For Susequent Debit we are not able to report differential COPA at header level.
    Normally whenever you do subsequent debit in case of 3rd party dropship for normal material, COPA document automatically attached to Billing. This is happening because of the behaviour of VPRS condition type. In our case VPRS only exists at header level and not at component level but replenishment is for components. Subsequent debit is also happening at component level. We need it to be reported at header level.
    We need some solution to this.
    Please advise
    Regards
    Neeraj
    Edited by: NEERAJ BHARDWAJ on Dec 2, 2011 5:12 AM

    Hi Raj,
    Please clarified your requirement here, you mention that you wanted to valuated COGS at actual cost of PO? That sound more like actual costing here and what is the reason for this requirement?
    Is this MTO with variant configuration?
    If this is MTO with VC, Yes - we do cost Sales Order and here is the brief steps:-
    Price Control S
    a) Sales Order Creation - Normally when you save this will be costed and marked automatically. Note that condition type EK02 will represent the cost here
    b) Run MRP based on Sales Order requirement which resulting planned orders, PR, etc
    c) Convert PR-PO, Planned Order -> Production Order
    d) Confirmations, GR on PO which valuated according to the SCE Costing in step a)
    e) PGI will be based on the GR value on step d) which is also your SCE Costing
    f) Any variance between PO and SCE need to be settle.
    Thanks,
    Ong Yang Lim

  • Critical Issue: Availabilty check & alternative BOM selction issue

    During the upgradation project I'm working facing the following critical issues:
    1)While creating the sales order, system carries out the availability check in APO.In material master checking group Z5 is defined.
        Actually I want to know hw the system carries out the search in APO & what are the settings in R/3 or APO we have to make?
    2)Suppose there are 3 alternative BOM's of a finished product.A requirement is while creating the sales order availabilty check should be carried out & system should check the availability of components on the required date.If the component is not avalable system should go & check the second alternative...third alternative until it gets the confirmation of component availability.
         How we can set this functionality & what are the prerequisites or customisation settings we needs to make?
        Would appreciate providing your inputs on this critical issue.
    Thanks,
    Nilesh<b></b>

    Before you understand how the APO Availability Checking concept works, I would suggest you understand about the regular R3 availability checking. As this is the core for the SD and APO GATP. Refer help.sap.com
    Question 1:
    <b>Settings in R3:</b> You have the ATP integration model in CFM1 transaction. You need to activate this just one time and never again. what this does is basically transfer all your availability checking customizing to APO.
    All the settings for the Availability Checking group ( Z5, etc) are already maintained in R3 and they get transferred to APO by the integration model. You donot need to anything else.
    <b>Settings in APO:</b>
    If you are using <b>Product Allocation Concept</b>, You have to maintain the Check Instructions.... Otherwise there are no other settings in APO
    <b>Availability Check in APO :</b>
    ( see the following blog for the requirements class( Name in R3) or check mode( Name in APO) determination http://solution-timezone-issue.blogspot.com/ )
    The check mode and the business event( These are hardcode internally in R3 - For SD- A) are determined from the order and based on this in APO it follows the following order
    (1) Reads the check instructions settings in APO
    For example say the following have been determined from the SD Order : Check Mode 041 and  Business Event A
    Say we have maintained in APO that the first step is Availability Check and all the other two steps we havent maintained or left blank ( Product Allocation and Forecast)
    Look for the customizing in APO
    SPRO>APO>GATP>General Settings>Maintain Check Instructions ****
    (2) Carries out availability Checking same as in R3 and no different
    From the masterial master considers the availability checking group ( Ex: Z1) and the business event( SD transactions- A)
    Very Important and the core of availability checking which is similar in R3 and APO***
    Against these 2 combinations, the settings are checked which define what stock and in/outward movements are to be considered during the availability check
    For customzing settings in APO
    SPRO>APO>GATP>Maintain Check Control>
       For Customizing in R3
    SPRO>Sales and Distribution>Basic Functions>Availability Check and transfer of requirements>Availability check with ATP logic or planning>Carry out control for availability check
    This is the answer to your first question.
    Your second question would need some time  and I will try to answer it as well.
    Hope this helps you..

  • To display flatfile rec's under 1 Alternative BOM using BDc recording.

    Hi,
    I m trying to display flat file entire(i.e.. 4 rec's i m using) records vertically under one (Alternative BOM) for CS01-BOM using BDC recording method.
    Now i m tried with the following code,i m getting as one (Alternative BOM) for one ff record,by replacing one by one.
    But i want as vertically under one (Alternative BOM).
    Can anyone help me to overcome this.
    report ZBOM
    no standard page heading line-size 255.
    *include bdcrecx1.
    DATA: BEGIN OF bdc OCCURS 0,
    matnr(18),
    werks(4),
    stlan(1),
    END OF BDC.
    DATA: BEGIN OF BDC1 OCCURS 0,
    idnrk(18),
    MENGE(18),
    MEINS(3),
    postp(1),
    posnr(4),
    END OF bdc1.
    DATA: BEGIN OF BDCDATA OCCURS 0,
    matnr(18),
    werks(4),
    stlan(1),
    idnrk(18),
    MENGE(18),
    MEINS(3),
    postp(1),
    posnr(4),
    END OF BDCDATA.
    data ibdcdata type standard table of bdcdata WITH header line.
    *start-of-selection.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    FILENAME = 'C:\Documents and Settings\dilipkumar.b\Desktop\soft.txt'
    FILETYPE = 'ASC'
    HAS_FIELD_SEPARATOR = ','
    HEADER_LENGTH = 0
    READ_BY_LINE = 'X'
    DAT_MODE = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    CHECK_BOM = ' '
    VIRUS_SCAN_PROFILE =
    NO_AUTH_CHECK = ' '
    IMPORTING
    FILELENGTH =
    HEADER =
    TABLES
    DATA_TAB = BDCDATA
    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.
    *perform open_group.
    loop at bdcdata.
    perform bdc_dynpro using 'SAPLCSDI' '0100'.
    perform bdc_field using 'BDC_CURSOR'
    'RC29N-STLAN'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RC29N-MATNR'
    'SOFTDRINKS'.
    perform bdc_field using 'RC29N-WERKS'
    'WIND'.
    perform bdc_field using 'RC29N-STLAN'
    '1'.
    perform bdc_field using 'RC29N-DATUV'
    '16.09.2008'.
    perform bdc_dynpro using 'SAPLCSDI' '0110'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RC29K-BMENG'
    '1'.
    perform bdc_field using 'RC29K-STLST'
    '1'.
    perform bdc_field using 'BDC_CURSOR'
    'RC29K-EXSTL'.
    perform bdc_dynpro using 'SAPLCSDI' '0111'.
    perform bdc_field using 'BDC_CURSOR'
    'RC29K-LABOR'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_dynpro using 'SAPLCSDI' '0140'.
    perform bdc_field using 'BDC_CURSOR'
    'RC29P-POSTP(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=FCBU'.
    perform bdc_field using 'RC29P-IDNRK(001)'
    BDCDATA-IDNRK.
    perform bdc_field using 'RC29P-MENGE(001)'
    BDCDATA-MENGE.
    perform bdc_field using 'RC29P-MEINS(001)'
    BDCDATA-MEINS.
    perform bdc_field using 'RC29P-POSTP(001)'
    BDCDATA-POSTP.
    perform bdc_dynpro using 'SAPLCSDI' '0130'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'BDC_CURSOR'
    'RC29P-POSNR'.
    perform bdc_field using 'RC29P-POSNR'
    BDCDATA-POSNR. "'0010'.
    perform bdc_field using 'RC29P-IDNRK'
    BDCDATA-IDNRK. "'15'.
    perform bdc_field using 'RC29P-MENGE'
    BDCDATA-MENGE. "'1'.
    perform bdc_field using 'RC29P-MEINS'
    BDCDATA-MEINS. "'ml'.
    perform bdc_dynpro using 'SAPLCSDI' '0131'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'BDC_CURSOR'
    'RC29P-POTX1'.
    perform bdc_field using 'RC29P-SANKA'
    'X'.
    *perform bdc_transaction using 'CS01'.
    *perform close_group.
    CALL TRANSACTION 'CS01' USING IBDCDATA MODE 'A' UPDATE 'S'.
    REFRESH IBDCDATA.
    clear ibdcdata.
    endloop.
    Start new screen *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
    CLEAR iBDCDATA.
    iBDCDATA-PROGRAM = PROGRAM.
    iBDCDATA-DYNPRO = DYNPRO.
    iBDCDATA-DYNBEGIN = 'X'.
    APPEND ibDCDATA .
    ENDFORM.
    Insert field *
    FORM BDC_FIELD USING FNAM FVAL.
    IF FVAL NODATA.
    CLEAR iBDCDATA.
    iBDCDATA-FNAM = FNAM.
    iBDCDATA-FVAL = FVAL.
    APPEND iBDCDATA .
    ENDIF.
    ENDFORM.

    Hi Dilip,
    Please change your code.
    I request you to please go through BDC tutorials before even starting to write the program.
    There are many online tutorials which can help you with.
    Also, search in SDN.. there you will get more than thousand results.. with the search term BDC.
    Take this suggestion seriously before nayone reports the moderators that u have been posting this thread daily without taking into consideration the previous replies.
    Regards,
    Vishwa.

Maybe you are looking for

  • Problem accessing variables in loaded Captivate swfs when run locally

    I'm loading Captivate 3 swfs into a custom Flash player. Here is pseudocode that just gets to the point: var cp1_mc:MovieClip = this.createEmptyMovieClip("cp1_mc", 1); cp1_mc.loadMovie("captivate1.swf"); [wait for (cp1_mc.rdcmndGotoSlide != undefined

  • Configuring RMAN for dataguard.

    Hi all, Here we have a dataguard environment with db1(db_unique_name) as primary and db2(db_unique_name) as physical standby database. For both primary and secondary the ORACLE_SID is 'oracledb'.We configured dataguard in 10g environments and we are

  • Document Class with Flash Lite 4.0

    I'm developing for Flash Lite (4.0) for the first time and I see that in the properties panel the Document Class section is grayed out. Does this mean that Flash Lite doesn't utilize a Document Class? If so, am I unable to use any external classes? I

  • Xcelsius - Bex Query

    Hi all, How can create Dashboards by using SAP Bex Query (without using universe ) How can get SAP Netweaver BI Connection type in Xcelsius

  • Restart numbers after previous level CS5

    I have several books with numbered lists in embedded text box sidebars. In each of the sidebars, I have the numbered lists set up as a level 2 numbered list set to restart the numbers after any previous level and the heading, which comes right before