How to split table records
Hi Gurus,
Need your help in this.
I am trying to split records in a table through ABAP routine. Following is the source table with 2 records
To split the record I wrote the following code in Start routine
DATA: ITAB_SOURCE TYPE _ty_t_SC_1,
WA_SOURCE TYPE _ty_s_SC_1,
TMP_COUNTER TYPE I VALUE 1.
LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.
CLEAR WA_SOURCE.
MOVE <SOURCE_FIELDS> TO WA_SOURCE.
TMP_COUNTER = 1.
DO 12 TIMES.
WA_SOURCE-CALMONTH2 = TMP_COUNTER.
APPEND WA_SOURCE TO ITAB_SOURCE.
TMP_COUNTER = TMP_COUNTER + 1.
ENDDO.
"TMP_COUNTER = 1.
ENDLOOP.
"REFRESH SOURCE_PACKAGE.
MOVE ITAB_SOURCE TO SOURCE_PACKAGE
However I could see only 1 record being split. Kindly point out the flaw in my routine.Following is the result for the routine.
Please help
it's already defined as a table, hence the update of 12 records
the note (1258089) is really straight forward... not sure what I could add to make it more clear to you? you're obviously in scenario 1... instead of "changing" the value of WA_SOURCE-CALMONTH2 you'll also have to "update" the value of WA_SOURCE-RECORD
your initial records have values 1 (for employee 9000125) and 2 (for employee 9001673) for RECORD
since you don't correctly update the values for RECORD, they're just being overwritten in your second loop
Similar Messages
-
How to split table in the report so it shows on the next page?
Hi,
How to split table in the report so it shows on the next page? Im trying to fit long (many columns) table into my report page. It is too long however. I want it to wrap and show the rest on the next page. What I get now is table cut at the page end and rest is not visible.Yes, this might be that the amount of data will cause table to grow and exceed 1, 2, 3.. pages. In that case I would probably want to have, lets say , one half of columns on 1st page then the other on the 2nd page and then repeatedly the same sequence down across all pages. Is there a way to achieve this?
-
Split table record into several lines - pdf forms
hello experts
im trying to split a table record into several lines in order to present the whole table record in the form.
for example:
table T has 4 fields F1 F2 F3 F4
if the tables has 2 records - R1 and R2 (every record contains 4 data fields) then i want to present my table in the following way:
R1-F1 R1-F2
R1-F3 R1-F4
R2-F1 R2-F2
R2-F3 R2-F4
please do not refer me to links - i really need a specific procedure
thanks ahead to all
Eyal
P.S i am using the adobe lifecycle - SFP tran.hey everyone
it has been solved
for the record:
subform table (flowed content) contains 2 positioned subforms
subforn header
subform lines contains 2 flowed subforms 1 for the first two fields and 1 for the ladt two fields
thank anyway
Eyal -
How to create table records..
hi,
i have table having 6 fields,
first two are key fields.. i need to create table records with repeating
1st field , how can i create plz tell me , because its not accepting in se11, is their any altenative .
thanks and regards,
kalyanCan you be more clear on what your requirement is ?
Lets put it in an example :
CASE 1 : Possible
Key1 Key2 Field1 Field2 Field3 Field4
1 1 XXX xxx xxxx xxx
1 2 XXX xxx xxxx xxx
OR
CASE 2 : Impossible with 2 keys, you will need one more key.
Key1 Key2 Field1 Field2 Field3 Field4
1 1 XXX xxx xxxx xxx
1 1 XXX xxx xxxx xxx
regards,
Advait -
How to split the records into two parts
Hi experts,
I have a field with 75 char length, this field have records also, Now i want to split the field into two differnt fields. That means upto first 40 char goes to one field, from 41st char to 70 char goes to another field, for that how to split record into two parts.
Plz advice this,
MohanaHi,
Do the following:
f1 = fsource(40).
f2 = fsource+40(30).
where fsource is the 70 character original string and target strings are f1 (length 40) and f2 (length 30).
Cheers,
Aditya
Edited by: Aditya Laud on Feb 22, 2008 2:10 AM -
How to split one record to two?
I am still trying to come up a good example. If you know any, please suggest. I will shoot the question out first.
The base tableA:
colA colB colC colD colE
==================
1 Y 100 23 564
2 N 65 345 23
3 Y 211 940 999
So i need to create a VIEW based on the above table. If the colB has value Y, that record will be split to two. if it's N, just copy all the data
colA colB colC colD colE
==================
1 Y 100
1 N 23 564
2 N 65 345 23
3 Y 211
3 N 940 999
Please keep in mind, this is a simplified view. The real view I created has about 40 columns. 'Union All' seems to be tedious if I have copy like 37 columns with only 3 columns have different values.
Oracle 10gR2.
Thanks.new2Oracle wrote:
Thanks.
As a learning experience, please explain your approach to this solution.
Edited by: new2Oracle on Mar 22, 2010 1:44 AMYeah, sorry about the first post. I read 2 lines of your sample data and made up the rest in my head so missed a case :)
This should mimic your sample output.
ME_XE?with your_data as
2 (
3 select 1 as col1, 'Y' as col2, 100 as col3, 23 as col4, 564 as col5 from dual union all
4 select 2 as col1, 'N' as col2, 65 as col3, 345 as col4, 23 as col5 from dual union all
5 select 3 as col1, 'Y' as col2, 211 as col3, 940 as col4, 999 as col5 from dual
6 ),
7 dual_data as
8 (
9 select 'Y' as col2 from dual union all
10 select 'N' as col2 from dual
11 )
12 select
13 y.col1,
14 case when y.col2 = 'N' then y.col2 else d.col2 end as col2,
15 case when y.col2 = 'N' then y.col3 else decode(d.col2, 'Y', y.col3, y.col4) end as col3,
16 case when y.col2 = 'N' then y.col4 else decode(d.col2, 'Y', to_number(NULL), y.col5) end as col4,
17 case when y.col2 = 'N' then y.col5 else NULL end as col5
18 from your_data y, dual_data d
19 where d.col2 = 'Y'
20 or d.col2 != y.col2
21 order by y.col1, d.col2 desc
22 /
COL1 COL COL3 COL4 COL5
1 Y 100
1 N 23 564
2 N 65 345 23
3 Y 211
3 N 940 999
5 rows selected.
Elapsed: 00:00:03.56
ME_XE?As for the explanation ... you need to make up 2 rows to join to (the data from dual) and then remove rows where you have a N value from your existing data (since you only want a single row in that instance). From there you need to determine what type of data you have in your select statement (hence all the case statements).
Hope that helps. -
How To Split One Record into 30 Records(Number of days in a Month)
Hi Experts,
we are getting the montly(yearmonth) Forecast data from flat file we need to generate the report which shows the daily Forecast data,
For example for the month of June Forecast we have 150EA.
Flat file data is like this
0calday Qty
201006 150
we need to show the report like datawise
Calday Forecast qty
20100601 5
20100602 5
20100603 5
20100604 5
20100605 5
20100606 5
20100630 5
its like month forecast / Number of days in a month.
we can achive these in two ways as per my knowledge
1. At the time loading data
2. Reporting level
Which is the best way
how can we achive this.
Thanks
ChandraHey. There was a similar posting I gave a suggestion on a while back. Here is the link...
Re: Spliting records into cube
As far as the correct time of doing this, I would definitely do this at the time of data load and not time of reporting.
Hope you find it helpful.
Thanks -
Oracle BI answers how to split table column?
I have one issue and i don't know it is possible. If it is possible please tell me.
In answer select cube's columns.
result in table of answers
--------------------------------|
CUBE1 |
--------------------------------|
COL1 | COL2 | COL3 |
--------------------------------|
data1 | data2 | data3 |
--------------------------------|
I want to change like
---------------------------------------|
NAME1 |
---------------------------------------|
NAME2 | NAME3 |
---------------------------|
NAME2 | NAME5 | NAME6 |
---------------------------------------|
COL1 | COL2 | COL3 |
---------------------------------------|
data1 | data2 | data3 |
----------------------------------------|
help meCan somebody help on this please?
-
How to split the crystal report records by batch
Post Author: dhivya
CA Forum: General
Im using a Crystal report and i have to split the records to be printed from the application.For Eg: I Generate a report which has about 2000 pages, now i want to print first 500 as one job and then the second job with the other 500 and til 2000 pages.Now i want to know how to split this records..If i use page count and split for first 500 and then how would the second job know that from where it has to continue (How will it take the 501th record).Post Author: Charliy
CA Forum: General
When I need to do something like that I use the primary sort field as the limiting feature. For example: if I'm printing a report sorted by Name I'll have parameters for the first letter of the name. So if the user enters the range A to E, then only names that start with those letters are printed. The pages wonlt be exactly as if you'd printed the whole report, but it makes in manageable. -
SPLIT data-record AT delimiter into table-fieldname
Hi all,
I have the following SPLIT statement. But unable to split into respective field in an internal table. I'm using the standard delimeter.
Please help me how to create a file using the delimeter w_delimeter.
When I create the file with separated by '#' even it is not spliting.
w_delimeter TYPE c value cl_abap_char_utilities=>horizontal_tab.
SPLIT data-record AT w_delimeter INTO i_0208-pernr
i_0208-begda
i_0208-endda
i_0208-wtart
i_p0208-allpc.
Thanks,
PrasadHi Prasad,
it should work try this bellow piece of code.
REPORT ZTEST_A.
data: Begin of itab occurs 1,
name(30),
street(30),
Apt(3),
city(30),
state(2),
zipcode(5),
end of itab,
text1(250),
text2(250).
Text1 = 'Jacson 3 xyz dr B4 abcd DE 12345'.
Text2 = 'Edward 3 Caaa dr B4 pqr DE 54623'.
split text1 AT ' ' into itab-name itab-street itab-Apt
itab-city itab-state itab-zipcode.
append itab.
split text2 AT ' ' into itab-name itab-street itab-Apt
itab-city itab-state itab-zipcode.
append itab.
thanks,
Venkat -
Regarding how to delete the record in internal table
Hi experts ,
how to delete the record in intarnal table after validating the data,
if record contains invalid fields?
i am giving my code see this and give me the answer?
loop at it_data into wa_data .
Validate Cost Center
READ TABLE it_kostl INTO wa_kostl WITH KEY kostl = wa_data-kostl BINARY SEARCH.
IF sy-subrc NE 0.
PERFORM update_error_log USING wa_data
text-004.
ENDIF.
Validate source file material ( material number )
loop at it_mara into wa_mara .
read table it_ausp into wa_ausp with key atwrt = wa_data-i_matnr .
if sy-subrc NE 0 .
PERFORM update_error_log USING wa_data
text-002.
delete it_data-objek .
else.
read table it_mara into wa_mara with key matnr = wa_ausp-objek .
if sy-subrc EQ 0 .
wa_data-objek = wa_mara-matnr.
wa_data-matkl = wa_mara-matkl.
ENDIF.
Modify it_data from wa_data .
endif.
*endloop.
Validate unit of measure (unit)
READ TABLE it_t006 INTO wa_t006 WITH KEY msehi = wa_data-unit .
IF sy-subrc NE 0.
PERFORM update_error_log USING wa_data
text-003.
endif.
Validate delivery location ( storage location )
READ TABLE it_lgort INTO wa_lgort WITH KEY del_loc = wa_data-del_loc.
IF sy-subrc NE 0.
PERFORM update_error_log USING wa_data
text-001.
if wa_data-flag ='x' .
delete it_data from wa_data .
endif.
ENDIF.
endloop.Hi Naren,
First get the index number of the IT_data table and store it in one variable whose declaration like this.
data: tabix type sy-tabix.
while reading the internal table it_data set the tabix variable.
tabix = sy-tabix.
Instead of the above use below one.
Delete it_data-objek
Use the Below statement it will delete the row from the internal table.
Delete it_data-objek index tabix
Thanks,
Chidanand -
How to identify missing records in a single-column table?
How to identify missing records in a single-column table ?
Column consists of numbers in a ordered manner but the some numbers are deleted from the table in random manner and need to identify those rows.Something like:
WITH t AS (
SELECT 1 ID FROM DUAL UNION ALL
SELECT 2 ID FROM DUAL UNION ALL
SELECT 3 ID FROM DUAL UNION ALL
SELECT 5 ID FROM DUAL UNION ALL
SELECT 8 ID FROM DUAL UNION ALL
SELECT 10 ID FROM DUAL UNION ALL
SELECT 11 ID FROM DUAL
-- end of on-the-fly data sample
SELECT '[' || (id + 1) || ' - ' || (next_id - 1) || ']' gap
FROM (
SELECT id,
lead(id,1,id + 1) over(order by id) next_id
FROM t
where id != next_id - 1
GAP
[4 - 4]
[6 - 7]
[9 - 9]
SQL> SY.
P.S. I assume sequence lower and upper limits are always present, otherwise query needs a little adjustment. -
How to split all the fields of output ls-l from an internal table
Hi all,
Using ls-l command i have brought the file attributes of a file like its read and write permissions,creation date ,path etc in a internal table.
Now how to split all these fields from the internal table or what should be the splitting criteria.
The field contents of internal table are like this:
-rw-rw---- 1 devadm sapsys 18360 apr 29......so on
I want to split this into different fields.
Kindly suggest.
Thank You.Hi,
I think the delimiter will be space. For date alone (Apr 29) you need to concatenate after the string has been split.
Thanks and regards,
S. Chandramouli -
How to process each records in the derived table which i created using cte table using sql server
I want to process each row from the CTE table I created, how can I traverse from first row to second row and so on....
how to process each records in the derived table which i created using cte table using sql serverIdeally you would be doing a set based processing rather than traversing row by row as thats more efficient. To answer it specific to your scenario we may need more info. Can you explain with some sample data your exact requirement?
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
How to fill the records from a User Define Table to PO item Grid
Hi To all,
I need to fill data from User Define table records into Purchase Order Item Grid.
I created an UDF Filed in PO - Header Part - "PRS"(Filed Name)
By using Formatted Search in itemcode column, i called a query,
"Select itemcode, qty from (@user define tablename) where PRS = $http://OPOR.U_PRS"
For eg:
Output from querry
ItemCode Qty
ABC 1
DEF 2
DFG 7
SDGD 9
By using formatted search it is filling only first data in to itemcode column in PO Grid.
Please help, how can i fill ALL the data in to my PO Grid?
Thanks in Advance
SAGARThe easisest way is to create datasource and the result bind to grid.
Datasource:
oDBDataSource = oForm.DataSources.DBDataSources.Add("@usertablename")
Dim xoConditions As SAPbouiCOM.Conditions
Dim xoCondition As SAPbouiCOM.Condition
xoConditions = New SAPbouiCOM.Conditions
xoCondition = xoConditions.Add
xoCondition.BracketOpenNum = 1
xoCondition.Alias = "u_zn"
xoCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
xoCondition.CondVal = "cond"
xoCondition.BracketCloseNum = 1
oDBDataSource.Query(xoConditions)
binding (example for matrix, in grid is simillar)
oMatrix.Clear()
Dim cols As SAPbouiCOM.Columns
Dim column As SAPbouiCOM.Column
cols = oMatrix.Columns
column = cols.Item("colX")
column.DataBind.SetBound(True, "@usertable", "u_x")
oMatrix.LoadFromDataSource()
hoep it helps
Petr
Maybe you are looking for
-
Open Doc Links not working - BO 3.1 (They were working fine earlier)
Hi All, I have come across a strange problem with Web intelligence links (opendoc). We have a number of links of our webi reports shared with the users, used in external portals. All of them were working but suddenly they have stopped working. Ex: ht
-
Hi All, I have to develop a report for vendor evaluation. fields are like this: Vendor, Average price,total supply,rejected, accepted, price rating Formula for price rating is :Price Rating = If Price of a Vendor for a material is lowest than weighta
-
Photoshop CC not allowing JPEG import from Nikon D800 - Photoshop CS6 worked fine.
When inporting JPEG from Nikon D800 nothing happens - screen remains blank. Went back to my provious version (Photoshop CS6) and it worked fine.
-
Library assests missing in Encore CS5
The whole Library section is coming up empty, any suggestions as to where I could find the files to attempt a reinstall? The main problem I have is that everything has to be installed through our IT department and they seem to be baffled by anything
-
Flash Player installs wrong version
I'm running Windows 7, IE 9 on a 64 bit system. I have gone through all trouble shooting on Adobe web site. I have uninstalled and reinstalled, ver 11.3.300.271 and continues to flash and when searching for flash player using control panel, it reads