CONVERT RAWSTRING to SOLIX TABLE
Hello,
I want to converte RAWSTRING to SOLIX TABLE.
how can i do that?
thank you...
Hi,
here an example from sending mail
it_graphics = is_job_info-xmloutput-xsfgr[].
LOOP AT it_graphics
INTO is_graphic.
CLEAR w_gr_xtxt.
LOOP AT is_graphic-content
INTO is_gr_raw.
CONCATENATE w_gr_xtxt
is_gr_raw-line
INTO w_gr_xtxt
IN BYTE MODE.
ENDLOOP.
w_gr_xtxt = w_gr_xtxt(is_graphic-length).
w_offset = 0.
w_len = 255.
CLEAR it_solix[].
WHILE w_offset < is_graphic-length.
w_diff = is_graphic-length - w_offset.
IF w_diff > w_len.
is_solix-line = w_gr_xtxt+w_offset(w_len).
ELSE.
is_solix-line = w_gr_xtxt+w_offset(w_diff).
ENDIF.
APPEND is_solix TO it_solix.
ADD w_len TO w_offset.
ENDWHILE.
Regards
Fred
Similar Messages
-
Hello,
i begin on sap and it's my first post on this site.
i developed an module function to attach image to QM.
The photo must be in SOLIX table format to use it.
so how i do to convert this image an SOLIX table?
I want to use this function as a web service in .NET C# application
Thank'sDear Fouad,
see given links:
http://f1053e01.benxbrain.com/en/sap/domain/COMPID-
Image in Mail body in ABAP
Regards,
Abbas. -
Convert byte array to table of int
[http://www.codeproject.com/KB/database/PassingArraysIntoSPs.aspx?display=Print|http://www.codeproject.com/KB/database/PassingArraysIntoSPs.aspx?display=Print] Hello friends.
I'm pretty new with PL/SQL.
I have code that run well on MSSQL and I want to convert it to PL/SQL with no luck.
The code converts byte array to table of int.
The byte array is actually array of int that was converted to bytes in C# for sending it as parameter.
The TSQL code is:
CREATE FUNCTION dbo.GetTableVarchar(@Data image)
RETURNS @DataTable TABLE (RowID int primary key IDENTITY ,
Value Varchar(8000))
AS
BEGIN
--First Test the data is of type Varchar.
IF(dbo.ValidateExpectedType(103, @Data)<>1) RETURN
--Loop thru the list inserting each
-- item into the variable table.
DECLARE @Ptr int, @Length int,
@VarcharLength smallint, @Value Varchar(8000)
SELECT @Length = DataLength(@Data), @Ptr = 2
WHILE(@Ptr<@Length)
BEGIN
--The first 2 bytes of each item is the length of the
--varchar, a negative number designates a null value.
SET @VarcharLength = SUBSTRING(@Data, @ptr, 2)
SET @Ptr = @Ptr + 2
IF(@VarcharLength<0)
SET @Value = NULL
ELSE
BEGIN
SET @Value = SUBSTRING(@Data, @ptr, @VarcharLength)
SET @Ptr = @Ptr + @VarcharLength
END
INSERT INTO @DataTable (Value) VALUES(@Value)
END
RETURN
END
It's taken from http://www.codeproject.com/KB/database/PassingArraysIntoSPs.aspx?display=Print.
The C# code is:
public byte[] Convert2Bytes(int[] list)
if (list == null || list.Length == 0)
return new byte[0];
byte[] data = new byte[list.Length * 4];
int k = 0;
for (int i = 0; i < list.Length; i++)
byte[] intBytes = BitConverter.GetBytes(list);
for (int j = intBytes.Length - 1; j >= 0; j--)
data[k++] = intBytes[j];
return data;
I tryied to convert the TSQL code to PL/SQL and thats what I've got:
FUNCTION GetTableInt(p_Data blob)
RETURN t_array --t_array is table of int
AS
l_Ptr number;
l_Length number;
l_ID number;
l_data t_array;
BEGIN
l_Length := dbms_lob.getlength(p_Data);
l_Ptr := 1;
WHILE(l_Ptr<=l_Length)
loop
l_ID := to_number( DBMS_LOB.SUBSTR (p_Data, 4, l_ptr));
IF(l_ID<-2147483646)THEN
IF(l_ID=-2147483648)THEN
l_ID := NULL;
ELSE
l_Ptr := l_Ptr + 4;
l_ID := to_number( DBMS_LOB.SUBSTR(p_Data, 4,l_ptr));
END IF;
END IF;
l_data(l_data.count) := l_ID;
l_Ptr := l_Ptr + 4;
END loop;
RETURN l_data;
END GetTableInt;
This isn't work.
This is the error:
Error report:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
06502. 00000 - "PL/SQL: numeric or value error%s"
I think the problem is in this line:
l_ID := to_number( DBMS_LOB.SUBSTR (p_Data, 4, l_ptr));
but I don't know how to fix that.
Thanks,
MTs.I'd found the solution.
I need to write:
l_ID := utl_raw.cast_to_binary_integer( DBMS_LOB.SUBSTR(p_Data, 4,l_ptr));
instead of:
l_ID := to_number( DBMS_LOB.SUBSTR (p_Data, 4, l_ptr));
The performance isn't good, it's take 2.8 sec to convert 5000 int, but it's works. -
Convert data from one table to another
SQL> select * from A;
empid | mon_tips | tues_tips | wed_tips | thu_tips | fri_tips
----------------- ------------ --------- ----------+----------
1 | 10 | 20 | 30 | 20 | 10
2 | 10 | 20 | 30 | 40 | 50
i want a SQL query that will convert the data from table A into table B with the following format:
B(empid, Day, tips) where the column Day can take the values (Mon, Tue, Wed, Thu, Fri).
Thanks in adavnce for the replies
sqllearnercreaate table B as (select empid, 'MONDAY' day_1, mon_tips tips from a
union
select empid, 'TUESDAY' day_1, tues_tips tips from a
union
select empid, 'WEDNESDAY' day_1, wed_tips tips from a
union
select empid, 'THURSDAY' day_1, thu_tips tips from a
union
select empid, 'FRIDAY' day_1, fri_tips tips from a)Cheers
Sarma. -
Convert data from internal table to XML file.
Hi All,
I am selecting data from database into one internal table.
Now I want to convert data from internal table to xml file format and save in to my desktop. Please suggest me how I can achieve my requirement.
Kindly reply me ASAP.Use this FM. SAP_CONVERT_TO_XML_FORMAT
Check this link too -
Re: Data Export in XML format
XML files from ABAP programs -
Simple transformation error in converting XML to internal table
Hi Team,
I have an issue, its working in Dev, QA, and Prod in PI 7.0, once we upgrade it to PI 7.1 I'm getting the below mention error,
Unknown Simple transformation error in converting XML to internal table
Application error in mapping program ZF_INT006_FILE_TO_SAP_FILE, error code: , error text: Unknown Simple transformation error in converting XML to internal table An exception has occurred.
Can any one suggest related notes are suggestion.
appericate in advance for the solutions which you all provide me
Thank you
Venkat AnilCheck the flag "use SAP XML toolkit" for the operation mapping and try, if that works then.
Check the flag for all XSLT and Java mappings which is migrated from PI 7.0 -
Converting a single column table into a two-column table
Hi everybody
What I'm trying to do is convert a single column table into a two-column table. Here an example:
Table A (single column):
ID1
ID2
ID3
ID4
ID5
Table B (two-column) should be:
ID1 ID2
ID3 ID4
ID5
I already did it by looping through a cursor and making an insert every 2 rows, but don't like performance.
Is there an easier/faster way to do this?
Thanks in advance
Oscarwith t as (
select 'ID1' col1 from dual union all
select 'ID2' from dual union all
select 'ID3' from dual union all
select 'ID4' from dual union all
select 'ID5' from dual
) -- end of sample table
select col1,
col2
from (
select col1,
lead(col1) over(order by col1) col2,
row_number() over(order by col1) rn
from t
where mod(rn,2) = 1
COL COL
ID1 ID2
ID3 ID4
ID5
SQL> SY. -
How to convert from SQL Server table to Flat file (txt file)
I need To ask question how convert from SQL Server table to Flat file txt file
Hi
1. Import/Export wizened
2. Bcp utility
3. SSIS
1.Import/Export Wizard
First and very manual technique is the import wizard. This is great for ad-hoc and just to slam it in tasks.
In SSMS right click the database you want to import into. Scroll to Tasks and select Import Data…
For the data source we want out zips.txt file. Browse for it and select it. You should notice the wizard tries to fill in the blanks for you. One key thing here with this file I picked is there are “ “ qualifiers. So we need to make
sure we add “ into the text qualifier field. The wizard will not do this for you.
Go through the remaining pages to view everything. No further changes should be needed though
Hit next after checking the pages out and select your destination. This in our case will be DBA.dbo.zips.
Following the destination step, go into the edit mappings section to ensure we look good on the types and counts.
Hit next and then finish. Once completed you will see the count of rows transferred and the success or failure rate
Import wizard completed and you have the data!
bcp utility
Method two is bcp with a format file http://msdn.microsoft.com/en-us/library/ms162802.aspx
This is probably going to win for speed on most occasions but is limited to the formatting of the file being imported. For this file it actually works well with a small format file to show the contents and mappings to SQL Server.
To create a format file all we really need is the type and the count of columns for the most basic files. In our case the qualifier makes it a bit difficult but there is a trick to ignoring them. The trick is to basically throw a field into the
format file that will reference it but basically ignore it in the import process.
Given that our format file in this case would appear like this
9.0
9
1 SQLCHAR 0 0 """ 0 dummy1 ""
2 SQLCHAR 0 50 "","" 1 Field1 ""
3 SQLCHAR 0 50 "","" 2 Field2 ""
4 SQLCHAR 0 50 "","" 3 Field3 ""
5 SQLCHAR 0 50 ""," 4 Field4 ""
6 SQLCHAR 0 50 "," 5 Field5 ""
7 SQLCHAR 0 50 "," 6 Field6 ""
8 SQLCHAR 0 50 "," 7 Field7 ""
9 SQLCHAR 0 50 "n" 8 Field8 ""
The bcp call would be as follows
C:Program FilesMicrosoft SQL Server90ToolsBinn>bcp DBA..zips in “C:zips.txt” -f “c:zip_format_file.txt” -S LKFW0133 -T
Given a successful run you should see this in command prompt after executing the statement
Starting copy...
1000 rows sent to SQL Server. Total sent: 1000
1000 rows sent to SQL Server. Total sent: 2000
1000 rows sent to SQL Server. Total sent: 3000
1000 rows sent to SQL Server. Total sent: 4000
1000 rows sent to SQL Server. Total sent: 5000
1000 rows sent to SQL Server. Total sent: 6000
1000 rows sent to SQL Server. Total sent: 7000
1000 rows sent to SQL Server. Total sent: 8000
1000 rows sent to SQL Server. Total sent: 9000
1000 rows sent to SQL Server. Total sent: 10000
1000 rows sent to SQL Server. Total sent: 11000
1000 rows sent to SQL Server. Total sent: 12000
1000 rows sent to SQL Server. Total sent: 13000
1000 rows sent to SQL Server. Total sent: 14000
1000 rows sent to SQL Server. Total sent: 15000
1000 rows sent to SQL Server. Total sent: 16000
1000 rows sent to SQL Server. Total sent: 17000
1000 rows sent to SQL Server. Total sent: 18000
1000 rows sent to SQL Server. Total sent: 19000
1000 rows sent to SQL Server. Total sent: 20000
1000 rows sent to SQL Server. Total sent: 21000
1000 rows sent to SQL Server. Total sent: 22000
1000 rows sent to SQL Server. Total sent: 23000
1000 rows sent to SQL Server. Total sent: 24000
1000 rows sent to SQL Server. Total sent: 25000
1000 rows sent to SQL Server. Total sent: 26000
1000 rows sent to SQL Server. Total sent: 27000
1000 rows sent to SQL Server. Total sent: 28000
1000 rows sent to SQL Server. Total sent: 29000
bcp import completed!
BULK INSERT
Next, we have BULK INSERT given the same format file from bcp
CREATE TABLE zips (
Col1 nvarchar(50),
Col2 nvarchar(50),
Col3 nvarchar(50),
Col4 nvarchar(50),
Col5 nvarchar(50),
Col6 nvarchar(50),
Col7 nvarchar(50),
Col8 nvarchar(50)
GO
INSERT INTO zips
SELECT *
FROM OPENROWSET(BULK 'C:Documents and SettingstkruegerMy Documentsblogcenzuszipcodeszips.txt',
FORMATFILE='C:Documents and SettingstkruegerMy Documentsblogzip_format_file.txt'
) as t1 ;
GO
That was simple enough given the work on the format file that we already did. Bulk insert isn’t as fast as bcp but gives you some freedom from within TSQL and SSMS to add functionality to the import.
SSIS
Next is my favorite playground in SSIS
We can do many methods in SSIS to get data from point A, to point B. I’ll show you data flow task and the SSIS version of BULK INSERT
First create a new integrated services project.
Create a new flat file connection by right clicking the connection managers area. This will be used in both methods
Bulk insert
You can use format file here as well which is beneficial to moving methods around. This essentially is calling the same processes with format file usage. Drag over a bulk insert task and double click it to go into the editor.
Fill in the information starting with connection. This will populate much as the wizard did.
Example of format file usage
Or specify your own details
Execute this and again, we have some data
Data Flow method
Bring over a data flow task and double click it to go into the data flow tab.
Bring over a flat file source and SQL Server destination. Edit the flat file source to use the connection manager “The file” we already created. Connect the two once they are there
Double click the SQL Server Destination task to open the editor. Enter in the connection manager information and select the table to import into.
Go into the mappings and connect the dots per say
Typical issue of type conversions is Unicode to non-unicode.
We fix this with a Data conversion or explicit conversion in the editor. Data conversion tasks are usually the route I take. Drag over a data conversation task and place it between the connection from the flat file source to the SQL Server destination.
New look in the mappings
And after execution…
SqlBulkCopy Method
Sense we’re in the SSIS package we can use that awesome “script task” to show SlqBulkCopy. Not only fast but also handy for those really “unique” file formats we receive so often
Bring over a script task into the control flow
Double click the task and go to the script page. Click the Design script to open up the code behind
Ref.
Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/ -
Convert 14000 wide char table to 255 wide char table
How to convert 14000 wide char table to 255 wide char table.
I have used QCE1_CONVERT which is throwing exception - convert not possible.
Please suggest.
Thanks a lot.You haven't provided that much info but I guess you are looking for something like FM RSDG_WORD_WRAP does, correct?
-
Convert text file to table on Import
We have a lot of tables, that we'd like to maintain outside of FrameMaker (we're using FM9). I've been trying to figure out the best way to do it, and using the Import>File>Convert option seems like the best.
However, my question is what is best practice for the type of files we use? At first it seemed like using Excel and saving as a .csv or tab-delimited text file would be easiest. But there doesn't seem to be a .csv convert option and setting "," as the delimiter means we can't use commas inside the cell content. And it seems to import tab-delimited cells that contain a comma inside quotes.
It seems like the other option would be to use HTML for the table content. We are new to all this stuff, so using HTML would add to the learning curve, but I can push it through if it's best practice/will make the cleanest conversions. Or is there a way to use Excel that converts cleanly that I just haven't figured out?
Any thoughts would be appreciated!Last year, based upon a comment on this forum, I imported an Excel table into a structured FrameMaker document by copy. FrameMaker created the table and applied its own version of a structure. For example, row elements were named ROW, cell elements were named CELL, etc. Because my table structure used different names, I had to change them to make the structure valid. There may have been some subtle issues with the table element itself. It was not clean but it got the job done.
Regarding Michael's suggestion about XML, I DID try this once, and it worked fine. The exported XML from Excel was simple and clean. The XSLT was therefore easy to write. If you have lots of tables to do, this might be the best way to go. It may take some work to get it working correctly, but once it is, subsequent work will be minimized.
Regarding XML from Excel, I was using the old Excel format xls. I have not worked with the newer xlsx format, which IS based upon XML. If you are using xlsx, I would be sure to export as XML and not "save" as XML (not sure what the command would be) in order to avoid getting all the XML used in newer Excel to store formatting and other meta information.
Good luck. -
Conversion from German to English to convert a filed of table EKPO
Hi Guys,
I want to know how to convert a filed of particular table from German to English for EKPO-MEINS field. This is a unit of measure field which I'm checking from SE11, it shows it in german (LE instead of ACT, MON instead of MO etc). I'm using call function reuse_alv_grid_display and the output for all unit of measure fields are coming in german and other fields are coming in english. This problem arises after upgrade from 4.6c to ecc 6.0. In 4.6c it is working fine. Please tell me how to change it to english.
Thanks,
AwanishHi,
Sorry...Not sure what you are looking for..
But the description says "Settlement type" for the field PERBZ
Thanks,
Naren -
I'm a language translator. My source files are very often pdf's containing huge tables with hundreds of embedded figures as well as text. So far, I've been unable to find a way to automatically convert such a structure to MS Word format. When selecting the table, the figures do not copy. Figures can be selected and copied only one at a time. Tried Reader, tried Acrobat, tried third party software like ABBYY PDF Transformer+ to no avail. Is there a way to do it?
Hi pielassss,
Could you share a sample file with me at [email protected] so that I can check at my end?
What version of Acrobat are you uisng?
Regards,
Rave -
Hello All,
I am using Acrobat 11 to convert PDF's to MS Word .doc or .docx. The tables are converted correctly but they are inside Text Boxes. My documents have hundreds of tables and I cant manually remove the text boxes.
Is there a way to remove the Text Box that contains each table?
Regards PaulHello Anubha,
My apologies. Hopefully you can see the table is inside a text box. The Acrobat 7 doesn't behave like this, nor do some of the other PDF conversion products.
In my output there is 700 pages with average of 3 tables per page. A manual workaround to get the tables out of the text boxes wouldn't be practicable.
Can you confirm that this is not the expected behaviour. I thought I recently saw a video showing this behaviour as standard for Acrobat 11.
Regards Paul -
Converting fromula in pivot tables in EXcel 2013
I'm looking to convert to Formulas in Excel 2013. The Help function says that the functionality resides in the pivot table tools-> Analyze->in the Calculations group> click OLAP tools > click convert to formula
This is grayed out in my worksheet and I am clicking on a cell within the Pivot table
The pivot table source is an other excel worksheet in the same workbook that is not OLAP data (I don't even really know what that is)
Is there something i need to do to ungray the OLAP tools icon? Or is this no longer possible. This functionality in 2007 was not tied to OLAP tools
ThanksHi,
As far as I know, only the Online Analytical Processing (OLAP) PivotTable report by using converting formula.
The data source must be imported from "Data tab>From other source>From Analysis Services" and then we could use the converting formula.
http://office.microsoft.com/en-us/excel-help/convert-pivottable-cells-to-worksheet-formulas-HA010096303.aspx
Regards,
George Zhao
TechNet Community Support -
How to connect to external web service and convert XML to a table
Hi experts,
I need to connect to external/non-SAP web service and convert XML in that site to a SAP table?
Is there a function call(SE37) to do this? Is it a must for me to install AS JAVA or PI and configure enterprise service? Please provide a link for me to retrieve relevant infomation, thx.No, you don't need PI or the Java stack for this. You can create an ABAP proxy using the WSDL file for the web service and call the web service using the proxy class in an ABAP program. You can transform the XML response to internal tables/structures/variables using a transformation template that you create.
Maybe you are looking for
-
Hi, I'm looking to migrate my iTunes library to another hard disk on my laptop. I have followed steps on Apple's website where I reset the library location to the new drive and am now using the consolidate library function. I'll highlight 20GB of fi
-
How can I repair and speed up my Mac?
Computer really started to slow down about 6 months ago, kept buffering on everything. I added 4gb memory but this didn't really help much. I have been trying to repair via 'disk utilities, first aid' but getting message: ERROR: The underlying task r
-
How to change the default dictionary on ios 7
-
Why can't I delete search phrases in App Store permanently?
Since iOS 7 update it seems to be impossible to permanently delete search phrases in App Store. Whenever I delete the search phrase, turn off App Store and come back, the old search reappears in all categories of the App Store. Any ideas how to overc
-
While playing my albums in iTunes it has just started playing the first song but will not progress through the other songs on the album. Did I accidentally change setting or are other people having the same trouble? thanks