HOW TO READ DATA SELECT TO_CHAR(TGL, 'DAY') AS TGL FROM TEMP_SELLOUT_MP_HY;
this is my code
SET SERVEROUTPUT ON
DECLARE
CURSOR CUR_SELLOUT_MP IS
SELECT /*+ INDEX_JOIN(SO) */ TK.ID,
TMP_SELLOUT_MP.TGL,
TMP_SELLOUT_MP.TOTAL_PENJUALAN,
TMP_SELLOUT_MP.LGE,
TMP_SELLOUT_MP.NOKIA,
TMP_SELLOUT_MP.SE,
TMP_SELLOUT_MP.SS,
TMP_SELLOUT_MP.LAINNYA,
TMP_SELLOUT_MP.NAMA_TOKO,
TMP_SELLOUT_MP.KOTA,
TMP_SELLOUT_MP.NAMA_MP,
TO_CHAR(TGL, 'Day')
FROM REF_TOKO TK,
TEMP_SELLOUT_MP_HY TMP_SELLOUT_MP,
REF_SALES_OFFICER SO
WHERE UPPER(TK.NAMA) = UPPER(TMP_SELLOUT_MP.NAMA_TOKO)
AND UPPER(TMP_SELLOUT_MP.NAMA_MP) = UPPER(SO.NAMA)
AND SO.SOF_TYPE = 'MOBILEPROMOTOR';
CURSOR CUR_TGL IS
SELECT DISTINCT(TO_CHAR(TGL, 'Day')) AS TANGGAL FROM TEMP_SELLOUT_MP_HY;
V_A VARCHAR2(20);
BEGIN
FOR I IN CUR_TGL LOOP
V_A := I.TANGGAL;
IF V_A = 'Friday' THEN
DBMS_OUTPUT.PUT_LINE(V_A);
END IF;
END LOOP;
END;
why dbms_output.put_line not show??
this data from cursor CUR_TGL:
Thursday
Friday
Wednesday
Saturday
Edited by: xoops on Mar 11, 2010 9:21 AM
What happens when you use:
SELECT DISTINCT(TO_CHAR(TGL, 'fmDay')) AS TANGGAL FROM TEMP_SELLOUT_MP_HY;Add 'fm' tyo the format, your match doesn't take the trailing space into account:
SQL> select '#'||to_char(sysdate, 'Day')||'#'
2 from dual;
'#'||TO_CHA
#Thursday #
SQL> select '#'||to_char(sysdate, 'fmDay')||'#'
2 from dual;
'#'||TO_CHA
#Thursday#Edited by: hoek on Mar 11, 2010 6:43 PM
Similar Messages
-
How to read data after select multiple record by checkbox,
hi experts
i m using simple report with check box , and itab whcih contain records
how to read data after select multiple record by checkbox,
thanksHi Prashant,
Try using this logic.This Code displays the list with check boxes. When you check a checkbox and press a button say 'Select All' or 'De Select all' or 'Display'. It will read the data of those records.
DATA :
fs_flight TYPE type_s_flight,
fs_flight1 TYPE type_s_flight1.
* Internal tables to hold Flight Details *
DATA :
t_flight LIKE
STANDARD TABLE
OF fs_flight,
t_flight1 LIKE
STANDARD TABLE
OF fs_flight1.
SET PF-STATUS 'SELECT' .
PERFORM selection.
PERFORM displaybasic .
* AT USER COMMAND EVENT *
AT USER-COMMAND.
PERFORM selectall .
*& Form SELECTION
* Select query to reteive data from SPFLI table
* There are no interface parameters to be passed to this subroutine.
FORM selection .
SELECT carrid " Airline Code
connid " Flight Connection Number
FROM spfli
INTO TABLE t_flight.
DESCRIBE TABLE t_flight LINES w_lines .
ENDFORM. " SELECTION
*& Form DISPLAYBASIC
* Display the basic list with SPFLI data
* There are no interface parameters to be passed to this subroutine.
FORM displaybasic .
LOOP AT t_flight INTO fs_flight.
WRITE :
w_check AS CHECKBOX,
w_mark,
fs_flight-carrid UNDER text-001,
fs_flight-connid UNDER text-002.
ENDLOOP. " LOOP AT T_FLIGHT..
CLEAR fs_flight-carrid .
CLEAR fs_flight-connid.
ENDFORM. " DISPLAYBASIC
*& Form SELECTALL
* To check all the checkboxes with a 'selectall' push button
* There are no interface parameters to be passed to this subroutine.
FORM selectall .
CASE sy-ucomm.
WHEN 'SELECT_ALL'.
w_check = 'X'.
w_line = 4 .
DO w_lines TIMES.
READ LINE w_line .
MODIFY LINE w_line FIELD VALUE w_check .
ADD 1 TO w_line .
ENDDO. " DO W_LINES TIMES
CLEAR w_line.
WHEN 'DESELECTAL'.
w_check = space.
w_line = 4 .
DO w_lines TIMES.
READ LINE w_line FIELD VALUE w_mark .
IF w_mark = space .
MODIFY LINE w_line FIELD VALUE w_check .
ENDIF. " IF W_MARK = SPACE
ADD 1 TO w_line .
ENDDO. " DO W_LINES TIMES
WHEN 'DISPLAY'.
IF sy-lilli BETWEEN 4 AND w_lines .
DO w_lines TIMES.
READ LINE w_num FIELD VALUE w_check INTO w_check
fs_flight-carrid INTO fs_flight-carrid
fs_flight-connid INTO fs_flight-connid.
IF sy-subrc = 0.
IF w_check = 'X'
SELECT carrid
connid
fldate " Flight date
seatsmax " Maximum capacity in economy
seatsocc " Occupied seats in economy class
FROM sflight
INTO TABLE t_flight1
WHERE carrid = fs_flight-carrid
AND connid = fs_flight-connid.
LOOP AT t_flight1 INTO fs_flight1.
WRITE :
/ fs_flight-carrid UNDER text-001,
fs_flight-connid UNDER text-002,
fs_flight1-fldate UNDER text-007,
fs_flight1-seatsmax UNDER text-008,
fs_flight1-seatsocc UNDER text-009.
ENDLOOP.
ENDIF. " IF SY-SUBRC = 0
ENDIF. " IF W_CHECK = 'X'.
ADD 1 TO w_num.
ENDDO. " DO W_LINES TIMES
CLEAR w_check.
w_num = 0.
ELSE .
MESSAGE 'INVALID CURSOR POSITION ' TYPE 'E' .
ENDIF. " IF SY-LILLI BETWEEN..
ENDCASE. " CASE SY-UCOMM
ENDFORM. " SELECTALL
Much Regards,
Amuktha. -
Javascript hel - how to limit date selection ?
I use the following javascript to validate a start and end date, and radio buttons on my form. What I need to do is limit the date selection to 30 days only. Anything more should display an error. So if I enter starting date of 1/1/2009 and ending date of 2/28/2009, then I should get a popup error. How can I do this with my exisintg code :
<Script language="JavaScript">
function validateForm()
if(document.indexForm.startDate.value == "" && document.indexForm.endDate.value == "")
alert('Start Date and End Date cannot be blank.');
indexForm.startDate.focus();
return(false);
if(document.indexForm.startDate.value > document.indexForm.endDate.value)
alert('End Date cannot be less than Start Date.');
indexForm.endDate.focus();
return(false);
if(document.indexForm.startDate.value !== "" && document.indexForm.endDate.value == "")
alert('End Date cannot be blank.');
indexForm.endDate.focus();
return(false);
if(document.indexForm.startDate.value == "" && document.indexForm.endDate.value !== "")
alert('Start Date cannot be blank.');
indexForm.startDate.focus();
return(false);
myOption = -1;
for (i=indexForm.region_code.length-1; i > -1; i--) {
if (indexForm.region_code[i].checked) {
myOption = i; i = -1;
if (myOption == -1) {
alert("Please select a region.");
return(false);
myOption = -1;
for (i=indexForm.reportName.length-1; i > -1; i--) {
if (indexForm.reportName[i].checked) {
myOption = i; i = -1;
if (myOption == -1) {
alert("Please select a report.");
return(false);
return(true);
</Script>Step 1. Get rid of anything that can be done with a cfinput tag and the built in js that comes with it.
Step 2 - js is reading strings, not dates from your text boxes. Convert these to dates before you start comparing the values to each other. -
How to read data from a CLUSTER STRUCTURE not cluster table.
Hi,
how to read data from a CLUSTER STRUCTURE not cluster table.
regards,
Usha.Hello,
A structre doesnt contain data.. so u cannot read from it. U need to find out table of that structure and read data from it.
Regards,
Mansi. -
How to read data from a file that was formatted by excel?
Hi everyone, I'm familiar with java.io and the ability to read from files, can anyone tell me how to read data from a file that was formatted by excel? Or at least give me some web references so that I can learn about it?
http://jakarta.apache.org/poi/hssf/index.html
HSSF stands for Horrible Spreadsheet Format, but it still works! -
How to read data from a router by using labview
I am a beginner labview. How to read data from a router by using labview ?
What kind of data are you trying to read?
Does the router behave like a webserver that you log into? If so, search the forums for threads discussing HTML. -
How to read data from a connected modem
any one can help me? how to read data from a connected modem. The modem received real-time data from other server. The data is in text format. I can see this text when I used hyperterminal for dial up and the data is accumulated such as:
@aa1235678
@bb2135647
@cc5214367
since it is real-time data, I want to read one line each time instantly when it arrives.You need to use the Java Communications API. (http://java.sun.com/products/javacomm/index.html)
-
How to read data from a zipped MS Access file?
How to read data from a zipped MS Access file?
RPJ,
You do not need to use the Close Zip File.vi when you unzip a folder. This VI is used when you are creating a zip folder.
As for examples, I found a couple of ActiveX based MS Access examples. These programs look to be pretty basic. For more in depth example I would search Microsoft Developers Network
http://zone.ni.com/devzone/cda/epd/p/id/2188
http://zone.ni.com/devzone/cda/epd/p/id/1694
Regards,
Jon S.
National Instruments
LabVIEW R&D -
can someone help me with this....
how to read data.....and move it to internal table....
the requirement is as:
<b>Get the Participant details in an internal table IT_FINAL_PAR</b>
Loop through IT_PA0002 and move Personnel number (PERNR), Personnel ID Number (PERID), Last name (NACHN), First name (VORNA), Gender Key (GESCH), Date of Birth (GBDAT) into a final internal table for Participant data IT_FINAL_PAR.
Read the internal table IT_PA0006 to get the corresponding House Number and Street
(STRAS), City (ORT01), Postal code (PSTLZ), State (STATE), 2nd address line (LOCAT) by comparing Personnel Number (PERNR)and move those retrieved field values to the final internal table for Participant data IT_FINAL_PAR.Hi,
you could try the following:
* work areas
data: W_PA0002 like line of IT_PA0002[],
W_PA0006 like line of IT_PA0006[],
W_FINAL_PAR like line of IT_FINAL_PAR[].
loop at IT_PA0002 into W_PA0002.
clear W_FINAL_PAR.
* move values from IT_PA0002
W_FINAL_PAR-PERNR = W_PA0002-PERNR.
W_FINAL_PAR-PERID = W_PA0002-PERID.
* read address values from IT_PA0006
read table IT_PA0006 into W_PA0006 with key pernr = W_PA0002-pernr.
if sy-subrc = 0.
* move fields from IT_PA0006
W_FINAL_PAR-STRAS = W_PA0006-STRAS.
endif.
append W_FINAL_PAR to IT_FINAL_PAR.
endloop. -
How to read data from an internal table into a real table?
Hello experts,
I'm relatively new to ABAP and I'm trying to figure out how to read data from an internal table into a table that I created. I'm trying to use the RRW3_GET_QUERY_VIEW_DATA function module to read data from a multiprovider. I'm trying to read data from the e_cell_data and e_axis_data tables into a table that I've already created. Please see code below.
TABLES MULTITAB.
DATA:
query_name TYPE RSZCOMPID,
s_cubename TYPE RSINFOPROV,
t_cell_data TYPE RRWS_T_CELL,
t_axis_data TYPE RRWS_THX_AXIS_DATA,
t_axis_info TYPE RRWS_THX_AXIS_INFO,
wa_t_cell_data like line of t_cell_data,
wa_t_axis_data like line of t_axis_data,
w_corp_tab like line of t_cell_data.
s_cubename = 'CORP_MPO1'.
query_name = 'Z_corp_test'.
CALL FUNCTION 'RRW3_GET_QUERY_VIEW_DATA'
EXPORTING
i_infoprovider = s_cubename
i_query = query_name
i_t_parameter = query_string_tab
IMPORTING
e_cell_data = t_cell_data
e_axis_data = t_axis_data
e_axis_info = t_axis_info.
If anyone has any information to help me, I would greatly appreciate it. Thanks.Hi,
<li>Once you call the function module RRW3_GET_QUERY_VIEW_DATA, lets say data is available in the corresponding tables e_cell_data e_axis_data which you have mentioned.
<li>Modify your internal table defined for other purpose, with data from e_cell_data e_axis_data like below.
LOOP AT t_cell_data INTO wa_t_cell_data.
"Get the required data from t_cell_data.
MOVE-CORRESPONDING wa_t_cell_data TO it_ur_tab.
"Modify your internal table wih data
MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
ENDLOOP.
LOOP AT t_axis_data INTO wa_t_axis_data.
"Get the required data from t_cell_data.
MOVE-CORRESPONDING wa_t_axis_data TO it_ur_tab.
"Modify your internal table wih data
MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
ENDLOOP.
Thanks
Venkat.O -
How to read data directly from clusters
hi all,
how to read data directly from clusters
Thanx in advance,
amruta.Using macro:
RP-IMP-C2-B2.
RP-IMP-C2-B1.
RP-IMP-C2-ZL.
....etc.
For TM cluster, U also can use BAPIs like HR_TIME_RESULTS_GET
More details see SAP HR course 350(HR Programming) -
Help me, How to read data from USB ???
Help me, How to read data from USB ???
If its a disk on key or some portable hard drive than once its connected to the usb and recognized by the system you can access it through java like you would access your hard drive.
-
How to read field selection in table T004F
How to read field selection(T004F-FAUS1) in table T004F?
it's showing me .---.. etc, how can I know which field it refers to?It looks like a code, I'm not sure, but try TBSL table and match the FAUS1 field to figure out what element does it refer to.
Avraham -
JTable, how to read Data from it when enter is pressed
How to read Data from JTable on Return or lost focus from cell.
Also please tell me which listener I should should.
thx for helpYou should read the tutorial about tables, cell editors and models.
Also you should not [url http://forum.java.sun.com/thread.jsp?thread=472677&forum=57&message=2186815]crosspost
Mike -
How to read data from select Options in another view without using context
I have 2 views, one for selection screen and another for displaying result.
In selection screen view I have define a select options with the help of webdynpro component.
Now my object is display result in result view based on entry of selection screen.
I don't want to do binding in context node, without that how I can read data of select option
in result view?
Regards,
Rasmi Ranjan MishraSolve by own.
If I define the Select options in component controller, then it will be global in nature. so i can get the value of select options
in another view also.
Regards,
Rasmi Ranjan Mishra
Maybe you are looking for
-
How to select JLabel inside a JTable
hi all, I have a Jtable which has own renderer so it can store components in it. I have added a Jlabel one of its cells but when I select that row the label stays upon the selected background color. here is a sample screenshot to decribe my problem c
-
Windows vista, trouble reinstalling itunes
I had to remove itunes and am not trying to reinstall it. I have gone through my computer, uninstalled and deleted all the apps and components as recommended in 'itunes troubleshooting. Downloading the software is fine, the installation begins but th
-
Bridge CC will not open. Reads "Error: The operation cannot be completed"
Hello, I just recently downloaded Creative Cloud. I am working on a Mac OSX 10.9.5 and I downloaded Creative Cloud to use both Photoshop and Bridge. Photoshop opens and is working however, Bridge opens for 1 second and then give me the message, "Erro
-
I set my default home page to AltaVista.com. This page comes up as expected when I start Firefox. However if I open a new tab I get a blank page. How to I setup Firefox to use my default web page for all subsequent tabs. This was an easy process in I
-
Process Flow Parameter Binding.
The docs on using process flow parameters are a bit sparse, so I wonder if anyone else has some input. We kick off our ETL processes by an external enterprise scheduling tool due to several remote dependencies. This tool provides us with an audit id