Modifying batch characteristics value

Dear Experts,
We have created batch characteristics named 'POTENCY','LOD','ASSAY'.
Now the value of POTENCY is calculated based on the formula, that is LOD * ASSAY. There are chances that the value is sometimes calculated more than 100%. Now I want to put a restriction that if the value increases more than 100 than the value of POTENCY should be automatically be 100.
What should I do to resolve this issue.
NOTE - POINTS WILL BE REWARDED.......

Hello,
You can write a specific FM called by the configurator (procedure which call a user FM). Input are your LOD andd ASSAY, output is POTENCY. Inside you can write your formula.
Parameters are given by std tables.
This is sample :
FUNCTION zsca_calcul.
*"  IMPORTING
*"     VALUE(GLOBALS) TYPE  CUOV_00
*"  TABLES
*"      MATCH STRUCTURE  CUOV_01
*"      QUERY STRUCTURE  CUOV_01
*"  EXCEPTIONS
*"      FAIL
*"      INTERNAL_ERROR
DATA : w_met_cmin_r  LIKE cuov_01-atflv.
  CLEAR : w_matnr_paracheve, w_instance .
  BREAK-POINT.
lecture des données en entrée dans la table query
  LOOP AT query WHERE atcio = 'I'.   "input parameter
vérification type num
    IF query-atfor NE 'CHAR'.
     MESSAGE ID 'ZSCA_CONFIGURATEUR' TYPE 'W' NUMBER '000' RAISING fail
    ENDIF.
    CASE query-varnam.
      WHEN  'MET_NUMART_MLAZ'. ' my single input characteristic
        w_matnr_paracheve = query-atwrt.
        PERFORM lire_mara.  ' process the input parameter
        PERFORM lire_carac.
      WHEN OTHERS..
     MESSAGE ID 'ZSCA_CONFIGURATEUR' TYPE 'W' NUMBER '000' RAISING fail.
    ENDCASE.
  ENDLOOP.
update of the output characteristic MET_CODEMAT (it is numeric and contains value 9
  READ TABLE query WITH KEY varnam = 'MET_CODEMAT'.
  match = query.
  match-atfor = 'NUM'.
  match-atflv = 9.
  APPEND match.
ENDFUNCTION.
Regards.

Similar Messages

  • Copying Batch Characteristics Value from Standard SAP Table Field

    Dear Experts,
    1. While creating a user-defined Batch Characteristics 'CREATED_BY' using ct04,  on the Additional Data tab, I filled  the following fields as follows:  Table Name = MCHA,  Field Name =ERNAM.
    'CREATED_BY' was then assigned to a batch Class TRIMMED (of class type 022).
    TRIMMED  was assigned to a batch managed material ADE245DD.     
    After posting co15 (confirmation of production order) for material ADE245DD, the value in table MCHA & field ERNAM is automatically copied into the Batch Characteristics value field of u2018CREATED_BYu2019  for the generated batch.
    2. But I am unable to achieve the same result when I create another Batch Characteristic with similar settings in the Additional Data tab as follows: Table Name = MARC, Field Name = DISPO.
    After doing co15, the value stored in table MARC and field DISPO does not get copied into the Batch Characteristics value.
    Please what do I need to do in Scenario 2 above to achieve the same result as in Scenario1?
    Regards

    Hi,
    Table and field used in additional data table should be related to the object than only it will work, for e.g. MCHA and ERDAT will work if you create a characteristcis and assign it to class type Batch (022/023) because MCHA table has Batch no. as primary key,
    this implies for using material specific table e.g. MARA , you should use characteristics with class type 001 (Material class) , try using with table MARC also
    Cheers
    Dheeraj

  • Batch Characteristics value in report

    I want to develop a custom report where material master batch characteristics value should be displayed.
    The report will display based on Process order No. In Process order AFPO table I am bringing MATNR, CHARG, WERKS information.
    Now, the MATNR is maintained with a batch classification of class type 001 (material class) one characteristic "Z_NUMERIC" and value is maintained as "22345".
    Now, in custom report I have to bring the 22345 no. In which Table I can get the information for material for 001 class type characteristics value?
    Please repond.

    You can find it in table ausp
    Regards,
    Dhaval

  • Copy of Batch characteristics value from material master to Batch

    Hi Gurus,
    I have maintained some values in the characteristics under batch classification in material master and want to copy the values in batch characteristics during batch creation at process order release.
    Can any one help me to achieve this in standard way?
    Thanks
    Sandip

    Hi,
    Try to understand the batch classification functionality...In batch classification characteristic values changes from batch to batch...Values should not be maintained in the material master...it does not have any meaning...in the material master we need to assign only the batch class with class type 023 in classification view ...no need to assign the values there....Batch classification means characteristics values differs from batch to batch...
    Thanks
    Kumar 

  • Populating Batch Characteristics values in MIGO

    Dear All,
    I have a requirement to populate MIGO Quantity in one of the Characteristic of the batch. If this is not possible then i need to check whethere that characteristic value and MIGO Quantity for Each item are same or not ....
    I have got certain exit EXIT_SAPMM07M_004...But this exit is not getting called .. I have put break point and checked but not working.
    Can you please help me out in this exit or if you have any other place where i can put my checks.
    Regards
    Bhavin

    Hello,
    You can try with the following BADIs.
    These may be helpful for your requirement.
    MB_QUAN_CHECK_BADI
    MB_CHECK_LINE_BADI
    MB_STOR_LOC_BADI_GTS
    DERIVATION
    Regards
    Arindam

  • Same Batch Number with different characteristics value

    Dear Gurus,
    I have the following scenerio:
    The finished goods should be maintain in batch with external number  and at the time of confirming the finished goods in co11n the client want to capture the finished goods value like length, width and diameter.
    So we propose the batch characteristics with class type of 022 for finished good and we maintain the character as length, width and diameter under the batch class 022 and assign the batch class in finished good classification view.
    Now the requirement is we want to capture the batch characteristics value length width and diameter with same batch number for multiple confirmation.
    Example:
    Confirmation      Batch number               batch Class               Length     width     Diameter
    1                        1000                              022                              100        50             20
    2                        1000                              022                              120        25             10
    3                        1000                              022                              150        70             30  
    Now at present we are trying to capture the batch characteristics with same batch number but our standard system will not allow to maintain the different batch characteristics value under same batch number. If we overrite the batch characteristics in msc2n transaction the last value maintained be copied to all batch number. but we want same batch number with different batch characteristics value.
    Please share your idea and try to solve..
    Regards,
    Vimal

    Dear Vimal,
    It is not possible to maintain multiple batch characteristics in one batch.
    Work around is to create original batches and assign to your production order.  During CO11N, generate one batch per confirmation.  There is a report in batch information cockpit to link between original batch and batch per confirmation. 
    Rgrds,

  • From which table characteristics value is been picked in Batch(023 class)

    Hi gurus,
    Could anyone helpme out of this problem
    While creating migo ,batch no gets automatically assigned for the material when I click on the check button and then clicking the classification screen , characteristics value have to be given manually for the material  that is to be receipt in migo.
    Now My problem is I am creating a report where the material no along with the batch no and the characteristics value of the batch is required , but I cannot get the table name
    I have tried with mcha,mch2,mch1 but here no characteristics value could be derived ,Table  Cawn,cabn is there but how to link with other tables like mseg or MKPF.
    In table AUSP characteristics value is picking but same problem how to link it with mseg or mkpf etc.
    Guys please help me out of this.
    Thanks N regrds,
    Siddhrtha

    Hi
    CABN Characteristics ( o.a. batch/vendor)
    CABNT Characteristics description
    CAWN Characteristics ( o.a. material)
    CAWNT Characteristics description
    AUSP Characteristic Values
    Class types and objects :TCLAO Several class types for object
    TCLA Class types ( vb. lfa1 => v10 en 010)
    TCLAT Class type text
    TCLT Classifiable objects
    TCLC Classification status
    Regards

  • From which table characteristics value of Batch management is been picked

    Hi gurus,
    Could anyone helpme out of this problem
    While creating migo ,batch no gets automatically assigned for the material when I click on the check button and then clicking the classification button , there characteristics value have to be given manually for the material  that is to be receipt in migo.
    Now My problem is I am creating a report where the material no along with the batch no and the characteristics value of the batch is required , but I cannot get the table name
    I have tried with mcha,mch2,mch1 but here no characteristics value could be derived ,Table  Cawn,cabn is there but how to link with other tables like mseg or MKPF.
    In table AUSP characteristics value is picking but same problem how to link it with mseg or mkpf etc.
    Guys please help me out of this.
    Thanks N regrds,
    Siddhrtha

    Hi Merwyn,
    I cannot  find any common field between AUSP and  MCH1 ,could you tell me the procedure to link these 2 tables.
    Thanks N Regards
    Siddhartha Chatterjee
    Hi,
    Using AUSP table pick the object No. and link it with MCH1 to find the Batch No.
    using the batch No. link to MSEG-CHARG

  • Assigning of characteristics value for a batch

    Hi All,
    Please help regarding the assigning of characteristics value for a batch in transaction code MSC2N or MSC2 in the classification tab.
    If Function modules or BAPI is available pls advise the inputs to be provided for the function modules.
    Here is one function module which i searched, but if i run this function module, i am not able to commit my characteristics value.
    The function module is CIF_BATCHCHAR_MAP.
    For the above function module the inputs which i have given are...
    Material number
    Batch
    Plant
    Class type
    Class Number
    Characteristics name
    Characteristics value
    Expecting your earliest reply.
    Thanks,
    G.C.Arravind Kumar Vikram

    Try the code below
    *.1 create key
      it_objects-key_field = 'MATNR'.
      it_objects-value_int = matnr.
      APPEND it_objects.
      it_objects-key_field = 'CHARG'.
      it_objects-value_int = charge.
      APPEND it_objects.
      CLEAR l_objectkey.
      CALL FUNCTION 'BAPI_OBJCL_CONCATENATEKEY'
        EXPORTING
          objecttable    = 'MCH1'
        IMPORTING
          objectkey_conc = l_objectkey
        TABLES
          objectkeytable = it_objects
          return         = it_return2.
    2 fill it_num it_char it_curr with values
    3 change characteristics
    CALL FUNCTION 'BAPI_OBJCL_CHANGE'
        EXPORTING
          objectkey          = l_objectkey
          objecttable        = 'MCH1'
          classnum           = it_class-classnum
          classtype          = '023'
        TABLES
          allocvaluesnumnew  = it_num
          allocvaluescharnew = it_char
          allocvaluescurrnew = it_curr
          return             = it_return.

  • How to show the Characteristics Values of Batch appear upon Search?

    Dear all
    We are implementing SAP for Wood Industry.
    Facts:
    1. There are 3 batches created for the raw material.
    2. Each batch has the characteristics of Thickness, Width, Length with characteristics value  24mm, 140mm, 1530mm
    3. 1 Production Order has been create to produce raw material (RM) to semifinised goods (SM).
    Quetions:
    During GI to Produciton Order using MVT 261, when we try to select batches from the Item Detail level, the pop up search windows only show us the existing 3 Batch Numbers available for the RM, it does not show the characteristics value "thickness, Width, length" that describe each batch.
    And this has caused serious problem to use during their selection of batch as batch number will only make more sense to them if it is shown together with the characteristics value.
    Apart of opening additional screen to show the batch information of each batch, is there any config I need to do to solve this situation?
    Mark will be given handsomely.
    Thanks.

    Hi,
    it is possible to use another search help (Tab Strip: Search for batches via classes, when you press F4 in the batch field).
    Here you have to enter the class number first.
    Then you get a list of all characteristics in this class, and you can narrow your selection, by setting values for specific characteristics.
    After that, press F8 (Find in initial class)
    You will get a list of batches, assigned to the selected class, and fullfilling your selection criteria.
    Now you can display either the characteristics of a single batch, or you can define a layout for the ALV-Table control, with all characteristics, which you want to see in the overview.
    Another possibility is, to open up the 'batch information cockpit' (transaction BMBC) in a separate mode. Here you can see the characteristics ( if you define a selection class on tab strip 'Characteristics' ), e.g. in combination with stock information, which might be relevant as well.
    Here you can download some screenshots (link wiil be valid for 80 days)
    Link: [https://sapmats-de.sap-ag.de/download/download.cgi?id=B7BKFOTZKKGJ73YA86VZISCMALG8DTQRTX1YX02892OT1D308Z]
    Kind Regards
    Michael Franz
    IBU Mil Products & Mining
    SAP AG

  • How to find batches from characteristics value

    Dear Team
    How to find no. of batches from characteristic value used in that batch class?
    B.R.
    Ramesh kumar

    Hi Ramesh,
    Please try with BMBC.
    For characteristics value you can set it from customizing->Batch where used list.
    Regards,
    Krishnendu.

  • Material batch characteristics

    Hi all,
                 I have a requirement to fetch the material batch characteristics with delivery number as input and print the characteristics for the corresponding batches. Can you please say me the logic to fetch the details ? It is an urgent requirement..
    Thanks & Regards,
    RamaKrishnan .T

    Hi
    See the sample code for fetching the BAtch characteristics of Material
    report z21311r_batch_char no standard page heading
                              line-size  132
                              line-count 58(1)
                              message-id mm.
    Declaration for Tables
    tables: mara,    " Material Master
            mard,    " Storage Location Data for Material
            t001w,   " Plants/Branches
            t001l,   " Storage Locations
            cabn,    " Characteristics
            inob.    " Link between Internal Number and Object
    Declaration for Constants
    constants : c_klart like ausp-klart value '023',     " Class Type
                c_obtab like inob-obtab value 'MCH1',    " Database Table
                c_flag  type c          value 'X',       " Flag
                c_c23   type i          value '23',      " Ratio
    Constants for Ratio Categories
                c_13    type p decimals 2 value '13.00', " For Ratio 13
                c_1499  type p decimals 2 value '14.99', " For Ratio 14.99
                c_15    type p decimals 2 value '15.00', " For Ratio 15
                c_1699  type p decimals 2 value '16.99', " For Ratio  16.99
                c_17    type p decimals 2 value '17.00', " For Ratio 17
                c_1899  type p decimals 2 value '18.99', " For Ratio 18.99
                c_19    type p decimals 2 value '19.00', " For Ratio 19
                c_2099  type p decimals 2 value '20.99', " For Ratio 20.99
                c_21    type p decimals 2 value '21.00', " For Ratio 21
                c_2299  type p decimals 2 value '22.99', " For Ratio 22.99
                c_23    type p decimals 2 value '23.00', " For Ratio 23
                c_g23(4) type c value '>=23',            " For Ratio >=23
                c_ratio(5) value 'RATIO',                  " For Ratio
    Constants for Storing Selected item field information
                c_cursor1(15) value 'I_OUTPUT1-MEINS',   " For Selected Base
                                                         " Unit of Measure
                c_cursor2(15) value 'I_OUTPUT1-MATNR',   " For Selected Base
                                                         " Material Number
                c_cursor3(15) value 'I_OUTPUT1-MAKTX',   " For Selected Base
                                                         " Material Des.
                c_cursor4(15) value 'I_OUTPUT1-CLABS',   "For Selected Base
                                                         " Stock Value
                c_cursor5(15) value 'I_OUTPUT1-ATFLV',   " For Selected Base
                                                        " Char.Value (Ratio)
                c_cursor6(5) value 'C_G23'.
    Declaration for Global Variables
    data : g_exit  type c,                            " Flag
           g_clabs1(16) type c,                       " Quantity
           g_clabs(18)  type c,                       " Quantity
           g_cursor(15) type c,                       " Cursor field name
           g_matnr     type mara-matnr,               " Material Number
           g_werks     type mchb-werks,               " Plant
           g_atinn(30) type c.                        " Character.
    Declaration for Internal tables
    Internal table to hold Batch Stock data
    data : begin of i_mchb occurs 0,
             matnr like mchb-matnr,      " Material Number
             werks like mchb-werks,      " Plant
             lgort like mchb-lgort,      " Storage Location
             charg like mchb-charg,      " Batch Number
             clabs like mchb-clabs,      " Stock Value
             meins like mara-meins,      " Unit of measure
             atflo like ausp-atflv,      " Char.Value (Ratio)
             atflv like ausp-atflv,      " Char.Value (Ratio)
           end of i_mchb.
    Internal table to hold Secondary List data
    data : begin of i_mchb1 occurs 0,
             werks like mchb-werks,      " Plant
             matnr like mchb-matnr,      " Material Number
             lgort like mchb-lgort,      " Storage Location
             charg like mchb-charg,      " Batch Number
             atinn like ausp-atinn,      " Char.Value
             clabs like mchb-clabs,      " Stock Value
             atflo like ausp-atflv,      " Char.Value (Ratio)
             atflv like ausp-atflv,      " Char.Value (Ratio)
           end of i_mchb1.
    Internal table to get the Plant Name
    data : begin of i_plant occurs 0,
             werks like t001w-werks,     " Plant
             name1 like t001w-name1,     " Name
           end of i_plant.
    Internal table to get the Material Description
    data : begin of i_makt occurs 0,
             matnr like makt-matnr,      " Material
             maktx like makt-maktx,     " Description
           end of i_makt.
    Internal table to hold AUSP data
    data : begin of i_ausp occurs 0,
             objek like ausp-objek,      " Object No
             atinn like cabn-atinn,      " Characteric value
             atflv like ausp-atflv,      " Characteristic Value
           end of i_ausp.
    Internal table to hold output data
    data : begin of i_output occurs 0,
             atinn like cabn-atinn,      " Characteric value
             werks like mchb-werks,      " Plant
             matnr like mchb-matnr,      " Material Number
             atnam like cabn-atnam,      " Characteristic
             atflv like ausp-atflv,      " Char.Value (Ratio)
             name1 like t001w-name1,     " Plant Description
             maktx like makt-maktx,      " Material Description
             clabs like mchb-clabs,      " Stock Value
             meins like mara-meins,      " Base Unit of Measure
           end of i_output.
    Internal table to hold final Output data
    data : begin of i_output1 occurs 0,
             atinn like cabn-atinn,      " Characteric value
             werks like mchb-werks,      " Plant
             matnr like mchb-matnr,      " Material Number
             atnam like cabn-atnam,      " Characteristic
             atflv(32) type c,           " Char.Value (Ratio)
             name1 like t001w-name1,     " Plant Description
             maktx like makt-maktx,      " Material Description
             clabs like mchb-clabs,      " Stock Value
             meins like mara-meins,      " Base Unit of Measure
           end of i_output1.
           Selection screen
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_werks for t001w-werks obligatory,  " Plant
                    s_lgort for t001l-lgort,             " Stor.Location
                    s_matnr for mara-matnr  obligatory,  " Material No
                    s_atinn for cabn-atinn.              " Character.
    selection-screen end of block b1.
    At selection screen
    at selection-screen.
    Validation of Selection Screen Fields
      perform validate_screen.
    Start of selection
    start-of-selection.
    Get the Material and Batch Stock data from MARA and MCHB Tables
      perform get_mat_stock_data.
    Get the Material Group Text and Plant Name from T023T and T001W Tables
      perform get_plant_grp_data.
    Append the data into final Output Internal Table after getting the
    Characteristic Values data from INOB and AUSP Tables
      perform append_final_data.
    Processing if the Characteristics contain 'RATIO'
      perform collect_ratio.
    End-of-Page
    end-of-page.
      write /1(125) sy-uline.
    End of selection
    end-of-selection.
      if g_exit <> c_flag.
    Display the Report Output data
        perform display_report.
      endif.
    Top-of-Page
    top-of-page.
    Write the Report and Column Headings
      perform get_headings.
    at line-selection
    at line-selection.
      if sy-lsind = 1.
        perform display_batch.
      endif.
    Top of page during line-selection
    top-of-page during line-selection.
      perform heading_seclist.
          Form validate_screen
    Validation of Selection Screen fields
    form validate_screen.
    Validation of Plant
      clear t001w.
      if not s_werks[] is initial.
        select werks
          into t001w-werks
          from t001w
          up to 1 rows
          where werks in s_werks.
        endselect.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Plant'(002).
        endif.
      endif.
    Validation of Material Number
      clear mara.
      if not s_matnr[] is initial.
        select matnr
          into mara-matnr
          from mara
          up to 1 rows
          where matnr in s_matnr.
        endselect.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Material'(003).
        endif.
      endif.
    Validation of Storage Location
      clear t001l.
      if not s_lgort[] is initial.
        select lgort
          into t001l-lgort
          from t001l
          up to 1 rows
          where lgort in s_lgort.
        endselect.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Storage Location'(004).
        endif.
      endif.
    Validation of Characteristic Value
      clear cabn.
      if not s_atinn[] is initial.
        select atinn
          into cabn-atinn
          from cabn
          up to 1 rows
          where atinn in s_atinn.
        endselect.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Characteristic Value'(005).
        endif.
      endif.
    Validation of Plant, Material and Storage Location
      clear mard.
      select matnr werks lgort
        into (mard-matnr, mard-werks, mard-lgort)
        from mard
        up to 1 rows
        where matnr in s_matnr and
              werks in s_werks and
              lgort in s_lgort.
      endselect.
      if sy-subrc <> 0.
        message e899 with 'No Data found for the Selection Criteria'(006).
      endif.
    endform.                          "validate_screen
    *&      Form  get_headings
    Write the Report and Column Headings
    form get_headings.
      data: l_repid type sy-repid.
      l_repid =  sy-repid.
      call function 'Y_STANDARD_HEADING'
           exporting
                repid    = l_repid
                heading1 = sy-title.
      write:/1(125) sy-uline.
      format color col_heading on.
      write : /1  sy-vline,  2(18)   'Material Number'(008) centered,
              20  sy-vline,  21(40)  'Material Description'(011) centered,
              61  sy-vline,  62(22)  'Ratio'(009) centered,
              84  sy-vline,  85(18)  'Quantity'(010) centered,
             103  sy-vline, 104(20)  'Base Unit of Measure'(015) centered,
             125  sy-vline.
      write:/1(125) sy-uline.
      format color off.
    endform.                    "get_headings
    *&      Form  get_mat_stock_data
    Get the Material and Batch Stock data from MARA and MCHB Tables
    form get_mat_stock_data.
      clear: i_mchb,i_output, i_output1.
      refresh: i_mchb,i_output, i_output1.
      select a~matnr       " Material Number
             b~werks       " Plant
             b~lgort       " Storage Location
             b~charg       " Batch Number
             b~clabs       " Stock Value
             a~meins       " Base Unit of Measure
          into table i_mchb
          from mara as a inner join mchb as b
          on amatnr eq bmatnr
          where b~matnr in s_matnr and
                b~werks in s_werks and
                b~lgort in s_lgort.
      if sy-subrc <> 0.
        g_exit = c_flag.
        message s899 with 'No Data found for the Selection Criteria'(006).
        stop.
      endif.
      sort i_mchb by matnr werks lgort charg.
    endform.                    " get_mat_stock_data
    *&      Form  get_plant_grp_data
    Get the Material Group Text and Plant Name from T023T and T001W
    form get_plant_grp_data.
      if not i_mchb[] is initial.
    Get the Plant Description from t001w Table
        clear i_plant.
        refresh i_plant.
        select werks      " Plant
               name1      " Name
          into table i_plant
          from t001w
          for all entries in i_mchb
          where werks = i_mchb-werks.
    Get the Material Description from MAKT Table
        clear i_makt.
        refresh i_makt.
        select matnr      " Material number
               maktx      " Material Description
          into table i_makt
          from makt
          for all entries in i_mchb
          where matnr = i_mchb-matnr and
                spras = sy-langu.
        sort i_plant by werks.
        delete adjacent duplicates from i_plant comparing werks.
        sort i_makt by matnr.
        delete adjacent duplicates from i_makt comparing matnr.
      endif.
    endform.                   "form get_plant_grp_data.
    *&      Form  append_final_data
    Append the data into final Internal Table
    form append_final_data.
      data : l_matbatch(28),
             l_tabix like sy-tabix.
      if not i_mchb[] is initial.
        loop at i_mchb.
          l_tabix = sy-tabix.
          clear l_matbatch.
          concatenate i_mchb-matnr i_mchb-charg into l_matbatch.
          move-corresponding i_mchb to i_output.
    Get the Plant Description from i_plant Table
            read table i_plant with key werks = i_mchb-werks binary search.
            if sy-subrc = 0.
              i_output-name1 = i_plant-name1.
            endif.
    Get the Material Description from i_makt Table
          read table i_makt with key matnr = i_mchb-matnr binary search.
          if sy-subrc = 0.
            i_output-maktx = i_makt-maktx.
          endif.
    Get the Characteristic Values data from INOB and AUSP Tables
          clear inob.
          select single cuobj from inob
              into inob-cuobj
              where klart = c_klart and
                    obtab = c_obtab and
                    objek = l_matbatch.
          if sy-subrc = 0.
            select objek
                   atinn
                   atflv
               from ausp
               into table i_ausp
               where objek = inob-cuobj and
                     atinn in s_atinn   and
                     klart = c_klart.
            sort i_ausp by objek atinn.
            loop at i_ausp.
              clear cabn.
              select single atinn atnam from cabn
                         into (cabn-atinn,cabn-atnam)
                         where atinn = i_ausp-atinn.
              if sy-subrc = 0.
    If the ratio value is between 13-14.99, display 13
                if cabn-atnam cs c_ratio.
                  if i_ausp-atflv between c_13 and c_1499.
                    i_mchb-atflo = i_ausp-atflv.
                    i_mchb-atflv = c_13.
    If the ratio value is between 15-16.99, display 15
                  elseif i_ausp-atflv between c_15 and c_1699.
                    i_mchb-atflo = i_ausp-atflv.
                    i_mchb-atflv = c_15.
    If the ratio value is between 17-18.99, display 17
                  elseif i_ausp-atflv between c_17 and c_1899.
                    i_mchb-atflo = i_ausp-atflv.
                    i_mchb-atflv = c_17.
    If the ratio value is between 19-20.99, display 19
                  elseif i_ausp-atflv between c_19 and c_2099.
                    i_mchb-atflo = i_ausp-atflv.
                    i_mchb-atflv = c_19.
    If the ratio value is between 21-22.99, display 21
                  elseif i_ausp-atflv between c_21 and c_2299.
                    i_mchb-atflo = i_ausp-atflv.
                    i_mchb-atflv = c_21.
    If the ratio value is greater than or equal to 23, display 23
                  elseif i_ausp-atflv >= c_23.
                    i_mchb-atflo = i_ausp-atflv.
                    i_mchb-atflv = c_23.
                  endif.           " Condition for RATIO values
                else.              " If characteristic does contain RATIO
                  i_mchb-atflv = i_ausp-atflv.
                endif.
                i_output-atinn = cabn-atinn.
                i_output-atnam = cabn-atnam.
                i_output-atflv = i_ausp-atflv.
                i_mchb1-matnr = i_mchb-matnr.
                i_mchb1-werks = i_mchb-werks.
                i_mchb1-lgort = i_mchb-lgort.
                i_mchb1-charg = i_mchb-charg.
                i_mchb1-clabs = i_mchb-clabs.
                i_mchb1-atinn = i_ausp-atinn.
                i_mchb1-atflo = i_mchb-atflv.
                i_mchb1-atflv = i_ausp-atflv.
                append : i_output, i_mchb1.
                clear i_mchb1.
                modify i_mchb index l_tabix transporting atflo atflv .
              endif.
            endloop.
          endif.
        endloop.
      endif.
    Checking whether the table is filled or not
      if not i_output[] is initial.
        sort i_output by atinn werks matnr atflv.
      else.
        g_exit = c_flag.
        message s899 with 'No Data found for the Selection Criteria'(006).
      endif.
    Delete the records where RATIO is less than 13.
      delete i_output where atnam cs c_ratio and atflv lt c_13.
    endform.                    "append_final_data
    *&      Form  display_report
    Display the Report Output data
    form display_report.
    data: l_tabix like sy-tabix.
      loop at i_output1.
        l_tabix = sy-tabix.
    At new Characteristic
         at new atinn.
          read table i_output1 index l_tabix.
          format color 1 intensified on.
          write: /1 sy-vline, 2(20) 'Characteristic Name:'(007),
                 23(40) i_output1-atnam,
                 125 sy-vline.
          format color off.
          format color 4 intensified on.
          write: /1 sy-vline, 2(20) 'Plant Name         :'(022),
                 23(4) i_output1-werks, 29(30) i_output1-name1,
                 125 sy-vline.
          format color off.
          write /1(125) sy-uline.
        endat.
        clear: g_clabs, g_clabs1.
        format color col_normal.
        write :/1 sy-vline,  2(18)   i_output1-matnr,
               20 sy-vline,  21(40)  i_output1-maktx,
               61 sy-vline.
        if i_output1-atflv = c_c23.
          write: 62(22)  c_g23 centered.
        else.
          shift i_output1-atflv left deleting leading space.
          write: 62(22)  i_output1-atflv centered.
        endif.
        write:  84     sy-vline,
               103     sy-vline,
               110(5)  i_output1-meins.
    If the quantity value is negative
        if i_output1-clabs ge 0.
          write: 85(18) i_output1-clabs unit i_mchb-meins,
                125     sy-vline.
        else.
          i_output1-clabs = - i_output1-clabs.
          write i_output1-clabs unit i_mchb-meins to g_clabs1.
          condense g_clabs1.
          concatenate '(' g_clabs1 ')' into g_clabs separated by space.
          write: 85(18) g_clabs right-justified,
               125 sy-vline.
        endif.
        format color off.
        hide : i_output1.
        new-line.
    At end of material
        at end of matnr.
          sum.
          move : i_output1-matnr to g_matnr.
          format color 3 intensified on.
          write /1(125) sy-uline.
          write :/1 sy-vline,  2(25) 'Total for Material      :'(012),
                 28(18) g_matnr.
          if i_output1-clabs ge 0.
            write: 85(18) i_output1-clabs  unit i_mchb-meins,
            125 sy-vline.
          else.
            i_output1-clabs = - i_output1-clabs.
            write i_output1-clabs unit i_mchb-meins to g_clabs1.
            condense g_clabs1.
            concatenate '(' g_clabs1 ')' into g_clabs separated by space.
            write: 85(18) g_clabs right-justified,
                 125 sy-vline.
          endif.
          write: 125 sy-vline.
          format color off.
          write /1(125) sy-uline.
        endat.
    At end of plant
        at end of werks.
          sum.
          move : i_output1-werks to g_werks.
          format color 3 intensified off.
          write :/1 sy-vline,  2(25) 'Total for Plant          :'(013),
                 28(4) g_werks.
          if i_output1-clabs ge 0.
            write:  85(18) i_output1-clabs  unit i_mchb-meins,
            125 sy-vline.
          else.
            i_output1-clabs = - i_output1-clabs.
            write i_output1-clabs unit i_mchb-meins to g_clabs1.
            condense g_clabs1.
            concatenate '(' g_clabs1 ')' into g_clabs separated by space.
            write: 85(18) g_clabs right-justified,
                 125 sy-vline.
          endif.
          format color off.
          write /1(125) sy-uline.
        endat.
    At end of  characteristic
        at end of atinn.
          read table i_output1 index l_tabix.
          sum.
          format color 3 intensified on.
          write :/1 sy-vline,  2(25) 'Total for Characteristic:'(014),
                 28(25) i_output1-atnam.
          if i_output1-clabs ge 0.
            write:  85(18) i_output1-clabs  unit i_mchb-meins,
            125 sy-vline.
          else.
            i_output1-clabs = - i_output1-clabs.
            write i_output1-clabs unit i_mchb-meins to g_clabs1.
            condense g_clabs1.
            concatenate '(' g_clabs1 ')' into g_clabs separated by space.
            write: 85(18) g_clabs right-justified,
                 125 sy-vline.
          endif.
          format color off.
          write /1(125) sy-uline.
        endat.
      endloop.
    endform.                    " display_report
    *&      Form  DISPLAY_BATCH
         Display the batch details for the seclected material            *
    form display_batch.
    Get the batch details for the selected material
      get cursor field g_cursor.
      if g_cursor = c_cursor1 or
         g_cursor = c_cursor2 or
         g_cursor = c_cursor3 or
         g_cursor = c_cursor4 or
         g_cursor = c_cursor5 or
         g_cursor = c_cursor6.
        format color 3.
        write: /1 sy-vline,
                2(17) 'Material Number :'(020),
               20(17) i_output1-matnr,
               94 sy-vline.
        format color off.
        write /1(94) sy-uline.
        loop at i_mchb1 where matnr = i_output1-matnr and
                              atinn = i_output1-atinn and
                              atflo = i_output1-atflv.
          format color col_normal.
          shift i_mchb1-charg left deleting leading '0'.
          write :/1 sy-vline,  2(16) i_mchb1-lgort centered,
                 18 sy-vline, 19(17) i_mchb1-charg centered,
                 36 sy-vline.
          if i_output1-atnam cs c_ratio.
            write: 37(29) i_mchb1-atflv
                           exponent 0 decimals 2 centered.
          else.
            write : 37(29) i_mchb1-atflv
                          exponent 0 decimals 0 centered.
          endif.
          write : 66 sy-vline, 67(27) i_mchb1-clabs unit i_mchb-meins,
                  94 sy-vline.
          format color off.
        endloop.
        write /1(94) sy-uline.
      else.
        message s899 with 'Invalid cursor position'(016).
        exit.
      endif.
    endform.                    " DISPLAY_BATCH
    *&      Form  HEADING_SECLIST
          Write the Column Headings for Interactive Report
    form heading_seclist.
      write /1(94) sy-uline.
      format color col_heading on.
      write :/1 sy-vline,  2(16) 'Storage Location'(021),
             18 sy-vline, 19(17) 'Batch Number'(017) centered,
             36 sy-vline, 37(29) 'Characteristic Value'(018) centered,
             66 sy-vline, 67(27) 'Quantity'(019) centered,
             94 sy-vline.
      write /1(94) sy-uline.
      format color off.
    endform.                    " HEADING_SECLIST
    *&      Form  COLLECT_RATIO
          Display the Characteristic ratio data
    form collect_ratio.
      loop at i_output.
        clear g_atinn.
        i_output1-atinn = i_output-atinn.
        i_output1-atnam = i_output-atnam .
        i_output1-werks = i_output-werks.
        i_output1-name1 = i_output-name1.
        i_output1-matnr = i_output-matnr.
        i_output1-maktx = i_output-maktx.
        i_output1-clabs = i_output-clabs.
        i_output1-meins = i_output-meins.
        call function 'CONVERSION_EXIT_ATINN_OUTPUT'
             exporting
                  input  = i_output-atinn
             importing
                  output = g_atinn.
        if g_atinn cs c_ratio.
    If the ratio value is between 13-14.99, display 13
          if i_output-atflv between c_13 and c_1499.
            i_output1-atflv = c_13.
    If the ratio value is between 15-16.99, display 15
          elseif i_output-atflv between c_15 and c_1699.
            i_output1-atflv = c_15.
    If the ratio value is between 17-18.99, display 17
          elseif i_output-atflv between c_17 and c_1899.
            i_output1-atflv = c_17.
    If the ratio value is between 19-20.99, display 19
          elseif i_output-atflv between c_19 and c_2099.
            i_output1-atflv = c_19.
    If the ratio value is between 21-22.99, display 21
          elseif i_output-atflv between c_21 and c_2299.
            i_output1-atflv = c_21.
    If the ratio value is greater than or equal to 23, display 23
          elseif i_output-atflv >= c_23.
            i_output1-atflv = c_23.
          endif.
          write i_output1-atflv to i_output1-atflv .
        else.
          write i_output-atflv to i_output1-atflv exponent 0 decimals 0.
        endif.
        collect i_output1.
        clear   i_output1.
      endloop.
      sort i_output1 by atinn werks matnr atflv.
    endform.                    " COLLECT_RATIO
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • MIGO : Error when copying batch characteristics

    Hi,
    I've some problem on MIGO Tcode when i want to copy the batch characteristics.
    I work with class type 022.
    I create a GR from PO. (movement 101). My item line contained sub-items (with BOM). So i would like to copy the batch characteristics in reference of component batch values.
    I've implemented the UE "EXIT_SAPMM07M_004".
    Case 1 : In this UE, i fill a standard internal table (named VALUES) with the characteristics names and values i want to resume.
    and i use the FM 'CLFM_OBJECT_CLASSIFICATION' with the father and the son batch information in UE, i go to MSC3n and all characteristics are copied (even those unwanted). But when i go to MCS2N,  i retrieve the expected values.
    Case 2 : Only use the internal table, but some characteristics are not maintained.
    Case 3 : Only use the FM, but no characteristics are reversed.
    Does anyone could help me ?
    Thanks in advance
    Best regards.

    Hi,
    Table and field used in additional data table should be related to the object than only it will work, for e.g. MCHA and ERDAT will work if you create a characteristcis and assign it to class type Batch (022/023) because MCHA table has Batch no. as primary key,
    this implies for using material specific table e.g. MARA , you should use characteristics with class type 001 (Material class) , try using with table MARC also
    Cheers
    Dheeraj

  • Activation of Batch Characteristics in Material Master

    Dear Gurus
    In Material Master the character values are in grey mode and not allowing to select.can anyone suggest how to activate this.
    other characters are in Blue colour.
    Thnk in Advance
    MK

    Hi There
    In material master you can assign the class in the classification view, it will provide the characteristics, that will flow when you do the receipt there you can enter the values or Create Batch-MSC1n and Change batch MSC2n, you can enter the characteristics values,,
    I dont have clue why you are trying to enter the values in material master,,,
    In CL02- Create the class and assign the characteristics (Create the Charac T code CT04)
    Provide more details to check further,,,
    Thanks
    Senthil

  • Batch Classification Values not getting changed

    Hi Gurus,
    I am using the following bapi ( BAPI_OBJCL_CHANGE ) to change Batch classification values Eg: Cut clarity etc.
    when i pass these values thru the function module in the program it is not getting changed while when i change it through msc2n it gets changed successfully...
    I have passed the following values in the parameters of the bapi :
    OBJECTKEY            = v_objectkey          
    OBJECTTABLE        = 'MCH1'          
    CLASSNUM             = V_CLASSNUM 
    CLASSTYPE           = '023'
    KEYDATE                = 30.04.2010
    ALLOCVALUESCHARNEW
    CHARACT = CLARITY
    VALUE_CHAR =  P040
    VALUE_NEW   = P040.
    Can some one help me solve this....
    Needed urgently..
    Edited by: NAVIN FERNANDES on Apr 30, 2010 12:31 PM
    Edited by: NAVIN FERNANDES on Apr 30, 2010 12:32 PM

    Hi Jacky,
    I am posting the code here.. Do let me know if u have ne queries:
    REPORT  ZNAVBATCH.
    SELECTION-SCREEN BEGIN OF BLOCK B1.
    PARAMETERS: P_MATNR TYPE MATNR,
                P_CHARG TYPE CHARG_D,
                P_WERKS TYPE WERKS_D,
                P_LGORT TYPE LGORT_D.
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
      DATA: WA_BATCH TYPE BAPI1003_OBJECT_KEYS,
            WA_ALLOCCHAR TYPE BAPI1003_ALLOC_VALUES_CHAR,
            WA_ALLOCVAL TYPE BAPI1003_ALLOC_VALUES_NUM,
            INT_BATCH TYPE STANDARD TABLE OF BAPI1003_OBJECT_KEYS,
            INT_RET1 TYPE STANDARD TABLE OF BAPIRET2,
            INT_RET2 TYPE STANDARD TABLE OF BAPIRET2,
            INT_RET3 TYPE STANDARD TABLE OF BAPIRET2,
            LV_KEY TYPE BAPI1003_KEY-OBJECT,
            INT_ALLOCVAL TYPE STANDARD TABLE OF BAPI1003_ALLOC_VALUES_NUM,
            INT_ALLOCCHAR TYPE STANDARD TABLE OF BAPI1003_ALLOC_VALUES_CHAR,
            INT_ALLOCCURR TYPE STANDARD TABLE OF BAPI1003_ALLOC_VALUES_CURR.
      WA_BATCH-KEY_FIELD = 'MATNR'.
      WA_BATCH-VALUE_INT = P_MATNR.
      APPEND WA_BATCH TO INT_BATCH.
      WA_BATCH-KEY_FIELD = 'CHARG'.
      WA_BATCH-VALUE_INT = P_CHARG.
      APPEND WA_BATCH TO INT_BATCH.
      CALL FUNCTION 'BAPI_OBJCL_CONCATENATEKEY'
        EXPORTING
          OBJECTTABLE    = 'MCH1'
        IMPORTING
          OBJECTKEY_CONC = LV_KEY
        TABLES
          OBJECTKEYTABLE = INT_BATCH
          RETURN         = INT_RET1.
      IF SY-SUBRC = 0.
       WRITE: 'SUCCESSFUL'.
        CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
          EXPORTING
            OBJECTKEY              = LV_KEY
            OBJECTTABLE            = 'MCH1'
            CLASSNUM               = 'ZTBATCHCHR'
            CLASSTYPE              = '023'
            KEYDATE                = SY-DATUM
          UNVALUATED_CHARS       = ' '
          LANGUAGE               = SY-LANGU
        IMPORTING
          STATUS                 =
          STANDARDCLASS          =
          TABLES
            ALLOCVALUESNUM         = INT_ALLOCVAL
            ALLOCVALUESCHAR        = INT_ALLOCCHAR
            ALLOCVALUESCURR        = INT_ALLOCCURR
            RETURN                 = INT_RET2
        IF SY-SUBRC = 0.
          WRITE : 'SUCCESSFUL'.
          READ TABLE INT_ALLOCCHAR INTO WA_ALLOCCHAR WITH KEY CHARACT = 'CLARITY'.
          IF SY-SUBRC = 0.
            WA_ALLOCCHAR-VALUE_CHAR = 'C02'.
            WA_ALLOCCHAR-VALUE_NEUTRAL = 'C02'.
            MODIFY INT_ALLOCCHAR FROM WA_ALLOCCHAR INDEX SY-TABIX TRANSPORTING VALUE_CHAR VALUE_NEUTRAL.
          ENDIF.
          CALL FUNCTION 'BAPI_OBJCL_CHANGE'
            EXPORTING
              OBJECTKEY                = LV_KEY
              OBJECTTABLE              = 'MCH1'
              CLASSNUM                 = 'ZTBATCHCHR'
              CLASSTYPE                = '023'
             STATUS                   = '1'
             STANDARDCLASS            =
             CHANGENUMBER             =
             KEYDATE                  = SY-DATUM
             NO_DEFAULT_VALUES        = ' '
           IMPORTING
             CLASSIF_STATUS           =
            TABLES
              ALLOCVALUESNUMNEW        = INT_ALLOCVAL
              ALLOCVALUESCHARNEW       = INT_ALLOCCHAR
              ALLOCVALUESCURRNEW       = INT_ALLOCCURR
              RETURN                   = INT_RET3
          IF SY-SUBRC = 0.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
             EXPORTING
               WAIT          = 'X'
            IMPORTING
              RETURN        =
            IF SY-SUBRC = 0.
              WRITE: 'SUCCESSFUL'.
            ENDIF.
          ENDIF.
        ENDIF.
    ENDIF.

Maybe you are looking for

  • CS6 Photoshop Update Option Does Not Run

    I ran the Update option once, mainly to get the ACR 8.2 version. It looked like all the files downloaded successfully and that the update process started. Then nothing. - Clicking Update has no effect. There are absolutely no error messages. - Downlo

  • Hi this is how to get into your old partner jobs list

    Hi there, I have worked out how to make the link to the old jobs in your partner portal work. 1. log into your partner site. 1. click on this link http://syd.worldsecuresystems.com/PartnerPortal/Support.aspx 1. log in to the new Adobe help screen tha

  • Does iOS 5.0.1 has any bugs.

    My iPhone 3GS upgraded to iOS Five restarts automatically while i am on call. Further got a new piece replaced by Apple and update it to iOS 5.0.1 and it came up with an issue of temporary white screen issues. Do anyone faces the same issue like. Ple

  • Which network to choose - Mysterious Apple networks

    I´m using the Airport Express and it keeps dropping of the internet or jumping to different networks which then drops the connection to the web. I´ve chosen from the Network settings the Prefered Networks instead of Automatic. BUT...how do I know to

  • GLT0 / GLT3 extractors

    Hi, We are implementing SEM-BCS 6.0 with SAP BI 7.0. For BCS we need the financial data displayed in table GLT3. But there are only standard extractors for table GLT0. Having in account that the extra fields in GLT3 (RMVCT, RASSC, SBUSA, RYACQ) are f