Question,Get data from ALV to internal table
Hi, friends
I currently need to get the data displayed on ALV.
But the original internal table is local.
It means it has already been deleted.
Do you know which method I shoud use?
After that, I will move the records to other internal
table.
3Q
Minghan
Hi,
are you using ALV list/GRID FM,
Check this..,
1. why can't you declare the internal table as Global.
2. you can call the FM
REUSE_ALV_LIST_LAYOUT_INFO_GET
here you get the table data using the table parameter <b>ET_OUTTAB</b>
try this...
where you will try?( when ever you want , please let me know where exactly you need this)
Regards
vijay
Similar Messages
-
One field gets cleared from ALV to internal table
I have an ALV grid in a view in which i append a row and add some data. This is giving me a very strange problem.
I appended a row in the ALV and then filled up the data in the row. I filled three fields, two of them dates and one a decimal field. Then i saved this data. No problems here.
Now the next time i come on this ALV grid view, i see the previously saved row. I now append another row and fill in some data again. This is where the surprise comes. Out of the two date fields, the first date field is losing its value and is getting cleared when i get the ALV data in an internal table...(using the following code)
node_et_indices_1->get_static_attributes_table( IMPORTING table = lt_indice ).
the lt_indice has the following structure...
field type
MANDT MANDT
BUKRS BUKRS
ZZINDICE ZEAGR_INDICE
ZZITEM CHAR3
ZZDESC CHAR40
ZZINVAL DATS 8
ZZFIMVAL DATS 8
ZZVATR DEC
ZZUATR DEC
ERNAM ERNAM
AEDAT AEDAT
ZCORRIG CHAR1
WAERS WAERS
out of these, the fields zzinval, zzfimval and zzvatr are being populated from webdynpro and the rest of the fields (including the key fields) are populated in the internal table later and then saved to the database.
After executing the above statement, the value in ZZINVAL is 00000000, while on the screen i have entered 01.02.2007. The same does not apply to ZZFIMVAL which holds the value 28.02.2007 as entered on the screen. ZZVATR also holds the correct value entered.
Any ideas why only one of the fields might be getting cleared like this?
The problem does not occur when i am saving only a single row from the ALV.
Please help!!
regards,
PriyankI have checked that the node itself is not containing the value.
How and what can i check for this. I have mapped the ALV in different views similarly and they are working?
Any ideas on where can i check ??
regards,
Priyank -
Transfer data from ALV to Z table
Hi,
I need to confirm the exact procedure to transfer data from ALV into z table.I am entering few values at runtime in the ALV & need to populate the z table with the same.
I created a z table,it has been assigned a internal table & work area.A loop is there on the internal table passed to fieldcatalog.
LOOP AT GIT_EKPO INTO GS_EKPO.
LS_ZPS005-EBELN = GS_EKPO-EBELN.
LS_ZPS005-EBELP = GS_EKPO-EBELP.
LS_ZPS005-ERECDAT = GS_EKPO-ERDAT. "this field is not passing value into z table
LS_ZPS005-LINEID = SY-TABIX.
LS_ZPS005-POQTY = GS_EKPO-POQTY.
LS_ZPS005-EREQTY = GS_EKPO-EREQTY. "this field is not passing value into z table
ENDLOOP.
INSERT INTO ZPS005 VALUES LS_ZPS005.
When I assign the values from Internal table into internal table of z table,the values in fields populated at runtime does not come.
Please help me with your suggestions on the same.
Thanks.Hi,
I tried the procedure,but do I need to include this before method set_table_for_first_display?
You can have a look at the whole code.Please let me know of a possible solution.Looking forward to an early reply.
Thanks.
TABLES: EKKO,
EKPO,
ZPS005.
INITIALIZATION.
PERFORM CREATE_FIELD_CATLOG.
Types Declaration *
*Structure for EKPO table
TYPES: BEGIN OF TYPE_EKPO,
EBELN TYPE EKPO-EBELN, "PURCHSE ORDER NUMBER
EBELP TYPE EKPO-EBELP, "Item Number of Purchasing Document
POQTY TYPE EKPO-MENGE, "Purchase Order Quantity
ERDAT TYPE SY-DATUM, "Date on Which Record Was Created
LINEID TYPE ZPS005-LINEID, "Unique identification of document line
EREQTY TYPE ZPS005-EREQTY, "Erection Quantity
END OF TYPE_EKPO.
Data *
Data Declaration for Internal Table & Work Area *
*INTERNAL TABLE FOR EKPO TABLE
DATA:LIT_EKPO TYPE TABLE OF EKPO,
LS_EKPO TYPE EKPO.
*SECOND INTERNAL TABLE FOR EKPO TABLE
DATA: GIT_EKPO TYPE TABLE OF TYPE_EKPO.
DATA: GS_EKPO TYPE TYPE_EKPO.
*INTERNAL TABLE FOR FIELD CATALOG
DATA: LIT_FIELDCAT TYPE lvc_t_fcat,
LS_FIELDCAT LIKE LINE OF LIT_FIELDCAT. "WORK AREA FOR FIELD CATALOG
*INTERNAL TABLE FOR Z TABLE ZPS005
DATA: LIT_ZPS005 TYPE TABLE OF ZPS005,
LS_ZPS005 TYPE ZPS005.
ALV GRID Data Declaration *
DATA: V_CONTAINER TYPE REF TO cl_gui_custom_CONTAINER.
data: grid TYPE REF TO cl_gui_alv_grid.
data: ok_code type sy-ucomm.
DATA: V_LAYOUT TYPE lvc_s_layo. " FOR LAYOUT
DATA: V_LINE TYPE I,
LINEID TYPE I.
DATA: V_INDEX TYPE SY-TABIX.
PARAMETER *
parameter : p_ebeln like ekko-ebeln.
START OF SELECTION *
START-OF-SELECTION.
SELECTION OF DATA *
CALL FUNCTION 'ME_PURCHASE_DOCUMENT_DATA_READ'
EXPORTING
I_EBELN = P_EBELN
I_TCODE = 'ME23'
I_NO_COMMIT = ' '
I_TRTYP = 'A'
I_NO_MESSAGING =
I_NO_MESSAGE_REQ =
I_NO_AUTHORITY_CHECK =
I_VORGA =
IMPORTING
E_EKKO =
TABLES
T_EKPO = LIT_EKPO
T_EKET =
T_EKKN =
T_KOMV =
EXCEPTIONS
NO_EBLNR = 1
EBLNR_NOT_FOUND = 2
NO_TCODE = 3
TCODE_NOT_ALLOWED = 4
NO_TRTYP = 5
INVALID_CALL_OF_FB = 6
OTHERS = 7
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 LIT_EKPO INTO LS_EKPO.
MOVE : LS_EKPO-EBELN TO GS_EKPO-EBELN,
LS_EKPO-EBELP TO GS_EKPO-EBELP,
LS_EKPO-MENGE TO GS_EKPO-POQTY.
APPEND GS_EKPO TO GIT_EKPO.
ENDLOOP.
End-of-selection.
perform field_catalog.
call screen 100.
END-OF-SELECTION *
MODULES FOR ALV DISPLAY *
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'PF-STAT'.
SET TITLEBAR 'TITLE'.
ENDMODULE. " STATUS_0100 OUTPUT
**& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
WHEN 'SWITCH'.
PERFORM switch_edit_mode.
WHEN 'SAVE'.
PERFORM FILL_TABLE.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
**& Module layout_0100 OUTPUT
text
MODULE layout_0100 OUTPUT.
V_LAYOUT-grid_title = 'Purchase Order Erection Details'.
ENDMODULE. " layout_0100 OUTPUT
**& Module data_retrivaL OUTPUT
text
MODULE data_retrivaL OUTPUT.
IF V_CONTAINER IS INITIAL.
CREATE OBJECT V_CONTAINER
EXPORTING container_name = 'GRID'.
CREATE OBJECT grid
EXPORTING i_parent = V_CONTAINER.
ENDIF.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = V_LAYOUT
CHANGING
IT_OUTTAB = GIT_EKPO
IT_FIELDCATALOG = LIT_FIELDCAT
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " data_retrivaL OUTPUT
*& Module field_catalog OUTPUT
text
FORM field_catalog.
CLEAR LS_fieldcat.
LS_fieldcat-fieldname = 'EBELN'.
LS_fieldcat-ref_table = 'GIT_EKPO'.
LS_FIELDCAT-coltext = 'PURCHSE ORDER NUMBER'.
LS_FIELDCAT-col_pos = 0.
LS_FIELDCAT-EDIT = ' '.
ls_FIELDCAT-style = cl_gui_alv_grid=>mc_style_disabled.
INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
APPEND LS_fieldcat TO LIT_fieldcat.
CLEAR LS_fieldcat.
LS_fieldcat-fieldname = 'EBELP'.
LS_fieldcat-ref_table = 'GIT_EKPO'.
LS_FIELDCAT-coltext = 'ITEM NUMBER'.
LS_FIELDCAT-col_pos = 1.
LS_FIELDCAT-EDIT = ' '.
ls_FIELDCAT-style = cl_gui_alv_grid=>mc_style_disabled.
INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
APPEND LS_fieldcat TO LIT_fieldcat.
CLEAR LS_fieldcat.
LS_fieldcat-fieldname = 'POQTY'.
LS_fieldcat-ref_table = 'GIT_EKPO'.
LS_FIELDCAT-coltext = 'PURCHASE ORDER QUANTITY'.
LS_FIELDCAT-col_pos = 2.
LS_FIELDCAT-EDIT = ' '.
ls_FIELDCAT-style = cl_gui_alv_grid=>mc_style_disabled.
INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
APPEND LS_fieldcat TO LIT_fieldcat.
CLEAR LS_fieldcat.
LS_fieldcat-fieldname = 'ERDAT'.
LS_fieldcat-ref_table = 'GIT_EKPO'.
LS_FIELDCAT-coltext = 'DATE OF ERECTION'.
LS_FIELDCAT-col_pos = 3.
LS_FIELDCAT-EDIT = 'X'.
ls_fieldcat-style = cl_gui_alv_grid=>mc_style_enabled.
INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
APPEND LS_fieldcat TO LIT_fieldcat.
CLEAR LS_fieldcat.
LS_fieldcat-fieldname = 'EREQTY'.
LS_fieldcat-ref_table = 'GIT_EKPO'.
LS_FIELDCAT-coltext = 'ERECTION QUANTITY'.
LS_FIELDCAT-col_pos = 4.
LS_FIELDCAT-EDIT = 'X'.
ls_fieldcat-style = cl_gui_alv_grid=>mc_style_enabled.
INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
APPEND LS_fieldcat TO LIT_fieldcat.
ENDFORM. " field_catalog OUTPUT
*& Form SWITCH_EDIT_MODE
text
--> p1 text
<-- p2 text
*FORM switch_edit_mode.
IF GRID->is_ready_for_input( ) eq 0.
set edit enabled cells ready for input
CALL METHOD GRID->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
ELSE.
lock edit enabled cells against input
CALL METHOD GRID->set_ready_for_input
EXPORTING
i_ready_for_input = 0.
ENDIF.
*ENDFORM. " SWITCH_EDIT_MODE
*& Form FILL_TABLE
text
--> p1 text
<-- p2 text
FORM FILL_TABLE .
LOOP AT GIT_EKPO INTO GS_EKPO.
LS_ZPS005-EBELN = GS_EKPO-EBELN.
LS_ZPS005-EBELP = GS_EKPO-EBELP.
LS_ZPS005-POQTY = GS_EKPO-POQTY.
LS_ZPS005-ERECDAT = GS_EKPO-ERDAT.
LS_ZPS005-EREQTY = GS_EKPO-EREQTY.
ENDLOOP.
MODIFY ZPS005 FROM LS_ZPS005.
ENDFORM. " FILL_TABLE -
Upload data from Excel to Internal table in ECC
Hello SDN,
Here I am facing a problem for uploading the data from excel sheet to internal table in ECC6.0
Main problem is we don't have any FM ALSM_EXCEL_TO_INTERNAL_TABLE.
Please provide me the solution how to upload the data from excel to internal table through class. If possible please provide me the sample code so that it will be very helpful for me.
Waitingfor your valuable response.
Thanks & Regards,
Kumar.Hi,
you can use OLE to acces (not only) excel, but this will only work in dialog processing.
regards,
Hans -
To upload data from excel to internal table
hi
in excel sheet it contains 4 tabs.to upload data from excel to internal table i have used this fm
text_convert_xls_to_sap .but error wil comeing.that error in tables parameter.iternal table does not contain data.ple help me.(v 6.0) ple give me one example with codingHello,
Take a look on this: [ABAP - Upload data from Excel to Sap using OO|https://wiki.sdn.sap.com/wiki/x/xOw].
Regards. -
How to transfer data from a dynamic internal table
Hi All
I want to transfer data from a dynamic internal table<dyn_table>
to a non dynamic internal table itab which should have the same structure as <dyn_table>.
How can this be done?
Regards,
Harshit RungtaAs stated earlier this can be done only through field symbols...
You cannot create an non dynamic internal table with ANY structure...using DATA statement
If the strucutre is defined well and good...you can create an non-dynamic internal table...
If you do not know the structure then the internal table has to be dynamic...and to be generated using field symbols
DATA: lv_ref TYPE REF TO data.
FIELD-SYMBOLS: <fs_dyn_table> TYPE STANDARD TABLE.
* You create a dynamic internal table...
CREATE DATA lv_ref LIKE (your_dynamic_internal_table).
ASSIGN lv_ref->* TO <fs_dyn_table>.
Now...do the transfer.
<fs_dyn_table> = "your_dynamic_internal_Table
Hope it helps! -
In SRM How to upload data from Excel to Internal Table
Hello Experts,
As seen the Function Module 'ALSM_EXCEL_TO_INTERNAL_TABLE' does not exists in SRM.
Is there any alternative to upload the data direct from excel to Internal table using any other FM. As seach did't get any relevant FM.
Please advice..
Thanks..did u try this
TEXT_CONVERT_XLS_TO_SAP
in this manner
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_line_header = 'X'
i_tab_raw_data = lt_raw
i_filename = p_path
TABLES
i_tab_converted_data = gt_output
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
this FM works on DOI
so
SAP document about DOI:
http://help.sap.com/saphelp_nw2004s/helpdata/EN/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
SAP Demo Program about DOI: SAPRDEMOEXCELINTEGRATION.
the fm you mentioned works on OLE
so you could refer,
SAP document about OLE:
http://help.sap.com/saphelp_46c/helpdata/EN/59/ae3c98488f11d189490000e829fbbd/frameset.htm
Also you can refer this post
Download of SRM Contracts in Excel - Unit of Measurement Missing
Let me know if this works ..
Regards
Manthan.
Edited by: Manthan_R on Feb 23, 2010 12:18 PM -
How to read data from idoc to internal table?
Hi
How to get data from idoc segments to internal table?Hi
Check this ex
The following coding sample, shows how you may read a MATMAS IDoc and extract the data for the MARA and MARC segments to some internal variables and tables.
DATA: xmara LIKE mara.
DATA: tmarc LIKE marc
OCCURS 0
WITH HEADER LINE.
LOOP AT edidd.
CASE edidd-segnam.
WHEN 'E1MARAM'.
MOVE edidd-sdata TO xmara.
WHEN 'E1MARCM'.
MOVE edidd-sdata TO tmarc.
APPEND tmarc.
ENDCASE.
ENDLOOP.
now do something with xmara and tmarc.
hope this helps you...
Reward points if useful..
Regards
Sreenivas -
Reading data from XML to Internal table
Hi Experts,
I got a requirement to read the data fom xml to internal table.is it possible to store deep internel table data into flat internal tables?my internel table contains 4 internel table and these 4 internel table contains 2 internel tables each...can any one help me o this...
points will be rewarded...
Regards,
RakhiHi Rakhi,
* Structure to Get the Client Details as in XML format
DATA: BEGIN OF client,
BEGIN OF Personal_Details,
kunnr like kna1-kunnr,
name1 like kna1-name1,
adrnr like kna1-adrnr,
END OF Personal_Details,
BEGIN OF Address,
street like adrc-street,
city1 like adrc-city1,
END OF Address,
BEGIN OF Communication,
fax_number like adrc-fax_number,
tel_number like adrc-tel_number,
END OF Communication,
END OF client.
DATA: it_client TYPE TABLE OF client WITH HEADER LINES,
result LIKE client.
DATA: xml_string TYPE string.
* Get the Client Details into the structure to be made as an XML string
TRY.
* Convert the Structure to XML string
CALL TRANSFORMATION ('ID')
SOURCE para = it_client
RESULT XML xml_string.
* Convert the XML string to structure - result
CALL TRANSFORMATION ('ID')
SOURCE XML xml_string
RESULT para = result.
CATCH cx_st_error.
ENDTRY.
best regards,
Thangesh -
How to fetch the data from query to internal table ?
Dear all ,
I would like to fetch the query data(sq01) into my internal table ? is it possible to do that ?
Best Regards,
CarlosHi
Try this <b>RRW3_GET_QUERY_VIEW_DATA</b>
Also, you can have a look at this...
<a href="/people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-ii Query results into Internal table</a>
Regards
Raj -
Reg transfer of data from excel to internal table
hi
i need to upload datas from Excel sheet to Internal Table.For this i use d FM
ALSM_EXCEL_TO_INTERNAL_TABLE.but the problem is if a particular field has no value in excel sheet,then its not uploaded into internal table.then next field value has come to that blank place in d internal table. what i need is if the excel sheet has a blank value for a field then a blank value is added in d inetrnal table also.Use below program logic
Program : ZLWMI151_UPLOAD(Data load to ZBATCH_CROSS_REF Table)
Type : Upload program
Author : Seshu Maramreddy
Date : 05/16/2005
Transport : DV3K919574
Transaction: None
Description: This program will get the data from XLS File
and it upload to ZBATCH_CROSS_REF Table
REPORT ZLWMI151_UPLOAD no standard page heading
line-size 100 line-count 60.
*tables : zbatch_cross_ref.
data : begin of t_text occurs 0,
werks(4) type c,
cmatnr(15) type c,
srlno(12) type n,
matnr(7) type n,
charg(10) type n,
end of t_text.
data: begin of t_zbatch occurs 0,
werks like zbatch_cross_ref-werks,
cmatnr like zbatch_cross_ref-cmatnr,
srlno like zbatch_cross_ref-srlno,
matnr like zbatch_cross_ref-matnr,
charg like zbatch_cross_ref-charg,
end of t_zbatch.
data : g_repid like sy-repid,
g_line like sy-index,
g_line1 like sy-index,
$v_start_col type i value '1',
$v_start_row type i value '2',
$v_end_col type i value '256',
$v_end_row type i value '65536',
gd_currentrow type i.
data: itab like alsmex_tabline occurs 0 with header line.
data : t_final like zbatch_cross_ref occurs 0 with header line.
selection-screen : begin of block blk with frame title text.
parameters : p_file like rlgrap-filename obligatory.
selection-screen : end of block blk.
initialization.
g_repid = sy-repid.
at selection-screen on value-request for p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = g_repid
IMPORTING
FILE_NAME = p_file.
start-of-selection.
Uploading the data into Internal Table
perform upload_data.
perform modify_table.
top-of-page.
CALL FUNCTION 'Z_HEADER'
EXPORTING
FLEX_TEXT1 =
FLEX_TEXT2 =
FLEX_TEXT3 =
*& Form upload_data
text
FORM upload_data.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = p_file
I_BEGIN_COL = $v_start_col
I_BEGIN_ROW = $v_start_row
I_END_COL = $v_end_col
I_END_ROW = $v_end_row
TABLES
INTERN = itab
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
write:/10 'File '.
ENDIF.
if sy-subrc eq 0.
read table itab index 1.
gd_currentrow = itab-row.
loop at itab.
if itab-row ne gd_currentrow.
append t_text.
clear t_text.
gd_currentrow = itab-row.
endif.
case itab-col.
when '0001'.
t_text-werks = itab-value.
when '0002'.
t_text-cmatnr = itab-value.
when '0003'.
t_text-srlno = itab-value.
when '0004'.
t_text-matnr = itab-value.
when '0005'.
t_text-charg = itab-value.
endcase.
endloop.
endif.
append t_text.
ENDFORM. " upload_data
*& Form modify_table
Modify the table ZBATCH_CROSS_REF
FORM modify_table.
loop at t_text.
t_final-werks = t_text-werks.
t_final-cmatnr = t_text-cmatnr.
t_final-srlno = t_text-srlno.
t_final-matnr = t_text-matnr.
t_final-charg = t_text-charg.
t_final-erdat = sy-datum.
t_final-erzet = sy-uzeit.
t_final-ernam = sy-uname.
t_final-rstat = 'U'.
append t_final.
clear t_final.
endloop.
delete t_final where werks = ''.
describe table t_final lines g_line.
sort t_final by werks cmatnr srlno.
Deleting the Duplicate Records
perform select_data.
describe table t_final lines g_line1.
modify zbatch_cross_ref from table t_final.
if sy-subrc ne 0.
write:/ 'Updation failed'.
else.
Skip 1.
Write:/12 'Updation has been Completed Sucessfully'.
skip 1.
Write:/12 'Records in file ',42 g_line .
write:/12 'Updated records in Table',42 g_line1.
endif.
delete from zbatch_cross_ref where werks = ''.
ENDFORM. " modify_table
*& Form select_data
Deleting the duplicate records
FORM select_data.
select werks
cmatnr
srlno from zbatch_cross_ref
into table t_zbatch for all entries in t_final
where werks = t_final-werks
and cmatnr = t_final-cmatnr
and srlno = t_final-srlno.
sort t_zbatch by werks cmatnr srlno.
loop at t_zbatch.
read table t_final with key werks = t_zbatch-werks
cmatnr = t_zbatch-cmatnr
srlno = t_zbatch-srlno.
if sy-subrc eq 0.
delete table t_final .
endif.
clear: t_zbatch,
t_final.
endloop.
ENDFORM. " select_data
Reward points if it is helpful
Thanks
Seshu -
Upload data from Excel to Internal table
Hi,
I am facing a peculiar problem in uploading the data in excel sheet to internal table.
The excel file contains material number and product hierarchy number. The product hierarchy number for some material is downloaded as 5.73101E17 for the value 573100910115782000. Though I expand the sheet the display is the same 5.73101E17. When i upload the sheet using the f'n module "ALSM_EXCEL_TO_INTERNAL_TABLE" the value is taken as it is (5.73101E+17) into the internal table which is wrong. I tried to change the data type to type n. Then the value is uploaded as 5731011700000000.
Please propose a solution to this without having to change the format of the column from general to "number without decimals"
Regards,
SamHI
see this example code which EXCEL TO INTERNAL TABLE AND THEN TO APPLICATION
*& 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. -
How to bring data from 3 different internal table to one
hii all,
i have 3 internal table ls_mat,which has around 20 fields,it_stpo,which has 3 fields,and it_mast,i need to bring all these 3 table data in one tabel...how do i do...plzz help...Hi ,
Does this internal table have any fields in common in all the three.
If yes , then loop ls_mat
Declare a type will all the fields and create a structure and internal table with that type (for ex lx_final and lt_final respectively)
Loop at ls_mat into lx_mat.
1.copy all the fields of lx_mat to respective lx_final.
2.read table it_stpo into lx_stpo with key field = lx_mat-field.
3.Copy all fields of lx_stpo to respective lx_final.
4. read table it_mast into lx_mast with key field = lx_mat-field.
5. copy all fields of lx_mast to respective lx_final.
6. now append lx_final to lt_final.
Endloop.
now you can get all values inside lt_final.
Regards,
sivaganesh -
Reading the data from field symbol internal table //
Hi,
There are 2 internal tables defined as Fieldsymbols (type any) and I need to retrive data from second internal table based on a field value in first internal table.
Let's assue the name internal table 1 is <it_itab1>, 2nd internal table name is <it_itab2> and the work areas are <wa_itab1> and <wa_itab2>.
The existing logic :
LOOP at <it_itab1> ASSIGNING <wa_itab1>.
ASSIGN COMPONENT 'XYZ' OF STRUCTURE <wa_itab1> TO l_field6.
LOOP AT <it_itab2> ASSIGNING <wa_itab2>.
ASSIGN COMPONENT 'XYZ' OF STRUCTURE <wa_itab2> TO <p_field7>.
IF <p_field7> = l_field6.
do the required business.
ELSE.
* do the required business.
ENDIF.
ENDLOOP.
ENDLOOP.
The requirement of reading second internal table was achieved by putting loop on the internal table but its giving considerable effect on performance !!
Is there any way to use READ statement in my case OR any way of putting WHERE condition on loop statement of second internal table ??
Thank you !!Use the below Logic.
Loop at Itab1 into wa_itab1.
Loop at itab2 into wa_itab2 where p_field7 = wa_itab1-xyz or I_field6.
do the required business.
endloop.
Loop at itab2 into wa_itab2 where p_field7 <> wa_itab1-xyz or I_field6.
do the required business.
endloop.
endloop.
Hope it is useful... -
Download data from excel to internal table in CRM system?
Hi Experts,
Can we read multiple work sheets from an Excel work book to internal tables in CRM system?
Ex.. Work book has 2 work sheets. One header sheet and one item sheet. Can we read this into two internal tables and process the data.
If yes, pls do let me know the FM name.
Thanks in advance,
Cheers'
Surekha.ALSM_EXCEL_TO_INTERNAL_TABLE
check this function module
Maybe you are looking for
-
I RECENTLY PURCHASED ANOTHER IPHONE. MY INTERNET IS NOT WORKING. I JUST CREATED AN APPLE ID. WHAT'S NEXT? I NOW HAVE TWO DIFFERENT ACCOUNTS WITH DIFFERENT USER NAMES. HOW CAN I USE ONLY ONE ACCOUNT FOR ITUNES, ICLOUD APPLE ID ETC???
-
Want to LOOK/SHARE JAVA code or Template for BI Publisher ?
1. If you are interested in sharing a nice piece of JAVA code you have written using BI Publisher APIs, or a template with an elegant solution to a problem, or any other BI Publisher object. 2. Or if you are interested in looking at some one else's s
-
Downloaded and installed Safari on my PC. Went to my website, but it does NOT work. Have tried it on a different Safari, same problem. Specifically, the MENU does NOT work at all... What might be the remedy, please? And, as I am at it, the title on S
-
Dynamic name for email attachment
Hi all I have a scenario where i have to change the name of the email attachment dynamically in the UDF or using Modules Requesting you to help me with this please. Your help is highly rewardful. --Keerhi
-
How to apply JSP expression %= var % in Java String
I have an unique problem. I am just trying to describe it with a simple example as follow: A servlet passes the following string to a JSP page: String sFromServlet = "hello my name is <%= strName %>"; The JSP code has the definition of the variable s