Excel Upload with Hidden Column
Hi Gurus-
Can you upload Excel file with hidden column and get the function to read values in hidden column? If yes, could you please guide me how?
I am using ALSM_EXCEL_TO_INTERNAL_TABLE
Any help will be highly appreciated.
Thanks in advance!
Hi,
Have a look at program RSDEMO01 (available in the controls examples of the workbench). It demonstrates an OLE connection to Excel.
To know which excel objects, methods and properties to use it is a good idea to use the excel macro recorder - just do what you want your program to do and then translate the resulting VB code to ABAP OLE.
For the import of the clipboard data you can use CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_IMPORT. In the result table, iirc, there is one line for each imported line and within the line the cell values are separated by tab. So there is some work left - it might be a good idea t import the data column by column.
It has been some time when I did this for a former client of me - so unfortunately I do not have the code any more.
Regards, Gerd Rother
Similar Messages
-
Hi,
I have enabled excel upload with the listener, and it actually works fine. I get the data into a collection.
Now what if I want to store the file in the database? It seems that the file is NOT inserted into wwv_flow_files. Also the item that contains the file has no value when the page is submitted with the XLS2COLLECTION button. (If I create another button that also submits the filename is there)..
So it seems that when this feature is enabled the file is deleted from www_flow_files when page processing starts.Hi Martin,
the feature is undocumented and not officially supported for 1.1, but known to work for Excel files up to the 2003 format. XLSX (2007 onwards) is not implemented.
Perhaps going through the discussion and examples in {thread:id=2342792} helps you solve your issue.
-Udo -
Excel upload with header in the first line
Hi ,
I have to upload a Excel sheet with data where the first line will be the Header .
I am using the FM
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_LINE_HEADER = 'X'
I_TAB_RAW_DATA = IT_TAB_RAW_DATA
I_FILENAME = P_FILE
TABLES
I_TAB_CONVERTED_DATA = IT_FS00_C
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2.
But the data is not getting uploaded in the IT_FS00_c table.
is there any other way to do it.
thanks and regards,
Vikki.Use the folllowing coding.....
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1
i_begin_row = 2
i_end_col = 7
i_end_row = 9999
TABLES
intern = t_alsm_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.
SORT t_alsm_tab BY row col.
LOOP AT t_alsm_tab INTO r_alsm_tab.
AT END OF row.
l_append = 'X'.
ENDAT.
IF r_alsm_tab-col = 1.
r_input_tab-kokrs = r_alsm_tab-value.
ELSEIF r_alsm_tab-col = 2.
r_input_tab-bukrs = r_alsm_tab-value.
ELSEIF r_alsm_tab-col = 3.
r_input_tab-rprctr = r_alsm_tab-value.
ELSEIF r_alsm_tab-col = 4.
r_input_tab-pline = r_alsm_tab-value.
ELSEIF r_alsm_tab-col = 5.
r_input_tab-sdatst = r_alsm_tab-value.
ELSEIF r_alsm_tab-col = 6.
r_input_tab-sdated = r_alsm_tab-value.
ELSEIF r_alsm_tab-col = 7.
r_input_tab-kostl = r_alsm_tab-value.
ENDIF.
IF l_append = 'X'.
APPEND r_input_tab TO t_input_tab.
CLEAR : l_append , r_input_tab.
ENDIF.
ENDLOOP.
ENDIF. -
Auto size columns but with hidden columns
I want to hide some columns for interal use with the following statements:
jTable.getColumnModel().getColumn(i).setMaxWidth(0);
jTable.getColumnModel().getColumn(i).setMinWidth(0);
jTable.getColumnModel().getColumn(i).setPreferredWidth(0);
Now I find that the widths of hidden columns become not zero.
But I still want to auto-size the columns, so I add
setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
Then I find that the widths of hidden columns become not zero.
Could anyone tell me how to auto size the columns while keeping the hidden columns with zero widths?
Thanks!If you want to hide columns then remove them from the TableColumnModel. The data is not removed, the columns are just not painted. Here is an example:
http://forum.java.sun.com/thread.jsp?forum=31&thread=411506 -
Excel Upload With Multiple Worksheets
Friends,
I have requirement wherein I have to read data from an excel file with multiple worksheets. I have gone through some earlier postings but most of them explain about creating an excel file with multiple worksheets (which is right oppsite of what I need to do)
I am trying to understand the concept of OLE and implement it but am finding it tricky!
Please help me out!
Thanks,
ShyamSee this site: AN EASY REFERENCE FOR OLE AUTOMATION by Serder Simsekler.
Best!
Jim -
Upload of Excel File with variable columns
Hi All,
I have a requirement where i have to upload xls file into SAP. This xls file has 10 rows fixed but the columns may vary from 20 to 400.
For Ex : My xls file has 10 rows and 27 columns filled at present. But in future columns can vary to 400 or more than that also.
So when i use ALSM_EXCEL_TO_INTERNAL_TABLE as
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = p_fname
I_BEGIN_COL = 1
I_BEGIN_ROW = 1
I_END_COL = 400
I_END_ROW = 10
TABLES
INTERN = itab1
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
It throws SY_SUBRC = 2.
Please let me know how i can solve this issue.
Thanks,Hi Ashwani,
I will send a sample code for ur problem.Please the check the function modules i have used and procedure i followed.My function modules can work for any no.of rows and columns ok..check it once..
Along with my code i am sending a flat file.plz copy the code and execute it and debug it ok..i will attach flat file at the end of the program check it once ok...
code:
*& Report YBDC_UPLOAD_MM01_XLS *
*& DEVELOPER : KIRAN KUMAR.G *
*& PURPOSE : MAKE CHANGES TO DOWNLOADED FILE AND UPLOAD THE FILE *
*& CREATION DT: 3/12/2007 *
*& REQUEST : ERPK900035 *
REPORT YBDC_UPLOAD_MM01_XLS.
Tables
TABLES : mara. "General Material Data
Global BDCDATA Structure and MESSAGE Structure
DATA: gt_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE,
gt_msgtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
Global Variables
DATA: gv_infile TYPE string,
gv_msg TYPE string,
gv_update VALUE 'A'.
Internal Table
DATA: BEGIN OF gt_data OCCURS 0,
matnr(20), "Material Number
mbrsh(20), "Account Group
mtart(20), "Material Type
meins(20), "Base Unit Of Measure
maktx(20), "Material Description
END OF gt_data.
Selection-screen
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_file LIKE rlgrap-filename,
p_mode.
SELECTION-SCREEN : END OF BLOCK b1.
Select the File
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM fetch_file.
START-OF-SELECTION.
Fetch Data From XLS File
PERFORM fetch_data.
Fetch Data From XLS File
PERFORM delete_headerinfo.
Fetch Data From XLS File
PERFORM place_data.
*& Form fetch_file
text
--> p1 text
<-- p2 text
FORM fetch_file .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
FIELD_NAME = ' '
IMPORTING
file_name = p_file.
gv_infile = p_file.
ENDFORM. " fetch_file
*& Form fetch_data
text
--> p1 text
<-- p2 text
FORM fetch_data .
refresh : gt_data. "Clear Body Of the Internal Table
clear : gt_data. "Clear Header Line
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = gv_infile
filetype = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = gt_data
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ENDFORM. " fetch_data
*& Form place_data
text
--> p1 text
<-- p2 text
FORM place_data .
LOOP AT gt_data.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=AUSW'.
PERFORM bdc_field USING 'RMMG1-MATNR'
gt_data-matnr.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(01)'
'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM bdc_field USING 'MAKT-MAKTX'
gt_data-maktx.
PERFORM bdc_field USING 'MARA-MTPOS_MARA'
'NORM'.
CALL TRANSACTION 'MM02' USING gt_bdcdata MODE p_mode
UPDATE gv_update
MESSAGES INTO gt_msgtab.
*For Error Messages Handling.
LOOP AT gt_msgtab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = sy-msgid
lang = sy-langu
no = sy-msgno
v1 = sy-msgv1
v2 = sy-msgv2
v3 = sy-msgv3
v4 = sy-msgv4
IMPORTING
msg = gv_msg
EXCEPTIONS
not_found = 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.
IF sy-tabix = 1.
WRITE: / 'Process Log' COLOR 3.
ENDIF.
WRITE:/ gv_msg.
ENDLOOP.
REFRESH gt_msgtab.
REFRESH gt_bdcdata.
ENDLOOP.
ENDFORM. " place_data
Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR gt_bdcdata.
gt_bdcdata-program = program.
gt_bdcdata-dynpro = dynpro.
gt_bdcdata-dynbegin = 'X'.
APPEND gt_bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM bdc_field USING fnam fval.
CLEAR gt_bdcdata.
gt_bdcdata-fnam = fnam.
gt_bdcdata-fval = fval.
APPEND gt_bdcdata.
ENDFORM. "BDC_FIELD
*& Form delete_headerinfo
text
--> p1 text
<-- p2 text
FORM delete_headerinfo .
DELETE gt_data INDEX 1.
ENDFORM. " delete_headerinfo
FLAT FILE
*MATERIAL NUMBER INDUSTRY SECTOR MATERIAL TYPE BASE UNIT OF
*MEASURE MATERIAL DESCRIPTION
*806 M FERT CM IRON
*807 M HALB KG STEEL
*808 M HAWA KG IRON
Reward points if helpful
Kiran Kumar.G.A
Have a nice day... -
How to link Excel Chart with multiple columns dynamically?
Hi all,
I have one problem. I have an excel chart which has to read data from multiple columns for it's X-axis values (time stamps) and the same number of values for it's Y-axis from multiple columns. See figure attached.
Now, you can do this by manually assigning values by holding control key to tell the chart that data from many columns is continued from the first column. i.e, a long data is distributed along may columns. This is done very easily manually.
Now, how to do it at runtime through LabVIEW 8.0?
Although, I have done it through labview when there where only two columns, A and B streching up to any length. But, now to save space we are dumping into many columns in the same page and want the chart plot that data as we dump it.
It is tough since I don't know how to assign SourceData of the chart through labview.
I have attached chart's SourceData picture.
Hope you all can solve my problem.
The Y-axis values are: =(good!$B$30:$B$70,good!$D$30:$D$70,good!$F$30:$F$70,good!$H$30:$H$70,good!$B$71:$B$140,good!$D$71:$D$140,good!$F$71:$F$140,good!$H$71:$H$140,good!$B$141:$B$189)
good is the name of the file.
The X- axis values are: =(good!$A$30:$A$70,good!$C$30:$C$70,good!$E$30:$E$70,good!$G$30:$G$70,good!$A$71:$A$140,good!$C$71:$C$140,good!$E$71:$E$140,good!$G$71:$G$140,good!$A$141:$A$189)
See the columns vary from A to F.
I have still not got what I love.....
Attachments:
ExcelChart.JPG 113 KB
SourceData.JPG 34 KB
XY values.JPG 36 KBOk i solved the excel chart problem. Here is the figure showing my victory! But offcourse with NI forum help.
Message Edited by Halemani on 09-19-2008 06:33 AM
I have still not got what I love.....
Attachments:
Chart_XValues_Values.JPG 36 KB -
Cant seem to get checkbox with hidden columns to work...
I tried to implement the guide to making checkboxes and make columns hidden tutorial on a report but I get the checkbox but no table. Is it because I imported from datalink and didnt create the data from scratch or there is something i needed to do?
I changed this statement from example"
STATIC2:Category;CAT,Description;DESCR,
Availability;AVAIL
to STATIC2:Category;CATEGORY,Description;DESCRCRIPTION,
Availability;AVAILABILTY
dont think there should be any problems...What exactly happened when you took the applicable steps in the support article?
-
How to download output data into Excel with all Column Headings
Hi Experts,
Please tell me How to download output data of ALV Grid into Excel file with all Column Headings and I want to do this using coding,
please send me if any solution is available.
Thanks & Regards,
YogeshVERSION CONTROL (Most recent on top): *
DATE(mm.dd.yyyy) AUTHOR *
06.25.2007 Pattan Naveen *
Hi yogesh,,
Go through this in this u find ur solution.
report ZTEst_programe no standard page heading
line-size 100
line-count 50(5)
message-id zz.
*--alv type declaration
type-pools: slis.
*--Tables:
tables: anla,
anlz,
anlh,
anlb,
anlc.
data: v_pos type i.
data: v_ndjar type i.
data: v_ndper type i,
v_ndperndabp type i,
v_ndjarndabp1 type i,
v_ndjarndabp type i,
value type i,
date(10) type c value '2006.12.04'.
data: c_0000(4) type c value '0000'.
data: begin of it_final occurs 0,
anlkl(8),
bukrs(4),
anln1 like anla-anln1,
anln2 like anla-anln2,
txt50 like anla-txt50,
txa50 like anla-txa50,
anlhtxt like anlh-anlhtxt,
sernr like anla-sernr,
invnr like anla-invnr,
menge like anla-menge,
meins like anla-meins,
inken like anla-inken,
ivdat like anla-ivdat,
aktiv like anla-aktiv,
gsber like anlz-gsber,
kostl like anlz-kostl,
kostlv like anlz-kostlv,
werks like anlz-werks,
stort like anlz-stort,
raumn like anlz-raumn,
txjcd like anlz-txjcd,
ord41 like anla-ord41,
ord44 like anla-ord44,
gdlgrp like anla-gdlgrp,
anlue like anla-anlue,
lifnr like anla-lifnr,
typbz like anla-typbz,
aibn1 like anla-aibn1,
aibn2 like anla-aibn2,
aibdt like anla-aibdt,
posnr like anla-posnr,
vmgli like anla-vmgli,
invzu like anla-invzu,
ernam like anla-ernam,
erdat like anla-erdat,
afabe like anlb-afabe,
afasl like anlb-afasl,
ndjar like anlb-ndjar,
ndper like anlb-ndper,
afabg like anlb-afabg,
ndabj like anlc-ndabj,
ndabp like anlc-ndabp,
andsj like anlc-andsj,
andsp like anlc-andsp,
safbg like anlb-safbg,
umjar like anlb-umjar,
inbda like anlb-inbda,
kansw like anlc-kansw,
knafa like anlc-knafa,
kaafa like anlc-kaafa,
deakt like anla-deakt,
kanza like anlc-kanza,
kaufw like anlc-kaufw,
kinvz like anlc-kinvz,
ksafa like anlc-ksafa,
kmafa like anlc-kmafa,
end of it_final.
data: begin of it_final_as91 occurs 0,
anlkl(8),
bukrs(4),
anln1 like anla-anln1,
anln2 like anla-anln2,
txt50 like anla-txt50,
txa50 like anla-txa50,
anlhtxt like anlh-anlhtxt,
sernr like anla-sernr,
invnr like anla-invnr,
menge like anla-menge,
meins like anla-meins,
inken like anla-inken,
ivdat like anla-ivdat,
aktiv like anla-aktiv,
gsber like anlz-gsber,
kostl like anlz-kostl,
kostlv like anlz-kostlv,
werks like anlz-werks,
stort like anlz-stort,
raumn like anlz-raumn,
txjcd like anlz-txjcd,
ord41 like anla-ord41,
ord44 like anla-ord44,
gdlgrp like anla-gdlgrp,
anlue like anla-anlue,
lifnr(10),
typbz(15),
aibn1 like anla-aibn1,
aibn2 like anla-aibn2,
aibdt like anla-aibdt,
posnr like anla-posnr,
vmgli like anla-vmgli,
invzu like anla-invzu,
ernam like anla-ernam,
erdat like anla-erdat,
end of it_final_as91.
data: it_download_as91 like it_final_as91 occurs 0
with header line."#EC NEEDED
data: begin of it_final_as92 occurs 0,
anlkl(8),
bukrs(4),
anln1 like anla-anln1,
anln2 like anla-anln2,
deakt like anla-deakt,
ernam like anla-ernam,
erdat like anla-erdat,
afabe like anlb-afabe,
afasl like anlb-afasl,
ndjar like anlb-ndjar,
ndper like anlb-ndper,
afabg like date,
ndabj(3) type c,
ndabp(3) type c,
kansw like anlc-kansw,
knafa like anlc-knafa,
kaafa like anlc-kaafa,
kanza like anlc-kanza,
kaufw like anlc-kaufw,
kinvz like anlc-kinvz,
ksafa like anlc-ksafa,
kmafa like anlc-kmafa,
end of it_final_as92.
data: it_download_as92 like it_final_as92 occurs 0
with header line."#EC NEEDED
data: begin of it_values occurs 0,
anlkl(8),
bukrs(4),
anln1 like anla-anln1,
anln2 like anla-anln2,
deakt like anla-deakt,
afabe like anlb-afabe,
afasl like anlb-afasl,
ndjar like anlb-ndjar,
ndper like anlb-ndper,
afabg like date,
ndabj(3) type c,
ndabp(3) type c,
afabe_02 like anlb-afabe,
afasl_02 like anlb-afasl,
ndjar_02 like anlb-ndjar,
ndper_02 like anlb-ndper,
afabg_02 like date,
ndabj_02 like anlc-ndabj,
ndabp_02 like anlc-ndabp,
kansw01 like anlc-kansw,
knafa01 like anlc-knafa,
kaafa01 like anlc-kaafa,
kansw02 like anlc-kansw,
knafa02 like anlc-knafa,
kaafa02 like anlc-kaafa,
kansw03 like anlc-kansw,
knafa03 like anlc-knafa,
kaafa03 like anlc-kaafa,
kansw04 like anlc-kansw,
knafa04 like anlc-knafa,
kaafa04 like anlc-kaafa,
kansw05 like anlc-kansw,
knafa05 like anlc-knafa,
kaafa05 like anlc-kaafa,
kansw06 like anlc-kansw,
knafa06 like anlc-knafa,
kaafa06 like anlc-kaafa,
kansw07 like anlc-kansw,
knafa07 like anlc-knafa,
kaafa07 like anlc-kaafa,
kansw08 like anlc-kansw,
knafa08 like anlc-knafa,
kaafa08 like anlc-kaafa,
kansw09 like anlc-kansw,
knafa09 like anlc-knafa,
kaafa09 like anlc-kaafa,
kanza01 like anlc-kanza,
kaufw01 like anlc-kaufw,
kinvz01 like anlc-kinvz,
ksafa01 like anlc-ksafa,
kmafa01 like anlc-kmafa,
end of it_values.
data: it_values_xls like it_values occurs 0
with header line."#EC NEEDED
data: begin of it_itab1 occurs 0,
bukrs like anla-bukrs,
anlkl like anla-anlkl,
anln1 like anla-anln1,
anln2 like anla-anln2,
txt50 like anla-txt50,
txa50 like anla-txa50,
invnr like anla-invnr,
ktogr like anla-ktogr,
sernr like anla-sernr,
menge like anla-menge,
meins like anla-meins,
ivdat like anla-ivdat,
inken like anla-inken,
aktiv like anla-aktiv,
deakt like anla-deakt,
zugdt like anla-zugdt,
zujhr like anla-zujhr,
zuper like anla-zuper,
gdlgrp like anla-gdlgrp,
anlue like anla-anlue,
xafabch like anla-xafabch,
aibn1 like anla-aibn1,
aibn2 like anla-aibn2,
aibdt like anla-aibdt,
posnr like anla-posnr,
ord41 like anla-ord41,
ord44 like anla-ord44,
vmgli like anla-vmgli,
invzu like anla-invzu,
typbz like anla-typbz,
lifnr like anla-lifnr,
ernam like anla-ernam,
erdat like anla-erdat,
end of it_itab1.
data: begin of it_itab2 occurs 0,
bukrs like anlz-bukrs,
anln1 like anlz-anln1,
anln2 like anla-anln2,
bdatu like anlz-bdatu,
werks like anlz-werks,
gsber like anlz-gsber,
kostl like anlz-kostl,
kostlv like anlz-kostlv,
stort like anlz-stort,
raumn like anlz-raumn,
txjcd like anlz-txjcd,
ipsnr like anlz-ipsnr,
end of it_itab2.
data: begin of it_itab3 occurs 0,
bukrs like anlh-bukrs,
anln1 like anlh-anln1,
anlhtxt like anlh-anlhtxt,
end of it_itab3.
data: begin of it_itab4 occurs 0,
bukrs like anlb-bukrs,
anln1 like anlb-anln1,
anln2 like anla-anln2,
afabe like anlb-afabe,
bdatu like anlb-bdatu,
afasl like anlb-afasl,
ndjar like anlb-ndjar,
ndper like anlb-ndper,
afabg like anlb-afabg,
ndurj like anlb-ndurj,
ndurp like anlb-ndurp,
umjar like anlb-umjar,
safbg like anlb-safbg,
zinbg like anlb-zinbg,
inbda like anlb-inbda,
end of it_itab4.
data: begin of it_itab5 occurs 0,
bukrs like anlc-bukrs,
anln1 like anlc-anln1,
anln2 like anla-anln2,
gjahr like anlc-gjahr,
afabe like anlc-afabe,
zujhr like anlc-zujhr,
zucod like anlc-zucod,
ndabj like anlc-ndabj,
ndabp like anlc-ndabp,
kansw like anlc-kansw,
knafa like anlc-knafa,
kaafa like anlc-kaafa,
ksafa like anlc-ksafa,
andsj like anlc-andsj,
andsp like anlc-andsp,
kanza like anlc-kanza,
kaufw like anlc-kaufw,
kinvz like anlc-kinvz,
kmafa like anlc-kmafa,
end of it_itab5.
ALV DECLARATIONS
*--declarations for Xls sheet header field names
data: begin of it_head occurs 0,
column(70).
data: end of it_head.
data: begin of it_head1 occurs 0,
column(70).
data: end of it_head1.
*--type declarations for field catalog for basic report
data: it_fldcat_head type slis_t_fieldcat_alv,
wa_fldcat_head type slis_fieldcat_alv."#EC NEEDED
data : w_field type slis_fieldcat_alv."#EC NEEDED
data: it_fldcat_head1 type slis_t_fieldcat_alv,
wa_fldcat_head1 type slis_fieldcat_alv."#EC NEEDED
*--type declarations for layout design
data: wa_layout type slis_layout_alv.
*--type declarations for list header on grid
*data: top_of_page type slis_t_listheader.
*--declaration of variables
data : w_repid like sy-repid.
**selection-screen
select-options: s_bukrs for anla-bukrs,
s_anln1 for anla-anln1.
select-options: s_deakt for anla-deakt,
s_gjahr for anlc-gjahr obligatory,
s_anlkl for anla-anlkl,
s_date for anla-aktiv.
*selection-screen
selection-screen begin of block blk1 with frame title text-022.
selection-screen begin of line.
parameters : r1 radiobutton group g1 default 'X'.
selection-screen comment 20(50) text-020.
selection-screen end of line.
selection-screen begin of line.
parameters : r2 radiobutton group g1.
selection-screen comment 20(50) text-021.
selection-screen end of line.
selection-screen end of block blk1.
selection-screen begin of block blk2 with frame title text-023.
select-options: s_ernam for anla-ernam,
s_erdat for anla-erdat .
selection-screen end of block blk2.
*--INITIALIZATION
initialization.
w_repid = sy-repid.
at selection-screen.
if r1 = 'X'.
perform selection_screen_validation.
endif.
if r2 = 'X'.
perform selection_screen_validation.
endif.
*--START-OF-SELCTION
start-of-selection.
if r1 = 'X'.
perform populate-data.
perform fill_finaldata.
perform comment_build using top_of_page.
perform xls_output.
perform download.
endif.
if r2 = 'X'.
perform populate-data.
perform fill_finaldata.
perform fill_as92data.
perform putdata_horizontal.
perform xls_output_as92.
perform download_as92.
endif.
*--END-OF-SELCTION
end-of-selection.
if r1 = 'X'.
perform build_layout.
perform build_fieldcatalog.
perform top_of_page.
perform list-display.
endif.
if r2 = 'X'.
perform build_layout.
perform build_fieldcatalog1.
perform list-display1.
endif.
*& Form SELECTION_SCREEN_VALIDATION
text
--> p1 text
<-- p2 text
form selection_screen_validation.
*--validating originating company code
data: l_bukrs like anla-bukrs."#EC NEEDED
if not s_bukrs[] is initial.
select single bukrs from anla
into l_bukrs
where bukrs in s_bukrs.
if sy-subrc <> 0.
message e000 with text-001 .
endif.
endif.
*--validating originating main asset no.
data: l_anln1 like anla-anln1."#EC NEEDED
if not s_anln1[] is initial.
select single anln1 from anla
into l_anln1
where anln1 in s_anln1.
if sy-subrc <> 0.
message e000 with text-002 .
endif.
endif.
*--validating originating Deactivation date
data: l_deakt like anla-deakt."#EC NEEDED
if not s_deakt[] is initial.
select single deakt from anla
into l_deakt
where deakt in s_deakt.
if sy-subrc <> 0.
message e000 with text-004 .
endif.
endif.
*--validating originating asset class.
data: l_anlkl like anla-anlkl."#EC NEEDED
if not s_anlkl[] is initial.
select single anlkl from anla
into l_anlkl
where anlkl in s_anlkl.
if sy-subrc <> 0.
message e000 with text-006 .
endif.
endif.
*--validating originating Date
data: l_date like anla-aktiv."#EC NEEDED
if not s_date[] is initial.
select single aktiv from anla
into l_date
where aktiv in s_date.
if sy-subrc <> 0.
message e000 with text-007 .
endif.
endif.
*--validating originating Fiscal year which first acquisition was posted
data: l_gjahr like anlc-gjahr."#EC NEEDED
if not s_gjahr[] is initial.
select single gjahr from anlc
into l_gjahr
where gjahr in s_gjahr.
if sy-subrc <> 0.
message e000 with text-008.
endif.
endif.
data: l_ernam like anla-ernam."#EC NEEDED
if not s_ernam[] is initial.
select single ernam from anla
into l_ernam
where ernam in s_ernam.
if sy-subrc <> 0.
message e000 with text-009.
endif.
endif.
data: l_erdat like anla-erdat."#EC NEEDED
if not s_erdat[] is initial.
select single erdat from anla
into l_erdat
where erdat in s_erdat.
if sy-subrc <> 0.
message e000 with text-010.
endif.
endif.
endform. " SELECTION_SCREEN_VALIDATION
*& Form POPULATE-DATA
text
--> p1 text
<-- p2 text
form populate-data.
select bukrs
anlkl
anln1
anln2
txt50
txa50
invnr
ktogr
sernr
menge
meins
ivdat
inken
aktiv
deakt
zugdt
zujhr
zuper
gdlgrp
anlue
xafabch
aibn1
aibn2
aibdt
posnr
ord41
ord44
vmgli
invzu
typbz
lifnr
ernam
erdat
from anla
into table it_itab1
where anlkl in s_anlkl and
anln1 in s_anln1 and
deakt in s_deakt and
bukrs in s_bukrs and
aktiv in s_date.
if sy-subrc ne 0.
message e000 with 'Data does not exist'(094).
endif.
if not it_itab1[] is initial.
select bukrs
anln1
anln2
bdatu
werks
gsber
kostl
kostlv
stort
raumn
txjcd
ipsnr
from anlz
into table it_itab2
for all entries in it_itab1
where bukrs = it_itab1-bukrs and
anln1 = it_itab1-anln1 and
anln2 = it_itab1-anln2.
anln2 = '0000'.
if sy-subrc ne 0.
message e000 with 'Data does not exist'(094).
endif.
endif.
if not it_itab2[] is initial.
select bukrs
anln1
anlhtxt
from anlh
into table it_itab3
for all entries in it_itab2
where bukrs = it_itab2-bukrs and
anln1 = it_itab2-anln1.
if sy-subrc ne 0.
message e000 with 'Data does not exist'(094).
endif.
endif.
if not it_itab1[] is initial.
select bukrs
anln1
anln2
afabe
bdatu
afasl
ndjar
ndper
afabg
ndurj
ndurp
umjar
safbg
zinbg
inbda
from anlb
into table it_itab4
for all entries in it_itab1
where bukrs = it_itab1-bukrs and
anln1 = it_itab1-anln1 and
anln2 = it_itab1-anln2.
anln2 = '0000'.
if sy-subrc ne 0.
message e000 with 'Data does not exist'(094).
endif.
endif.
sort it_itab4 by bukrs anln1 anln2 afabe.
if not it_itab4[] is initial.
select bukrs
anln1
anln2
gjahr
afabe
zujhr
zucod
ndabj
ndabp
kansw
knafa
kaafa
ksafa
andsj
andsp
kanza
kaufw
kinvz
kmafa
from anlc
into table it_itab5
for all entries in it_itab4
where bukrs = it_itab4-bukrs and
anln1 = it_itab4-anln1 and
anln2 = it_itab4-anln2 and
anln2 = '0000' and
gjahr in s_gjahr.
if sy-subrc ne 0.
message e000 with 'Data does not exist'(094).
endif.
endif.
sort it_itab5 by bukrs anln1 anln2 ndabj ndabp.
endform. " POPULATE-DATA
*& Form FILL_FINALDATA
text
--> p1 text
<-- p2 text
form fill_finaldata.
loop at it_itab5.
loop at it_itab4 where bukrs = it_itab5-bukrs and
anln1 = it_itab5-anln1 and
anln2 = it_itab5-anln2 and
afabe = it_itab5-afabe.
it_final-afabe = it_itab4-afabe.
it_final-afasl = it_itab4-afasl.
it_final-ndjar = it_itab4-ndjar.
it_final-ndper = it_itab4-ndper.
it_final-afabg = it_itab4-afabg.
it_final-umjar = it_itab4-umjar.
it_final-safbg = it_itab4-safbg.
it_final-inbda = it_itab4-inbda.
it_final-ndabj = it_itab5-ndabj.
it_final-ndabp = it_itab5-ndabp.
it_final-kansw = it_itab5-kansw.
it_final-knafa = it_itab5-knafa.
it_final-kaafa = it_itab5-kaafa.
it_final-andsj = it_itab5-andsj.
it_final-andsp = it_itab5-andsp.
it_final-kanza = it_itab5-kanza.
it_final-kaufw = it_itab5-kaufw.
it_final-kinvz = it_itab5-kinvz.
it_final-ksafa = it_itab5-ksafa.
it_final-kmafa = it_itab5-kmafa.
read table it_itab1 with key bukrs = it_itab5-bukrs
anln1 = it_itab5-anln1
anln2 = it_itab5-anln2.
if sy-subrc = 0.
it_final-anlkl = it_itab1-anlkl.
it_final-anln1 = it_itab1-anln1.
it_final-anln2 = it_itab1-anln2.
it_final-bukrs = it_itab1-bukrs.
it_final-txt50 = it_itab1-txt50.
it_final-txa50 = it_itab1-txa50.
it_final-invnr = it_itab1-invnr.
it_final-sernr = it_itab1-sernr.
it_final-menge = it_itab1-menge.
it_final-meins = it_itab1-meins.
it_final-ivdat = it_itab1-ivdat.
it_final-inken = it_itab1-inken.
it_final-aktiv = it_itab1-aktiv.
it_final-deakt = it_itab1-deakt.
it_final-gdlgrp = it_itab1-gdlgrp.
it_final-anlue = it_itab1-anlue.
it_final-aibn1 = it_itab1-aibn1.
it_final-aibn2 = it_itab1-aibn2.
it_final-aibdt = it_itab1-aibdt.
it_final-ord41 = it_itab1-ord41.
it_final-ord44 = it_itab1-ord44.
it_final-vmgli = it_itab1-vmgli.
it_final-typbz = it_itab1-typbz.
it_final-lifnr = it_itab1-lifnr.
it_final-posnr = it_itab1-posnr.
it_final-invzu = it_itab1-invzu.
endif.
read table it_itab2 with key bukrs = it_itab5-bukrs
anln1 = it_itab5-anln1
anln2 = it_itab5-anln2.
if sy-subrc = 0.
it_final-werks = it_itab2-werks.
it_final-gsber = it_itab2-gsber.
it_final-kostl = it_itab2-kostl.
it_final-kostlv = it_itab2-kostlv.
it_final-stort = it_itab2-stort.
it_final-raumn = it_itab2-raumn.
it_final-txjcd = it_itab2-txjcd.
endif.
read table it_itab3 with key bukrs = it_itab5-bukrs
anln1 = it_itab5-anln1.
if sy-subrc = 0.
it_final-anlhtxt = it_itab3-anlhtxt.
endif.
append it_final.
clear it_final.
endloop.
endloop.
loop at it_final.
move-corresponding it_final to it_final_as91.
append it_final_as91.
clear it_final_as91.
endloop.
delete adjacent duplicates from it_final_as91 comparing anlkl bukrs
anln1 anln2.
it_download_as91[] = it_final_as91[].
endform. " FILL_FINALDATA
*& Form BUILD_LAYOUT
text
--> p1 text
<-- p2 text
form build_layout.
wa_layout-zebra = 'X'.
endform. " BUILD_LAYOUT
*& Form BUILD_FIELDCATALOG
text
--> p1 text
<-- p2 text
form build_fieldcatalog.
if it_fldcat_head is initial.
v_pos = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'ANLKL'.
wa_fldcat_head-seltext_l = 'Asset Class'(093).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'BUKRS'.
wa_fldcat_head-seltext_l = 'Company'(092).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'ANLN1'.
wa_fldcat_head-seltext_l = 'Asset No'(091).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'ANLN2'.
wa_fldcat_head-seltext_l = 'Asset Sub No'(090).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'TXT50'.
wa_fldcat_head-seltext_l = 'Asset Des.'(089).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'TXA50'.
wa_fldcat_head-seltext_l = 'Asset Des.'(088).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'ANLHTXT'.
wa_fldcat_head-seltext_l = 'Asset main no txt'(087).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'SERNR'.
wa_fldcat_head-seltext_l = 's.no/Expl no.'(086).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'INVNR'.
wa_fldcat_head-seltext_l = 'Inv No'(085).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'MENGE'.
wa_fldcat_head-seltext_l = 'Qtty'(084).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'MEINS'.
wa_fldcat_head-seltext_l = 'Units'(083).
append wa_fldcat_head to it_fldcat_head.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'INKEN'.
wa_fldcat_head-seltext_l = 'Inv indi.'(082).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'IVDAT'.
wa_fldcat_head-seltext_l = 'Last inv date'(081).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'AKTIV'.
wa_fldcat_head-seltext_l = 'Asset Capital date'(080).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'GSBER'.
wa_fldcat_head-seltext_l = 'Busin. Area'(079).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'KOSTL'.
wa_fldcat_head-seltext_l = 'cost centre'(078).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'KOSTLV'.
wa_fldcat_head-seltext_l = 'CC respon.for asset'(077).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'WERKS'.
wa_fldcat_head-seltext_l = 'Plant'(076).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'STORT'.
wa_fldcat_head-seltext_l = 'Asset location'(075).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'RAUMN'.
wa_fldcat_head-seltext_l = 'Room'(074).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'TXJCD'.
wa_fldcat_head-seltext_l = 'Tax. Jur.'(073).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'ORD41'.
wa_fldcat_head-seltext_l = 'Evaluation Grp 1'(072).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'ORD44'.
wa_fldcat_head-seltext_l = 'Evaluation Grp 4'(071).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'GDLGRP'.
wa_fldcat_head-seltext_l = 'Evalu. group 5'(070).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'ANLUE'.
wa_fldcat_head-seltext_l = 'Asset Super No'(069).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'LIFNR'.
wa_fldcat_head-seltext_l = 'Vendor Acct. No.'(068).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'TYPBZ'.
wa_fldcat_head-seltext_l = 'Reference no'(067).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'AIBN1'.
wa_fldcat_head-seltext_l = 'Original Asset Trans.'(066).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'AIBN2'.
wa_fldcat_head-seltext_l = 'Original Asset Trans.'(065).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'AIBDT'.
wa_fldcat_head-seltext_l = 'Trans. Asset'(064).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'POSNR'.
wa_fldcat_head-seltext_l = 'WBS Elt. Invt. Proj.'(063).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'VMGLI'.
wa_fldcat_head-seltext_l = 'Property clas.key'(062).
append wa_fldcat_head to it_fldcat_head.
V_POS = 0.
v_pos = v_pos + 1.
w_field-col_pos = v_pos.
wa_fldcat_head-tabname = 'it_FINAL_AS91'.
wa_fldcat_head-fieldname = 'INVZU'.
wa_fldcat_head-seltext_l = 'suppl.inv spec.'(061).
append wa_fldcat_head to it_fldcat_head.
endif.
endform. " BUILD_FIELDCATALOG
*& Form COMMENT_BUILD
text
-->P_TOP_OF_PAGE text
*form comment_build using top_of_page type slis_t_listheader.
data: ls_line type slis_listheader.
****Header
clear : ls_line.
ls_line-typ = 'H'.
LS_LINE-KEY: not used for this type
ls_line-info = 'ASSET MASTER DATA LIST'.
append ls_line to top_of_page.
****Selection
clear ls_line.
ls_line-typ = 'S'.
ls_line-key = 'Key 1'.
ls_line-info = 'Asset Records'.
append ls_line to top_of_page.
****Action
clear ls_line.
ls_line-typ = 'A'.
LS_LINE-KEY: not used for this type
ls_line-info = 'for AS91'.
append ls_line to top_of_page.
*endform. "comment_build
FORM top_of_page *
*form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
i_logo = 'ENJOYSAP_LOGO'
it_list_commentary = top_of_page.
*endform. "top_of_page
*& Form LIST-DISPLAY
text
--> p1 text
<-- p2 text
form list-display.
wa_layout-colwidth_optimize = 'X'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = w_repid
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = wa_layout
it_fieldcat = it_fldcat_head
i_background_id = 'ALV_BACKGROUND'
tables
t_outtab = it_final_as91
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
write:/'No Top of Page'(098).
endif.
endform. " LIST-DISPLAY
*& Form DOWNLOAD
text
--> p1 text
<-- p2 text
form download.
perform setup_header.
call function 'DOWNLOAD'
exporting
filetype = 'DAT'
tables
data_tab = it_download_as91
fieldnames = it_head
exceptions
invalid_filesize = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
customer_error = 7
others = 8.
if sy-subrc <> 0.
write:/'Error in file Type'(097).
endif.
endform. " DOWNLOAD
*& Form setup_header
text -
Upload file with dynamic columns
Hi,
My requirement is, I have to upload a file with number of columns being dynamic.
My Input file column number can vary based on the input data. For one entry it can have 10 columns of input and for another entry it can have just 5. First few columns are common for all entries and then from one particular column the next columns can vary based on the input data.
I have come across FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' , but for this FM we have to pass the scope of the excel, like the column and row details which is not the required thing in my case.
Please let me know as to how to achieve the requirement of uploading a file with he number of columns varying.
Thanks in advance.
Regards,
Dedeepya ThotaHi,
Your saying in you excel sheet your entering the details.
As you said, Suppose your data is 5 columns. And each entry various
there are 3 records in excel sheet
one entry contains 5 columns of data
second entry contains only 2 columns of data
third entry contains 4 columns of data
As shown below
Column1 Column2 Column3 Column4 Column5
100 AA AA1 AA2 AA3
200 BB BB2
300 CC CC2 CC3
Now your excel sheet contains data as shown above.
When you upload this file to your internal table 3 entries will be uploaded and every column contains according to that column value in itab.
In this case record second entry column3 contains value BB2 will store in itab-column3, But as per our requirement it should store in itab-column4. Same will happen for third entry also.
In above case you report will not work.
So wat you have to do is, definatly we know there is some maximum colums in entries.
You fix for that maximum no.columns in excel and declare your itab.
In excel you maintian the values according to the columns value which has to maintian.
For example like below.
Column1 Column2 Column3 Column4 Column5
100 AA AA1 AA2 AA3
200 BB BB2
300 CC CC2 CC3
If some columns are not having data that will be empty. It wont be any problem. Just you have to maintain your template for data
and according to your template you have declare itab in your report.
Regards,
Shankar. -
I saved an Excel workboob as a web-page - In IE 8 it displays exactly as I want (that is all visible, non-hidden columns) - In Firefox 10 it displays the same, ''plus'' the ''first'' of what should be a series of'' hidden columns'' - Why would Firefox see a hidden column which IE doesn't - I'm working on XP (fully up-to-date with all patches applied)
Thanks fmdeveloper as a result of you confirming that it is an FF bug I delved deeper into it and I've now found a fix as follows:-
1) Unhide Excel columns, format cells to ;;;
2) From first re-formatted col to rightmost end of all cols select & hide
When saved as web page this then displays in FireFox as it does in IE
NB: After re-formatting previously hidden cols it is necessary to hide '''all''' the remaining cols or there will be a display of blank cols in FF where garbled 'hidden entries' were seen previously
Regards homeric -
How to delete file from column after upload with messageFileUpload?
Which is the way to delete a file from column i have uploaded with messageFileUpload. After uploading the system generates a link to download the file. But how i can delete the file?
Thank you! Syncing has always scared me...basically I am just afraid to lose any photos. But it worked. Again thank you
-
In BI Publisher Report of excel output for one column is filled with spaces
Hello,
We have issue in BI Publisher report of excel output.
In Excel output for one column few records are displaying as left alignment
and few record are displaying as right alignment.
If you are having any xml tag or any syntax for removing spaces for left side
Please help on this issue.
Thanks in Advance.
Regards,
SwarajPlease post the details of the application release, database version and OS along with BI Publisher.
Is the issue with all reports or specific one(s) only?
Do you have the patches in the following docs applied?
Overview of Available Update Patches for Oracle BI Publisher Enterprise 10g [ID 797057.1]
Overview of Available Update Patches for Oracle BI Publisher Enterprise 11g [ID 1276869.1]
Overview of Available Patches for Oracle XML Publisher embedded in the Oracle E-Business Suite [ID 1138602.1]
BI Publisher 10g RTF Template Changes Alignment Settings for Numbered Lists [ID 1418504.1]
Thanks,
Hussein -
Filter issues with hidden/visible columns on a table
OK, 1st post to this forum:
This is based on:
http://labs.adobe.com/technologies/spry/samples/data_region/SpryPagedViewSample.html
I have a contact list that has contact info on it (office
phone, home phone, cell phone, etc). There are several hundred
entries in the .xml file. As a default, I am putting the contacts
in a table that has the office phone and email address visible, and
the other info hidden. I have a "ShowDetail" checkbox that will
allow the hidden columns to be visible and vice versa by using the
addClassName and removeClassName.
The issue I have, is that when you start typing in an contact
name when the checkbox is checked, the table flashes the correct
info up with the columns visible, but then the HTML is rendered and
the Hidden class is reassigned to the columns.
Is there anyway to run the javascript function that toggles
the class after the HTML is rendered based on the checked status of
the checkbox? Thanks for any help!Thanks for the reponse. However here is the syntax I need to edit
SELECT u.user# as "UID",
lower(u.name) as owner,
lower(t.name) as table_name,
col.col# as column_id,
lower(col.name) as column_name,
decode(col.type#,
1, 'varchar2',
2, decode(col.scale,
null, decode(col.precision#, null, 'number', 'float'),
'number'),
8, 'long',
9, 'varchar',
12, 'date',
23, 'raw',
24, 'long raw',
69, 'rowid',
96,'char',
105, 'mlslabel',
106, 'mlslabel',
'undefined') as data_type, /* these decodes come from the view */
/* definition for DBA_TAB_COLUMNS */
/* in CATALOG.SQL for version 7.3 */
/* the next two decodes are derived from the actual queries performed by Storage */
/* when Manager retrieving column information. */
decode(nvl(col.precision#, 0),
0, col.length,
nvl(col.precision#,0)) as data_length,
to_number(decode(nvl(col.precision#, 0),
0, null,
decode(col.type#,
2, nvl(col.scale,-127/*MAXSB1MINAL*/),
0) ) ) as scale,
decode(col.null$, 1, 'n', null) as nulls,
'y' as in_primary_key
FROM sys.col$ col,
sys.obj$ t,
sys.user$ u
WHERE u.user# = t.owner# /* user$ will be the driving table because no index on user# */
AND t.obj# = col.obj#
AND u.name = 'POWERSELLER' /* We only care about PowerSeller tables/columns; */
AND t.type# in (2, 4) /* Tables and views only */
AND EXISTS (SELECT 1
FROM sys.ccol$ ns_ccol,
sys.cdef$ ns_cdef,
sys.obj$ ns_t,
sys.user$ ns_u
WHERE ns_u.user# = ns_t.owner#
AND ns_t.obj# = ns_cdef.obj#
AND ns_cdef.con# = ns_ccol.con#
AND ns_u.name = 'POWERSELLER'
AND ns_cdef.type# = 2 /* primary key constraint */
AND ns_cdef.enabled is not null
AND ns_ccol.obj# = t.obj# /* using ns_ccol instead of ns_t */
/* does 70% as many logical reads */
AND ns_ccol.col# = col.col#
) -
ALV download to Excel--Problem with Column Headers
Hi,
I have created a dynamic internal table and displaying it as ALV using SALV classes. Problem is that when I download this ALV to Excel I'm not getting Column headings same as they are in ALV display.
I mean in Excel it is showing Column headings taken from domain or data element.
While creating dynamic table i'm passing short/ Medium & Long text too. Still it is not working.
Any kinda help is appreciated.
Thanks & Regards,
Vivek Gaur
Edited by: Vivek Gaur on Nov 4, 2009 2:04 PMLook I cant actually post the code as it is divided in some global classes and main program. But i can elaborate the steps little further:
1: I have created a field catalog for Dynamic internal table. In it i have passed every necessary field along with short/medium/Long texts.
2: I fill up this dynamic table with data.
3: I assign a field symbol to this dynamic internal table.
4: I pass this field symbol to the factory method of CL_SALV_TABLE Class.
Thats it buddy..Hope u have understood my problem.
Maybe you are looking for
-
PDF Optimizer in Acrobat Pro X1
Where are the same file minimizing functions that exist in PDF Optimizer in Acrobat Pro 9 found in X1? So frustrating. I work in Illustrator and am dependent on this function to get files down to a reasonable size for sending to print, the client and
-
How to put values from selection screen to ztable
hi all, i have created a ztable. now i want to put data through se38. i have given 5 parameters in selection screen same as there in ztable. now if i put values in selection screen then it should put that values to my ztable . how can i put values in
-
Procedure to insert same record for 30 times in a table using for loop
Hi, I need to insert a record in a table which has to be iterated using for loop
-
Big lagging when i open a flash game with new firefox 8.0 version
Since i updated my Firefox to 8.0, i am experiencing big lagging when i open a flash game; it takes longer than usual and when i finally get to play the game, within 3-4 minutes it shows error in the flash application and i have to reload my page aga
-
IPhone 3GS and Store Security Alarms..
i've noticed that ONLY when I carry my iPhone 3GS I will set off the store alarm when entering or leaving a store.. I thought I was crazy, but i've done the test.. and ONLY when I walk through the door with the iPhone does it set off the alarm. witho