Syntax for validating data..

Hi friends
I have one internal table with material no.,i want o check wheather that data is there in standard table or not..
how to check..?
and after checking if that particular material is not there i have to move the data in other internal table..
plz give me one example also..

For material MARA is the master table.
Check the table before selecting the data.
whether the material avilable or not?
tables : mara.
selection-screen begin................
parameter p_matnr like mara-matnr.
selection-screen end of..................
if p_matnr is not initial.
at selection-screen on p_matnr.
select single * from mara into mara where matnr = p_matnr.
if sy-subrc <> 0.
Raise the message.
endif.
endif.
Hope it will help you.
Regards,
Madan.
Edited by: Madan kurapati on May 19, 2008 11:36 AM

Similar Messages

  • FM for validating date coming from a file

    HI All,
    I have to validate date that needs to be validated before passing it to DB.
    Is der any FM for same
    I tried CONVERT_DATE_TO_INTERNAL.
    But it accepts date only in one specified format.

    hi,
    try this
    Use Function module DATE_CHECK_PLAUSIBILITY to validate a date.
    1)If you given a invalidate date then it will ask you to enter a valid date.
    2)After changing it to correct value, you can click on SAVE button or if you want to continue with the invalid date then click on USE INVALID VALUE button.
    Try with this code.
    PARAMETER P_DATE TYPE SYDATUM.
    CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
    EXPORTING
    date = P_DATE
    EXCEPTIONS
    PLAUSIBILITY_CHECK_FAILED = 1
    OTHERS = 2.
    IF sy-subrc 0.
    MESSAGE E000(ZI) WITH 'INPUT DATE IS INVALID DATE'.
    ENDIF.
    Regards,
    RItesh J

  • Need a Better Regular Expression for Validating Dates

    I have data coming from file with date in the format DD-MON-YY.
    I have created the following regular expression:
    '^([0-2]{1}[0-9]{1}|[3]{1}[0-1]{1})-(JAN|FEB|MAR|A PR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC|Jan|Feb|Mar|Apr |May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-[[:digit:]]{2}$'
    However, it doesn't catch dates like 31-APR, 29-FEB. Can someone make changes to it to make it foolproof
    WITH temp AS
    (SELECT '29-FEB-07' AS COL1 FROM DUAL
    UNION ALL
    SELECT '31-APR-08' FROM DUAL
    UNION ALL
    SELECT '32-JAN-08' FROM DUAL
    UNION ALL
    SELECT '29-MAR-08' FROM DUAL
    UNION ALL
    SELECT '31-JAN-08' FROM DUAL)
    SELECT COL1,
    CASE WHEN REGEXP_LIKE(COL1,'^([0-2]{1}[0-9]{1}|[3]{1}[0-1]{1} )-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC |Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)- [[ :digit:]]{2}$')
    THEN 'VALID'
    ELSE 'INVALID'
    END
    FROM TEMP;

    Hi,
    Please check this function.
    The function works for the dates in the format 'DD-MON-YYYY','DD/MON/YYYY'.
    create or replace function date_validation_f(v_date varchar2) return varchar2 is
    v_ip_date     date;
    v_ip_date_ch  varchar2(20);
    v_ip_year  number;
    v_ip_month char(3);
    v_ip_day   number;
    v_return   varchar2(10);
    v_leap_year_check number :=0 ;
    type v_month_name_typ      is varray (12) of char(3);
    type v_month_last_day_typ  is varray (12) of number(2);
    v_month_name     v_month_name_typ    :=v_month_name_typ('JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC');
    v_month_last_day v_month_last_day_typ:=v_month_last_day_typ(31,28,31,30,31,30,31,31,30,31,30,31);
    begin
    --Assuming that input date is in the format DD-MON-YYYY or DD/MON/YYYY
    v_return := 'invalid';
    v_ip_date := to_date(v_date);
    v_ip_date_ch := to_char(v_ip_date,'DD-MON-YYYY');
    dbms_output.put_line('v_ip_date_ch := '||v_ip_date_ch);
    v_ip_month   := substr(v_ip_date_ch,4,3);
    dbms_output.put_line('v_ip_month := '||v_ip_month);
    v_ip_day    := substr(v_ip_date_ch,1,2);
    dbms_output.put_line('v_ip_year := '||v_ip_year);
    v_ip_year     := to_number(substr(v_ip_date_ch,8,4));
    dbms_output.put_line('v_ip_day := '||v_ip_day);
    -- Ckecking for leap year
    if MOD(v_ip_year,4)=0 then
      if MOD(v_ip_year,100)=0 then
        if MOD(v_ip_year,400)=0 then
           v_leap_year_check:=1;
        end if;
      else
           v_leap_year_check:=1;
      end if;
    end if;
    if v_leap_year_check = 1 then
       v_month_last_day(2):=29;
    end if;
    for i in 1..12
    loop
    if v_month_name(i)=upper(v_ip_month) then
         if v_ip_day between 1 and v_month_last_day(i) then
            v_return := 'valid';
            exit;
        else
            v_return := 'invalid';
            exit;
        end if;
    end if;
    end loop;
    dbms_output.put_line('v_return := '||v_return );
    return v_return;
    exception
    when others then
    return v_return;
    dbms_output.put_line(SQLERRM);
    end;you can use this function in SELECT statement.
    Edited by: Sreekanth Munagala on Nov 13, 2008 11:25 PM

  • User Exit for Validity Date for VA41 Tcode

    Hi,
    I am giving order type in VA41 Tcode and then Clicking on 'Create with Reference' .Then  a Pop Up is getting generated. In this i am giving Contract created with validity date lessthan today's date(in Contract Tab).For Example i created a Contract xxxxxx with 'valid to'  9.12.2008. When I am giving this contract and clicking on 'Copy' button a Warning message is getting generated 'The sales document is only valid until 09.12.2008'. Now i have to change this into Error message instead of Warning Message.
    i used User Exits  mv45afzz,MV45AFZA,MV45AFZB. But the debugger is getting started only after Warning message got generated.Is there any User Exit for which debugger gets started  when i give the Contract and then Click on 'Copy' button. Please Suggest.
    Thanks and Regards
    K Srinivas

    Hi,
    One idea. Go to VTAA (copy between sales docs) and create a new VOFM where you manage the copy control. Set a warning/error message in the new VOFM (in your range number), and try it.
    Regards,
    Eduardo
    Edited by: Eduardo Hinojosa on Dec 10, 2008 3:58 PM

  • SQL Syntax for hour/date range in Query

    Hi
    I am trying to set up an query for sales order documents procesed in the last 30 minutes to be set as an alert to be run every 30 minutes to the sales manager.  I am having difficulty getting the syntax for the last 30 minutes
    Any suggestions?
    David

    hi,
    I'm not sure query is correct,but u can modify it futher to get correct one.
    SELECT T0.DocNum, T0.DocDate, T0.CardName, T0.DocTotal FROM ORDR T0 WHERE DateDiff(dd, T0.DocDate ,getdate()) = 0 and
    DateDiff(Minute,T0.DocTime,' ') <= 30
    Jeyakanthan

  • Regarding Function module for validating Date

    Hi ,
    Cananybody tell me that is there any function mdoule for validating the BGDDA and ENDDA.

    dear ,
    See if you are using it in the input parameter then you dont need to validate .
    Beacuse selection option has that option .
    secondlly if you are checking internally then is could be done simplly by if condition
    regds ankit

  • Fm for Validity Dates.

    Hi Gurus,
    I need Discount Condition Start Validity Date and Discount Condition End Validity Date along with condition details.
    I have tried  RV_INVOICE_DOCUMENT_READ &
    FM RV_PRICE_PRINT_HEAD is returning all the pricing conditions in the invoice in TKOMV, but I couldn't find the Validity Dates in TKOMV.
    please help me to sort out my problem.
    I have closed my previous [Thread|http://forums.sdn.sap.com/thread.jspa?threadID=2139454]
    Thanks & regards.

    Hi,
    try use COND_VALIDITY_FOR_SINGLE_DATE, may help u
    Thanks & regards.

  • Syntax for retrieving data from a task container

    Hello Workflow Fans !
    I have a Task with the following configuration:
    BASIC DATA - Object Method :
    Object Category: BOR Object Type
    Object Type: ZBusObj1
    Method: 022_Data_Upd
    CONTAINER :
    I have added a second BOR Object in the container called ZBusObj2
    In conclusion, when the task is executed within my WF run, the method ZBusObj1.022_Data_Upd is executed and both business objects (ZBusObj1 and ZBusObj2) should be available in my Task container.
    My question:
    How, in my method 022_Data_Upd, can I retreive (get) the value of the ZBusObj2 key field (Customer No)?
    Here is what I tried... obviously... without any success:
    BEGIN_METHOD O22_Data_Upd CHANGING CONTAINER.
      break-point.
    * Variable declarations
      DATA: lva_Risk_Cat    TYPE ZTCOMP_PDV-CTLPC.
      DATA: lva_Montant_V TYPE ZTCOMP_PDV-MONTANT_V.
      DATA: lva_Custno       TYPE KNA1-KUNNR.
    * Data retreival from the task container 
      SWC_GET_PROPERTY self 'RiskCategory' lva_Risk_Cat.
      SWC_GET_PROPERTY self 'MONTANT_V'    lva_Montant_V.
      SWC_GET_ELEMENT container 'ZBUSOBJ2.Customerno' lva_Custno.
    The last line (SWC_GET_ELEMENT...) is the one I'm strugling with...
    Any help will be appreciated.
    Thanks in advance.
    José

    So, my understading is that you need an instance of the second object OBJ2 inside the method of the first object OBJ1.
    First, if you only need the customer number, I recommend that you only pass the number itself. Here is what you need to do:
    1- Add an "Import" parameter to method 022_DATA_UPD and call it anything (I'll use PARAM): the parameter can be either an object or a field. You specify the type when you define the parameter. Parameters are added by "single" clicking the method name in SWO1 so that the pointer is on the method name then clicking the "Parameters" button.
    2- Inside the method, add the following code
    Case 1: parameter is an object
    DATA: lvo_custobj  TYPE swc_object.
    DATA: lva_custno TYPE KNA1-KUNNR.
    swc_get_element container 'PARAM' lvo_custobj.
    swc_get_property lvo_custobj '<CUSTOMER_NUMBER_PROPERTY_NAME>' customer_number.
    Case 2: parameter is just a field
    DATA: lva_custno TYPE KNA1-KUNNR.
    swc_get_element container 'PARAM' lva_custno.
    As you can see, adding only the customer number is easier to read. The method should work when you test it in SWO1 before you proceed into the next steps.
    3- Make sure the standard task calling the method is updated with the new parameter. Basically open the task in change mode and type an extra space in the description field then hit Enter. The system will ask you if you want to update the list of parameters.
    4- Update the binding of the task in the workflow template to pass either the customer object or customer number.

  • Syntax for embeding data bound values

    This does not work:
    source="@Embed(source='{sourceFile}'))" autoLoad="true"/>
    <mx:String id="sourceFile">file:///C|/FlexWork/flex
    maps/assets/products/Talby.png</mx:String>
    nor does simply @Embed({sourceFile})
    So what does work?

    Also @Embed(source="{sourceFile}) does not work.
    BTW, can one Embed an XML file
    <mx:XML source={whatever} />
    "Yechezkal Gutfreund" <[email protected]> wrote in
    message
    news:eci6o0$juc$[email protected]..
    > This does not work:
    >
    > source="@Embed(source='{sourceFile}'))"
    autoLoad="true"/>
    > <mx:String
    id="sourceFile">file:///C|/FlexWork/flex
    > maps/assets/products/Talby.png</mx:String>
    >
    >
    > nor does simply @Embed({sourceFile})
    >
    > So what does work?
    >
    >
    >

  • Syntax for Data Pump in Oracle Database 11g

    Hi, thanks to all. i myself clarifying many doubts by refering the POSTS in this Forum.
    I need the syntax for the Data Pump in Oracle 11g.
    Could you post the syntax plese.
    Thanks & Regards..

    Hello,
    You may have all the options in Datapump by typing the statements belows:
    expdp help=y
    impdp help=yElse, you'll have much more details and examples in the Utilities book from Oracle 11g documentation on the link below:
    http://www.comp.dit.ie/btierney/Oracle11gDoc/server.111/b28319/part_dp.htm#i436481
    Hope this help.
    Best regards,
    Jean-Valentin
    Edited by: Lubiez Jean-Valentin on Apr 19, 2010 11:07 PM

  • Can I exit from paintComponent?  ...or... how can I check for invalid data?

    I'm writing a calendar applet for a programming class and I've nearly completed it but I'm stuck at checking for valid data.
    What seems to be happening is that paintComponent() is being called before actionPerformed.
    In actionPerformed (when they click the button), it checks to make sure they entered a valid month (1 to 12). If the didn't it dispalys a message, but if they did it calls repaint().
    But even if repaint() isn't called, Java still seems to call it before actionPerformed and I get exceptions.
    So I tried checking inside of paintComponent() by using a simple if(...) return; but that doesn't seem to do anything... it just keeps going through with the method.
    So -- Once the user presses my button I want to make sure the data is valid before repainting the screen. How can I do this?

    I validate it in actionPerformed which is called by
    the action listener... that is what you meant right?
    The problem is that it seems paintComponent() is being
    called before I can validate the data with
    actionPerformed(). I need to stop paintComponent()
    from always being calledMVC. (Model, View, Controller)
    Initially the internal value of the data (the model) should be valid (or null with a check in the paintComponent method)
    paintComponent (the view part) shows the state of the valid data.
    You press the button.
    actionPerformed is called (the controller).
    It checks the value and, if valid, writes it to the data (model), then updates the view.
    At no point will the view have to render invalid data, because the model is only updated after actionPerformed checks the value.
    The pattern may be applied with different classes performing the three roles, or different methods in the same class (sometimes it's easier that way for simple cases).
    Pete

  • Regarding validating data using excel add-in

    hi
    i am new to essbase, please any help me regarding the steps to be followed for
    validating data that is loaded in to a cube using excel add-in

    There are no standard steps.
    If you wish to just cross check the data which has been loaded in cube ,then Identify the level 0 combination of members in data source from where cube is picking up data (Oracle,flat file ..etc) and retrieve the same combination through excel addin and compare the data.
    hope this will help !

  • What is the proper SQL syntax for dates input as variable

    Hello,
    I am working on an ASP JavaScript page that requests totals
    from an Access database for a specific date range. I can write the
    SQL statement to query the DB and get the results I need using the
    WHERE statement below.
    ...WHERE LABOR_DATE BETWEEN #7/15/2006# AND #7/18/2006# GROUP
    BY [LABOR].[JOB_NUMBER_NAME]
    I have another page that I want to pass two variables in
    Dreamweaver specifying the date range varBeginDate and varEndDate
    and query the database using the date range input by the user.
    What is the correct syntax for replacing the actual dates in
    the example above with my variable values?

    Short answer - you can't. There's no automatic link between file paths and mounting servers. There are lots of valid reasons for this (e.g. preventing malicious links from automatically opening files from remote servers), but you can get there in a controlled environment.
    You can configure Automounts on any directory. That way whenever any application tries to access a particular path the OS will automatically mount the directory, but it needs to be told in advance which directories (and which servers) to mount.
    For example, if you'd configured your iTunes Library to be saved at /mnt/itunes and it's served from afp://mediaserver.your.net/path/to/itunes you would configure an automount to mount the AFP server at /mnt/itunes.
    Since its an automount, the OS wouldn't mount the server until some process tried to read /mnt/itunes.
    There are several ways of specifying automounts, and for each there are several tutorials online that walk you through the process. Try Mike Bombich's site for a starter.

  • Power View in SharePoint Server - The data extension type for a data source is not valid

    Hi All,
    All of a sudden I am getting following error when trying to create Power View report using shared report data source (no error testing the connection):
    "The current action cannot be completed. The data extension type for a data source
    'http://dev/Shared Ducuments/Sales.rsds' is not valid for this operation"
    I already have a data source (I had created it after creating my site collection a week ago) and when I use this source to create Power View report then there is no error but I am getting above error when I create another similar data source and use it to create
    a Power View report.
    Please help me to resolve the error.
    Thanks

    I am going nuts! I had selected 'Analysis Services' instead of 'Microsoft BI Semantic Model for Power View'

  • Table for Valid To date field in C203 Tcode

    Let me know the table name for "Valid To Date" field in C203 transaction.
    Thanks,
    Angavai.E

    Hi Angavai,
    Check with table PLMW.
    Regards,
    Raghu

Maybe you are looking for

  • I have two MacBook Pros. Can I use one Apple ID?

    I have two MacBook Pros and I really would like to use just one Apple ID. Can I link my facetime (and imessage) to my phonenumber on both or just on one computer? My phone number is linked to my apple id already and I have it linked to one macbook. I

  • My iphone 5 is not being detected on itunes

    just bought an iphone 5 second hand and it wont show up on itunes. my partners iphone 5 is showing up but not mine. ive tried differnt usb port and turned lap top off and on. can someone help me please

  • Finder won't launch at startup

    What's the best way out of a problem which stops the Finder launching at startup? I have no idea why my recently clean-installed system seems to spontaneously start corrupting in the middle of innocuous tasks but here's my own grisly log of this issu

  • Photo Booth doesn't recognize logitech camera

    I have a logitech camera, it works with Skype, iChat and is recognized by Photo Booth but the screen (photo booth screen) is black. If I take a picture, it counts down but then nothing. The camera works in all other apps. If I remove my Elgato Hybrid

  • Issue launching InDesign trial

    Hi, I have installed the InDesign trial but when i launch it i get the following error message "Unable to launch InDesign as you dont have sufficient permissions to access the preferences folder. Ensure that you have appropriate permissions and the r