<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Date Formats in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532858#M1855339</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Valentin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.As I am using field-symbols first I move the value to the field-symbol then it checks for initial or not.If it is not initial I will check for the field name (ValidFrom/To) if it is any of these two I should check for the format of the date in the field-symbol.If it is in this MM/DD/YYYY&lt;/P&gt;&lt;P&gt;format it is fine.Else I should move the message as "Invalid date format" to the field-symbol &amp;lt;fs_status&amp;gt;.Please tell me how to acheive it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chakradhar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Sep 2014 10:53:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-09-01T10:53:04Z</dc:date>
    <item>
      <title>Date Formats</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532853#M1855334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri,sans-serif;"&gt;&lt;SPAN&gt;&lt;SPAN lang="en-US"&gt; I am facing a small problem in a report which I have developed.In this report the user downloads the flatfile first and then he enters the values under the respective field names and uploads it into the database. My issue is ,the&amp;nbsp; p&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="en-US"&gt;rogram is accepting incorrect date formats. Date format should be MM/DD/YYYY. If there is any other format then it should be show it as incorrect format in Status field.The below screen shots make you understand my requirement clearly.Can anyone suggest me how to solve my issue.Thanks in Advance.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri,sans-serif;"&gt;&lt;SPAN lang="en-US"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri,sans-serif;"&gt;&lt;SPAN&gt;&lt;SPAN lang="en-US"&gt;&amp;nbsp; &lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/530926" /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="en-US"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: see the date formats under the valid from and valid to fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Chakradhar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 07:05:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532853#M1855334</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-09-01T07:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formats</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532854#M1855335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chakradhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to make sure I got your question right: You wrote a report which allows the user to upload some file (an Excel sheet, for example). In the report you load the specified file (by calling some SAP helper method or function module) and then you have to create some database entries from the file content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I write a report like this I usually take the following approach:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. In the first step I call a helper method to load e.g. the Excel file. The helper methods returns in internal table. For the structure of this internal table I use a structure where all fields have type "string" (even for all numeric and date fields). This ensures that the call of the helper method doesn't result in an exception due to invalid input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. In a second step I perform validity checks on the internal table containing the raw string input. For numeric fields I check, for example, that the field's string value contains only digits. One can use regular expressions for more complicated checks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. If some validity checks failed I generate some meaningful error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. If all validity checks were successful, I copy the raw string table content into another fully-typed internal table. With "fully-typed" I mean that the line type of the second internal table is a structure with the same field names as the first raw input table, but the fields have the correct ABAP type (which corresponds to the ABAP type of the database table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue you mention seems to be due to a missing validity check in step 2 above. I suggest you add such checks to your report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Valentin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 07:30:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532854#M1855335</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-09-01T07:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formats</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532855#M1855336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Valentin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.I had also&amp;nbsp; done everything which you mentioned in above reply but the problem is that my program is dynamic(the fields may change based on the input values) so I use field-symbols in my report.As per now i just checked whether the field-symbol is initial or not.If initial&amp;nbsp; I am showing message as initial in status field of my alv output.But the user wants to me validate date formats(validfrom and valid to)fields whether the user entered date is in the format(MM/DD/YYYY) or not.If it is not in the format I should show the message as date format is incorrect in status field of alv output.Please tell me how to resolve my issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chakradhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 08:02:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532855#M1855336</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-09-01T08:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formats</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532856#M1855337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Load data into Internal table.&lt;/P&gt;&lt;P&gt;use functional module "CONVERT_DATE_TO_INTERN_FORMAT" to convert date format into SAp format.&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;use functional Module "ISU_DATE_FORMAT_CHECK" to validate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 08:56:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532856#M1855337</guid>
      <dc:creator>buddhika_krishantha</dc:creator>
      <dc:date>2014-09-01T08:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formats</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532857#M1855338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chakradhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you have to handle a dynamic field list the question we have to answer is:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;How can one determine the correct type for each field in the user input?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several approaches you could use for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A) For each possible field list define a structure in the DDIC. The fields should have the correct types (e.g., DATS for the "valid from/to" fields). For checking the input the report would have to determine the correct structure (based on the untyped user input). Then load the structure definition (using the class CL_ABAP_STRUCTDESCR, for example) and use the structure's field list to determine the correct type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B) In case you have colum names in the user input you could try to maintain a map of column names to data element names in the report. For checking the input loop over the entries in the raw string-typed internal table. Inside the loop, loop over the column names and use the map to look up the type for the current field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the output ALV grid you could still use the raw string-typed internal table, since you may have to display invalid values, too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Valentin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 10:24:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532857#M1855338</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-09-01T10:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formats</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532858#M1855339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Valentin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.As I am using field-symbols first I move the value to the field-symbol then it checks for initial or not.If it is not initial I will check for the field name (ValidFrom/To) if it is any of these two I should check for the format of the date in the field-symbol.If it is in this MM/DD/YYYY&lt;/P&gt;&lt;P&gt;format it is fine.Else I should move the message as "Invalid date format" to the field-symbol &amp;lt;fs_status&amp;gt;.Please tell me how to acheive it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chakradhar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 10:53:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532858#M1855339</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-09-01T10:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formats</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532859#M1855340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chakradhar,&lt;/P&gt;&lt;P&gt;Please share the code you are currently using. I regret I cannot help you on this detailed level without having a look at the source code you are using right now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Valentin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 12:59:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-formats/m-p/10532859#M1855340</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-09-01T12:59:13Z</dc:date>
    </item>
  </channel>
</rss>

