Make the column to row.(internal table)
hi
i have an internal table ITAB
data:begin of itab
quarters(2),
end of itab.
that has contents
Q1
Q2
Q3
Q4
I would like to have a ITAB2 like this
data:begin of itab
Q1(2),
Q2(2),
Q3(2),
Q4(2)
end of itab.
Q1 Q2 Q3 Q4 Q5
any ideas guys..........
thanks
raghu.
REPORT z_test.
Transpose itab1 to itab2.
TYPES: BEGIN OF ty_1,
first,
second,
third,
fourth,
END OF ty_1.
TYPES: BEGIN OF ty_2,
first,
second,
third,
END OF ty_2.
FIELD-SYMBOLS: <fs> TYPE ANY,
<fs2> TYPE ANY.
DATA: itab1 TYPE TABLE OF ty_1 WITH HEADER LINE,
itab2 TYPE TABLE OF ty_1 WITH HEADER LINE,
curr_line TYPE sy-tabix.
itab1-first = '1'.
itab1-second = '2'.
itab1-third = '3'.
itab1-fourth = '4'.
APPEND itab1.
itab1-first = '1'.
itab1-second = '2'.
itab1-third = '3'.
itab1-fourth = '4'.
APPEND itab1.
itab1-first = '1'.
itab1-second = '2'.
itab1-third = '3'.
itab1-fourth = '4'.
APPEND itab1.
LOOP AT itab1.
CLEAR itab2.
ASSIGN COMPONENT sy-tabix OF STRUCTURE itab2 TO <fs>.
curr_line = sy-tabix.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE itab1 TO <fs2>.
IF sy-subrc NE 0.
EXIT.
ENDIF.
IF curr_line = 1.
<fs> = <fs2>.
APPEND itab2.
ELSE.
READ TABLE itab2 INDEX sy-index.
<fs> = <fs2>.
MODIFY itab2 INDEX sy-index.
ENDIF.
ENDDO.
ENDLOOP.
LOOP AT itab2.
WRITE:/ itab2.
ENDLOOP.
Please find the above code for the same.
Regards
Ramesh.
Similar Messages
-
WPF: How to make the Column and Row separator more wide and different color in datagrid?
Our application uses WPF.
One of request is make the DataGrid column separator and row separator more wide and use different color and remove original black separator of rows and columns.
Which template we need to modify to make it? Thx!
JaneCHi Magnus,
Thanks for replying our question and provide your suggestions!
Now we know modify both HorizontalGridLinesBrush and VerticalGridLinesBrush we can change the DataGrid cell separator color.
Following your suggested, we modify the DataGridCell as following:
<Style x:Key="Body_Content_DataGrid_Centering"
TargetType="{x:Type DataGridCell}">
<Setter Property="Padding" Value="2,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Border BorderThickness="2" BorderBrush="{StaticResource PageBorderBackground}" Margin="-1">
<Grid Background="{TemplateBinding Background}" VerticalAlignment="Center" Height="42">
<ContentPresenter VerticalAlignment="Center"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DataGridStyle1" TargetType="{x:Type DataGrid}">
<Setter Property="HorizontalGridLinesBrush" Value="{x:Null}"/>
<Setter Property="VerticalGridLinesBrush" Value="{x:Null}"/>
</Style
JaneC -
Convert Columns into Rows (internal tables) - Urgent Help Pleasse..
Hi friends i'm having a little problem and hope you can help me..Here's the situation.
I have an internal table like shown below
(Key) (Key) (Key) (Key)
PATH_ID | GROUP | LINE | ATRIBUTE | VALUE
ASLN2 1 1 Company_Code 5146
ASLN2 1 1 Account_Code 400405
ASLN2 1 1 Profit_Centre AA00N2
ASLN2 1 2 Company_Code 5146
ASLN2 1 2 Account_Code 400705
ASLN2 1 2 Profit_Centre AA00N2
ASLN3 1 1 Company_Code 5146
ASLN3 1 1 Account_Code 400405
ASLN3 1 1 Profit_Centre AA00N2
ASLN3 1 2 Company_Code 5146
ASLN3 1 2 Account_Code 400705
ASLN3 1 2 Profit_Centre AA00N2
and i want to convert this internal table to one like below
PATH_ID | GROUP | LINE | Company Code | Account Code | Profit Centre
ASLN2 1 1 5146 400405 AA00N2
ASLN2 1 2 5146 400705 AA00N2
ASLN3 1 1 5146 400405 AA00N2
ASLN3 1 2 5146 400705 AA00N2
but i'm a bit of stuck, all those key fields are making me confused...anyone have a marvelous ( ) idea of how to implement this transformation ?
best regards,
Ricardo MonteiroItab1 with the structure PATH_ID | GROUP | LINE | ATRIBUTE | VALUE
Itab2 with structure PATH_ID | GROUP | LINE | ATRIBUTE | VALUE
Itab3 with the final structure PATH_ID | GROUP | LINE | Company Code | Account Code | Profit Centre
move itab1 to itab2.
sort itab2 by path_id group line.
delete adjacent duplicates from itab2 comparing path_id group line.
loop at itab2.
clear itab3.
move:
itab2-pathid to itab3-pathid,
itab2-group to itab3-group,
itab2-line to itab3-line.
loop at itab1where pathid = itab2-pathid
and group = itab2-group
and line = itab2-line.
IF itab1-ATRIBUTE = ' Company_Code'.
itab3-Company_Code = itab1-attribute.
elseif itab1-ATRIBUTE = ' Account_Code '.
itab3-Account_Code = itab1-attribute.
elseif itab1-ATRIBUTE = ' Profit_Centre ' .
itab3-profit_center = itab1-attribute.
endif
endloop.
append itab3.
endloop.
try this.
Thanks,
rajinikanth -
Moving columns of an internal table to rows of an another internal table.
Hi
i have an internal table with 20 fields for single record .Now i need to move the 20 fields
(of similar length) of single record into internal table with those 20 fields as 20 records i.e i need to make rows of first internal table into columns of second internal table.
hope iam clear.HI Deepthi,
Try with this Logic...
IF NOT ITAB[] IS INITIAL.
LOOP AT ITAB FROM 7.
ITAB2-FIELD1 = ITAB-FIELD1.
ITAB2-FIELD2 = ITAB-FIELD2.
APPEND : ITAB2.
CLEAR : ITAB2.
ENDLOOP.
DO 27 TIMES.
CASE CNT.
WHEN '1'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD6.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD6.
WHEN '2'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD7.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD7.
WHEN '3'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD8.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD8.
WHEN '4'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD9.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD9.
WHEN '5'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD10.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD10.
WHEN '6'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD11.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD11.
WHEN '7'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD12.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD12.
WHEN '8'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD13.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD13.
WHEN '9'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD14.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD14.
WHEN '10'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD15.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD15.
WHEN '11'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD16.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD16.
WHEN '12'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD17.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD17.
WHEN '13'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD18.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD18.
WHEN '14'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD19.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD19.
WHEN '15'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD20.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD20.
WHEN '16'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD21.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD21.
WHEN '17'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD22.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD22.
WHEN '18'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD23.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD23.
WHEN '19'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD24.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD24.
WHEN '20'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD25.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD25.
WHEN '21'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD26.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD26.
WHEN '22'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD27.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD27.
WHEN '23'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD28.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD28.
WHEN '24'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD29.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD29.
WHEN '25'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD30.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD30.
WHEN '26'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD31.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD31.
WHEN '27'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD32.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD32.
WHEN '28'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD33.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD33.
WHEN '29'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD34.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD34.
WHEN '30'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD35.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD35.
WHEN '31'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD36.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD36.
WHEN '32'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD37.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD37.
WHEN '33'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD38.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD38.
WHEN '34'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD39.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD39.
WHEN '35'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD40.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD40.
WHEN '36'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD41.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD41.
WHEN '37'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD42.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD42.
WHEN '38'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD43.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD43.
WHEN '39'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD44.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD44.
WHEN '40'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD45.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD45.
WHEN '41'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD46.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD46.
WHEN '42'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD47.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD47.
WHEN '43'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD48.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD48.
WHEN '44'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD49.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD49.
WHEN '45'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD50.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD50.
WHEN '46'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD51.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD51.
WHEN '47'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD52.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD52.
WHEN '48'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD53.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD53.
WHEN '49'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD54.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD54.
WHEN '50'.
READ TABLE ITAB INDEX 4.
ITAB3-FIELD1 = ITAB-FIELD55.
READ TABLE ITAB INDEX 5.
ITAB3-FIELD2 = ITAB-FIELD55.
ENDCASE.
APPEND ITAB3.
CLEAR ITAB3.
CNT = CNT + 1.
ENDDO.
ENDIF.
ENDIF.
Regards,
Santosh -
How to find the number of columns in an internal table DYNAMICALLY ?
Hi,
How to find the number of columns in an internal table DYNAMICALLY ?
Thanks and Regards,
saleem.Hi,
you can find the number of columns and their order using
the <b>'REUSE_ALV_FIELDCATALOG_MERGE'</b>
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = sy-repid
I_INTERNAL_TABNAME = 'ITAB'
I_INCLNAME = sy-repid
changing
ct_fieldcat = IT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif
now describe your fieldcat . and find no of columns.
and their order also..
regards
vijay -
How to read the data from an internal table,when column names are known
Hi All
I have a specific requirement. I got an internal table with many fields (let it be my_tab). Some of the fieldnames (column names in internal table my_tab) are stored in separate internal table(let it be my_fields).
I need to store/read data corresponding to the fields (whose name is stored in my_fields) from my_tab.
I am able to build dynamic table (referred by field-symbol) with respect to the given field names in my_fields.
But i am unable to read the data corresponding to the fieldnames from my_tab.
Please provide me some pointer in this regard.
Regards
Swetabh ShuklaHI All
Thanks for the prompt response. I got solution for my question. Please check below thread. For quick reponse i posted my question in one more category. Thanks to all of you.
How to read internal table w.r.t. fieldnames stored in other table -
Adding a column in an internal table
Hi,
I want to know how to add different rows of a column in an internal table.
My code :
Declaration Part-----
types : begin of imchb,
clabs like mchb-clabs,
cumlm like mchb-cumlm,
cinsm like mchb-cinsm,
tot_val_stock type p decimals 3,
pm_percent type p decimals 6,
end of imchb.
data : int_inv type standard table of imchb with header line,
wa_inv like line of int_inv.
Then I do few calculations and display it in the column pm_percent.
Now I want to sum this column.
Summation---
loop
at int_inv into wa_inv.
at end of pm_percent.
sum.
endat.
endloop.
write :/ wa_inv-pm_percent.
However , wa_inv-pm_percent only gives me the value of the last row of the column.
Kindly suggest .Hi,
Please try this code:
loop at int_inv into wa_inv.
lv_count = lv_count + 1.
AT END OF posnr. <------- The field you want to sum..
gs_total-posnr = wa_inv-posnr.
gs_total-cov_total = lv_count.
APPEND gs_total TO gt_total.
CLEAR : gs_total,
lv_count,
wa_inv.
ENDAT.
ENDLOOP. -
How can I make the rolumn and row headers appear on the printed sheet?
I am working in Numbers'09. I want to print out my chart with the column letters and row numbers showing.
How can I make the rolumn and row headers appear on the printed sheet?g,
Those annotations are called "Labels", and they are only visible during editing when a cell selection is made within the table. If you need to have the labels on your final output, you can create labels in Text Boxes and position them adjacent to the table.
Jerry -
How to make the column title needs to be on each page?
If a document has more than one page than a column title needs to be on each page,I can use Word fuction to do that. But If I Only use XML publisher, How to do it.
Message was edited by:
zhengrHi
If you mean how do you repeat the column titles on a table if the table extends over several pages then all you need do is:
Highlight the table header row
Right click and select table properties
On the Row tab, specify that the header row should be repeated on every page
Save your work
XMLP will now respect the word setting and will repeat the header row on evey page the table needs.
Regards, Tim -
Set the column name of a table in a list box
is there any code to set the column name of a table in a list box at oracle devloper 6i?
pls help.I dont want to go for pl/sql . It should work any table.You want Dynamic SQL without using PL/SQL? Tricky. I'm sure there's a possible way using some very complex and convoluted XML functionality of SQL but in reality you are asking for something that isn't natural to SQL queries, especially if you are expecting a dynamic number of columns to be produced for each row of data. SQL expects a table structure, including output formats, to be a defined number of columns with any number of rows, not a defined number of rows with any number of columns.
Perhaps if you explain why you need this sort of functionality then we may be able to offer a better solution.
;) -
Moving columns in an internal table
Hi Gurus,
I have this ALV program which displays the cost element and its corresponding groups (up to 10th level only).
My problem is on how to display the report where the first column is the cost element and the succeeding columns the cost element groups starting from the top level.
Below is example of a hierarchy of a given cost element ( 50030000 ).
EMPSTOTAL <---Top level
ESSPENDING
ES5003
ES5003P
50030000 <---Cost Element
Now, since the selection of data is from the cost element up to to the top level group.
The internal table would look like this:
Cost Element Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 .......
50030000 ES5003P ES5003 ESSPENDING EMPSTOTAL (blank) (blank)......
But this output is wrong, what I really want is like this:
Cost Element Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 .......
50030000 EMPSTOTAL ESSPENDING ES5003 ES5003P (blank) (blank)......
As you can see, what is placed next to the cost element is the Top level Group and the last is the group directly linked to the cost element.
Can you please teach me on how to do just that?
Thank you so much for your help.
Regards,
OnyxHi,
As my analysis you are passing the values to the wrong fields of the internal table. Please check the structure of your internal table . Is this in the order which you want?
Other wise please look into how this internal table is getting filled?
This is the sturucture mismatch probelm.
Also look in to the fieldcatalog.
With Regards,
Sumodh.P -
How to insert a button on the column header of a table in webdynpro java
Hi
Can anyone tell me how to insert a button on the column header of a table in webdynpro java?
regards
sunitHi sunit,
Instead of adding button in the column header , in the column
add a fixed top cell.
right click on the column
Insert FixedTopCell
Right click on the fixedTopCell
insert Editor.
select button.
then button will be only in the top most row.
Hope it will satisfy ur requirement
Regards
Smitha -
Custom ItemRenderer makes the column non editable
Hi Folks,
I have a DataGrid which s editable, I've created a custom ItemRenderer to deal with special format needed for Date variables, for that I extended the mx:Text class in order to get access to the listData.dataField variable.
The problem is that this makes the column non-editable, the other column in the table are editabe.
When I used a VBox container the column was editable however I didn't get access to the listData, which I need for the dataField variable.
Any help will be appreciated.
Thanks,
MR.
Here is the my DateItemRenderer code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Text xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import aslib.common.Constants;
import aslib.common.Utils;
import aslib.connection.JSONConnector;
import mx.controls.dataGridClasses.DataGridListData;
import mx.controls.listClasses.ListData;
import mx.formatters.DateFormatter;
[Bindable]
private var _dispValue:String;
public function dateStr(val:Object):String {
var innerDt:Date;
if(!(val is Date))
innerDt = Utils.convertDateStr(val as String);
else
innerDt = val as Date;
if(innerDt){
var df:DateFormatter = new DateFormatter();
df.formatString = "DD/MM/YYYY";
var formatedDate:String = df.format(innerDt);
return formatedDate;
}else{
return "";
public override function set data(value:Object):void {
var date:Object = value[(listData as DataGridListData).dataField];
if(date){
_dispValue = dateStr(date);
]]>
</fx:Script>
<mx:text>{_dispValue}</mx:text>
</mx:Text>OK, found the issue, forgot to add 'super.data = value' in the set data method...
-
Copy columns of an internal table
hi,
i want to copy columns of an internal table into another internal table, now i loop the original table to one workarea and then get the field i need, and then append to destination table.
is there any more effective way ?hi,
use move corresponding statement.
Example:
MOVE-CORRESPONDING ADDRESS TO NAME.
and also use
<itab2> = <itab1>.
*if useful reward with points.* -
FM to upload the Excel file to internal table
Hi
Is any FM available to upload the Excel file to internal table.
Thanks
AnbuHi
se this code
EXCEL to INTERNAL TABLE and then to APPLICATION SERVER
*& Report ZSD_EXCEL_INT_APP
REPORT ZSD_EXCEL_INT_APP.
parameter: file_nm type localfile.
types : begin of it_tab1,
f1(20),
f2(40),
f3(20),
end of it_tab1.
data : it_tab type table of ALSMEX_TABLINE with header line,
file type rlgrap-filename.
data : it_tab2 type it_tab1 occurs 1,
wa_tab2 type it_tab1,
w_message(100) TYPE c.
at selection-screen on value-request for file_nm.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
STATIC = 'X'
MASK = ' '
CHANGING
file_name = file_nm
EXCEPTIONS
MASK_TOO_LONG = 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.
start-of-selection.
refresh it_tab2[].clear wa_tab2.
file = file_nm.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = file
i_begin_col = '1'
i_begin_row = '1'
i_end_col = '10'
i_end_row = '35'
tables
intern = it_tab
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at it_tab.
case it_tab-col.
when '002'.
wa_tab2-f1 = it_tab-value.
when '004'.
wa_tab2-f2 = it_tab-value.
when '008'.
wa_tab2-f3 = it_tab-value.
endcase.
at end of row.
append wa_tab2 to it_tab2.
clear wa_tab2.
endat.
endloop.
data : p_file TYPE rlgrap-filename value 'TEST3.txt'.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
*--- Display error messages if any.
IF sy-subrc NE 0.
MESSAGE e001(zsd_mes).
EXIT.
ELSE.
*---Data is downloaded to the application server file path
LOOP AT it_tab2 INTO wa_tab2.
TRANSFER wa_tab2 TO p_file.
ENDLOOP.
ENDIF.
*--Close the Application server file (Mandatory).
CLOSE DATASET p_file.
loop at it_tab2 into wa_tab2.
write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
endloop.
Maybe you are looking for
-
.exe or installation package
maybe "Creating an application" is not the right title for what I need cuz I had used this and someone referred to something else.What i actually need is to create an executable or an application package which one can use to install the java applicat
-
iPod is stuck in recovery mode, and not recognized by iTunes. Tried all of the recommended resets and combinations mentioned, but the ipod is still not recognized. Genius at apple said it may be a hardware error, "The button is broke" but all of the
-
HORRIBLE BUZZING/HUMMING WHEN CONNECTING SYNTHESIZER TO GARAGEBAND?
Hi! I want to connect my synthesizer to garage band so that I can use it as a live instrument when recording. I have a MobilePre USB from M-Audio. I just sent for an Imic, and I just bought a guitar cable adapter today from Griffin. Ok, when I use th
-
Batch field truncation-- affecting interactive screen msc3n as 'No batch'.
I have batch field in my ALV interactive report. batch field I declared as database table's batch field which is char 10. But when it is displayed in ALV output,1) . it has truncated the leading zeros. So , when the user clicks on the batch(as the
-
Is there a way to give one AP in a network the role of a "controller", so that basically all other APs will get their configuration or client authentication through the single device? We have 12 autonomous APs and we are using MAC authentication as p