Convert table to xstring
hallow
i have internal table (person_tab) and i wont convert it to
<b>xtring</b>
how can i do that?
best regards.
TYPES : BEGIN OF 1_itab,
werks TYPE persa,
persg TYPE persg,
persk TYPE persk,
orgeh TYPE orgeh,
stell TYPE stell,
lastname TYPE pad_nachn,
firstname TYPE pad_vorna,
stdaz TYPE enstd,
btrtl TYPE btrtl,
name1 TYPE pbtxt,
btext TYPE btrtx,
perid TYPE prdni,
END OF 1_itab.
DATA : person_tab TYPE TABLE OF 1_itab,
wa_person_tab LIKE LINE OF person_tab
<b>
i now this function but how i move person_tab to this function?</b>
<b>plz give example</b>
call function 'SOTR_SERV_TABLE_TO_STRING'
exporting
line_length = gl_linewidth
langu = p_langu
importing
text = l_text
tables
text_tab = l_text_tab.
call function 'SCMS_STRING_TO_XSTRING'
exporting
text = l_text
importing
buffer = l_xstring_data
exceptions
failed = 1
others = 2
Hello,
Please try this combination FM.
SOTR_SERV_TABLE_TO_STRING
SCMS_STRING_TO_XSTRING or SCMS_FTEXT_TO_XSTRING
Please try this.
data: l_text type string.
types: begin of text_table,
line type sotr_txt,
end of text_table.
data: l_text_tab type table of text_table.
data: l_xstring_data type string.
call function 'SOTR_SERV_TABLE_TO_STRING'
exporting
line_length = gl_linewidth
langu = p_langu
importing
text = l_text
tables
text_tab = l_text_tab.
call function 'SCMS_STRING_TO_XSTRING'
exporting
text = l_text
importing
buffer = l_xstring_data
exceptions
failed = 1
others = 2
Regards,
Deepu.K
Similar Messages
-
FM or Class to convert Internal table to Xstring.
Hi,
I have used the following code to convert internal table in to Xstring but it is giving syntax error.
DATA: lt_person TYPE TABLE OF <your_type>,
ls_person TYPE <your_type>,
xstring TYPE XSTRING.
LOOP AT it_person.
IF sy-index = 1.
CONCATENATE ls_person INTO xstring
ELSE.
CONCATENATE xstring CL_ABAP_CHAR_UTILITIES=>CR_LF ls_person
INTO xstring.
ENDLOOP.
Kindly help me out. My requirment is i have to convert internal table into XString and later i will use cl_wd_runtime_services=>attach_file_to_response method to download the file.
Thanks and regards,
dhinesh kumar.JHi Dhinesh,
Please find the Below Link
[http://wiki.sdn.sap.com/wiki/display/ABAP/CL_ABAP_ZIPusage-ZippingABAPreportoutput]
[http://www.sapnet.ru/viewtopic.php?t=588]
Thanks
Surendra -
Convert PDF to XSTRING and dysplay in portal(html)
Hi experts :
I need your help once again. I've read all the post regarding this issue but can't find a solution for my problem.
Basically, I have to create a PDF from a spool, convert it to xstring and send it to the web via RFC.
What I do is :
Convert the spool to PDF using FM CONVERT_OTFSPOOLJOB_2_PDF.
Convert the PDF tline table into XSTRING using a field symbol and a table of tlines (as described in one of the SDN blogs).
Then, I send to the web the value reurned from the conversion of the PDF line to XSTRING.
But, when opening the xstring there is nor PDF file but and error. If I download the PDF tline table, it works and can create the PDF, but nothing from the XSTRING.
My questions are :
Do we have to do any conversion on the portal side to convert the XSTRING into PDF?
is there any possibility of downloading the xstring to my desktop in order to check if I could create the PDF file from it?.
Helpful answer will be rewarded.
Regards,
Carlos.For the last question, use this code:
FORM write_bin_file
USING
i_filename TYPE string
i_file_xstring TYPE xstring.
TYPES xx(50) TYPE x.
DATA lt_xstring TYPE TABLE OF xx.
DATA l_length TYPE i.
CALL METHOD cl_swf_utl_convert_xstring=>xstring_to_table
EXPORTING
i_stream = i_file_xstring
IMPORTING
e_table = lt_xstring
EXCEPTIONS
OTHERS = 3.
l_length = XSTRLEN( i_file_xstring ).
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = l_length
filename = i_filename
filetype = 'BIN'
CHANGING
data_tab = lt_xstring
EXCEPTIONS
OTHERS = 3.
ENDFORM. "write_bin_file -
How to convert if_ixml_istream to xstring?
hi guys,
would anyone give me some ideas about converting if_ixml_istream to xstring?
can I use the method like:
CREATE OBJECT l_xml.
rc = l_xml->CREATE_WITH_DATA( dataobject = istream ).
l_xml->render_2_xstring( EXPORTING pretty_print = 'X' IMPORTING stream = xstring size = size retcode = retcode ).
Thanks a lot
Regards,
Liying
Message was edited by:
Liying Wang/people/r.eijpe/blog/2005/11/21/xml-dom-processing-in-abap-part-ii--convert-an-xml-file-into-an-abap-table-using-sap-dom-approach
check this out i think this might help -
How can I convert table object into table record format?
I need to write a store procedure to convert table object into table record. The stored procedure will have a table object IN and then pass the data into another stored procedure with a table record IN. Data passed in may contain more than one record in the table object. Is there any example I can take a look? Thanks.
I'm afraid it's a bit labourious but here's an example.
I think it's a good idea to work with SQL objects rather than PL/SQL nested tables.
SQL> CREATE OR REPLACE TYPE emp_t AS OBJECT
2 (eno NUMBER(4)
3 , ename VARCHAR2(10)
4 , job VARCHAR2(9)
5 , mgr NUMBER(4)
6 , hiredate DATE
7 , sal NUMBER(7,2)
8 , comm NUMBER(7,2)
9 , deptno NUMBER(2));
10 /
Type created.
SQL> CREATE OR REPLACE TYPE staff_nt AS TABLE OF emp_t
2 /
Type created.
SQL> Now we've got some Types let's use them. I've only implemented this as one public procedure but you can see the principles in action.
SQL> CREATE OR REPLACE PACKAGE emp_utils AS
2 TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
3 PROCEDURE pop_emp (p_emps in staff_nt);
4 END emp_utils;
5 /
Package created.
SQL> CREATE OR REPLACE PACKAGE BODY emp_utils AS
2 FUNCTION emp_obj_to_rows (p_emps IN staff_nt) RETURN EmpCurTyp IS
3 rc EmpCurTyp;
4 BEGIN
5 OPEN rc FOR SELECT * FROM TABLE( CAST ( p_emps AS staff_nt ));
6 RETURN rc;
7 END emp_obj_to_rows;
8 PROCEDURE pop_emp (p_emps in staff_nt) is
9 e_rec emp%ROWTYPE;
10 l_emps EmpCurTyp;
11 BEGIN
12 l_emps := emp_obj_to_rows(p_emps);
13 FETCH l_emps INTO e_rec;
14 LOOP
15 EXIT WHEN l_emps%NOTFOUND;
16 INSERT INTO emp VALUES e_rec;
17 FETCH l_emps INTO e_rec;
18 END LOOP;
19 CLOSE l_emps;
20 END pop_emp;
21 END;
22 /
Package body created.
SQL>Looks good. Let's see it in action...
SQL> DECLARE
2 newbies staff_nt := staff_nt();
3 BEGIN
4 newbies.extend(2);
5 newbies(1) := emp_t(7777, 'APC', 'CODER', 7902, sysdate, 1700, null, 40);
6 newbies(2) := emp_t(7778, 'J RANDOM', 'HACKER', 7902, sysdate, 1800, null, 40);
7 emp_utils.pop_emp(newbies);
8 END;
9 /
PL/SQL procedure successfully completed.
SQL> SELECT * FROM emp WHERE deptno = 40
2 /
EMPNO ENAME JOB MGR HIREDATE SAL COMM
DEPTNO
7777 APC CODER 7902 17-NOV-05 1700
40
7778 J RANDOM HACKER 7902 17-NOV-05 1800
40
SQL> Cheers, APC -
When converting tables in a MS Word 2010 or 2007 to PDF the table borders do not retain the correct thickness as identified in the word document. Is there a solution for this issue?
Please try with latest version of MS Word and Acrobat.
Regards,
Anoop -
Error during transport-Structure change at field level (convert table /BIC)
Hi,
I am trying to transport from DEV to Test when I encountered this error.
The tables are both consistent when I checked with SE14.
Start of the after-import method RS_CUBE_AFTER_IMPORT for object type(s) CUBE (Activation Mode)
Error/warning in dict. activator, detailed log > Detail
Structure change at field level (convert table /BIC/DZCRUSDI026)
Table /BIC/DZCRUSDI026 could not be activated
Return code..............: 8
Following tables must be converted
DDIC Object TABL /BIC/DZCRUSDI026 has not been activated
Error when activating InfoCube ZCRUSDI02
Error/warning in dict. activator, detailed log > Detail
Structure change at field level (convert table /BIC/DZCRUSDI023)
Structure change at field level (convert table /BIC/FZCRUSDI02)
Table /BIC/DZCRUSDI023 could not be activated
Table /BIC/FZCRUSDI02 could not be activated
Return code..............: 8
Following tables must be converted
DDIC Object TABL /BIC/DZCRUSDI023 has not been activated
Error when resetting InfoCube ZCRUSDI02 to the active version
How do I resolve this
thanksHi,
There are no Inactive objects in the cube in DEV system. Also must of the changes I made in Test are already in the cube in TEST But the cube is not active.
SAP proposed that the cube be activated manually but is not a good procedure to activate in TEST system.
Error when resetting InfoCube ZCRUSDI02 to the active version
Message no. RSO410
Diagnosis
Errors arose when activating InfoCube ZCRUSDI02. An active version already existed before the activation.
System Response
InfoCube ZCRUSDI02 could not be reset to the old active version. Since the generated objects no longer correspond to the old active version, they were reset to inactive.
Procedure
The old active version of InfoCube ZCRUSDI02 can no longer be used. Remove the cause of the activation error and activate InfoCube ZCRUSDI02 anew.
thanks -
Is it possible to convert tables into text (easy way and no changes)?
Thanks!After copy & paste use DW's Find & Replace feature (Ctrl+F)
Find in: Current document
Search: Specific Tag table
Action: Strip tag.
Repeat for tr, th, td, tbody, etc...
Nancy O. -
Convert table MARA -- Help Me Please!!
Hi all,
I was to experiment if bapi extension works for currency field or not. As such added two fields ( one CURR other CUKY) in a Z-STRUCTURE already appended in MARA table.
After experimenting, I deleted these fields from the Z-Structure and tried activating the Z-structure. It ended up in partial activation of the Z-Structure and an Error message saying
Structure change at field level (convert table MARA)
Now though the fields have been deleted from the structure ZST_MMNEW, The MARA table still has these fields.
What should I do to remove these field from MARA? These fields are blank for all the records in MARA.
Have I done something wrong with the Standard SAP table? Can this be corrected?
Please help
Thanks in advance,
KGRavi and Thomas,
Please tell me whether these steps will correct the problem
1. go to se14
2. Enter object name as MARA and Click EDIT.
3. Click "Activate and Adjust database" with the Save Data radio button checked.
Is it all? The current records in the table won't be deleted, right?
At present the mara table has 65K records. Will it take more than half hour to run this process?
Kindly confirm,
Thanks in advance,
KG -
Convert table from % to Pixels
Does anyone know how to convert table that is already full of
cells and text from % to pixels? I don't want to try and build
another table and copy the cell contents into it, this table is too
complex. You can see it at:
http://alternativecancer.us/#table2On Sun, 23 Dec 2007 17:33:39 +0000 (UTC), "Paul Winter"
<[email protected]> wrote:
>Does anyone know how to convert table that is already
full of cells and text
>from % to pixels? I don't want to try and build another
table and copy the
>cell contents into it, this table is too complex. You can
see it at:
>
http://alternativecancer.us/#table2
The link did not work
Either in the code - but if you are not happy with this,
ensure
properties box is open, then select the tables using the tag
selector
and enter the table width in pixels. Then select a column in
turn and
add the width of the column in pixels -
Horizontal Width
put the following into Dw's help system:
Resizing tables, columns, and rows
~Malcolm N....
~ -
Problem converting tables in exportPDF
I am using adobe reader XI with a paid exportPDF subscription. I want to use, it to convert tables scanned into pdf into excel spreadsheets I can then work with. These are one page tables. They are formatted in landscape. Every once in a while they covert acceptable, but usually the format of the table is garbled (sections put into very unlikely locations). With a lot of cut and past this can be fixed, but is no better a solution than the free converters out there. I believe the problem is that the converter is reading the orientation as portrait regardless of the actual orientation. I can't seem to find a parameter choice to fix this. If the conversion don't work properly the program saves no time and becomes useless. Any suggestions?
Hi There,
Please click on the following link for exportPDF forums: Adobe ExportPDF (read only)
Regards,
Mayank -
FM for converting PDF to XSTRING - display R/3 report in Portal as PDF
Hello SDNers,
Requirement:
I am trying to display an R/3 report in Portal as PDF. I am trying to do it with the following logic:
1. Call a RFC enabled FM from my Webdynpro Java appln.
2. The FM then submits the Print request for the R/3 report and then gets the spool.
3. Convert the ABAP spool to PDF (using FM CONVERT_ABAPSPOOLJOB_2_PDF).
4. Convert the PDF to XSTRING and send it back to the calling Webdynpro appln.
5. Using the XSTRING regenerate the PDF using some Webdynpro Java APIs.
The Problem / Question:
The output of the FM CONVERT_ABAPSPOOLJOB_2_PDF is a table of type "TLINE" which includes TDFORMAT and TDLINE.
To get the XSTRING I am using the FM "'SCMS_STRING_TO_XSTRING". This FM only uses the "TDLINE" and completely ignores the "TDFORMAT". When I import this XSTRING value into my Webdynpro for Java appln., and assign to the corresponding UI element, my PDF does not show up.
My FM code is like this:
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spono
no_dialog = 'X'
TABLES
pdf = t_pdf
IF sy-subrc 0.
ENDIF.
IF sy-subrc EQ 0.
LOOP AT t_pdf INTO w_pdf.
CONCATENATE
output
w_pdf-tdformat
w_pdf-tdline
INTO output.
ENDLOOP.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = output
IMPORTING
buffer = outputx.
I doubt if "'SCMS_STRING_TO_XSTRING'" is the right FM to use in my scenario.
If we had a smartform, we could have used the FM "CONVERT_OTF" , but in our case we do not have a smart form and I am not able to figure out which FM should be used.
Please suggest if I am doing any thing wrong.
Thanks for Reading.
Regards,
Raj KumarHi
check this thread
spool to pdf conversion
It looks like you are missing translate in you processing of the table t_pdf. Something like the following line is missing:
TRANSLATE gd_buffer USING '~ '.
Loo at the standard program RSTXPDFT4 as well. It converts spool to PDF and then you can download it to your desktop. -
Problem in converting table data into CSV file
Hi All,
In my Process i need to convert my error table data into csv file,my data is converted as csv file by using OdisqlUnload function,but the column headers are not converted,i use another procedure for converting column headers but iam getting below error ...
com.sunopsis.sql.SnpsMissingParametersException: Missing parameter string.find, string.find
SQL: import string import java.sql as sql import java.lang as lang import re sourceConnection = odiRef.getJDBCConnection("SRC") output_write=open('C:/Oracle/Middleware/Oracle_ODI2/oracledi/pro/PRO.txt','r+') myStmt = sourceConnection.createStatement() my_query = "select * FROM E$_LOCAL_F0911Z1" my_query=my_query.upper() if string.find(my_query, '*') > 0: myRs = myStmt.executeQuery(my_query) md=myRs.getMetaData() collect=[] i=1 while (i <= md.getColumnCount()): collect.append(md.getColumnName(i)) i += 1 header=','.join(map(string.strip, collect)) elif string.find(my_query,'||') > 0: header = my_query[7:string.find(my_query, 'FROM')].replace("||','||",',') else: header = my_query[7:string.find(my_query, 'FROM')] print header old=output_write.read() output_write.seek(0) output_write.write (header+'\n'+old) sourceConnection.close() output_write.close()
And i used below code for converting.......
import string
import java.sql as sql
import java.lang as lang
import re
sourceConnection = odiRef.getJDBCConnection("SRC")
output_write=open('C:/Oracle/Middleware/Oracle_ODI2/oracledi/pro/PRO.txt','r+')
myStmt = sourceConnection.createStatement()
my_query = "select FROM E$_COMPANY"*
*my_query=my_query.upper()*
*if string.find(my_query, '*') > 0:*
*myRs = myStmt.executeQuery(my_query)*
*md=myRs.getMetaData()*
*collect=[]*
*i=1*
*while (i <= md.getColumnCount()):*
*collect.append(md.getColumnName(i))*
*i += 1*
*header=','.join(map(string.strip, collect))*
*elif string.find(my_query,'||') > 0:*
*header = my_query[7:string.find(my_query, 'FROM')].replace("||','||",',')*
*else:*
*header = my_query[7:string.find(my_query, 'FROM')]*
*print header*
*old=output_write.read()*
*output_write.seek(0)*
*output_write.write (header+'\n'+old)*
*sourceConnection.close()*
*output_write.close()*
Any one can you help regarding this
Edited by: 30021986 on Oct 1, 2012 6:04 PMThis may not be an option for you but in pinch you may want to consider outputing your data to an MS Spreadsheet, then saving it as a CSV. It's somewhat of a cumbersome process, but it will get you by for now.
You will need to change your content type to application/vnd.ms-excel.
<% response.setContentType("application/vnd.ms-excel"); %> -
Convert table linked report into a Command version - Howto?
How can I convert hundreds of reports from table linked into a Command version?
One way to do is to take the SQL syntax off the report, add a Command with that Syntax and manually replace the database fields by the Command fields.
I can not believe that is the right way to this. Is there no hidden (re-)mapping fields button or another undocumented feature?
If this is the way to do it... when will there be a one-button-click solution. The underlaying data keeps the same, could not be that hard to build..?
Without that basic functionality Crystal Reports is not option for us anymore.
Backgroud: We do have hundreds of reports that are created by an ODBC (RDO) database (SQL Anywhere database), created by linking the tables and select the fields we like to use in the report. This works fine at least as we used the RDC method in our application. Because we are moving to .NET we could not use RDC anymore and have to use the .NET methods. However the .NET SDK is very limited. The only way to add more complex WHERE statements is to use the Command functionality of Crystal Reports.Hi Hans,
Let me explain, Command Objects are sent directly to the DB server as is. CR does not alter the SQL at all. As you know in SQL there are minor differences between the various servers and the SQL syntax can vary from DB to DB. Because of this CR could not build in the logic to handle the vast number of potential mappings, and not jsut SQL types but also PC databases.
To be able to map reports based on connections directly to the DB through a Command object the current versions of CR do not have the ability. Possibly the next version may have this feature though but we can't say for sure until it's released. Check our WEB site for new versions and there functionality.
Next question about moving off of the RDC to .NET, you are correct. CR no longer allows you to modify the SQL statement directly. The RDC was actually supposed to stop you also but it did work.
One possible solution is to use .NET and inProc RAS ( Report Application Server) and using record sets. Your app can get the SQL from the report, process the query and appending the info onto the WHERE clause as well as other filtering and then set the existing reports data source to the record set. As long as your data is less than 5000 rows then no performance issues, over 5K and you may start to see slow report processing. Depends on other info and report complexity etc.
If this is an option for you please post your question to the Crystal .NET development forum. Also, you will need to use 12.x.2000.x versions of the CR .NET assemblies and not use the basic version 10.5 or 10.2 that comes with .NET 2008 and 2005.
Thank you
Don -
Converting PDF to XSTRING for Adobe in WD ABAP Application
I have a requirement to develop a WD abap application in the portal, where 300 PDF's would exist on our LAN all with the pernr number embedded in the name. When a user logs onto the portal, it would retrieve the correct PDF for their pernr and display in an adobe form. In the application, I know how I can use the username, to derive the pernr to get the PDF name.
Right now I can use the upload functionality to upload(with an upload UI element) a particular file and put in a PDF with adobe, However, If I want to point to a particular file (based on the pernr name) on a secure folder on our LAN, can I do that?
If I plug in a file name instead of using the upload UI element, I need to figure out how to convert the PDF to an XSTRING so that I can pass that xstring to the adobe form interface.
Also, is there even a way to assign a file name on a LAN to an upload element in a WD ABAP application or is it necessary to use the dropdown to retrieve the file name from the users desktop in order for it to convert ot a PDF correctly?
Thanks,
Pam Lavertyhi pam,
I think it's not possible to select the file automatically. use action must be there.
So use upload ui element, once you click on upload button and select the file, that file data will be in DATASOURCE ATTRIBUTE ( the attribute which is binded to data property of upload ui element ) OF UPLOAD UI element in XSTRING format.
From there you can pass it to pdf.
Regards
srinivas
Maybe you are looking for
-
Dw cs5 with existing wordpress site hosted on yahoo need help connecting to existing remote database
I am having trouble establishing a database connection. I can connect with test databases but am having trouble using dreamweaver wtih my existing wordpress website. Am I able to use dreamweaver to edit and live view my changes before uploading
-
Internal Server Error; Live View not working...please help:)
I am a beginner doing a tutorial through David Sawyer McFarlands' "CS5: The Missisng Manual. I have MAMP set up and working fine. I just got through doing a tutorial on editing a recordset and linking to a Detail page. I have used Live View just a
-
Unable to download apps (keynote,pages,etc)
After clicking on app icon, an error appears "unable to download app "pages" could not be downloaded at this time. Done/Retry. How can I download these apps?
-
How do i get a list of all objects in a combo box
I want to get the list of all Objects in a JComboBox. I appreciate your help! Thanks!
-
Hello Is their a way that the SBO SDK UI exposes the file selection like the one use for add bit maps etc? I tried doing this by using writing code but cannot get this to display on the screen it is called from. The code is: Public Function Open_File