Generate calender date in column wise
Hi,
I need to get a report based on Year and Month as a input, calender date must get populate.
if user inputs values are JAN AND 2011 as the input it must generate the report as
1 2 3 4 5 .... 30
based on the number of days it has it must populate the date. Each date must be a separate column. Please suggest me
Thanks
Sudhir
Hi,
This does what you requested:
WITH got_dt AS
SELECT TO_DATE ( 'JAN 2011'
, 'MON YYYY'
, 'NLS_DATE_LANGUAGE=ENGLISH' -- If needed
) AS dt
FROM dual
SELECT TO_CHAR (dt, 'MON YYYY') as mon_year
, MIN (CASE WHEN LEVEL = 1 THEN LEVEL END) AS d1
, MIN (CASE WHEN LEVEL = 2 THEN LEVEL END) AS d2
, MIN (CASE WHEN LEVEL = 31 THEN LEVEL END) AS d31
FROM got_dt
CONNECT BY LEVEL <= EXTRACT ( DAY
FROM LAST_DAY (dt)
;The query you were copying had one row per week, which is hy it used the aGROUP BY clause like it did. You only want one row altogether, so you won't need a GROUP BY clause.
The query you were copying had 7 poivoted columns, each fgenerated by a line of code such as
max(decode(to_char(dt,'d'),'1',lpad(to_char(dt,'fmdd'),2))) "Su",that was specifically looking for one of the 7 possible days of the week. You want 31 columns, for the 31 possible values for the day of the month.
The sub-query isn't really necessary for the problem as you gave it, but it could be very useful for related problems. Gor example, if you wanted output that had DATEs in each column instead of NUMBERs:
d1 d2 d3 ...
01-Jan-2011 02-Jan-2011 03-Jan-2011 ...
Similar Messages
-
Display data column wise in alv
my problem is i want to display data in column wise in alv grid display
for example it will display
Name1 Amount
GTS 12000
TSL 8970
MJB 4678
but i want like:
GTS TSL MJB
12000 8970 4678
Edited by: jadav_avani on Nov 15, 2010 8:33 AM
Moderator Message: Search for available information.
Edited by: kishan P on Nov 15, 2010 1:50 PMmy problem is i want to display data in column wise in alv grid display
for example it will display
Name1 Amount
GTS 12000
TSL 8970
MJB 4678
but i want like:
GTS TSL MJB
12000 8970 4678
Edited by: jadav_avani on Nov 15, 2010 8:33 AM
Moderator Message: Search for available information.
Edited by: kishan P on Nov 15, 2010 1:50 PM -
How to get data with out having any date/timestamp columns by year wise
hi,
how can i select years wise rows from tables,if that have not any date/timestamp column.Well Govind it quite depends on what is the data type of that column and the format in which it is stored.
If the data type is varchar2/varchar and all the values are in a uniform format then there is no problem. All you need to use is the to_date function to convert the supplied strings to default date format and then use to_char function to only extract the YY or YYYY or RR or RRRR aspect of the data.
For example: If the column is called 'hire_date' and it's data type is varchar2 and the entries in this column are all in a uniform format, say month,date,year like January,12,1999. What you need to do is convert this string to a default date value using to_date function, like to_date(hire_date,'format_model') In the format model mention the format of the hire_date string. The out put of this function can be fed into to_char to extract the year, like to_char(output_of_to_date,'YYYY')
I hope you got what I meant. Let me know if it was of any use. -
How to Fetch Data into internal table column wise?
The internal table contains huge set of data. Normally we fetch the data row wise using insert and select statements in work area.
But, the requirement is on fetching the data column wise for each field from the database.
So,can anyone help me on this issue for fetching the data column wise?Welcome to SDN.
What you want to do(if I understand correctly) is not possible with the statements available to us. You could do it, but I think it would be a lot of code and I don't think that its worth it. Why exactly do you want to do this?
Regards,
Rich Heilman -
Output data in row wise instead of column
hi all,
i need to get the output data in row wise which is getting now as column wise.
for eg:
below is my final internal table.
HEADING DATE MATNR BUKRS DMBTR
jan/08 200801 567 10 800
feb/08 200802 567 10 900
mar/08 200803 567 10 200
apr/09 200804 567 10 400
the output should come as
MATNR BUKRS Jan/08 Feb/08 Mar/08 Apr/08
567 10 800 900 200 400.
instead of column wise the output should display as row as above.
please help how to get this.
thanks in advanceHi Vignesh,
Please use below program which I created for you reference. It will work for your requirement.
DATA:BEGIN OF it_test OCCURS 1,
date(6),
matnr(5),
bukrs(3),
END OF it_test.
it_test-date = 'jan/08'.
it_test-matnr = '01234'.
it_test-bukrs = 'AE1'.
APPEND it_test.
it_test-date = 'feb8'.
it_test-matnr = '56789'.
it_test-bukrs = 'AE1'.
APPEND it_test.
it_test-date = 'mar8'.
it_test-matnr = '23478'.
it_test-bukrs = 'AE1'.
APPEND it_test.
START-OF-SELECTION.
LOOP AT it_test.
WRITE :/ 'DATE', 'MATNR', 'BUKRS', it_test-date, it_test-matnr, it_test-bukrs .
ENDLOOP.
Output Will be as follows :-
DATE MATNR BUKRS jan/08 01234 AE1
DATE MATNR BUKRS feb8 56789 AE2
DATE MATNR BUKRS mar8 23478 AE3
Please set to resolve if this satisfies your requirement.
Regards
Abhii.. -
Display data as rowwise (horizontally ) instead of column wise ( verticaly)
I am displaying the data from milti select prompt of BI Answers in BIP report.
The data from the table is displayed as
Table structure :
Company. Unit name f_company_._unit_e
output :
unit1
unit2
unit3
I want output as unit1, unit2, unit3
Thanks
Aj
Edited by: user9031011 on May 11, 2010 7:35 AM
Edited by: user9031011 on May 11, 2010 7:46 AMHi Aj,
First of all, correct me my previous solution.
1. If you want to print the units in column wise i.e. if the for loop is in a table and you want each unit to be displayed in a separate columns side by side then in one of the table cell (i.e. in the for-each field of the cell) keep below code,
<?for-each@column:ROW?> <?EMPNO?> <?end for-each?>
2. If you want to print as a normal text (with out table) then use
<?for-each@inlines:ROW?> <?EMPNO?> <?end for-each?>
Second, to modify the form field,
Select the for-each form field, go to to Add-Ins -> Tools -> Field Browser , then double click the for-each and in the edit box change the text according to your requirement, then click 'Update' button.
You can also place that for-each condition out side(i mean with out form field) -
How to print data in h:dataTable by column wise
I've Arraylist holding of Item objects, in that again one more Arraylist containing Item parameters
My problem is i want to display ItemParams side by side(column wise) not row by row(normal procedure)
Table looks like
ItemNo ItemName ItemDesc Change
234 Colgate toothpaste checkbox
123 Pepsodent toothpaste checkbox
In above table ItemName having different params
colgate have 3params
peopsodent have 2 params
ItemParameters class(bean) containing fields of parameterValue(textBox in UI) and parameterDescription(textArea in UI)
So the total ItemName column looks like
ItemName
Colgate
parameterValue parameterDescription,parameterValue parameterDescription,parameterValue parameterDescription
Pepsodent
parameterValue parameterDescription,parameterValue parameterDescription
Cibaca
parameterValue parameterDescription,parameterValue parameterDescription,parameterValue parameterDescription,parameterValue parameterDescription
Please help me
Thanks in advanceHi,
Try with this piece of code
Declaration of local constants
CONSTANTS : lc_paart LIKE sy-paart VALUE 'X_65_132', " Paper Format
lc_locl TYPE sypdest VALUE 'LOCL'. " Destination
MOVE 'X' TO v_print.
Setup the Print Parmaters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
authority = space
immediately = v_print
new_list_id = c_x
no_dialog = c_x
user = sy-uname
IMPORTING
out_parameters = v_print_parms
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc NE 0.
CLEAR : v_print_parms.
ENDIF.
The printer destination has to be set up
IF v_print_parms-pdest = space.
v_print_parms-pdest = lc_locl.
ENDIF.
Explicitly set line width, and output format so that
the PDF conversion comes out OK
v_print_parms-linsz = c_linsz.
v_print_parms-paart = lc_paart.
Regards,
nagaraj -
Generate linear dates betwen two dates
Hi,
There are two dates as input. need to generate series of dates between those dates. Dates must appear in column wise
please suggest how to write the query on that.
Eg: If we enter two dates as start date 1-JAN-2011 and end date as 5-JAN-2010
It must generate a linear date as 1-JAN-2011 2-JAN-2011 3-JAN-2011 4-JAN-2011 5-JAN-2011
date must appear as column wise. P|lease let me know
Thanks
SudhirSQL> -- generating sample data:
SQL> with t as (
2 select to_date('1-JAN-2011', 'dd-mon-yyyy') start_date
3 , to_date('5-JAN-2011', 'dd-mon-yyyy') end_date
4 from dual
5 )
6 --
7 -- actual query:
8 --
9 select max(decode(max(lvl), 1, dt)) dt1
10 , max(decode(max(lvl), 2, dt)) dt2
11 , max(decode(max(lvl), 3, dt)) dt3
12 , max(decode(max(lvl), 4, dt)) dt4
13 , max(decode(max(lvl), 5, dt)) dt5
14 from ( select start_date+level-1 dt
15 , level lvl
16 from t
17 connect by level <= end_date-start_date+1
18 )
19 group by dt;
DT1 DT2 DT3 DT4 DT5
01-01-2011 00:00:00 02-01-2011 00:00:00 03-01-2011 00:00:00 04-01-2011 00:00:00 05-01-2011 00:00:00
1 row selected.
SQL> -- generating sample data:
SQL> with t as (
2 select to_date('1-JAN-2011', 'dd-mon-yyyy') start_date
3 , to_date('5-JAN-2011', 'dd-mon-yyyy') end_date
4 from dual
5 )
6 --
7 -- actual query:
8 --
9 select max(decode(max(lvl), 1, dt)) dt1
10 , max(decode(max(lvl), 2, dt)) dt2
11 , max(decode(max(lvl), 3, dt)) dt3
12 , max(decode(max(lvl), 4, dt)) dt4
13 , max(decode(max(lvl), 5, dt)) dt5
14 from ( select start_date+level-1 dt
15 , level lvl
16 from t
17 connect by level <= end_date-start_date+1
18 )
19 where to_char(dt, 'dy', 'nls_date_language=american') not in ('sat', 'sun')
20 group by dt;
DT1 DT2 DT3 DT4 DT5
03-01-2011 00:00:00 04-01-2011 00:00:00 05-01-2011 00:00:00
1 row selected. -
How to display the data in row wise in smartform
Hi,
I have to make a modification a smartform of poprinting and i want to display the row wise . At present it is displaying the
column wise. Actually there is a text which i want to display the data row wise.
It is possible to display the data in row wise of the text .
Edited by: nav009 on Oct 8, 2009 10:39 AMHello ,
I assume that your requiremen is related to smartform.the below is the solution i suggest.
As per my understanding of your requirement ,It's clear that as of now there is some description field which is also getting displayed along with other PO fields.
However you would like to display the description field in a new line since the length of this field is longer than other fields as a result the data is getting scattered .
Therefore one better option could be: since the whole data from PO would be in a loop you can display all other fields in one line type of the table as per the intial requirement and you display the description line alone in a new line type wth the desired length so that data would not be scattered and no data loss would happen.
I assume you are aware of creating of line types for table.
Thanks
M.Naveen. -
How to make fields grow dynamically within the same page and in column wise
Hi,
Like the newspaper format: Where contents of news are shown columns wise.
We need to make the fields in a page grow column wise within that same page.
For example, in a page:
Column 1 Column 2
ASDASDASDGKASHDGKAA | ASDFASGFHSJFAJKSD
ASDFASDFASDJFASGJKDFHA | ASDFASDASDFASDFASD
AFSDFASDFASDHGFKASDFASD | ASDFASDFASDFASDFASDFA
ASDFSDGFJASHDGFJKASHDGKFAS |
ASDFAGASDHFKASHDGFHASDJKFHASJKHF |
ASDFHASGDKFASDJGHFASDFJKSDGFJKAGSDJ |
If the Column 1 is full with the fields in the page it should start filling the column 2 which is also in the same page.
If the Column 2 is also full then only it should move to the next page and should continue the same scenario.
Please suggest a better way to do this in the Adobe Output Designer.
Thanks and regards,
Gurunath V.
E-Mail: [email protected]
P.S: Please also mail to my e-mail ID.Hi Gurunath, if you steel need a solution on this problem, I think this could help:
1- place two fields on the form (JF01, JF02), one under each other.
2- Make two subform with them (Sline1, Sline2)
3- Make the field JF02 expand on same subform.
4- Modify the preamble in this way:
^define group:D_line1 \field$POSITION\reserve"0.333",in\subformSline1.\positionsave,"first_line"
^define group:JF01!OnOverflow \groupG_Sline2.\fieldJF02.
^define group:G_Sline2!OnBOF \positionrestore,"first_line"\positionright,"3.65",in
In the data file put all the text in JF01.
-The first line say:
When JF01 is called, save it's y position (\positionsave,"first_line")
-The second line means:
when the text overflow JF01 put it in JF02.
(cause JF02 overflow on itself all the remaining data is overflowed in JF02)
-The third line means:
if JF02 arrives at the end of the page (OnBOF), restore the saved position ( \positionrestore,"first_line") and move to the right of "3,65" inches (\positionright,"3.65",in).
In other words, when JF02 arrive at the and of the age, the next field JF02 is positioned at the same height of JF01 and is shifted on the right
Take care that in this way JF02 cannot anymore go o a new page.
Hope this help.
Andrea -
How 2 Change of column wise o/p to row wise output in ABAP?
Hi all,
I am getting the output in column wise as normally but how can I get the ouput in row wise.in ABAP.
its urgent. can any one help me how to change the output layout?
thanks in advance,
Sakthi.Cif it is normal report .then
go through the write statents . one of that is below
Loop at itab .
write : itab .
endloop.
if it is ALV then you have to define an internal table which are the fieldds you want palce in the Row .
so that
data c type i value '1'.
loop at itab .
fieldcatalog-fieldname = itab-field.
fieldcatalog-col_pos = c.
append fieldcatalog to fieldcatalog.
clear fieldcatalog
c = c + 1.
endloop.
so that the Col_pos will be increased and the Column data will be moved into Row .
reward points if it is usefull...
Girish -
Colors in ALV report - column wise
Hi,
I have a ALV report. I want color in my report like Column Wise.
ex.
Document No........Date.........Amount......Document No......Date........Amount........Document Nov........Date.............Amount....
2008000123...10.07.2009....2000.00......2008000133....10.07.2009....2000.00.....2008000143.......10.07.2009.......2000.00
2008000124...10.07.2009....2000.00......2008000134....10.07.2009....2000.00.....2008000144.......10.07.2009.......2000.00
2008000125...10.07.2009....2000.00......2008000135....10.07.2009....2000.00.....2008000145.......10.07.2009.......2000.00
Please see, there is 3 times Document No, Date and Amount. I want that there should come diff. colors for diff. document numbers.
It is possible or not. If yes, then how...
Thanks...Hi,
go though this link....
i hope this will help u
TABLES:
SPFLI.
TYPE-POOLS:
SLIS.
PARAMETERS:
P_COL TYPE I ,
P_ROW TYPE I,
P_COLOR(4) TYPE C .
DATA:
T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FS_FIELDCAT LIKE LINE OF T_FIELDCAT,
FS_LAYOUT TYPE SLIS_LAYOUT_ALV ,
W_COLOR(4) ,
W_ROW TYPE I,
W_FIELDNAME(20),
W_PROG TYPE SY-REPID.
DATA:
BEGIN OF T_SPFLI OCCURS 0,
COLOR(4),
CHECKBOX ,
CELL TYPE SLIS_T_SPECIALCOL_ALV,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
CITYFROM TYPE SPFLI-CITYFROM,
CITYTO TYPE SPFLI-CITYTO,
DISTANCE TYPE SPFLI-DISTANCE,
END OF T_SPFLI.
DATA:
FS_CELL LIKE LINE OF T_SPFLI-CELL.
SELECT *
FROM SPFLI
INTO CORRESPONDING FIELDS OF TABLE T_SPFLI.
W_COLOR = P_COLOR.
T_SPFLI-COLOR = P_COLOR.
IF P_COL IS INITIAL AND P_ROW GT 0.
MODIFY T_SPFLI INDEX P_ROW TRANSPORTING COLOR.
ENDIF.
FS_FIELDCAT-FIELDNAME = 'CARRID'.
FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
FS_FIELDCAT-COL_POS = 1.
FS_FIELDCAT-KEY = 'X'.
FS_FIELDCAT-HOTSPOT = 'X'.
APPEND FS_FIELDCAT TO T_FIELDCAT.
CLEAR FS_FIELDCAT .
FS_FIELDCAT-FIELDNAME = 'CONNID'.
FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
FS_FIELDCAT-COL_POS = 2.
FS_FIELDCAT-KEY = 'X'.
FS_FIELDCAT-HOTSPOT = 'X'.
APPEND FS_FIELDCAT TO T_FIELDCAT.
CLEAR FS_FIELDCAT .
FS_FIELDCAT-FIELDNAME = 'DISTANCE'.
FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
FS_FIELDCAT-COL_POS = 3.
FS_FIELDCAT-KEY = ' '.
FS_FIELDCAT-EDIT = 'X'.
APPEND FS_FIELDCAT TO T_FIELDCAT.
CLEAR FS_FIELDCAT.
FS_FIELDCAT-FIELDNAME = 'CITYFROM'.
FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
FS_FIELDCAT-COL_POS = 4.
FS_FIELDCAT-KEY = ' '.
APPEND FS_FIELDCAT TO T_FIELDCAT.
LOOP AT T_FIELDCAT INTO FS_FIELDCAT.
IF FS_FIELDCAT-COL_POS EQ P_COL.
FS_FIELDCAT-EMPHASIZE = P_COLOR.
W_FIELDNAME = FS_FIELDCAT-FIELDNAME.
IF P_ROW IS INITIAL AND P_COL GT 0.
MODIFY T_FIELDCAT FROM FS_FIELDCAT TRANSPORTING EMPHASIZE.
ENDIF.
ENDIF.
ENDLOOP.
FS_CELL-FIELDNAME = W_FIELDNAME .
FS_CELL-COLOR-COL = 6.
FS_CELL-NOKEYCOL = 'X'.
APPEND FS_CELL TO T_SPFLI-CELL.
IF P_ROW IS NOT INITIAL AND P_COL IS NOT INITIAL.
MODIFY T_SPFLI INDEX P_ROW TRANSPORTING CELL.
ENDIF.
FS_LAYOUT-INFO_FIELDNAME = 'COLOR'.
FS_LAYOUT-BOX_FIELDNAME = 'CHECKBOX'.
FS_LAYOUT-COLTAB_FIELDNAME = 'CELL'.
FS_LAYOUT-F2CODE = '&ETA'.
W_PROG = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = W_PROG
IS_LAYOUT = FS_LAYOUT
IT_FIELDCAT = T_FIELDCAT
TABLES
T_OUTTAB = T_SPFLI
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
NOTE
Column and Row are colored with a coded color u2018Cxyzu2019.
Where C: Color (coding must begin with C)
X: Color Number
Y: Bold
Z: Inverse.
Thanks
Ashu -
Hi All,
Can anyone please explain me the functionality of report RPCEMDU0_CALL (Tcode-PC00_m10_OTEM). This is used to generate master data idocs. Any documentation would be really helpful.
Also is there any way to alter the idoc data before sending. Please let me know.
Thanks in advance.
Regards,
Priti ThakurStandard Doc[ for this transaction.|http://help.sap.com/saphelp_erp60_sp/helpdata/EN/f6/2318b13cf011d2a62900104b56737d/frameset.htm]
There are few threads in SDN and ittoolbox to discuss about the problems but nothing much!
To alter the format...explore the program. You can use the "Enhancement" part to add your custom logic to add columns to interface internal table. To access the enhancement...go to the program and press the 6th button from left ..the swirl button or press Shift + F4. Then activate enhancements ...to do the necessary coding as required.
Also try the user exit:
Note 1515497 - OT: Selection of a Provider - Customization User Exits
As per this note, there is a contact info of SAP Developer...if the note and the info is helpful and you need help related to that note or that functionality contact them.
Edited by: Amosha on Jun 22, 2011 10:31 AM -
i love the date added column. I think it's one of the best unmentioned new features in Lion.
I reinstalled OS 10.7 2 days ago, went through all of the updates to get current, because I was unhappy with the speed of my iMac 27, 3.4 Ghz & 16 gigs of RAM. The speed is unacceptable. (nothing changed, speed-wise)
Today I notice the Date Added column in any finder window is blank, except for 2 hyphens "– –".
Has anyone seen this or heard of it before? Did I hit a switch or turn something off by accident? I haven't made any other changes besides the reinstall.
What am I missing here?
Thanks,
GreggThanks SmokeMonster, That did it. Actually I had installed Lion on an external drive and forced indexing to stop by putting my other drives into Privacy in Spotlight. I didn't realize that it would carry on when I went back to running on my internal drive.
Paul Williams3, open Spotlight in System Preferences. Click on the Privacy tab and drag your hard drive(s) into the list to prevent Spotlight from indexing. I think you get an "Are you sure you want to do this?" message. Go ahead. This deletes the spotlight index of whatever you drag in there.
When you select whatever you put in there and click the minus button at the bottom left of the window, Spotlight will immediately begin to reindex.
Have a good day!
Gregg -
How to save data in columns with headers?
I'm trying to save 10 different types of data into individual columns with headers, but I can either get one giant column of data with the given header at the start of each data set (imbeded in the column) or I can get the headers in different columns, but the data all in one row. This seems like a simple problem, but for the life of me I can't figure it out--HELP!
I've attached my code...don't laugh, I think I've created a monster trying to figure this out. What I'm trying to get is one column with the header "Power (watts)" and then the power data in that column, one column with the header "angular acceleration (rad/s^2)" and then the angular acceleration data in that column, and so on...
Thanks!
Attachments:
RILE-25.vi 335 KBHi
Take a look at this VI / Block diagram pic
Here, I am demonstrating how to write data to a file column wise along with relevant column headers
Hope this helps
Regards
Dev
Attachments:
header_column data.JPG 49 KB
header_column data.vi 20 KB
Maybe you are looking for
-
my mail has been working perfectly on my 3gs iphone. I can now longer access the mail after tapping on the mail icon. All i get is a blank screen with a reload icon and a write icon at the bottom, neither of which responds when touched. The icon cont
-
Multiplex control files in Oracle 10g...
Hi , the Oracle documentation , in one of its books points out....: 'Once the disk drive is repaired, the damaged control file can be restored using the intact copy of the control file from the other disk and the instance can be restarted'. Is it ach
-
Filling in Rich Text fields in PDF
Is it possible to fill in RichText fields in a PDF from Coldfusion? I need to have certain words bolded, etc. I created the form in liveCycle and the field in question has Rich Text selected Field and Data format. When I assign data to the field thro
-
Turning off monitor detection?
Is there a way to turn of monitor auto-detection. I am using a kvm and have the a monitor hooked up as primary desktop on external dvi connector. Using iMac display as secondary monitor. Every time I use kvm to switch to another monitor the resolutio
-
MoveItemRequest: missing id in response
Hi, I'm trying to move posted appointments from one calendar to another via SOAP (GW 12): Code: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://schemas.novell.com/2005/01/GroupWise/types" xmlns:met="http://schemas.no