How to validate when date format is diff Internally and externally

Hello,
How can I validate the Date format if Internal format and external format is different.
Ex :
*  SELECT SINGLE CRTSP
**                FROM /SAPSLL/PR
**                INTO L_CRTSP
**                WHERE CRTSP IN S_CRTSP .
CRTSP (YYYY/DD/MM HHMMSEC) Internal Format
S_CRTSP (YYYY/DD/MM) External format - selection option
I had done following to convert the internal format to external format.
DATA : LV_DT TYPE STRING.
DATA :  L_CRTSP TYPE /SAPSLL/CRTSP.
SELECT SINGLE CRTSP
                FROM /SAPSLL/PR
                INTO L_CRTSP.
MOVE : L_CRTSP TO LV_DT. "(YYYY/DD/MM HHMMSEC)
L_LEN = STRLEN( LV_DT ).
L_DATE = LV_DT+0(8).
I have the date format that i need in L_DATE."  (YYYY/DD/MM)
Now how should I validate?
*  SELECT SINGLE CRTSP
**                FROM /SAPSLL/PR
**                INTO L_CRTSP
**                WHERE CRTSP IN S_CRTSP .
Please let me know how can I validate or how can I write the select query to validate this field.
There should be some way using Wildcard or some function module...which I am not sure...
Any suggestions will be appreciated!
Regards,
Kittu
Edited by: Kittu on Jan 6, 2009 12:58 PM

Hello,
Thank you for youe response and I apprecaite the help so far.
This logic work if it is Parameter...When I have select option it is not working as it is not taking the range values...
SELECT GUID_PR "Primary Key as GUID in "RAW" Format
CRTSP "PRODUCT CREATED ON
CHTSP "PRODUCT CHANGED ON
FROM /SAPSLL/PR
INTO TABLE T_PR.
DATA : T_PR1 TYPE TY_PR OCCURS 0 WITH HEADER LINE.
DATA:  W_TEST    TYPE STRING,
       W_LV_LEN  TYPE I,
       W_LV_LEN1 TYPE I,
       W_LV_DATE(20)  TYPE C,
       W_LV_DATE1(20) TYPE C.
DATA : W_V(8) TYPE C,
       S_CT(11) TYPE C.
SORT T_PR BY CRTSP CHTSP.
LOOP AT T_PR INTO WA_PR.
  W_TEST = WA_PR-CRTSP.
  W_LV_LEN = STRLEN( W_TEST ).
  W_LV_DATE = W_TEST+0(8).
** IF WE SELECT ONLY ONE DATE IN SELECT OPTION
s_crtsp VALUE IS - IEQ20040101..bY REMOVING FIRST THRID DIGITS
WE ARE GETTING THE S_CRTSP VALUE IS 20040101 AND THIS LOGIC IS WORKING FINE..
   MOVE S_CRTSP TO S_CT.
  W_LV_LEN1 = STRLEN( S_CT ).
  W_LV_DATE1 = S_CT+3(8).
*  IF W_LV_DATE NE S_CRTSP
IF W_LV_DATE NE W_LV_DATE1.
  W_FLG = 'X'.
    DELETE T_PR INDEX SY-TABIX.
  ENDIF.
  CLEAR W_FLG.
ENDLOOP.
Can we do anything for this...
ANy suggestions would be apprecaited!
Regards,
Kittu

Similar Messages

  • How to validate a date in message mapping

    Hi experts,
                    how to validate a date in message mapping. For ex:  if date comes as 2008/02/31, then file it shold not get processed.how to achieve this in message mapping. Please help .
    Thanks&Regards,
    Reyaz Hussain

    Hi,
    There are few simple ways for date validation as follow,
    1.If you would like to handle it in XI only, then in message mapping you could verify about it with the help of generating smart exception.
    For e.g in mapping there is one Date conversion API i.e. somthing DateTransformation It converts the incoming date format to required format. Here give the date format i.e expected from Sender File.
    If in case the format miss-matched then it will create the exception.
    You could handle this exception with the use of [Alert notification|http://help.sap.com/saphelp_nw04/helpdata/en/2c/abb2e7ff6311d194c000a0c93033f7/frameset.htm] and could be even able to notify to sender system about it.
    2. The another solution is easy for SAP synchornous communication --If you are passing the file data to SAP, then you could use below function modules to verify date format in receiver RFC/BAPI or inbound IDOC program. If the sy-subrc is not 0 then don't process further.
    CONVERT_DATE_FORMAT
    ISU_DATE_FORMAT_CHECK
    Thanks
    Swarup

  • How test the date formats  M/d/yyyy and MM/dd/yyyy .

    how test the date formats M/d/yyyy and MM/dd/yyyy .format should accept 3/3/1982 and 03/03/1982 dates.
    please help me

    georgemc wrote:
    kajbj wrote:
    Spoiler: Reply #3 is actually the answer to your question.Also, Bruce Willis is a ghost, the Titanic sinks and Verbal is Keyzer Soze.Only one of those endings really surprised me.
    You should've heard me in that theatre when the Titanic struck that iceberg...

  • How to validate the dates in the table control ?

    How to validate the dates in the table control ?
    Can I write like this ?
    LOOP AT it_tab .
    CHAIN.
    FIELD : it_tab-strtdat,it_tab-enddat.
    module date_validation.
    ENDCHAIN.
    ENDLOOP.
    Module Date_validation.
    ranges : vdat type sy-datum.
    vdat-sign = 'I'.
    VDAT-LOW = it_tab-STRTDAT.
    VDAT-HIGH = it_tab-ENDDAT.
    VDAT-OPTION = 'BT'.
    APPEND VDAT.
    WHAT CODE I have to write here to validate ?
    and If I write like this How can we know which is the current row being add ?
    It loops total internal table ..?
    Bye,
    Muttu.

    Hi,
    I think there is no need to put chain endchain.
    To do validation you have to write module in PAI which does required validations.
    Thanks
    DARSHAN PATEL

  • How to change the date format?

    Hi,
    I need to display the data format as(YYYY-MM-DD). But now it displays(2009-1-9)
    Here is my code snippet which i used to display the data format as(2009-1-9)
    *<INPUT TYPE=TEXT NAME="date_submitted" MAXLENGTH=20 SIZE=10 VALUE="" onBlur= "return dateSubmitted()">  (YYYY-MM-DD)*
    *<SCRIPT LANGUAGE="javascript">*
    dateSubmitted()
    *</SCRIPT>*
    function dateSubmitted()
                        if (document.pgUpdate.date_submitted.value == "")
                             date = new Date();     
                             month = date.getMonth() + 1     
                             document.pgUpdate.date_submitted.value =
                                            date.getYear() + "-" + month + "-" + date.getDate();
                        return true;
    Can anybody help me how to change the date format?
    Thanks in advance!

    prit123 wrote:
    use SimpleDateFormat class. The code is :He posted a Javascript related question, not a Java related question.
    Please use forums devoted to Javascript. You're here at a Java/JSP forum.
    There are JS forums at webdeveloper.com and dynamicdrive.com. Good luck.
    String formatPattern = "yyyy-mm-dd";
    SimpleDateFormat sdf = new SimpleDateFormat(formatPattern);
    sdf.format(yourdate);yyyy-mm-dd denotes year-minutes-days. Please go read the SimpleDateFormat API as well.

  • How to define the date format for this date string

    2006-11-13 00:00:00.0
    How to define the date format in control file for sqlldr. "yyyy-mm-dd hh24:mi:ss" or "yyyy-mm-dd hh24:mi:ss.FF1" does not work
    thanks,

    SQL> desc t
    Name                                      Null?    Type
    TS                                                 TIMESTAMP(6)
    SQL> !cat t.ctl
    load data
    into table t
    truncate
    (ts timestamp "YYYY-MM-DD HH24:MI:SS.FF1")
    SQL> !cat t.dat
    2006-11-13 00:00:00.0
    SQL> !sqlldr userid=scott/tiger control=t.ctl data=t.dat log=t.log
    SQL*Loader: Release 10.2.0.3.0 - Production on Fri Sep 7 11:19:28 2007
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 1
    SQL> select * from t;
    TS
    13-NOV-06 12.00.00.000000 AMBest regards
    Maxim

  • How to change the date format in xml form?

    hi,
    How to change the date format in xml form?
    For example:  11/20/2008 3:00:03 PM    ->   11-20 03:00
    Any opinions greatly appreciated!
    Thanks.
    Edited by: ke wenxing on Dec 2, 2008 8:33 AM

    You could go to System - User Profile - Own Data would take you to the "maintain user profile screen"
    Click the defaults button and change the date format.This changes date format for all the dates in your login.

  • How to change the date format  YYYYMMDD to MM/DD/YYYY

    Hi ,
    How to change the date format  YYYYMMDD to MM/DD/YYYY .
    Ex :  20071008  to 10/08/2007
    Is there any function module for this ??
    Regards
    Rahul

    Hi Sharma,
    check the code:
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-031.
    PARAMETERS: date1 RADIOBUTTON GROUP rad1 DEFAULT 'X', "SAP date format YYYYDDMM
    date2 RADIOBUTTON GROUP rad1, "Date format like aprial31, 2006
    date3 RADIOBUTTON GROUP rad1, "Date format like 31 apr,2006
    date4 RADIOBUTTON GROUP rad1, "Date format like DD/MM/YYYY
    date5 RADIOBUTTON GROUP rad1. "Date format like DD.MM.YYYY
    SELECTION-SCREEN END OF BLOCK b2
    FORM getmonth .
    SELECT mnr
    ktx
    ltx
    INTO TABLE T_month
    FROM t247
    WHERE spras = 'EN'.
    IF sy-subrc NE '0'.
    MESSAGE I "Message - Not able to get month values from the table T247
    ENDIF.
    ENDFORM.
    DATA : temp_date(16) TYPE c,
    temp1_date(60) TYPE c,
    year(4) TYPE c,
    daymonth(11) TYPE c,
    daymonth1(11) TYPE c,
    month(9) TYPE c,
    day(2) TYPE c,
    mon LIKE t247-ktx,
    len TYPE i .
    MOVE date TO temp1_date .
    CONDENSE temp1_date NO-GAPS.
    MOVE temp1_date TO temp_date .
    IF date2 EQ 'X'. "The date format is like Aprial 31, 2007
    CONDENSE temp_date NO-GAPS.
    SPLIT date AT ',' INTO daymonth year.
    IF STRLEN( year ) NE '4'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ELSE.
    daymonth1 = daymonth.
    CONDENSE daymonth1 NO-GAPS.
    _len = STRLEN( _daymonth1 ).
    l_len = 13 - len.
    SHIFT daymonth1 RIGHT BY len PLACES.
    CONDENSE daymonth1 NO-GAPS.
    month = daymonth1.
    CONDENSE month NO-GAPS.
    SORT t_month BY monthltx.
    READ TABLE t_month WITH KEY monthltx = month.
    IF sy-subrc <> 0.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ELSE.
    len = STRLEN( month ).
    CONDENSE daymonth NO-GAPS.
    SHIFT daymonth LEFT BY len PLACES.
    day = daymonth.
    CONDENSE day NO-GAPS.
    CONCATENATE year t_month-monthnumber day INTO o_date.
    ENDIF.
    ENDIF.
    ELSEIF p_date3 EQ 'X'. "The date format is like 31 apr, 2007
    CONDENSE temp_date NO-GAPS.
    SPLIT i_date AT ',' INTO daymonth year.
    IF STRLEN( year ) NE '4'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ELSE.
    daymonth1 = daymonth.
    CONDENSE daymonth1 NO-GAPS.
    SHIFT daymonth1 LEFT BY 2 PLACES.
    CONDENSE daymonth1 NO-GAPS.
    month = daymonth1.
    CONDENSE month NO-GAPS.
    TRANSLATE month TO UPPER CASE.
    SORT t_month BY monthstx.
    MOVE month to mon.
    READ TABLE t_month WITH KEY monthstx = mon.
    IF sy-subrc <> 0.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ELSE.
    CONDENSE daymonth NO-GAPS.
    day = daymonth+0(2).
    CONDENSE day NO-GAPS.
    CONCATENATE year t_month-monthnumber day INTO o_date.
    ENDIF.
    ENDIF.
    ELSEIF p_date4 EQ 'X' OR p_date5 EQ 'X'. "Date format is like DD.MM.YYYY or DD/MM/YYYY
    CONDENSE temp_date NO-GAPS.
    IF STRLEN( temp_date ) EQ 10.
    o_date0(4) = temp_date6(4).
    o_date4(2) = temp_date3(2).
    o_date6(2) = temp_date0(2).
    ELSE.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ENDIF.
    ENDIF.
    IF STRLEN( o_date ) NE '8'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ENDIf.
    ENDFORM. " f0100_conv_date
    Reward if helpful.
    Regards,
    Harini.S

  • Change date format in dashboard promt and calendar

    hi,
    do any one know how to change the date format when using the calendar option in dashboard prompt. As the user picks a date from the calendar the format becomes DD-MM-YYYY. The customer would like YYYY-MM-DD!!
    Any suggestions?

    Hi Jose, i tried to update the settings in the NQSConfig.INI file, but there was no luck.
    I would like to mention my issue here again.
    I have a dashboard prompt built on a Date Column and I would like to see it as a Calendar Type. The value of this prompt is save in a variable pDate.
    In the answer, i have a filter on a date column(This is exactly the same column used to build the Prompt). The filter i set as Advance SQL Filter as I want to use the TimeStampAdd function.
    The filter is set as Date_Key = TimeStampAdd(SQL_TSI_DAY, -6, '@{pDate}')
    The above request when ran from the dashboard, gives me the following error:
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 932, message: ORA-00932: inconsistent datatypes: expected DATE got NUMBER at OCI call OCIStmtExecute. [nQSError: 17010] SQL statement preparation failed. (HY000)
    SQL Issued: SELECT Calendar."Time Id" saw_0, "Sales Facts"."Amount Sold" saw_1 FROM SH WHERE Calendar."Time Id" = TimeStampAdd(SQL_TSI_DAY, -6, '01/01/2002 12:00:00 AM') ORDER BY saw_0
    My understanding is that the Calendar control is populating pDate variable in 'mm/dd/yyyy hh:mi:ss' Format, while the TimeStampAdd function expect the variable as 'yyyy-mm-dd hh:ss:mi' Format.
    Is there any other place that we need to update on the server that will force the Calendar to return the prompt value in 'YYYY-MM-DD HH:MI:SS' Format ?
    Thanks
    Sai

  • How do I move data on time machine from one external hard drive to another

    How do I move data on time machine from one external hard drive to another?

    Although the documentation says you can copy Time Machine backups in the Finder, it's very slow and sometimes doesn't work at all.
    Launch Disk Utility, open the built-in help, and search for the term "Duplicate." Follow the instructions. Turn Time Machine OFF in its preference pane while copying the volume.

  • How to validate the  FI-AR& AP& FI-GL   and CO-PA extractor in R3

    Hi,
    I would like to do the integration testing in R/3 and BW.
    How to validate  Standard FI-AR& AP& FI-GL  and CO-PA extractor in R/3.
    Snapshot result of RSA3 and the tables?
    What are the tables and extractors need to be validate for FI-AR& AP& FI-GL   and CO-PA extractor in R3.
    As per our integration testing for FI-AR& AP& FI-GL   and CO-PA extractor in R3.
    How would i like to do the testing in BW QA system.
    Please some one will help me in this and answer would be great appreciate.

    Solved

  • How to read XI Data type in Java code and populate as array list, using UDF

    Hi,
    How to read XI Data type in Java code and populate as array list, using UDF?
    Is there any API using which  the XI data types can be read?
    Kindly reply.
    Richa

    Input Structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:CustomerCreateResp xmlns:ns0="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
       <CUSTOMER>
          <item>
             <CUSTOMERNO/>
             <MDMCUSTOMER/>
             <CREATE_DATE/>
             <RETURN>
                <TYPE/>
                <MESSAGE/>
             </RETURN>
             <PT_CONTPART_RETURN>
                <item>
                   <MDM_CONTACT/>
                   <CONTACT/>
                </item>
             </PT_CONTPART_RETURN>
             <PARTNERS>
                <item>
                   <CUSTOMERNO/>
                   <PARTNER_FUNCTION/>
                   <PARTNER_NUMBER/>
                   <DEFAULT_PARTNER/>
                </item>
             </PARTNERS>
          </item>
       </CUSTOMER>
    </ns0:CustomerCreateResp>
    Output structure
    (Sample output structure.This actually needs to be mapped and generated using UDF)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:updateCustomer xmlns:ns1="urn:xiSericeVi"><ns1:customer><ns2:ArrayList xmlns:ns2="java:sap/standard">[]</ns2:ArrayList></ns1:customer><ns1:name>2344566</ns1:name></ns1:updateCustomer>

  • TEM How to diffrentiate b/w internal and external events

    Hi experts,
            How do i distinguish b/w internal and external events ? When i try to create an event always by default it shows as internal in the top right above planned and firmly booked radio buttons. How do i create an external event which is held outside the company ?
    please help...
    Thanks & regards,
    Pavan

    Hi Pavan,
    If you create a business event with resources, it is automatically considered an "internal" event -as you cannot plan resources OUTSIDE of your company-.
    If you create a business event w/o resources, than system gives you the option of internal/external selection.
    Regards,
    Dilek

  • Single URL for internal and external CRM access when using IFD

    Hello,
    At one of our client site I have setup IFD on CRM 2011. This IFD is behind TMG. My client is a big corporation therefore all CRM components including CRM, ADFS and SQL are on separate servers.
    I have configured IFD using single url https://orgname.contoso.com Their IT staff wants to know why can't they use single URL for internal and external access where internal users are nto prompted for authentication
    when logging on to the CRM server. I know you can do URL re-write in ADFS but they want to know the reason "why internal users can't use the same IFD URL and don't get prompted for their credentials". Text below is from their IT staff.

    There are several approaches to your question.  You need to set up both an internal and an external relying party trust. If you use the external URL, it will always direct you to the signin page, if you use the internal URL, it will resolve you single
    sign on.
    I've configured IFD for CRM multiple times, and this is how it works. CRM looks at the URL. If you use the external URL (org.domain.com), it will prompt for credentials. So what you are asking for, a single URL that works single sign on internally and prompts
    externally really isn't possible.
    What I recommend is:
    1. make the external URL available internally
    2. Configure all outlook clients against the external URL, that way you won't have to reconfigure when someone goes internal to external
    3. Have users who are primarily internal use the internal URL for the web client, which will resolve single sign on
    4. Have users who are primarily external use the external URL for the web client
    For #1, since you only need to enter the credentials when you first configure CRM, it is in all effects single sign on.
    One thing I haven't tried that may work is using IIS redirect internally to redirect the external URL to the internal URL. There is also a powershell script in the IFD guide that you can use to make the outlook client switch between the internal and external
    URL's, but nothing that will give you a single URL that works as the internal relying party trust when internal and the external relying party trust when you are external.

  • How to configure AD on windows 2012 server for Exchange 2013 internal and external email flow

    Dear Experts,
    I have to configure exchange 2013 on Windows server 2012 STD. Company has registered Static IP addresses and can get the MX record pointing to any of this Static IP.  
    The registered domain name is e.g.  contoso.com. 
    a. What should I use as domain name on AD? contoso.com or contoso.local
    b. Is it recommended to have two different servers  for AD and Exchange?
    c. What should be my connector settings for mail flow?
    d. how can I set 2 email servers in company for load balancing?

    Hi,
    a, I suggest use contoso.com as domain name. It is convenient to add urls into our certificate for internal and external mail flow.
    b, Recommended that installing AD
    and Exchange Server on two separate
    Servers. If Exchange Server downed unfortunately, it can prevent AD server from crushing at the same time.
    c, Found some articles for your reference:
    Configure Mail Flow and Client Access
    http://technet.microsoft.com/en-us/library/jj218640(v=exchg.150).aspx
    Configuring Outbound Mail Flow in Exchange Server 2013
    http://exchangeserverpro.com/configuring-outbound-mail-flow-in-exchange-server-2013/
    d, Load Balancing
    http://technet.microsoft.com/en-us/library/jj898588(v=exchg.150).aspx
    Hope it is helpful
    Thanks
    Mavis
    Mavis Huang
    TechNet Community Support

Maybe you are looking for