Problem with Emailing the Internal table data as an excel attachment
Hi Friends,
I am facing problem with Emailing an internal table data as an excel file. I am using standard function module "SO_NEW_DOCUMENT_ATT_SEND_API1" which is using SOLI structure can have record with 255 character length. But my Internal table having each record means after concatenating all the fields it is going to be morethan 450 characters. so i t is not displaying all the data in excel file.
Can somebody help me if there is any other function module or any other way that i need to follow.
thanks for help
venkat.
You must use the the :
CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB as a field seperator and
CL_ABAP_CHAR_UTILITIES=>CR_LF as a record seperator.
Check this example:
http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
Regards,
Naimesh Patel
Similar Messages
-
Problem with downloading the internal table onto the presentation server.
Hey folks,
I have a problem where in i am downloading one year of sales done by the company. I wrote a program to download the file onto the presentation server . The error occurs in the FM GUI_DOWNLOAD where if the file exceeds 105843504 bytes its giving me a dump saying that
When the program was running , it was established that more memory was needed than the operating system is able to safely to provide.
The current program has to be terminted because of the program already requested 105843504 bytes from the operating system with malloc when the operating system reported after further memory request that there was no more memory space available.
Could somebody provide an alternative soltuion for this.
Its really urgent as i can download the file with 70,000,000 bytes
Regards
RockHi Rock,
Please download the files on to Application Server, else as suggested by Ashish download into 2 or 3 files and merge them manually.
Declare same internal tables may be 5 times.
When you fill the internal table check for a counter and when you hit a certain number stop appending to it and start appending to the next.
After you are done so download all the internal tables.
I guess this would be a good way. I am not sure if there are any ther alternative good methods.
Hope this helps.
Shreekant -
How to pass the internal table data to smartforms
Hi Gurus,
I have a problem in passing the internal table data to the smartforms. In the print program
I get the data into one internal table "LT_PRDLBL1". I am passing this internal table to the other in print program by calling the FM_NAME.
CALL FUNCTION fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = T_SSFCTRLOP
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = T_SSFCOMPOP
USER_SETTINGS = ' '
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
LT_PRDLBL = LT_PRDLBL1
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
In the print program I had defined the internal tables like
Data: lt_prdlbl type standard table of zprdlbl.
Data: Begin of lt_prdlbl1 occurs 0.
include structure zprdlbl.
Data: End of lt_prdlbl1.
How do I define the internal table in the smartform to get the values printed in the smartform?.
<REMOVED BY MODERATOR>
Thanks,
Edited by: Alvaro Tejada Galindo on Apr 21, 2008 1:01 PMNehal,
Thanks for quick response.
In the smartform under the Form Interface->Tables tab
I had defined
LT_PRDLBL LIKE ZPRDLBL. If I define TYPE instead of LIKE I get the error message saying "FLAT TYPES may only be referenced using LIKE for table parameters".
In the main window I have created LOOP, in which I have ticked the internal table and
LT_PRDLBL INTO LT_PRDLBL. In the text node I am passing the values of this internal table
<_PRDLBL-XXXX&.
I am able to get the print but the data is not printing.
Please help me with this.
Thanks, -
FM to upload the Internal table data into application server.
Hi,
Could you please give me Function module to Upload the Internal table data into Application server ie., in Tcode AL11.
I know for downloading the Application server file into itab is "SUBST_GET_FILE_LIST" FM and using open dtaa set we get the data.
Regards,
deepthi.Hi Deepthi
Incase you are looking to upload data in the AL11 through a program , then you can make use of OPEN DATASET...CLOSE DATASET statements.
Here's the code snippet:
IF tb_alvdisplay[] IS INITIAL.
MESSAGE e999(/dcsea/zais_msg) WITH text-e01.
ELSE.
IF NOT cb_ufile IS INITIAL "Download to file
AND sy-pagno = 0. "Only down page headers for first page
PERFORM fm_concatenate_path_name USING p_path
p_file
CHANGING v_file.
*Open file for download.
PERFORM fm_open_file USING v_file .
ENDIF.
LOOP AT tb_alvdisplay.
IF NOT cb_ufile IS INITIAL.
*Passing the values of the respective headings to the structure.
ws_rec-vend_no = tb_alvdisplay-vendno.
ws_rec-vend_nm = tb_alvdisplay-vendnm.
ws_rec-title = tb_alvdisplay-vendtl.
ws_rec-add = tb_alvdisplay-add.
ws_rec-city1 = tb_alvdisplay-city1.
ws_rec-region = tb_alvdisplay-region.
ws_rec-country = tb_alvdisplay-country.
ws_rec-pobox = tb_alvdisplay-po.
ws_rec-phone = tb_alvdisplay-telf1.
ws_rec-extn = tb_alvdisplay-extn.
ws_rec-fax = tb_alvdisplay-telfx.
ws_rec-zterm = tb_alvdisplay-zterm.
ws_rec-remark = tb_alvdisplay-remark.
ws_rec-email = tb_alvdisplay-email.
*Passing the separator 'PIPE' to the structure.
ws_rec-sep01 = co_sep.
ws_rec-sep02 = co_sep.
ws_rec-sep03 = co_sep.
ws_rec-sep04 = co_sep.
ws_rec-sep05 = co_sep.
ws_rec-sep06 = co_sep.
ws_rec-sep07 = co_sep.
ws_rec-sep08 = co_sep.
ws_rec-sep09 = co_sep.
ws_rec-sep10 = co_sep.
ws_rec-sep11 = co_sep.
ws_rec-sep12 = co_sep.
ws_rec-sep13 = co_sep.
TRANSFER ws_rec TO v_file.
ENDIF.
AT LAST.
IF NOT cb_ufile IS INITIAL.
*Closing the DATASET file.
CLOSE DATASET v_file.
IF sy-subrc <> 0.
*Failure Message.
MESSAGE e999(/dcsea/zais_msg) WITH text-t04 text-t06.
ELSE.
*Success message.
MESSAGE s999(/dcsea/zais_msg) WITH text-t05.
ENDIF.
ENDIF.
ENDAT.
ENDLOOP.
ENDIF.
Also as Gautham suggested you can use tcode CG3Z or CG3Y incase you are looking to upload the data directly.
FInally, you can search SCN using the keywords, "Upload to AL11" and you'll get loads of results.
Hope this helps.
Harsh -
With in the internal table can I READ the same internal table for a record?
With in the internal table can I READ the same internal table?
For Suppose
LOOP AT itab.
can I do as below
READ TABLE itab with key bukrs = itab-bukrs
belnr = itab-belnr.
*and I have to compare
IF itab-shkzg = itab-shkzg_ia.
ENDIF.
ENDLOOP.Hi,
Yes..But use work area to differentiate..
EX.
DATA: WA LIKE ITAB.
DATA: WA_READ LIKE ITAB.
LOOP AT itab <b>INTO WA</b>.
can I do as below
READ TABLE itab <b>INTO WA_READ</b>
with key bukrs = itab-bukrs
belnr = itab-belnr.
*and I have to compare
IF <b>WA</b>-shkzg = <b>WA_READ</b>-shkzg_ia.
ENDIF.
ENDLOOP.
Please reward for helpful answers.
Thanks,
Naren -
Creating MS- Access data base from the Internal tables data of an ABAP Prog
Hi,
I have a requirement where I have to create Access tables from the Internal tables of ABAP program.
The tables are like Project systems Header data, WBS elements data, Netwrok data, Activity data, Milestone data and Project revunes. I will have the internal tables for these. I want to transfer these tables data into MS-Access tables onto Users desktop.
Please adivce me how to do this.
Thanks,
PrabhakarHI,
I am trying to create a DB table in the access but I am not successful. The following is the format of the table needs to be created from the ABAP program.
I have created a table with the following format in MS-Access with the name tblHeader. Is it neccessary to create a DB table ( MS-Access) in advance or by using the FM STRUCTURE_EXPORT_ TO_MSACCESS we need to create a structure in MS-Access?
False tblHeader
Field Name Type Length
ProjectDef Text 255
ProjectDes Text 255
Created Text 50
Change Text 50
RespPerson Text 255
Profile Text 255
Plant Text 255
ObjNo Text 255
OverheadKey Text 255
I have created a Z table ZTAB1 with the same format from the SAP fields.
MS-Access Table name : tblHeader
ABAP program Internal table : t_tblheader
Z table Name : ZTAB1.
First I am trying to create a structure in MS-Access with the following FM.
CALL FUNCTION 'STRUCTURE_EXPORT_ TO_MSACCESS'
EXPORTING
dbname = 'D:\test\db2'
LANGU = SY-LANGU
dest = 'PS_ACCESS_1'
TABLES
tabname = ttblheader
EXCEPTIONS
system_failure = 1
comm_failure = 2
OTHERS = 3
Table ttblheader type is DFIES and I am filling the table with only one record and one field i.e TABNAME and the value is ZTAB1.
The source code of the FM is using another FM
CALL FUNCTION 'MSACCESS_STRUCT_ EXPORT_RFC' DESTINATION DEST
Here I am getting the Error message Object required. I can't able to create a table structure in MS-Access.
Next I am going to Use the FM
'TABLE_EXPORT_ TO_MSACCESS'
and it will create the records in the MS-access table.
CALL FUNCTION 'TABLE_EXPORT_ TO_MSACCESS'
EXPORTING
dbname = 'D:\test\db2'
langu = sy-langu
dest = 'PS_ACCESS_2'
tabname = 'ZTAB1'
reftable = 'tblheader'
FLG_NO_DOWNLOAD = ' '
FLG_APPEND = ' '
FLG_POPUP = ' '
TABLES
dtab = t_tblheader
here t_tblheader is the internal table.
Reftable = tblheader is the table which i have created in advance. ( not by using the First FM)
In this FM i am getting a error message : Unable to connect to Database D:\test\db2.
Please help me how to create the MS-Access database. -
Creating the spool request for the internal table data
Hi..
I am little confused with the function module used for creating the spool request.
well...I am practicing the ALV report and sending the that report to the spool.
I ve used the FM SLVC_TABLE_PS_TO_SPOOL.
this is the way i defined the internal table.
Data:
begin of imat occurs 0,
matnr like marav-matnr,
maktx like marav-maktx,
matkl like marav-matkl,
ntgew like marav-ntgew,
gewei like marav-gewei,
end of imat.
data i_lines type sy-tfill
and i declared..
describe table imat lines i_lines.
then i given the value for i_file_length as i_lines in the export paramet of the FM SLVC_TABLE_PS_TO_SPOOL.
CALL FUNCTION 'SLVC_TABLE_PS_TO_SPOOL'
EXPORTING
i_file_length = i_lines
IMPORTING
E_SPOOLID = spoolid
tables
it_textdata = imat
when i executed it shows the list and wen going back it shows the runtime error as
CALL_FUNCTION_CONFLICT_LENG - Type conflict when calling a function module (field length).
please provide me some solutions.
thanks in advance.
etienne.Hi satyajit,
Thanks for your response....but the fields in my internal table "IMAT" is not compatible with the structure LVC_S_1022 as it has it componenrt - LINE.
so how can i define my internal table IMAT as type lvc_s_1022 as you suggested.
thanks in advance.
etienne. -
Problem in sending an internal table data to application layer
i have an internal table
DATA : BEGIN OF I_DPAYH OCCURS 0,
ECS_TCODE TYPE char2 VALUE '66',
ZBKON TYPE DPAYH-ZBKON,
LEDGER_FOLIO TYPE Char3 ,
ZBNKN TYPE DPAYH-ZBNKN,
ZNME1 TYPE DPAYH-ZNME1,
MICR TYPE char9 VALUE '40021102',
USER_NO TYPE char7 VALUE '4009175',
DESP TYPE char20 VALUE 'MAHANAGAR GAS LTD',
MASTR TYPE DPAYH-MASTR,
RBETR TYPE DPAYH-RBETR, -
> "
LAUFI TYPE DPAYH-LAUFI,
ORIGN TYPE DPAYH-ORIGN,
END OF I_DPAYH.
the arrow mark field is of currency data type and the problem
is that in application server on character data type it accept
thats why i have changed all the fields as character data type
except RBETR field all the data is transfferd except this field
regards
sarfarazwhen iam doing converting currency into char
Data: RBETR type char13
writing
SELECT RBETR
FROM DPAYH INTO CORRESPONDING FIELDS OF
I_DPAYH .
it is giving error when transffering in application server
and giving the error
( The current statement is only defined for character-type data objects.) -
How to Pass the internal table data?
DearAll,
How to pass the Data of one internal table on a 1.html page to another html page for output, in BSP Application.
regards.Hi ,
In the onInputProcessing event of the first page , write the following code...
call method NAVIGATION->SET_PARAMETER exporting
name = 'it_filt_cur'
value = it_filt_cur.
Here it_filt_cur is internal table.
NAVIGATION->GOTO_PAGE('next.htm').
In the next page , you can make the internal table as auto in the attributes.
Since you have made the itab as auto transfer , you can directly access the itab in the initialization event of the next page if it is stateless.
Regards,
Laxman Nayak.
Message was edited by: Laxman Nayak -
Problem in changing the internal table contents of a standard program
Dear All,
I am making changes to internal table LT_PPDIT of standard program SAPLHRPT in the user exit EXIT_SAPLACC4_001 while payroll posting to accounting with tcode PC00_M99_CIPE. But though the changed value of LT_PPDIT is visible within the exit still the value of LT_PPDIT when we come outside exit is the same as what was before entering exit.
Please suggest is there any way of modifying internal table of a standard program in the user exit.
Regards,
KanupriyaHi,
I think the internal table is getting refreshed or something like that after the user exit.
Try debugging after the user exit and put breakpoints at clear and modify statements.
Then you ll find out where its regaining the oringinal value after getting changes.
After locating that point try finding some enhancmenent point there and including your code so that your value of internal able gets modified.
Regards,
Subhashini -
Regarding the internal table data by using read table it_mard into wa_mard
hi,
i am reading the internal table it_mard with key matnr .
my code is like this.
*loop at it_final into wa_final.*
*wa_second-matnr = wa_final-matnr.*
wa_second-bwart = wa_final-bwart.
wa_second-bwtar = wa_final-bwtar.
*read table it_mard into wa_mard with key matnr = wa_final-matnr*
*binary search.*
*if sy-subrc = 0.*
*wa_second-labst = wa_mard-labst.*
*endif.*
*append wa_second to it_second.*
clear :wa_final.
*endloop.*
final internal table haveing duplicate values because this table it_final having movement types
so that i am not using delete statement .
is there any logic for handling the duplicate values inside the loop statement
by using read table statement.
could u plz explain clearly \[removed by moderator\]
Edited by: Jan Stallkamp on Jul 11, 2008 2:11 PMthis is my code could u plz explain regarding duplicate material number .
LOOP AT IT_MSEG INTO WA_MSEG.
WA_FINAL-MBLNR = WA_MSEG-MBLNR.
WA_FINAL-MATNR = WA_MSEG-MATNR.
WA_FINAL-BWART = WA_MSEG-BWART.
WA_FINAL-BWTAR = WA_MSEG-BWTAR.
WA_FINAL-MENGE = WA_MSEG-MENGE.
WA_FINAL-SOBKZ = WA_MSEG-SOBKZ.
COLLECT WA_FINAL INTO IT_FINAL.
CLEAR WA_FINAL.
ENDLOOP.
LOOP AT IT_FINAL INTO WA_FINAL.
READ TABLE IT_MARD INTO WA_MARD WITH KEY MATNR = WA_FINAL-MATNR
BINARY SEARCH.
this is reading the duplicate records i need to control duplicate records here .
the labst value is repeating the number of times because of the meterial number duplication
how can i restrict plz explain
IF SY-SUBRC = 0.
WA_FINAL-LABST = WA_MARD-LABST.
ENDIF.
READ TABLE IT_MKPF INTO WA_MKPF WITH KEY MBLNR = WA_FINAL-MBLNR
BINARY SEARCH.
IF SY-SUBRC = 0.
WA_FINAL-BUDAT = WA_MKPF-BUDAT.
ENDIF.
MODIFY IT_FINAL FROM WA_FINAL.
CLEAR WA_FINAL.
ENDLOOP.
LOOP AT IT_FINAL INTO WA_FINAL.
WA_SECOND-BWTAR = WA_FINAL-BWTAR.
IF WA_FINAL-BWART = '101' OR WA_FINAL-BWART = '501' OR WA_FINAL-BWART = '561'.
WA_SECOND-MENGE11 = WA_FINAL-MENGE.
ENDIF.
IF WA_FINAL-BWART = '201'.
WA_SECOND-MENGE12 = WA_FINAL-MENGE.
ENDIF.
IF WA_FINAL-BWART = '541' AND WA_FINAL-SOBKZ = 'O' .
WA_SECOND-MENGE13 = WA_FINAL-MENGE.
ENDIF.
IF WA_FINAL-BWART = '601'.
WA_SECOND-MENGE14 = WA_FINAL-MENGE.
ENDIF.
IF WA_FINAL-BWART = '543'.
WA_SECOND-MENGE15 = WA_FINAL-MENGE.
ENDIF.
IF WA_FINAL-BWART = '702'.
WA_SECOND-MENGE16 = WA_FINAL-MENGE.
ENDIF.
IF WA_FINAL-BWART = '313'.
WA_SECOND-MENGE17 = WA_FINAL-MENGE.
ENDIF.
IF WA_FINAL-BWART = '315'.
WA_SECOND-MENGE18 = WA_FINAL-MENGE.
ENDIF.
IF WA_FINAL-BWART = '122' OR WA_FINAL-BWART = '161'.
WA_SECOND-MENGE19 = WA_FINAL-MENGE.
ENDIF.
COLLECT WA_SECOND INTO IT_SECOND.
CLEAR WA_SECOND.
ENDLOOP. -
Exporting Multiple Internal table data to Single Excel file.
Hello Expert,
I want to export more than one internal table data from Web Dynpro Application to single Excel file but in such a way that
each table's data to be get exported to different tabs in (Multiple sheets) that single excel file.
So help me in this matter.
Thank You.
Varun
Moderator message: wrong forum, please post again in "Web Dynpro ABAP".
Edited by: Thomas Zloch on Oct 29, 2010 1:39 PMEach table having different sheet in same CSV file .
A CSV file is a flat file and don't have "Sheets"; you would have to Export to an Excel file, which supports several Sheets in one file.
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Export & Import internal table data across the programs
Hi All,
I have two different reports,let say ZPRO1 & ZPRO2. I want to export internal table data of ZPRO1 to ZPRO2 and then I want to do some calculations in ZPRO2 with the imported internal table data(ZPRO1).
If I use 'SUBMIT' or CALL TRANSACTION syntax ZPRO1 is displaying..but I want to use only internal table data of ZPRO1.
Pls advise.
Pranitha.Hi,
Please follow the simple code and try to solve your issue.
Code in program1
types: begin of ty_itab,
matnr type matnr,
end of ty_itab.
data: it_itab type table of ty_itab,
wa_itab type ty_itab,
it_itab1 type table of ty_itab.
select matnr from mara into table it_itab.
export it_itab to shared buffer indx(st) id 'ABC'.
Code in program2
types: begin of ty_itab,
matnr type matnr,
end of ty_itab.
data: it_itab type table of ty_itab,
wa_itab type ty_itab.
import it_itab from shared buffer indx(st) id 'ABC'.
loop at it_itab into wa_itab.
write:/ wa_itab-matnr.
endloop.
Please delete shared buffer indx(st) id 'ABC', once we don't need the internal table data.
Regards
Dande -
Adobe form - Split internal table data & dis on the right and left corner
HI ,
I have a form where i am populating the data via an Internal Table.
The concern i have is i have 100 rows in the table and i want to print the first 10 rows on the right hand side of the page and the next 10 rows on the Left hand side of the page. I want to do this dynamically on multiple pages during run time based on the volume of data in the internal table.
I am sure i cannot dynamically change the interface of the form to allow multiple internal table , Please suggest if there is any other solution.
Thanks in advance
Tk
Edited by: tarunk on Jan 16, 2012 5:56 PMHi,
Thank you very much for the input, But my concern is
I have a table with 120 records.
i have three columns which i have it on the right side as well as on the Left side of the page.
EX:
Right Side Left Side
Col1 col2 col3 col1 col2 col3.
Now what i want to do is the first ten rows of the internal table data i want to print it on the Right Side and the Next 10 rows on the Left Side in the same page .
I want to do this on Multiple pages.
please suggest.
Thanks,
Tk -
How to send internal table data through mail from report in foreground
hi all,
iam trying to convert the internal table data into excel format and sending it through mail by runnning the report in foreground.
mail is going sucessfully with excel format,but iam facing the problem in the excel format of the material column as follows:
the matrno shows the wrong format -2.63E+11 instead of displaying correct format-263215000000.
Pls suggest the alternative process for the above mentioned problem.
Thanks,
Sivagopal R.Hi Siva,
Try to copy 263215000000 in one of the cells of excel sheet and press enter.It will automatically convert into -2.63E+11 .
This means the default formatting of the excel sheet makes this happen.If you convert the format of the cell to "NUMBER" then u will get the required result.
But I doubt whether or not it is possible through ABAP programming.
Regards,
Vimal.
Maybe you are looking for
-
Powerbook -can't start up in single user mode or from CD-why?
My daughter was gifted a Powerbook (15"). I've upgraded it to 10.5.8. It has enough speed, (1.67 Ghz), 2 gigs RAM- but it is a sticky little machine- it freezes a lot. Froze twice during the upgrade, froze once during login, Froze once while trying t
-
HT2534 how to remove my payment
i both a visa card on shop for 20$ and now i dont have monny on my accoount and app store telling me to put other card i want to know how to fix this problems. please help me
-
Hi all, hope you can help... Received nano on 26th April. All was working well, playing music and connecting to computer up until I updated to IPOD 1.1.1. This update seems to have unleashed the IPOD gremlins. iTunes no longer recognises the ipod nor
-
How to repair the database used by Oracle Identity Manager 11g
Hi friends, I have a question about Oracle Identity Manager 11g. As I can repair the database used by Oracle Identity Manager 11g Thanks
-
DB Server: Oracle Linux 5.5 10.2.0.4.0 DB Version Application Server: Redhat EL 5.5 EBS 12.0.6 How does one figure out the version of "oracle configurator"? In a recent SR I was asked this question by Oracle support. Their method for me to find out w