Display specific file on specific date (php)
Hi there.
PHP & MySQL
I have done something like this in ASP many years ago, but don't know it in PHP.
I have a website and on it, I want to display on the right hand side, a motivational quote for everyday. In the ASP version, I had different files: 1.asp, 2.asp and so on.
I am sure there must be scripts like this available but don't know what it is called. It doesn't need to be added as part of a database. I will apppreciate some direction, please.
Regards,
Deon
Hi
$todaysdate = See below for php date function;
$changedate = "insert date here";
if ( $changedate >= $todaysdate) {
include ("file_to_include.php");
else {
include ("file_to_include.php");
PHP Date function, see - http://www.w3schools.com/PHP/php_date.asp.
PZ
www.pziecina.com
Message was edited by: pziecina
Similar Messages
-
The View menu option to display the File Name is grayed out and thus I cannot display the file name.
Hi,
You need to go to View menu and check Details as well.
You may even have to make the thumbnails larger by using the zoom slider at the bottom
Good luck
Brian -
How to Read specific data from file and do a calculation and display on the output
FYI: Below is the function use for the writing:
-OpenFile(use ASCII)
-sprintf
-WriteFile
Example: Output from the doc file
…EndTime: 09:34:48 program time: 0.567663 sec
…EndTime: 09:36:48 program time: 0.666666 sec
My objective is to read data 0.666666 (FYI: is last sentence of the file) to do some calculation. How can we read specific data(specific location) from file..
Any advice or help?
What is the function needed?I would consider counting line feeds and checking for end-of file to isolate the last line, which then can be read using fscanf...
Have a look at getc...
character = fgetc ( stream );
if ( character == '\n' ) // new line
if ( character == EOF ) // end-of-file -
How can I use Automator to extract specific Data from a text file?
I have several hundred text files that contain a bunch of information. I only need six values from each file and ideally I need them as columns in an excel file.
How can I use Automator to extract specific Data from the text files and either create a new text file or excel file with the info? I have looked all over but can't find a solution. If anyone could please help I would be eternally grateful!!! If there is another, better solution than automator, please let me know!
Example of File Contents:
Link Time =
DD/MMM/YYYY
Random
Text
161 179
bytes of CODE memory (+ 68 range fill )
16 789
bytes of DATA memory (+ 59 absolute )
1 875
bytes of XDATA memory (+ 1 855 absolute )
90 783
bytes of FARCODE memory
What I would like to have as a final file:
EXCEL COLUMN1
Column 2
Column3
Column4
Column5
Column6
MM/DD/YYYY
filename1
161179
16789
1875
90783
MM/DD/YYYY
filename2
xxxxxx
xxxxx
xxxx
xxxxx
MM/DD/YYYY
filename3
xxxxxx
xxxxx
xxxx
xxxxx
Is this possible? I can't imagine having to go through each and every file one by one. Please help!!!Hello
You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
if f ends with "/" then set f to f's text 1 thru -2
do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
use strict;
use open IN => ':crlf';
chdir $ARGV[0] or die qq($!);
local $/ = qq(\\0);
my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
local $/ = qq(\\n);
# CSV spec
# - record separator is CRLF
# - field separator is comma
# - every field is quoted
# - text encoding is UTF-8
local $\\ = qq(\\015\\012); # CRLF
local $, = qq(,); # COMMA
# print column header row
my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
# print data row per each file
while (@ff) {
my $f = shift @ff; # file path
if ( ! open(IN, '<', $f) ) {
warn qq(Failed to open $f: $!);
next;
$f =~ s%^.*/%%og; # file name
@dd = ('', $f, '', '', '', '');
while (<IN>) {
chomp;
$dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
last unless grep { /^$/ } @dd;
close IN;
print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
EOF
Hope this may help,
H -
Hi Experts,
My Requirement : I need to develope one custom report where it has to display operating unit specific data based on the resposibility selection in Discoverer.
My Approach : I prepared the below query and I am trying to pick Business_group_id from profile options and passing to the query.(You can observe the condition which is highlighted as red color)While i am running the query I am getting zero records.
Please suggest me how to achieve the my requirement of displaying operating unit specific data in Discoverer.
SELECT A1.PERSON_ID
,A1.employee_number
,A1.first_name
,A1.last_name
,A1.known_as PREFERRED_NAME
,A1.GENDER
,A1.date_of_birth
,A1.Marital_status
,A1.original_date_of_hire
,A1.Organization
,A1.Location
,A1.Job_name
,A1.OLF_DEPARTMENT
,A1.OLF_DEPT_SUBGROUP
,A1.salary
,A1.salary_change_date
,A1.HIRE_DATE
,A2.PERSON_ID SUPERVISOR_ID
,A2.EMPLOYEE SUPERVISOR
,A3.PERSON_ID SUPERVISOR_ID_1
,A3.EMPLOYEE SUPERVISOR_NAME_1
FROM (
SELECT PAPF.first_name
,PAPF.last_name
,papf.known_as
,papf.*** GENDER
,papf.date_of_birth
,papf.marital_status
,papf.employee_number
,PAPF.person_id
,PAAF.supervisor_id
,PAPF.original_date_of_hire
,(SELECT name FROM hr_all_organization_units WHERE Organization_id=PAAF.organization_id) Organization
,(SELECT location_code FROM hr_locations WHERE location_id=PAAF.Location_id) Location
,(SELECT name FROM per_jobs WHERE job_id=PAAF.job_id) Job_name
,PPP.proposed_salary_n SALARY
,ppp.change_date salary_change_date
,ppgk.segment1 OLF_DEPARTMENT
,ppgk.segment2 OLF_DEPT_SUBGROUP
,papf.original_date_of_hire HIRE_DATE
FROM per_all_people_f PAPF
,per_all_assignments_f PAAF
,per_pay_proposals PPP
,PAY_PEOPLE_GROUPS_KFV ppgk
WHERE 1=1
AND PAPF.person_id=PAAF.person_id
AND papf.business_group_id=paaf.business_group_id
AND PAAF.assignment_id=PPP.assignment_id
AND paaf.people_group_id=ppgk.people_group_id
AND ppp.change_date =(SELECT MAX(change_date)
FROM per_pay_proposals
WHERE assignment_id=PPP.assignment_id)
AND SYSDATE BETWEEN PAPF.effective_start_date AND PAPF.effective_end_date
AND SYSDATE BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date<font color="red">AND PAPF.BUSINESS_GROUP_ID = TO_NUMBER(FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID '))</font>
) A1
SELECT PAPF.first_name
||','||PAPF.last_name EMPLOYEE,PAPF.PERSON_ID,PAAF.supervisor_id
FROM per_all_people_f PAPF
,per_all_assignments_f PAAF
WHERE PAPF.person_id=PAAF.person_id
AND papf.business_group_id=paaf.business_group_id
AND SYSDATE BETWEEN PAPF.effective_start_date AND PAPF.effective_end_date
AND SYSDATE BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
) A2
SELECT PAPF.first_name
||','||PAPF.last_name EMPLOYEE
,PAPF.PERSON_ID
,PAAF.supervisor_id
FROM per_all_people_f PAPF
,per_all_assignments_f PAAF
WHERE PAPF.person_id=PAAF.person_id
AND papf.business_group_id=paaf.business_group_id
AND SYSDATE BETWEEN PAPF.effective_start_date AND PAPF.effective_end_date
AND SYSDATE BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
) A3
WHERE 1=1
AND A2.PERSON_ID(+)=A1.SUPERVISOR_ID
AND A3.PERSON_ID(+)=A2.SUPERVISOR_ID
AND A4.PERSON_ID(+)=A3.SUPERVISOR_ID
;Pl identify versions of OS, database, EBS and Discoverer. Have you reviewed these MOS Docs ?
373634.1 - Using Discoverer 10.1.2 with Oracle E-Business Suite Release 12
1074326.1 - Using Discoverer 11.1.1 with Oracle E-Business Suite Release 12
313418.1 - Using Discoverer 10.1.2 with Oracle E-Business Suite 11i
1073963.1 - Using Discoverer 11.1.1 with Oracle E-Business Suite Release 11i
HTH
Srini -
Using Time Machine, is it possible to back up a computer AFTER a specific date. I only want to back up files from AFTER January 2015. Is this possible, and how can I do this?
emilypdunne wrote:
Using Time Machine, is it possible to back up a computer AFTER a specific date. I only want to back up files from AFTER January 2015. Is this possible, and how can I do this?
Is what you're saying that you only want backups in TM of the state of your Mac from January 2015 to the current date and nothing before then? I'd think the simplest solution would just be to delete in TM all the backups prior to 1/15 and then let TM do its thing. The ultimate source for all things Time Machine is here. On this page, note the comment that "Time Machine will never delete the backup copy of anything that was on the disk being backed-up at the time of any remaining backup" which I understand to mean that if you delete all the backups in the TM file prior to 1/15, any file that wasn't present on your Mac as of 1/15 will no longer be represented in the TM file. Note that the second link also has instructions for how to delete TM files.
If you were trying to accomplish something else, then as Emily Litella (Gilda Radner in SNL) used to say, "never mind." -
Displaying operating unit specific data in Discoverer Report ????
Hi Experts,
My Requirement : I need to develope one custom report where it has to display operating unit specific data based on the resposibility selection in Discoverer.
My Approach : I prepared the below query and I am trying to pick Business_group_id from profile options and passing to the query.(You can observe the condition which is highlighted as red color)While i am running the query I am getting zero records.
Please suggest me how to achieve the my requirement of displaying operating unit specific data in Discoverer.
SELECT A1.PERSON_ID
,A1.employee_number
,A1.first_name
,A1.last_name
,A1.known_as PREFERRED_NAME
,A1.GENDER
,A1.date_of_birth
,A1.Marital_status
,A1.original_date_of_hire
,A1.Organization
,A1.Location
,A1.Job_name
,A1.OLF_DEPARTMENT
,A1.OLF_DEPT_SUBGROUP
,A1.salary
,A1.salary_change_date
,A1.HIRE_DATE
,A2.PERSON_ID SUPERVISOR_ID
,A2.EMPLOYEE SUPERVISOR
,A3.PERSON_ID SUPERVISOR_ID_1
,A3.EMPLOYEE SUPERVISOR_NAME_1
FROM (
SELECT PAPF.first_name
,PAPF.last_name
,papf.known_as
,papf.sex GENDER
,papf.date_of_birth
,papf.marital_status
,papf.employee_number
,PAPF.person_id
,PAAF.supervisor_id
,PAPF.original_date_of_hire
,(SELECT name FROM hr_all_organization_units WHERE Organization_id=PAAF.organization_id) Organization
,(SELECT location_code FROM hr_locations WHERE location_id=PAAF.Location_id) Location
,(SELECT name FROM per_jobs WHERE job_id=PAAF.job_id) Job_name
,PPP.proposed_salary_n SALARY
,ppp.change_date salary_change_date
,ppgk.segment1 OLF_DEPARTMENT
,ppgk.segment2 OLF_DEPT_SUBGROUP
,papf.original_date_of_hire HIRE_DATE
FROM per_all_people_f PAPF
,per_all_assignments_f PAAF
,per_pay_proposals PPP
,PAY_PEOPLE_GROUPS_KFV ppgk
WHERE 1=1
AND PAPF.person_id=PAAF.person_id
AND papf.business_group_id=paaf.business_group_id
AND PAAF.assignment_id=PPP.assignment_id
AND paaf.people_group_id=ppgk.people_group_id
AND ppp.change_date =(SELECT MAX(change_date)
FROM per_pay_proposals
WHERE assignment_id=PPP.assignment_id)
AND SYSDATE BETWEEN PAPF.effective_start_date AND PAPF.effective_end_date
AND SYSDATE BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date<font color="red">AND PAPF.BUSINESS_GROUP_ID = TO_NUMBER(FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID '))</font>
) A1
SELECT PAPF.first_name
||','||PAPF.last_name EMPLOYEE,PAPF.PERSON_ID,PAAF.supervisor_id
FROM per_all_people_f PAPF
,per_all_assignments_f PAAF
WHERE PAPF.person_id=PAAF.person_id
AND papf.business_group_id=paaf.business_group_id
AND SYSDATE BETWEEN PAPF.effective_start_date AND PAPF.effective_end_date
AND SYSDATE BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
) A2
SELECT PAPF.first_name
||','||PAPF.last_name EMPLOYEE
,PAPF.PERSON_ID
,PAAF.supervisor_id
FROM per_all_people_f PAPF
,per_all_assignments_f PAAF
WHERE PAPF.person_id=PAAF.person_id
AND papf.business_group_id=paaf.business_group_id
AND SYSDATE BETWEEN PAPF.effective_start_date AND PAPF.effective_end_date
AND SYSDATE BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
) A3
WHERE 1=1
AND A2.PERSON_ID(+)=A1.SUPERVISOR_ID
AND A3.PERSON_ID(+)=A2.SUPERVISOR_ID
AND A4.PERSON_ID(+)=A3.SUPERVISOR_ID
;you are in the wrong forum, try an ebusiness-related forum, maybe this OA Framework
-
Issue with displaying QM control chart for specific date range
Dear All
In our chemical mfg organisation, we just implemented SAP QM solution and things are working fine. I have implemented control chart functionalities as below:
SPC Criteria in Inspection Plan: Task List Charateristics / Material (0020)
Sampling Procedure: Fixed Sample / SPC Inspection (without inspection point)
We use process orders to get the inspection lots for products (material) and record results for the MICs and UD the inspection lots.
Currently all our Control Chart have status 1 (created) and we have not moved any of those charts to status 3 and 5 yet.
Using QGC1 when user trying to run control chart for any particular material in the plant and for a specific date range, report showing all the charts for that material with different MICs as expected. Though the result is NOT restricted to the selection dates either against "Lot Created On" or " Insp. Start Date" ( may be due to SPC criteria????) , its always showing all the result for any particular MIC for that material starting from go live till today.
How to restrict the dispaly of result on the chart for any particular MIC against the Material / Plant within a specific date range ?
Looking forward for your response.
Best Regards
SKHi,
1. Even though when i give the Created on, and to date the system is displaying the report which is prior to the created on date.
2. Similarly the report data is different when the field is maximum no of Hits is given. for example when i giving this field as 10, 20, 30, etc the report is showing only 10 line items. if i enter 50, 60 etc it is showing the list for half i given.
Note that system is having more than 1000 line items to display..
Regards,
R. Loganathan -
Script to delete files created on a specific date with sepecific name
Hi,
Is it possible to help me with a powershell script that delete files under a folder and subfolders that have the following attributes
1. have the name (default.*) and (index.*)
2. created on a specific date say 1-9-2014
3. created between specific time say between 10:00 - 16:00
Thanks in advance!break out the components of the script.
IE does this match
Get-ChildItem -Recurse c:\temp\*.*or Get-ChildItem -Recurse c:\temp\*.* | Where-Object {$_.CreationTime -gt (get-date "01-09-2014 10:00AM") -and $_.
CreationTime -lt (get-date "01-09-2014 14:00PM")}Get-ChildItem -Recurse c:\temp\*.* | Where-Object {$_.CreationTime -gt (get-date "01-09-2014 10:00AM") -and $_.
CreationTime -lt (get-date "01-09-2014 14:00PM")} | Where-Object {$_.name -match "default"}Might not be working as it might not be matching.Once you get it matching the remove-item will work.
Cheers,
Martin
Blog:
http://sustaslog.wordpress.com
LinkedIn:
Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. -
Store User specific data in Secure file in EP
Hi
I wanted to store User specific data into Secure file .Please help me to access JAVA Secure Storage API 's of SAP netweaver
Regards
Ganesan Ssorry, wrong post
-
Loop through files locating specific data sets
Hi there,
I have been given the wonderful task of developing a setup which needs to do the following using JCAPS:
- open and read through various flat files in a folder. These flat files have random data sets in them, where a line starting with 01, marks the start of a data set and 99, marks the end of a data set. 03, marks the line where the account number can be found.
- retrieve the account number from the data sets and verify that against an external Oracle database table.
- if account number is found, then read the data set from the flat file and write the data set to an output file.
- if the account number is not found in the Oracle database table, just discard the dataset and continue with the next data set.
If you have any ideas on how to set this up, that would be much appreciated. No need to spell things out, but if anyone has worked on a scenario like this or similar using JCAPS to do the trick please let me know.
A scenario variant is that, instead of looking up the account number against the oracle database, we can use an if-statement like "if the currency is GBP, EUR, SEK, then take the data set from the input file and write the data set to the output file.
I can create an input OTD to read in the data sets, and an output OTD which creates the output file. There is a blank line between data sets. The structure of a data set looks like this:
01,CITIDIRECT,2978169,080922,0401,04010900,999,,2/
02,2978169,400515,1,080919,0000,USD,2/
03,57787314,USD,010,2191397371,,,015,2191397371,,,030,2191397371,,,040,2191397371,,,045,2191397371,,,060,2191397371,,,072,000,,,074,000,,,100,000,0,,400,000,0,,470,000,0,/
49,13148384226,2/
03,57787322,USD,010,1494730626,,,015,1494730626,,,030,1494730626,,,040,1494730626,,,045,1494730626,,,060,1494730626,,,072,000,,,074,000,,,100,000,0,,400,000,0,,470,000,0,/
49,8968383756,2/
03,57787349,USD,010,423382915,,,015,423382915,,,030,423382915,,,040,423382915,,,045,423382915,,,060,423382915,,,072,000,,,074,000,,,100,000,0,,400,000,0,,470,000,0,/
49,2540297490,2/
98,24657065472,3,8/
99,24657065472,1,10/
Thanks & Kind Regards,
RichardYes
1. Have a variable inside SSIS to get folder path. Set path based on your rule using an expression
like
(@[User::ProductName] == "Product" ? "\\....\Src\Product" : (@[User::ProductName] == "Product_NCP" ? \\....\Src\Product_NCP:..))
similary archive
(@[User::ProductName] == "Product" ? "\\....\Src\Product\Archive" : (@[User::ProductName] == "Product_NCP" ? "\\....\Src\Product_NCP\Archive" :..))
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
CS6 Bridge "Lens Specification Data" appears incorrect (W7 Pro 64Bit SP1)
Viewing Camera Data (Exif) in CS6 Bridge
Noc ahgnges to default settings applied in CS6 Bridge
Observed Results:
The new "Lens Specification Data" under the Camera Data (Exif) appears to be be correctly reporting the lens type but shows the lens as "f/0" which is incorrect
This appears to be the case with pictures taken with two different lenes both of which are reported as f/0
Further up in the same tab the "Lens" data is correctly reported for the lens type and maximum aperture.
Expected Result:
Wasd to see the maximum aperture of the lens reproted in addition to the lens type, which I would ahve expected to be the same data as reproted under the "Lens" information higher up in the same panel.
Which begs the question what is the difference between the "Lens" information and the "Lens Specification Data" meant to be ?
Observed these results with the following two lenses:
EF-S17-55mm f/2.8 IS USM
EF70-200mm f/2.8L IS II USM
System Info:
Won't let me paste in :(Hi Baichao,
Thank you for your response.
The camera in questions is a Canon 7D (actullay I shoot with a pair of 7D's and the results are the same for both cameras), the files are both .CR2 and .JPG, with the same results being seen for both file formats. the images have not been edited in any other applications but viewed immediately after donwload to the PC from the memory card.
I have also viewed these and other older images in both the CS6 and CS5 versions of bridge for comparision purposes and see the same differences irrespective of how old the image is or if its been previously edited in CS5 for both .CR2 and .JPG files.
In addition I also don't see an indication of the subject distance displayed in CS6 bridge, although the option is selected and works as expected in CS5 bridge.
I will send you a seperate email with screen shots showing an example in both CS5 and CS6.
Regards Mark -
I want to display specific line to be color in alvlist how
i want to display specific line to be color in alvlist
i write the code as follows here document type is initial. then that line is to be
appeared as color line but problem is initially it is appeared correct later i moved to next previous screens error lines are to be colored where i have to clear
loop at it_doclist where blart eq space.
gt_layout-info_fieldname = 'COLOR_LINE'.
it_doclist-color_line = 'C600'.
modify it_doclist .
clear:it_doclist.
endloop.
please help me exactly
Thanks
Ramana reddyu r requiremnt is not clear...but any how check this code....
it has a form for assigning colors....
rewardif useful
REPORT zppb001_prd_posting_upload
NO STANDARD PAGE HEADING LINE-SIZE 255
MESSAGE-ID zpp.
INCLUDE bdcrecx1.
TYPE-POOLS :slis.
DATA: wk_success(5) TYPE c, "To store the successfull Hits
wk_failure(5) TYPE c, "To store the failed Hits
l_mstring(600), "To store Message texts
t_date TYPE zservice_date,"To store Uploaded Date
wk_lines(5) TYPE c, "To store No of Records
lines(5) TYPE c, "To store No of Records
wk_len(150) TYPE c, "To store File path
wk_alp TYPE i, "To store path length
lent TYPE i, "To store path length
b(4). "To store File extension
DATA: alvfld TYPE slis_t_fieldcat_alv WITH HEADER LINE,
v_events TYPE slis_t_event WITH HEADER LINE,
wk_events LIKE LINE OF v_events,
it_list_comments TYPE slis_t_listheader,
wk_list_comments LIKE LINE OF it_list_comments,
wk_layout TYPE slis_layout_alv.
CONSTANTS: c_formname_top_of_page TYPE slis_formname
VALUE 'F_TOP_OF_PAGE'.
--TO STORE FINAL DATA TO BE POSTED--
Generated data section with specific formatting - DO NOT CHANGE ***
DATA: BEGIN OF record OCCURS 0,
budat_002(010),
bktxt_004(025),
matnr_005(018),
werks_006(004),
alort_007(004),
erfmg_008(017),
END OF record.
End generated data section ***
DATA: BEGIN OF messages OCCURS 0, "TO STORE FINAL STATUS DISPLAY
budat_002(010),
bktxt_004(025),
matnr_005(018),
maktx TYPE makt-maktx,
werks_006(004),
alort_007(004),
erfmg_008(017),
msg_e(400),
msg_s(600),
msgtyp TYPE c,
line_color(4),
END OF messages.
DATA: BEGIN OF st_record1 ,
matnr_005(018),
werks_006(004),
budat_002(010),
bktxt_004(025),
erfmg_007(017),
erfmg_008(017),
alort_007(004),
END OF st_record1.
DEFINE alv_macro.
move : &1 to alvfld-col_pos,
&2 to alvfld-fieldname,
&3 to alvfld-seltext_m.
if &2 = 'MATNR_005' or &2 = 'MAKTX'.
alvfld-fix_column = 'X'.
endif.
append alvfld.clear alvfld.
END-OF-DEFINITION.
DATA : record1 LIKE TABLE OF st_record1 WITH HEADER LINE,
it_excel LIKE TABLE OF alsmex_tabline WITH HEADER LINE,
messtab1 LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE,
it_acc LIKE TABLE OF record WITH HEADER LINE,
it_rej LIKE TABLE OF record WITH HEADER LINE.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
PARAMETERS: p_file TYPE localfile OBLIGATORY .
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
CHANGING
file_name = p_file.
AT SELECTION-SCREEN ON p_file.
wk_len = p_file.
CONDENSE wk_len NO-GAPS.
lent = STRLEN( wk_len ).
wk_alp = lent - 4.
b = wk_len+wk_alp(lent).
IF ( b NE '.txt' ) AND ( b NE '.xls' ).
MESSAGE e939.
CLEAR p_file.
STOP.
ENDIF.
START-OF-SELECTION.
PERFORM upload_fun.
PERFORM open_group.
PERFORM fill_bdc_table.
PERFORM close_group.
PERFORM assign_colors.
PERFORM f_event_build.
SORT messages BY matnr_005 ASCENDING.
PERFORM assign_columns.
PERFORM count.
IF ctu = 'X'.
PERFORM alv.
ENDIF.
FREE:messages,messtab1,record1.
END-OF-SELECTION.
--FORM UPLOAD_FUN--
FORM upload_fun.
REFRESH: record1, it_acc, it_rej, record, messages, messtab1, it_excel.
PERFORM fetch_from_flat_file.
CLEAR it_excel.
DESCRIBE TABLE it_excel.
IF sy-tfill = 0.
MESSAGE i937. STOP.
ENDIF.
LOOP AT it_excel.
CASE it_excel-col.
WHEN '0001'. MOVE: it_excel-value TO record1-matnr_005.
WHEN '0002'. MOVE: it_excel-value TO record1-werks_006.
WHEN '0003'. MOVE: it_excel-value TO record1-budat_002.
WHEN '0004'. MOVE: it_excel-value TO record1-bktxt_004.
WHEN '0005'. MOVE: it_excel-value TO record1-erfmg_007.
WHEN '0006'. MOVE: it_excel-value TO record1-erfmg_008.
WHEN '0007'. MOVE: it_excel-value TO record1-alort_007.
ENDCASE.
AT END OF row.
APPEND record1. CLEAR record1.
ENDAT.
ENDLOOP.
DELETE record1 WHERE matnr_005 EQ ' '.
--DO NOT UPLOAD WHERE PRD QTY = 0--
DELETE record1 WHERE ( erfmg_007 = 0 OR erfmg_007 = ' ' )
AND ( erfmg_008 = 0 OR erfmg_008 = ' ' ).
DESCRIBE TABLE record1[].
IF sy-tfill > 0.
--MOVE ACCEPTED QTY AND FETCH THE RESPECTIVE STGLOC-**
LOOP AT record1 WHERE erfmg_007 NE 0 AND erfmg_007 NE ' '.
MOVE: record1-budat_002 TO it_acc-budat_002,
record1-bktxt_004 TO it_acc-bktxt_004,
record1-matnr_005 TO it_acc-matnr_005,
record1-werks_006 TO it_acc-werks_006,
record1-erfmg_007 TO it_acc-erfmg_008.
APPEND it_acc. CLEAR: it_acc,record1.
ENDLOOP.
--MOVE ELPRO FOR THE ACCEPTED ENTRIES--
LOOP AT it_acc.
SELECT SINGLE elpro INTO it_acc-alort_007
FROM mkal CLIENT SPECIFIED
WHERE mandt = sy-mandt
AND matnr = it_acc-matnr_005
AND werks = it_acc-werks_006.
MODIFY it_acc TRANSPORTING alort_007. CLEAR: it_acc.
ENDLOOP.
--MOVE PRD QTY FOR REJECTED QTY--
LOOP AT record1 WHERE erfmg_008 NE 0 AND erfmg_008 NE ' '.
MOVE: record1-budat_002 TO it_rej-budat_002,
record1-bktxt_004 TO it_rej-bktxt_004,
record1-matnr_005 TO it_rej-matnr_005,
record1-werks_006 TO it_rej-werks_006,
record1-erfmg_008 TO it_rej-erfmg_008,
record1-alort_007 TO it_rej-alort_007.
APPEND it_rej. CLEAR: it_rej, record1.
ENDLOOP.
--MOVE ACCEPTED AND REJECTED READINGS TO FINAL TABLE
APPEND LINES OF it_acc TO record. APPEND LINES OF it_rej TO record.
FREE : it_rej, it_acc, record1.
ELSE.
MESSAGE i937.
STOP.
ENDIF.
ENDFORM. " UPLOAD_FUN
--FORM fill_bdc_table--
FORM fill_bdc_table.
IF NOT record[] IS INITIAL.
LOOP AT record.
PERFORM bdc_dynpro USING 'SAPLBARM' '0800'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RM61B-BKTXT'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ISTDA'.
PERFORM bdc_field USING 'RM61B-BUDAT' record-budat_002.
PERFORM bdc_field USING 'RM61B-BKTXT' record-bktxt_004.
PERFORM bdc_field USING 'RM61B-MATNR' record-matnr_005.
PERFORM bdc_field USING 'RM61B-WERKS' record-werks_006.
PERFORM bdc_field USING 'RM61B-ALORT' record-alort_007.
PERFORM bdc_field USING 'RM61B-ERFMG' record-erfmg_008.
PERFORM bdc_dynpro USING 'SAPLCOWB' '0130'.
PERFORM bdc_field USING 'BDC_OKCODE' '=WEIT'.
PERFORM bdc_field USING 'BDC_CURSOR' 'G_COWB_HEADER-MNGTXT'.
PERFORM bdc_transaction USING 'MFBF'.
CLEAR messtab.
messtab1[] = messtab[].
LOOP AT messtab1 WHERE msgtyp = 'S' OR msgtyp = 'E'.
SELECT SINGLE * FROM t100 WHERE sprsl = messtab1-msgspra
AND arbgb = messtab1-msgid
AND msgnr = messtab1-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
PERFORM store_messages.
CLEAR l_mstring.
ENDIF.
ENDLOOP.
MOVE-CORRESPONDING record TO messages.
SELECT SINGLE maktx INTO messages-maktx FROM makt CLIENT SPECIFIED
WHERE mandt = sy-mandt
AND matnr = messages-matnr_005
AND spras = 'EN'.
APPEND messages.
CLEAR: messages, messtab1. REFRESH messtab1.
ENDLOOP.
ENDIF.
ENDFORM. "fill_bdc_table
--FORM assign_columns--
FORM assign_columns .
REFRESH alvfld.
alv_macro '1' 'MATNR_005' 'PART NO'.
alv_macro '2' 'MAKTX' 'DESCRIPTION'.
alv_macro '3' 'WERKS_006' 'PLANT'.
alv_macro '4' 'BUDAT_002' 'POSTING DATE'.
alv_macro '5' 'BKTXT_004' 'SHIFT'.
alv_macro '6' 'ERFMG_008' 'QUANTITY'.
alv_macro '7' 'ALORT_007' 'STGLOC'.
alv_macro '8' 'MSG_E' 'ERRORS DUE TO'.
alv_macro '9' 'MSG_S' 'STATUS'.
ENDFORM. " assign_columns
--FORM f_event_build--
FORM f_event_build .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = v_events[].
READ TABLE v_events WITH KEY name = slis_ev_top_of_page
INTO wk_events.
wk_layout-info_fieldname = 'LINE_COLOR'.
wk_layout-colwidth_optimize = 'X'.
IF sy-subrc = 0.
MOVE c_formname_top_of_page TO wk_events-form.
MODIFY v_events FROM wk_events INDEX sy-tabix.
ENDIF.
ENDFORM. " f_event_build
--FORM f_top_of_page--
FORM f_top_of_page.
WRITE sy-datum TO t_date.
CLEAR: it_list_comments[].
wk_list_comments-typ = 'H'. "H=Header, S=Selection, A=Action
wk_list_comments-key = ''.
CONCATENATE 'UPLOADED STATUS FOR PRODUCTION POSTING ON - ' t_date INTO
wk_list_comments-info SEPARATED BY space.
APPEND wk_list_comments TO it_list_comments.
CLEAR wk_list_comments.
DESCRIBE TABLE messages LINES wk_lines.
lines = wk_lines.
wk_list_comments-typ = 'S'. "H=Header, S=Selection, A=Action
wk_list_comments-key = ''.
CONCATENATE 'Total No of Hits:' lines INTO wk_list_comments-info
SEPARATED BY space.
APPEND wk_list_comments TO it_list_comments.
CLEAR wk_list_comments.
wk_list_comments-typ = 'S'. "H=Header, S=Selection, A=Action
wk_list_comments-key = ''.
CONCATENATE 'Successfull Hits:' wk_success INTO
wk_list_comments-info SEPARATED BY space.
APPEND wk_list_comments TO it_list_comments.
CLEAR wk_list_comments.
wk_list_comments-typ = 'S'. "H=Header, S=Selection, A=Action
wk_list_comments-key = ''.
CONCATENATE ' Failed Hits:' ' ' wk_failure INTO
wk_list_comments-info
SEPARATED BY space.
APPEND wk_list_comments TO it_list_comments.
CLEAR wk_list_comments.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo = 'ENJOYSAP_LOGO'
it_list_commentary = it_list_comments.
ENDFORM. "F_TOP_OF_PAGE
--FORM assign_colors--
FORM assign_colors .
LOOP AT messages.
CASE messages-msgtyp.
WHEN 'E'.
messages-line_color = 'C601'.
WHEN 'S'.
messages-line_color = 'C501'.
ENDCASE.
MODIFY messages TRANSPORTING line_color.
ENDLOOP.
ENDFORM. " assign_colors
--FORM COUNT--
FORM count .
CLEAR: wk_failure, wk_success.
LOOP AT messages.
CASE messages-msgtyp.
WHEN 'E'.
ADD 1 TO wk_failure.
WHEN 'S'.
ADD 1 TO wk_success.
ENDCASE.
ENDLOOP.
ENDFORM. " COUNT
--FORM ALV--
FORM alv .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = wk_layout
it_fieldcat = alvfld[]
it_events = v_events[]
TABLES
t_outtab = messages
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. " ALV
--FETCH_FROM_FLAT_FILE--
FORM fetch_from_flat_file .
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1 "From 1st Column
i_begin_row = 2 "From 2nd row
i_end_col = 7 "Till 7th Column
i_end_row = 65000 "Till Row
TABLES
intern = it_excel
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
ENDFORM. " FETCH_FROM_FLAT_FILE
--FORM STORE_MESSAGES--
FORM store_messages.
IF l_mstring CS '&1'.
REPLACE '&1' WITH messtab1-msgv1 INTO l_mstring.
REPLACE '&2' WITH messtab1-msgv2 INTO l_mstring.
REPLACE '&3' WITH messtab1-msgv3 INTO l_mstring.
REPLACE '&4' WITH messtab1-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH messtab1-msgv1 INTO l_mstring.
REPLACE '&' WITH messtab1-msgv2 INTO l_mstring.
REPLACE '&' WITH messtab1-msgv3 INTO l_mstring.
REPLACE '&' WITH messtab1-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
IF messtab1-msgtyp = 'E'.
CONCATENATE messages-msg_s l_mstring INTO l_mstring SEPARATED BY space.
MOVE l_mstring TO messages-msg_e.
MOVE 'E' TO messages-msgtyp.
MOVE 'Document Not Posted' TO messages-msg_s.
ELSEIF messtab1-msgtyp = 'S'.
CONCATENATE messages-msg_s l_mstring INTO l_mstring SEPARATED BY space.
MOVE l_mstring TO messages-msg_s.
MOVE 'S' TO messages-msgtyp.
ENDIF.
ENDFORM. " store_messages -
How to get users' login logout time for user IDs for a specific date?
Dear All,
There is a case I being requested to retrieve the Userid, User Name,
User Group, User Dept, Date, Login Time, Logout Time in a specific date, for example, 21.05.2009.
How should I retrieve the information? The user want to input specific date and user group then return the details that mentioned above.
I try with SUIM->Users->By Logon Date and Password Change... but I can't specific the date that I want ...
I try with SM19 (Security Audit Log), but unfortunately in my system this is not activated.
I've seek for SAP's advise, and they say need to ask abaper to developr a report in order to get such details....
Do you guys have any other methods?
Do you guys know which tables will contain the details as mentioned above?
Best Regards,
KenUnfortunately without the audit log, you're going have a hard time finding this information. As mentioned, ST03N will give you some information. If your systems daily workload aggregation goes back to the date you require then you'll be able to get a list of all users who logged on that day. ST03N doesn't keep time stamps just response times.
My only idea is VERY labor intensive. If your DB admin can retrieve a save of the database from that day then table USR02 will hold a little more information for you. It will contain last login times for that day. If your system backup policy happened to have saved the contents of folder "/usr/sap/<SID>/<instance>/data" then you potentially have access to all the data you require. The stat file will have recorded every transaction that took place during that day. If that file is restored you could use program RSSTAT20 to query against it.
Good luck and turn on the audit log as it makes your life much easier! -
How to marking email for follow up on a specific date
In projects I often receive e-mails which need to be followed up/chased by a specific date in the future. I would like to be able to mark them with a specified date and then file them in the relevant mail folder. On the date specified either the email re-appears in your in box for action or a reminder is sent.
The flag option is fine - but does not really help if one has many e-mails to follow up on different dates.
This must be feature which would be useful to 1000's of users - does it exist is there a work round? I have not found this feature on other e-mail applications including Yahoo.
Thanks in advance.There are always programs on http://www.tuaw.com that do things like this. I don't know if any of them specifically do this. They always want to suck you in and live in their little iGTD world. I don't really conform to that. I am trying to write software that I would want to use. This seems like one that would fall into that category. Simple, easy-to-use, does one thing well, and doesn't get in your way.
Maybe you are looking for
-
Hi guys, im using GUI_DOWNLOAD, and i need the file in txt format, but is always generated in dat format, any help is more than welcome. this is the code CALL function 'GUI_DOWNLOAD' exporting BIN_FILESIZE = filename
-
Use of time series functions with horizontally fragmented fact tables
Hi Guys, in OBIEE 10g it wasn't possible to use time series functions [AGO, TO_DATE] on horizontally fragmented fact tables. This was due to be fixed in 11g. Has this been fixed? Has somebody used this new functionality? What the the limitations? Tkx
-
Survey answers not coming back in CRM 7.0
We are about to implement CRM 7.0. I created a new survey via the web UI. I then launch a web page which brings back the survey results based on the Business Partner that logs in. I have debugged the program and it appears that the the problem is
-
Why are some cells in my spreadsheet higher than others? There's like extra space.
Why are some cells in my spreadsheet higher than others? There's like extra space.
-
Hi, I have an XML file, which I'm opening with the Excel application. The stylesheet I use is horizontal.xsl. The problem arised when the XML has data in the format "1/4" or "1/16", which is translated in the Excel as date (like "01/04/2007"). I thin