Condition record selection for MATNR

Hi Experts,
I'm selecting the Condition Record Number(a505-knumh) for a Material Number like this.,(I want the record number whose validity date should be greater than today's date and whose begin date should be less than today's date.)
<b>    select knumh from a505 into i_price-knumh
           where kappl = 'V'
             and kschl = 'ZR10'
             and vkorg = '1000'
             and pltyp = '01'
             and matnr = itab-matnr
             and datbi >= sy-datum
             and datab <= sy-datum.</b>
But when I see the table a505, there are 3 records(knumh) for that material number (for eg: MATNR = 100813) like this:
-KAPPL|KSCHL |VKORG |PLTYP|MATNR|DATBI|DATAB  |KNUMH|
V |ZR10|1000|01|100813 |11/30/1992|08/01/1989|0000037438|
V |ZR10|1000|01|100813 |04/07/1996|12/01/1992|0000037439|
V |ZR10|1000|01|100813 |12/31/2039|04/08/1996|0000042185|
My problem is: When i'm selecting the record like this, it should display the 3rd record as my value.
but it is showing up the wrong values.
plz tell me what is the wrong with the selection statement.
thnx,
Message was edited by: dev a
Message was edited by: dev a

Hi Dev,
Are you looping internal table itab?
If you are then each loop the program will overwrite the internal table i_price with the new value. In other word,
you only get the last value from the select statment result.
Please try like the following example instead of looping internal table itab.
SELECT * FROM A306
INTO CORRESPONDING FIELDS OF TABLE T_HEADER_A306
FOR ALL ENTRIES IN ITAB_KSCHL
WHERE KSCHL EQ ITAB_KSCHL-KSCHL AND
       KSCHL IN KSCHL            AND
       VKORG IN P_1              AND
       VTWEG IN P_2              AND
       PLTYP IN L_1              AND
       WAERK IN H_1              AND
       MATNR IN L_3              AND
       KFRST IN L_2              AND
       DATAB >= DATLOW           AND 
       DATAB <= DATHIGH          AND
       KAPPL = 'V'.
Hope this will help.
Regards,
Ferry Lianto

Similar Messages

  • Creation of condition record (MEK1) for freight w.r.t. vendor in STO

    I am working in ECC 6.0 environment. My requirement is to fetch value of freight automatically w.r.t. selected vendor in condition while creation of STO.
    How can i define condition record by MEK1 for the same? Which access sequence needs to be assign to freight condition for creation of condition record of the same so system can fetch value of freight in STO w.r.t. vendor?

    hi,
    Create one access sequence for freight conditon with follwing table and assign the same that access sequnce to condtion .
    665     Vendor/Customer/Material
    716     Vendor/Plant/Material
    give the fright accout key for valution with FG cost add and seperate GR/IR vaules for vendor payment.
    while purchase order update conditon and in the view detial mentain transporter vendor for the same .
    pass the miro ref planned delivery cost
    Sans.

  • Pricing condition record Scales for width

    Hi,
    Wanted your expertise, as we are trying to implement scale for a pricing condition as below. Please advise which scale type to be used I think we should use D as interval graduated scale, but my query is my width value stored in material master and once order read it should pick the price as per interval . Need to know when i select type D it should not do graduation in same sales order for other lines. I mean if order has two line item with same material and third line with different material. system should calculate first line price 0.09 and second line should also pick price 0.09 as width is within 0 to 1
    third material should price 0.13
    please advise how this is posible because i think gradutaion type adds previous line record value, which we don't want.
    Mat 1 - 0.7 in
    Ma t2 - 0.9 in
    Mat 3 - 2.5 in
    0.000 - 1.000 in 0.090
    1.010 - 2.000 in 0.110
    2.010 - 3.000 in 0.130
    3.010 - 4.000 in 0.140
    4.010 - 5.000 in 0.150
    5.010 - 6.000 in 0.160
    6.010 in 0.200
    thanks
    Niki

    My order has quantity 1 and sales unit of measure is PAC and material base unit of measure is FT. As if now maintained condition record scale in FT for the width.
    in additional data of material we have unit convertion as below
    1     FT     Foot     <=>     1     FT     Foot                                                                                1.722     1.566     LB     1.000     FT
    1,566     LB     pound, US     <=>     1,000     FT     Foot                                                                                0.000          0.639     FT
    3,600     PC     Piece     <=>     54,600     FT     Foot                                                                                0.000          15.167     FT
    100     PAC     Pack     <=>     54,600     FT     Foot                                                                                0.000          546.000     FT
                                   <=>                FT     Foot                                                                                0.000                   
    thanks

  • Dates in the condition record maintenance for the condition type?

    Hi,
    Condition type has the following dates when maintaining the condition record,
    Valid from date:
    Valid on :
    Please ellaborate on the  above dates?
    Thanks

    Dear Rajiv
    Valid from date:-   The date from which the said condition type is applicable.  For example, in VK11, if you changed (let us assume PR00 changed to Rs.250 from 200) a condition with a date as  01-06-08 in the above field, only from 1st of June'08, whatever sale orders you generated, revised value of Rs.250 will flow in the respective sale orders.  Whatever created b4 1st June'08 will be having Rs.200.
    Valid on :-  As in the above case, if you input a date as 30-05-08 for the above condition type, system will populate Rs.200/- and if you input 01-06-08, it will propose Rs.250/-.
    Hope this explanation is suffice for you to understand the difference between the two fields.
    thanks
    G. Lakshmipathi

  • Controlling Record Selection for Subreports from the Main Report

    Post Author: Horizon57
    CA Forum: Formula
    Hello - I am generating a standard report template that will be applied to all of my accounts and I am connecting to an Access DB that has multiple tables. Each table corresponds to a single Subreport within my Mainreport and contains the data for all of the accounts. Essentially I would like to be able to write some logic in the Formula section of my Mainreport whereby I can control which account to run the report for based on the Account Name.  I am having sucess with this method when I change the parameters of the formula in each subreport, but how do I modify my code to allow me to control this from the mainreport.  An example of a formula is below. // Account AAA//{Subreport1.Account } = "AAA" and {Subreport2.Account } = "AAA" and {Subreport3.Account } = "AAA" and {Subreport4.Account } = "AAA"// Account BBB//{Subreport1.Account } = "BBB" and {Subreport2.Account } = "BBB" and {Subreport3.Account } = "BBB" and {Subreport4.Account } = "BBB"// Account CCC//{Subreport1.Account } = "CCC" and {Subreport2.Account } = "CCC" and {Subreport3.Account } = "CCC" and {Subreport4.Account } = "CCC" Essentially, I am looking to just uncomment the particular Account I would like to produce the report for and have that filter down to all the subreports. How do i Modify the logic? Is there a better way to approach this?

    Post Author: Horizon57
    CA Forum: Formula
    Thanks for all the responses..... Just to clarify, I am essentially trying to control the record selection of each subreport with a forumula in the mainreport. To this end I am trying to avoid having to modify the formula in each subreport to change accounts each time i need to run a set of reports. I am still not having any luck modifying the subreport links as mentioned above. The only way I have been able to control the data is with formulas in each subreport. If anyone has accomplished what I am attempting, could you post an actual formula from both the subreports and mainreport so I can try to mirror them. Also, if anyone can point me to an example where I can integrate a dialog box to automatically control the record selection (as mentioned above), that would be great. Thanks,Mike

  • How to restrict the record selection for PLPO table .

    Hi,
    Am selecting 'plnnr' and 'vornr' from PLPO table . For one Plnnr their are multiple Vornr including 0001 & 9999.
    I want to select only those entries which have only Vornr 0001 & 9999.
    Ex : 1) Plnnr - 5689
               Vornr - 0001,2536,8989,9999
           2) Plnnr - 8787
               vornr -  0001
           3) Plnnr - 5936
               vornr -  9999
           4) Plnnr - 2345
               vornr -  0001,9999
    Here for this example i want to select only the entry with Plnnr = 2345 as it only contains 0001 & 9999.
    Can any one let me know how to get this in a select query.
    Your help is much appreciated.
    Thanks in advance.   
    Ravi Kasnale.

    Hi
    Try with below code
    RANGES:r_vornr FOR plpo-vornr.
    TYPES:BEGIN OF ty_plpo,
    plnnr TYPE plpo-plnnr,
    vornr TYPE plpo-vornr,
    END OF ty_plpo.
    DATA:it_plpo_temp TYPE STANDARD TABLE OF ty_plpo.
    DATA:it_plpo TYPE STANDARD TABLE OF ty_plpo.
    DATA:it_plpo_temp1 TYPE STANDARD TABLE OF ty_plpo.
    DATA:wa_plpo_temp1 TYPE ty_plpo.
    DATA:v_line TYPE sy-tabix.
    START-OF-SELECTION.
      r_vornr-sign = 'I'.
      r_vornr-option = 'EQ'.
      r_vornr-low = '0000'.
      CLEAR:r_vornr-high.
      APPEND r_vornr.
      r_vornr-sign = 'I'.
      r_vornr-option = 'EQ'.
      r_vornr-low = '9999'.
      CLEAR:r_vornr-high.
      APPEND r_vornr.
      SELECT plnnr vornr FROM plpo INTO TABLE it_plpo_temp1 WHERE vornr IN r_vornr.
      CLEAR:it_plpo[].
      LOOP AT it_plpo_temp1 INTO wa_plpo_temp1.
        CLEAR:it_plpo_temp[].
        it_plpo_temp[] = it_plpo_temp1[].
        DELETE it_plpo_temp WHERE plnnr <> wa_plpo_temp1-plnnr.
        DESCRIBE TABLE it_plpo_temp LINES v_line.
        IF v_line EQ '2'.
          APPEND LINES OF it_plpo_temp TO it_plpo.
        ENDIF.
      ENDLOOP.
      SORT it_plpo BY plnnr.
      DELETE ADJACENT DUPLICATES FROM it_plpo COMPARING plnnr.
    Regards
    Srilaxmi

  • Conditionally record selection

    I have a table named t1 wih two columns
    col1 ,col2 and col3
    create table t1
    (col1 date,
    col2 varchar2(20),
    col3 number);
    COL1 COL2 COL3
    15-JAN-2008 00:00:00 A 4
    15-JAN-2008 00:00:00 B 7
    15-JAN-2008 00:00:00 C 9
    15-JAN-2008 00:00:00 D 5
    16-JAN-2008 00:00:00 A 3
    16-JAN-2008 00:00:00 B 2
    16-JAN-2008 00:00:00 C 6
    16-JAN-2008 00:00:00 D 7
    17-JAN-2008 00:00:00 A 4
    17-JAN-2008 00:00:00 B 1
    17-JAN-2008 00:00:00 C 7
    17-JAN-2008 00:00:00 D 3
    17-JAN-2008 00:00:00 E 3
    18-JAN-2008 00:00:00 A 2
    18-JAN-2008 00:00:00 B 4
    18-JAN-2008 00:00:00 C 5
    18-JAN-2008 00:00:00 D 3
    17 rows selected.
    here i want to find the max(col1) and max(col1)-1 then compare the missing columns2 and display for the max(col2)the data for each date with the all the distinct values of col2.
    i.e on 18thjan i don't have data for E(col2) but i have data for E on 17th jan
    COL1 COL2 COL3
    15-JAN-2008 00:00:00 A 4
    15-JAN-2008 00:00:00 B 7
    15-JAN-2008 00:00:00 C 9
    15-JAN-2008 00:00:00 D 5
    16-JAN-2008 00:00:00 A 3
    16-JAN-2008 00:00:00 B 2
    16-JAN-2008 00:00:00 C 6
    16-JAN-2008 00:00:00 D 7
    17-JAN-2008 00:00:00 A 4
    17-JAN-2008 00:00:00 B 1
    17-JAN-2008 00:00:00 C 7
    17-JAN-2008 00:00:00 D 3
    17-JAN-2008 00:00:00 E 3
    18-JAN-2008 00:00:00 A 2
    18-JAN-2008 00:00:00 B 4
    18-JAN-2008 00:00:00 C 5
    18-JAN-2008 00:00:00 D 3
    18-JAN-2008 00:00:00 E 0
    Thanks

    Alternative, assuming that col2 is alphabetic and can have more than just A-E..
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select to_date('15-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS') as col1, 'A' as col2, 4 as col3 from dual union all
      2             select to_date('15-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'B', 7 from dual union all
      3             select to_date('15-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'C', 9 from dual union all
      4             select to_date('15-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'D', 5 from dual union all
      5             select to_date('16-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'A', 3 from dual union all
      6             select to_date('16-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'B', 2 from dual union all
      7             select to_date('16-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'C', 6 from dual union all
      8             select to_date('16-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'D', 7 from dual union all
      9             select to_date('17-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'A', 4 from dual union all
    10             select to_date('17-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'B', 1 from dual union all
    11             select to_date('17-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'C', 7 from dual union all
    12             select to_date('17-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'D', 3 from dual union all
    13             select to_date('17-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'E', 3 from dual union all
    14             select to_date('17-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'F', 5 from dual union all
    15             select to_date('18-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'A', 2 from dual union all
    16             select to_date('18-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'B', 4 from dual union all
    17             select to_date('18-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'C', 5 from dual union all
    18             select to_date('18-JAN-2008 00:00:00','DD-MON-YYYY HH24:MI:SS'), 'D', 3 from dual)
    19  --
    20     ,d as (select max(col1) col1 from t union all
    21            select max(col1)-1 from t)
    22     ,v as (select chr(64+rownum) as v
    23            from dual connect by rownum <=
    24                 (select max(ascii(col2)) - min(ascii(col2)) + 1 from t join d on (t.col1 = d.col1))
    25           )
    26  --
    27  select col1, col2, col3 from t where col1 not in (select col1 from d)
    28  union all
    29  select d.col1, v.v, nvl(t.col3,0) as col3
    30  from   d cross join v
    31         left outer join t on (t.col1 = d.col1 and t.col2 = v.v)
    32* order by 1,2,3
    SQL> /
    COL1        C       COL3
    15-JAN-2008 A          4
    15-JAN-2008 B          7
    15-JAN-2008 C          9
    15-JAN-2008 D          5
    16-JAN-2008 A          3
    16-JAN-2008 B          2
    16-JAN-2008 C          6
    16-JAN-2008 D          7
    17-JAN-2008 A          4
    17-JAN-2008 B          1
    17-JAN-2008 C          7
    17-JAN-2008 D          3
    17-JAN-2008 E          3
    17-JAN-2008 F          5
    18-JAN-2008 A          2
    18-JAN-2008 B          4
    18-JAN-2008 C          5
    18-JAN-2008 D          3
    18-JAN-2008 E          0
    18-JAN-2008 F          0
    20 rows selected.
    SQL>

  • BAPI for creation of condition records  MEK1 tcode

    Hi,
        Any one used to upload condition records data for MEK1 transaction code. Please give me reply any once knows.
    Thanks in advance
    Shaik Basha

    Hi Vijay,
        Thanks for giving reply. I checked BAPI_PO_Change and
    BAPI_PO_CREATE1. But in these two PO number is the mandatory field. In mek1 tcode, for particular condtion type key combination i dont have any PO field that time i will use this FMs. Please give me advice regarding this.
    I am also facing some other problem i.e to change the routing master data. I alreay downloded data from routing master in excel and i did changes in excel. Now i';ll upload the excel to sap that will update the routing master. If u have any idea for updating the routing master data.please send me the fm.
    Regards
    Shaik Basha.

  • Display of condition record for PPF actions

    Hi,
    Standard ECC functionality provides the option to view the condition record considered for relevant condition type in sales order etc . Please inform whether I can see the PPF condition record in similar way for relevant documents like IBD , ODO etc.
    Thanks in advance.
    With regards,
    Mrinal

    Hi Mrinal
    Best find out the object/table and create new report in WH-Monitor.aj
    Regards
    Sur

  • Table for Rebate Condition Types( Condition Records)

    Hello All,
    I need the table and the FM name which stores the values of the Key Combination of the Rebate Condition Type maintained in a Rebate Agreement.
    If not, at least, give me the name of the FM which stores the values of the key combination maintained in condition records for pricing.
    Regards,
    Raghu.

    I'll give an example,what am looking for..:
    I've a Condition Type: ZBAX for ex. it has a key combination: Sales OrgCustomerMaterial.
    I maintain condition records as:
    For CU70/21100043/3456  the value of the condition record is say 100 euro.
    My question is where will I get the values CU70/21100043/3456 ?
    FYI..in T685 the defintion of the Condition Type is stored. in SAP, no T-table is meant to store condition record values.
    KONA contains data on Rebate Agreements i.e. RA no, Rebate Recepient etc..
    I know that KONP stores the accrual %, scale base, scale values etc..
    but, I want to know where are the values for the key stored? Or, the FM that would fetch me these details?
    I hope am clear..
    Regards,
    Raghu.

  • Authorization level check for Condition records.

    Hi,
    Hi Gurus,
    Pls help me out in the the following scenario.
    I want to activate Authorization level check for Condition records.
    For example, Product price PR00 is being entered by first level.
    After verification done by second level only, that condition record to be used for sales order processing.
    I have gone through Process status & Release Status. But once it is Blocked  i am not able to release it...
    Rgds,
    Amol

    Amol,
    Please confirm transaction code you are using in this scenario to release. I can help with this, just a little more detail.
    Thanks,
    Jay

  • Process Status & Release Status for Condition Record

    Hi Gurus,
    Pls help me out in the the following scenario.
    I want to activate Authorization level check for Condition records.
    For example, Product price PR00 is being entered by first level.
    After verification done by second level only, that condition record to be used for sales order processing.
    I have gone through Process status & Release Status. But not getting full clarity on this.
    Rgds,
    Senni.B

    Hi,
    Please go through the following information.
    [Relase Procedure for Condition Record|http://help.sap.com/saphelp_47x200/helpdata/en/a4/af9e78e69611d2ace10000e8a5bd28/frameset.htm]
    [Release Procedure for PR|http://www.sap123.com/showthread.php?t=59]
    Reward if helpful.
    Thanks and Regards,
    Naveen Dasari

  • TAXINN SD For Excise Duty where to maintain TAX CODE in condition record?

    is Tax code necessary for excise determination in TAXINN in SD Scenario? While maintaining condition record ( JEXP) for Excise access sequence JEXC doesnu2019t has Tax Code field Whereas for Sale Tax determination ( JCST/JLST) access sequence JLST /CST which has Tax code field . (In TAXINN we create Dummy tax code (blank))
    is it true whatever I have written ? If yes then what is use of tax code where it triggers in FI Posting? Why we use only for Sale Tax not for Excise duty?
    If u go to SAP Std condition type & access sequence provide for CIN in SD (TAXINN) While maintaining condition record ( JEXP) for Excise. Access sequence JEXC doesnu2019t has Tax Code field . do u think we should modify that create field for Tax code ..... Pl check in system & answer the question .......I hope u understand what i want to ask.

    Hi,
    As per my knowledge, Excise is not Tax its a Duty....
    Excise gets added to your base price and the tax is calculated on the whole amount and not only the basic price.
    Say if u r manufacturing a material and u r under excise regulations, then without paying excise duty you can't move the goods out of your premises, Here even before you sell the material to a customer the excise duty is paid from you. But when u will be selling the material to a customer, the customer is charged the excise duty which gets added to the net value and then the sales tax is calculated.
    If u see a sale order condition tab page, there are two fields
    1. Net Value      2. Tax
    Net value is the value which includes the excise duty and the tax is only the CST/LST/VAT.
    Regards

  • Condition records in sales orders

    Hi All
    My requirement is when ever  i create a sales order, system should not allow be save the sales order without condition records
    Some times there is not CST or VAT condition records found for the customers, the system is showning the value as ZERO.
    In this case system is allowing me to save,
    I want to make this condition record as mandatory without any values system should not save the document.
    quick reply will be highly appreciated

    Hi
    I have 2 different sales tax condition types both are used in the same pricing procedure, so i cant make both as mandatory depending on the customer region the system pickup the condition records. I need this feature to be based on customer region.
    1.Try to Maintain the Condition record with combination of Customer Region and material ( based on your requirement )
    2. go to T-Code V/08 , select your pricing procedure and click on the control , "UnTick" the manual and Required of those condition Types
    Try to Create sales order and check
    Regards,
    Prasanna

  • Sales & purchase output condition records

    Hi ,
    I am asked to develop a query for the sales output condition records and the purchase output condition records.
    Can someone help me with the details like tables and the selection I can make to test them ?
    Please help me with the transaction code for the same too.
    Thanks in advance.

    You can use transaction NACE to display condition records.
    Execute NACE > Select Application V1 - Sales from list > then select button 'Condition Records' > select output > select key conbination > then report will occur with Slection.
    You can do the same steps for Application EF - Purchase Order
    If you wants to find out tables you can go to respective reports and find tables given in program under statement TABLE
    For sales there are tables for different key combinations like B001, B915, B520, B511 etc. for Purchase Order tables like B025, B504, B027 etc basically tables starts with B*
    I am not sure why you need to develope query because these reports gives list of condition records maintained for particular output.
    Hope it helps !!

Maybe you are looking for

  • Yoga 2 Pro Touch screen not working

    I've had no problems with my yoga 2 pro for over a month, but last night I decided to do windows updates.  This is the model with the i7, and 8gb of ram.  I let it update and then restarted it.  After it started up, I tried to swipe the cover screen

  • PR00 does not calculate / deleted for TANN in R/3 for CRM order - Free Good

    I hv done free good configuration both in R/3 and CRM. Main Category - TAN and Free good category - TANN Pricing for TANN = PR00 and ZFRE -100% discount When I see result in R/3 and CRM, it does populate PR00 and calculate ZFRE. While in Order creati

  • Error while connecting 10g developer to 11 g database (windows7 64 bit)

    pls help me.I have 11g database in my laptop and I installed oracle developer suit 10g ..everything seems normal but when I try to connect to database , I am getting tns error ora12154:TNS couldnt resolve the connect identifier.. I know this thing ab

  • Configure Airport via ethernet connection

    Hi everyone, Is there a way to connect to and adminster Airport Extreme base station using a physical (ethernet) connection? I could have sworn I've done this before but cannot seem to do it now and when I try, Airport Utility simply says it cannot f

  • HT204053 how to I find my pictures

    how do I save my pictures and videos from my iphone to my icloud account and how do i view them?