If statement in calculated batch characteristic (dependencies)

I have a little problem with calculating a certain batch characteristic.
The situation is the following:
I have batch char A, batch char B and batch char C. Batch char C is the result of the sommation of char A and B. The problem I have now is that batch char C only should be calculated when batch char A and B are different from 0.
I have a custom build interface that imports QM data to the batch chars. Default, all my batch chars are set to 0 so if I just say $self.charC = $self.charA + $self.charB, I always get a value.
Is it possible to some sort of IF statement to check if the value is different from 0?

Dear,
You need to try with variant table
take all the combination and enter in a variant table and see the result...it works
example
A     B      C
0      0      space
0      1      sapce
1      1      space
I hope you got it

Similar Messages

  • Automatic calculation for batch characteristic

    Conversion factor is a batch characteristic which is to be calculated based on the other batch characteristics values entered by the user at the time of confirmation.
    I have maintained the objectdependency in the batch class (023). The dependency type maintained is "Procedure".  The batch class is assigned to material master. The formula is as follows
    $self.conversionfactor=((($self.actthickness-0.067)*$self.density)
    ($self.paintgsm$self.metalgsm))*$self.width/1000
    The formula is appearing in 2 lines in the dependency editor. There is no syntax error. As well as the dependency status is also "released".
    But at the time of confirmation, if the values of the other characteristics are entered, no calculation for the characteristic conversion factor is done by the system.
    Can anybody please guide on this???
    Regards,
    Manish

    thanks a lot

  • Editing the formula in batch characteristic

    The product is maintained with batch. The batch is created for the finished product manually at the time of confirmation. The batch characteristic values are maintained at the same time.
    One of the characteristic value is to be calculated by using algebraic formula which includes simple mathematical operations on the values of the other characteristic.
    for ex---
    characteristic a---- 89 (VALUE entered by user)
    characteristic b---- 1 (VALUE entered by user)
    characteristic c---- 5 (VALUE entered by user)
    characteristic d-----Automatic calculation based on above values & the formula.
    I want for characteristic D----
    Char D = {(a-0.03-0.07) * b + c} / d
    How can I do this???? What will be syntax for this???
    Please if anybody can help on this........

    Dear Ramanujan,
    I have received the reply from you & thanks very much for ur quick reply.
    I have tried the settings suggested by you, but having still the problem.
    Conversion factor is a batch characteristic which is to be calculated based on the other batch characteristics values entered by the user at the time of confirmation.
    I have maintained the objectdependency in the class as mentioned by you. The dependency type mantained is "Procedure". The formula is as follows
    $self.conversionfactor=((($self.actthickness-0.067)*$self.density)
    ($self.paintgsm$self.metalgsm))*$self.width/1000
    The formula is appearing in 2 lines in the dependancy editor. There is no syntax error. As well as the the dependency status is also "released".
    But at the time of confirmation, if the values of the other characteristics are entered, no calculation for the characteristic conversion factor is done by the system.
    Can you please guide on this???

  • Linking MIC & Batch characteristic

    Hey All
    My understanding is that to move values from batch characteristic to MIC we need to maintain the link in MIC and this relationship is one to one relationship.
    We have a business requirement as below. I do 2 types of testing i.e. official & vendor. First i do vendor testing and this will be reflected in the batch. After this i do official testing and this needs to overwrite the vendor results and update the batch automatically.
    If i have to use the batch characteristic + MIC link, then i need to create 2 batch characteristics & 2 MIC's / test i perform on the material.
    Is there  a way by which i can have multiple link between batch characteristic & MIC and manage this link via some user exit or
    do you have some suggestions on how to handle this business requirement?
    Regards
    TOM

    You only need one inspection characteristic.
    You don't indicate in your process how or when these two types of inspection happen.
    You can create a source inspection lot with the tests the you use to record the vendor results on.
    Then when you receive the material, you have an 01 inspection lot created for recording your actual results.
    The second set UD on the 01 lot will over write the batch record results from the first source inspection.
    If you have one inspection lot that is created at goods receipt, use two operations.  Operation 10 has the vendor tests.  Operation 20 has the in-house testing.  When the UD is made the test results from the last operation will be written to the batch record.
    Craig

  • Need to restrict values in F4 help for Batch Characteristic

    Hi,
    I need to restrict values in F4 Help for a batch characteristic based on values entered for another characteristic. I could not find any BADI or Exit for this purpose. There is a BADI CACL_VALUE which is triggered after an entry is selected from dropdown list but nothing when we press F4. I thought of using Object Dependency but I need to write a programming logic for the requirement. Please let me know if there is any way to write program in Object Dependency or any other way for this requirement.
    Regards,
    Nikhil

    Hi nikhil simha,
    first of all, find out which search help is called.
    [Hierarchy of the Search Help Call|http://help.sap.com/saphelp_nw70/helpdata/en/0b/32e9b798da11d295b800a0c929b3c3/frameset.htm]
    may help you.
    If you know the search help, you may enhance it, but first of all you should check the where-used-list and make sure that the search help shows the requested behavior only in the context where you want it to.
    If it is your own program, you may be better off to create your own search help and define the triggering fields as search help interface input fields. Then you can use the values to filter results.
    Regards
    Clemens

  • Populate Batch characteristic values in create sales order BAPI

    Can anybody help me in populating the batch characteristic values using BAPI_SALESORDER_CREATEFROMDAT2?
    I have checked the related notes provided by SAP, like, 567348 but it will be great if someone can send some code snippet on this.

      Subramanian, Brad and Raja.
      Thanks for your suggestions its were useful, with
      these i can resolve my problem.
       !!! Best Regards !!!
    Raja
      I used the se37 to test bapis, is more easy and fast !!
      and you can save data like variant, and you can simulate the real execution without write any code abap,
    and re-process the times that you need,
    when you know what fields you need you write your abap code faster.
       Thanks !!!
    Message was edited by: Noemi Huerta

  • Statement caching and batch update

    Can these 2 JDBC features work together ?
    Is it possible while statement is cached to be reparsed (soft) if used in batch update ?
    I am asking this questions because i have a sitution where an insert is cached using implicit statement caching and then put in a batch to exeute batch updates !!! From statspack reports i find that 1/3 of statements are reparsed ... even soft !!!

    Statement caching and batch update work fine together. The most common cause of unexpected soft parses is changing the type of some parameters. If you first bind one type, setInt(1, ...), do addBatch, then bind another type to the same parameter, setString(1, ...), and do addBatch, you will get a soft reparse. There is nothing the JDBC driver can do about this, the RDBMS requires it.
    In general, whatever parse behavior you see with statement caching you would also see without it.
    Douglas

  • Batch Characteristic not updating with result for linked MIC

    Hi,
    I have created a MIC and linked to a batch characteristic i.e. potency and included the characteristic in a specific batch class. This MIC is part of the inspection plan for a certain material.
    If I generate a lot of origin 01 and 09 for the material and record a result for the MIC and apply a UD, the batch characteristic is not updated with the result recorded in the batch master record..
    If I generate a lot origin 89 for the same material, when the result is recorded for the MIC and apply a UD the batch characteristic is updated with the mic value in the batch master record.
    Can you help regards?

    Ok. I am a little bit further.
    I put a trace (ST05) on the result recording and I find a difference between 4.7 and ECC6.0.
    In ECC6.0 I've an deletion in table "AUSP". This deletion isn't performed in the 4.7 system.
    Hope that this can help to solve my problem.
    Regards,
    René
    @ Mayank
    Above, all the master data and customizing is mentioned to transfer the result to the batch classification
    Edited by: Rene Fuhner on Jul 30, 2010 7:03 PM

  • "The CREATE USER statement must be the only statement in the batch" in SQL Azure - why? what to do?

    I'm getting an error on a line in the middle of a larger sql script, only in SQL Azure.
    IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'foouser')
    CREATE USER [foouser] FOR LOGIN [foouser] WITH DEFAULT_SCHEMA=[dbo]
    GO
    Error: "The CREATE USER statement must be the only statement in the batch."
    I don't actually understand what 'the only statement in the batch' means.
    What is a batch? Is it a SQL file? Is it related to a 'GO' statement or an 'IF' statement? What is the reason for the error? And how do I avoid it?
    Thanks,
    Tim

    >IF...ELSE imposes conditions on the execution of a Transact-SQL statement
    I understand the general purpose of an If statement. I could let go of our definition of statement counting disagreeing too except that because of the error I'm stuck.
    It's less important for Create User but what I am really puzzled over now is a very similar issue how am I supposed to do a safe version of CREATE LOGIN, when I don't know whether a login has been previously created on the server or whether I
    am setting up the database on a clean server?
    IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name = N'foouser')
    CREATE LOGIN [foouser] WITH PASSWORD = 'asdfasdf'
    GO
    If I try and execute this script, it throws the same error as above.
    The first unworkable workaround idea is to omit the if statement
    CREATE LOGIN [foouser] WITH PASSWORD = 'asdfasdf'
    GO
    But if the login already exists on the server (because a similar script was already run), then the script throws an error.
    The second unworkable workaround idea is to do
    DROP LOGIN [foouser]
    GO
    CREATE LOGIN [foouser] WITH PASSWORD = 'asdfasdf'
    GO
    Obviously this throws an error in the second block if the login doesn't already exist on the server.
    The third workaround idea I have is to go conditional by putting an IF condition around DROP instead of CREATE:
    Unfortunately that doesn't work for me either!
    "The DROP LOGIN statement must be the only statement in the batch"
    (This is despite the fact that 'drop login' is listed on the
    supported commands page, not the partially supported page..?! Which disagrees with the notes on
    this page.)
    Anyway the real question I am interesting in addressing is: is there actually a way to have a 'Create/Delete login
    if exists' operation which is SQL-Azure compatible and doesn't throw me error messages (which messes with the sql execution tool I am using)?
    If there is no way, I would like to believe it's because it would be a bad idea to do this. But in that case why is it a bad idea?
    Tim

  • Statements in calculation fields

    Can you use sql statements in calculated fields, for instance can you use a statement like IF(GL_SEGMENT-04='401000'TO'409999'THEN SUM(GL_BALANCE_PERIOD_BAL_DB-GL_BALANCE_PERIOD_BAL_CR)
    I would think that you could use statements within calculated fields but I am having no luck.
    Thanks in advance

    You are so close, I guess. An alternative syntax you may try:
    SUM(CASE WHEN SEGMENT3 BETWEEN '401010' AND '405999' THEN PERIOD_NET_DR-PERIOD_NET_CR ELSE 0 END)
    You may get error message for not using table prefix. In that case, use the table prefix with each field. As you have seen, Discoverer takes care of the prefix when it first executes the formula. Regarding 0 balance, make sure that the sum is not zero for that range. You may also try with a bigger range. Good luck!

  • Find material and batch based on batch characteristic name

    Hi,
    I need to fetch all material and batch that have a particular batch characteristic. Can someone let me know how i can establish this link. I only have a characteristic name with me, need to find batches that use them.
    Thanks & Regards,
    Naresh.

    HJi
    Try table MCHA.
    Pushpraj

  • Multiple Alter Table Statements in one batch

    Hi Team,
    We have in one of our upcoming release two columns being added to a table that has over 20 million records and 14 indexes.
    We needed to add two columns to the table both not null (bit). Because it was taking a while to add the columns, we thought that putting these two alter statements in one batch would speed up the operation significantly but to my surprise it did not.
    Conclusion from my test: individual alter statements or batch alter statements take the same time
    Here are me test and results - table Order1 and Order2 are exactly the same structure and data.
    Test case 1:
    ===================
    ALTER TABLE Order1
    ADD OR_N BIT DEFAULT 0 NOT NULL
    go
    ALTER TABLE AccountTradeConfirmation_Alter1
    ADD OR_S BIT DEFAULT 0 NOT NULL
    Go
    Elapsed Time: 2 hrs
                 Mar 18 2015 5:56PM
    (1 row affected)
    Non-clustered index (index id = 3) is being rebuilt.
    Non-clustered index (index id = 4) is being rebuilt.
    Non-clustered index (index id = 5) is being rebuilt.
    Non-clustered index (index id = 6) is being rebuilt.
    Non-clustered index (index id = 7) is being rebuilt.
    Non-clustered index (index id = 8) is being rebuilt.
    Non-clustered index (index id = 9) is being rebuilt.
    Non-clustered index (index id = 10) is being rebuilt.
    Non-clustered index (index id = 11) is being rebuilt.
    Non-clustered index (index id = 12) is being rebuilt.
    Non-clustered index (index id = 13) is being rebuilt.
    Non-clustered index (index id = 14) is being rebuilt.
    (21777920 rows affected)
    Non-clustered index (index id = 3) is being rebuilt.
    Non-clustered index (index id = 4) is being rebuilt.
    Non-clustered index (index id = 5) is being rebuilt.
    Non-clustered index (index id = 6) is being rebuilt.
    Non-clustered index (index id = 7) is being rebuilt.
    Non-clustered index (index id = 8) is being rebuilt.
    Non-clustered index (index id = 9) is being rebuilt.
    Non-clustered index (index id = 10) is being rebuilt.
    Non-clustered index (index id = 11) is being rebuilt.
    Non-clustered index (index id = 12) is being rebuilt.
    Non-clustered index (index id = 13) is being rebuilt.
    Non-clustered index (index id = 14) is being rebuilt.
    (21777920 rows affected)
                 Mar 18 2015 7:52PM
    Test case 2:
    ===================
    ALTER TABLE Order2
    ADD OR_N BIT DEFAULT 0 NOT NULL, OR_S BIT DEFAULT 0 NOT NULL
    go
    2 hrs elapsed time
                 Mar 20 2015 11:10AM
    (1 row affected)
    Non-clustered index (index id = 3) is being rebuilt.
    Non-clustered index (index id = 4) is being rebuilt.
    Non-clustered index (index id = 5) is being rebuilt.
    Non-clustered index (index id = 6) is being rebuilt.
    Non-clustered index (index id = 7) is being rebuilt.
    Non-clustered index (index id = 8) is being rebuilt.
    Non-clustered index (index id = 9) is being rebuilt.
    Non-clustered index (index id = 10) is being rebuilt.
    Non-clustered index (index id = 11) is being rebuilt.
    Non-clustered index (index id = 12) is being rebuilt.
    Non-clustered index (index id = 13) is being rebuilt.
    Non-clustered index (index id = 14) is being rebuilt.
    (21777920 rows affected)
                 Mar 20 2015 1:12PM

    Hi Kiran,
    I have read your response a few times and I was not able to understand your angle. I assume based on the results of my test that Sybase does the following in processing the alter statements
    ALTER TABLE Order2
    ADD OR_N BIT DEFAULT 0 NOT NULL, OR_S BIT DEFAULT 0 NOT NULL
    go
    process alter ADD OR_N BIT
    -- > make copy of table
    ---> alter original table
    --> put data back in
    process alterOR_S BIT
    -- > make copy of table
    ---> alter original table
    --> put data back in
    rebuild index
    my expectation was that it would make a copy of the table only once and process the two alter statements. Also when doing the alter separately (test1) it rebuilt the index twice, however using the batch the index was rebuilt once (at least only one message displayed).
    Regards.

  • ATP check on a specific batch characteristic

    Hi Experts,
    Is possible in GATP to check on a specific batch characteristic?
    For example:
    Sales order:  Customer request SKU A (1000KG) with quality profile with a specific characteristic e.g. Water content need to be between 110 and 130 ppm.
    Production manufacture the SKU A with quality profile Water content between 80 and 160. Production is completed and goods are on hand.
    Stock on hand of the SKU A
    250 KG Batch 1 -> Water content 85 ppm
    250 KG Batch 2 -> Water content 120 ppm
    250 KG Batch 3 -> Water content 140 ppm
    250 KG Batch 4 -> Water content 115 ppm
    250 KG Batch 5 -> Water content 122 ppm
    250 KG Batch 6 -> Water content 117 ppm
    Is it possible that GATP runs this check on order entry ?
    1000 KG SKU A required, GATP is searching and finds 250KG batch 2, 250KG batch 4, 250KG batch 5, 250KG batch 6.
    Does standard GATP provide this functionality ? If yes, how does it support this business process ?
    Thanks,

    Hi
    It appears that you are describing a scenario where goods are sold from stock. In that case you can use the Characteristics Based ATP check.
    Characteristics-Based Product Availability Check - Global Available-to-Promise (Global ATP) - SAP Library
    Search on this forum and SAP help for more details. Customer requirements for characteristic values of batch are maintained in Sales Order using batch search strategies (Tcode VCH1).
    Since customers will potentially accept multiple values of a characteristic you can use characteristic substitution in Rules Based ATP to check for multiple discrete values.
    Characteristics Substitution Procedure - Rules-Based Availability Check - SAP Library
    Note that characteristic based ATP (with or without characteristic substitution) may be difficult to use if a characteristic can have continuous values or if the value of a characteristic changes over time (for example, remaining shelf life or quality grade).
    Characteristic substitution creates sub-items in Sales Orders for every substituted characteristic value. May or may not be acceptable from a logistics execution perspective.
    Finally, this gets even more complex depending on your scope of check. Foe example, if you want to commit to Inbound STO's at a distribution center, these ATP categories do not have characteristic assignment.
    An alternative to using Characteristics Based ATP is to use Characteristic Evaluation functionality. See OSS note 601813 for its several limitations. From a performance perspective it is preferable to use Characteristics Based ATP over Characteristic Evaluation since it uses the ATP time series instead of detailed pegging relationships in order live cache.
    Rishi Menon

  • Transfer single results from results recording to batch characteristic

    Hi all,
    I've a question. Is it possible to transfer multiple single results from results recording to a batch? It should only be qualitative results. The problem is as follows.
    We have a SAP - LIMS interface (QM-IDI). In SAP we have an inspection plan with two MICs:
    Customers OK
    Customers Not Ok
    Both MICs are linked to a catalog with customer + specification number. For example:
    0001 - Customer A v. 2015.01
    0002 - Customer B v. 2014.08
    0003 - Customer C v. 2015.02
    0004 - Customer D v. 2015.01
    LIMS determines which customer specifications passed and which failed. We'd like to get the following batch from LIMS:
    Customers OK
    0002 - Customer B v. 2014.08
    0003 - Customer C v. 2015.02
    0004 - Customer D v. 2015.01
    Customers Not Ok:0001 - Customer A v. 2015.01
    This is what we would like to see in the batch as well. Batch selection should be performed based on this information. Ik looked into multiple specifications, but I don't think this can help.
    Thanks for your help.
    regards,
    Maarten

    This is basically standard SAP functionality under Multiple specifications functionality.  With that process you can specify what country a material is Ok for or not ok for.
    Multiple Specifications in Inspection Planning - Quality Management (QM) - SAP Library
    Otherwise, without this, there is no standard way to implement what you want.
    However, since you are using an interface between your LIMS and SAP, you can have your system, based on values in the file transfered, take certain values from the file and directly update the batch characteristic values, (MSC2n) and record the countries it's ok for.  It would simply be a mult-value characteristic.  But the data for it comes from the transfer file, not QM.  There would basically be nothing visible about this in the inspection lot.
    Craig

  • Getting an error while using if statement in calculated column.can anyone please help me with this issue

    I am trying to learn HANA on my own.i have product id,product name,delivery date and Grossamount in my calculated view.i am trying to create calculated column where i need Grossamount in two columns based on delivery date.I have 2012 and 2013 as values for my delivery date.so i have created two column as grossamount_2012 and grossamount_2013.if i have delivery date as 4thdec,2012 i want the grossamount value to be in coloumn grossamount_2012 and the grossamount_2013 should be blank.i have written an expression like this
    if("Deliverydate" <= longdate(2012-12-04),"Grossamount","0")
    and it looks like this is wrong.i am getting the text Grossamount rather than values for that field in my output.so can anyone help me please?

    Hi chandra
    i am trying to get the same result by using sql script and CE functions.i have written the following code
    select A."PRODUCTID",
           E."TEXT" as "PRODUCTNAME",
           C."COUNTRY",
           D."DELIVERYDATE",
           Sum(D."GROSSAMOUNT") as "GROSSAMOUNT"
           from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Products" as A     
           inner join "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.BusinessPartner" as B
           on A."SUPPLIERID" = B."PARTNERID"      
           inner join "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses" as C
           on B."ADDRESSID" = C."ADDRESSID"
           inner join "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.Purchase.Item" as D
           on A."PRODUCTID" = D."PRODUCTID"
           inner join "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.Util.Texts" as E
           on A."NAMEID" = E."TEXTID"
           GROUP BY A."PRODUCTID",E."TEXT",C."COUNTRY",D."DELIVERYDATE"; 
    this is working fine but i want to split the grossamount based on current year and last year.Any idea how to do this
    In calculation view using script can we use if and case statements?

Maybe you are looking for

  • How can I get C or S number to register in ES workplace?

    Hi, I do want to register for ES workplace. I could not do that because of guest logon(P number). My company is Business One B1 partner with SAP. It seems that partners or customers are supposed to have C or S number. Shall we get C or S number? If y

  • How to hyperlink "Email this site"?

    How can I hyperlink "Email this site" on my webpage? (I have "email me" and "email [another person]" buttons done, but I can't find how the viewer can email the site to a friend. I can't find it in the online manual. http://web.mac.com/lwm2/mywebpage

  • Error in the MI2.5 client application

    Hi,    In the MI 2.5 standard application I am getting the following error: com.sap.mbs.core.api.BOException: Failed inserting Mam005: com.sap.mbs.core.api.BOException: Failed writing to Row: java.lang.IllegalArgumentException: Actual decimal length

  • Firefox crashes when I try to print a document such as an e-mail. How do I correct this?

    I am using Mac OS X version 10.5.8 and never had this problem before. If I go to print an e-mail off of my aol account or any other document off Firefox, then Firefox closes.

  • I hit vertical text in my iPhoto Book and now I can't change it back, help!!

    I am creating an iPhoto Book, and wanted some vertical text, so I highlighted my text and selected "vertical". It didn't go vertical, but now any time I highlight any text I can't see it, and I can't change the setting back, nor can I find any help a