How to increase the length of internal table dynamically
How to increase the length of internal table dynamically depending on the number of fields fetched into the internal table ?
The requirement code :
types: begin of t_data,
form like zscr_data_hdr-form,
werks like zscr_data_hdr-werks,
matnr like zscr_data_hdr-matnr,
verid like zscr_data_hdr-verid,
lot like zscr_data_hdr-lot,
lot_qty like zscr_data_hdr-lot_qty,
udate like zscr_data_hdr-udate,
utime like zscr_data_hdr-utime,
zuser like zscr_data_hdr-zuser,
processed like zscr_data_hdr-processed,
defect like zscr_defect_data-defect,
vornr like zscr_route_data-vornr,
fld1 like zscr_defect_data-defect_val,
fld2 like zscr_defect_data-defect_val,
fld3 like zscr_defect_data-defect_val,
fld4 like zscr_defect_data-defect_val,
fld5 like zscr_defect_data-defect_val,
fld6 like zscr_defect_data-defect_val,
fld7 like zscr_defect_data-defect_val,
fld8 like zscr_defect_data-defect_val,
fld9 like zscr_defect_data-defect_val,
fld10 like zscr_defect_data-defect_val,
fld11 like zscr_defect_data-defect_val,
fld12 like zscr_defect_data-defect_val,
fld13 like zscr_defect_data-defect_val,
fld14 like zscr_defect_data-defect_val,
fld15 like zscr_defect_data-defect_val,
fld16 like zscr_defect_data-defect_val,
fld17 like zscr_defect_data-defect_val,
fld18 like zscr_defect_data-defect_val,
fld19 like zscr_defect_data-defect_val,
fld20 like zscr_defect_data-defect_val,
fld21 like zscr_defect_data-defect_val,
fld22 like zscr_defect_data-defect_val,
fld23 like zscr_defect_data-defect_val,
fld24 like zscr_defect_data-defect_val,
fld25 like zscr_defect_data-defect_val,
fld26 like zscr_defect_data-defect_val,
fld27 like zscr_defect_data-defect_val,
fld28 like zscr_defect_data-defect_val,
fld29 like zscr_defect_data-defect_val,
fld30 like zscr_defect_data-defect_val,
fld31 like zscr_defect_data-defect_val,
fld32 like zscr_defect_data-defect_val,
fld33 like zscr_defect_data-defect_val,
fld34 like zscr_defect_data-defect_val,
fld35 like zscr_defect_data-defect_val,
fld36 like zscr_defect_data-defect_val,
fld37 like zscr_defect_data-defect_val,
fld38 like zscr_defect_data-defect_val,
fld39 like zscr_defect_data-defect_val,
fld40 like zscr_defect_data-defect_val,
fld41 like zscr_defect_data-defect_val,
fld42 like zscr_defect_data-defect_val,
fld43 like zscr_defect_data-defect_val,
fld44 like zscr_defect_data-defect_val,
fld45 like zscr_defect_data-defect_val,
fld46 like zscr_defect_data-defect_val,
fld47 like zscr_defect_data-defect_val,
fld48 like zscr_defect_data-defect_val,
fld49 like zscr_defect_data-defect_val,
fld50 like zscr_defect_data-defect_val,
fld51 like zscr_defect_data-defect_val,
fld52 like zscr_defect_data-defect_val,
fld53 like zscr_defect_data-defect_val,
fld54 like zscr_defect_data-defect_val,
fld55 like zscr_defect_data-defect_val,
fld56 like zscr_defect_data-defect_val,
fld57 like zscr_defect_data-defect_val,
fld58 like zscr_defect_data-defect_val,
fld59 like zscr_defect_data-defect_val,
fld60 like zscr_defect_data-defect_val,
fld61 like zscr_defect_data-defect_val,
fld62 like zscr_defect_data-defect_val,
fld63 like zscr_defect_data-defect_val,
fld64 like zscr_defect_data-defect_val,
fld65 like zscr_defect_data-defect_val,
fld66 like zscr_defect_data-defect_val,
fld67 like zscr_defect_data-defect_val,
fld68 like zscr_defect_data-defect_val,
fld69 like zscr_defect_data-defect_val,
fld70 like zscr_defect_data-defect_val,
fld71 like zscr_defect_data-defect_val,
fld72 like zscr_defect_data-defect_val,
fld73 like zscr_defect_data-defect_val,
fld74 like zscr_defect_data-defect_val,
fld75 like zscr_defect_data-defect_val,
fld76 like zscr_defect_data-defect_val,
fld77 like zscr_defect_data-defect_val,
fld78 like zscr_defect_data-defect_val,
fld79 like zscr_defect_data-defect_val,
fld80 like zscr_defect_data-defect_val,
fld81 like zscr_defect_data-defect_val,
fld82 like zscr_defect_data-defect_val,
fld83 like zscr_defect_data-defect_val,
fld84 like zscr_defect_data-defect_val,
fld85 like zscr_defect_data-defect_val,
fld86 like zscr_defect_data-defect_val,
fld87 like zscr_defect_data-defect_val,
fld88 like zscr_defect_data-defect_val,
fld89 like zscr_defect_data-defect_val,
fld90 like zscr_defect_data-defect_val,
fld91 like zscr_defect_data-defect_val,
fld92 like zscr_defect_data-defect_val,
fld93 like zscr_defect_data-defect_val,
fld94 like zscr_defect_data-defect_val,
fld95 like zscr_defect_data-defect_val,
fld96 like zscr_defect_data-defect_val,
fld97 like zscr_defect_data-defect_val,
fld98 like zscr_defect_data-defect_val,
fld99 like zscr_defect_data-defect_val,
fld100 like zscr_defect_data-defect_val,
fld101 like zscr_defect_data-defect_val,
fld102 like zscr_defect_data-defect_val,
fld103 like zscr_defect_data-defect_val,
fld104 like zscr_defect_data-defect_val,
fld105 like zscr_defect_data-defect_val,
fld106 like zscr_defect_data-defect_val,
fld107 like zscr_defect_data-defect_val,
fld108 like zscr_defect_data-defect_val,
fld109 like zscr_defect_data-defect_val,
fld110 like zscr_defect_data-defect_val,
fld111 like zscr_defect_data-defect_val,
fld112 like zscr_defect_data-defect_val,
fld113 like zscr_defect_data-defect_val,
fld114 like zscr_defect_data-defect_val,
fld115 like zscr_defect_data-defect_val,
fld116 like zscr_defect_data-defect_val,
fld117 like zscr_defect_data-defect_val,
fld118 like zscr_defect_data-defect_val,
fld119 like zscr_defect_data-defect_val,
fld120 like zscr_defect_data-defect_val,
fld121 like zscr_defect_data-defect_val,
fld122 like zscr_defect_data-defect_val,
fld123 like zscr_defect_data-defect_val,
fld124 like zscr_defect_data-defect_val,
fld125 like zscr_defect_data-defect_val,
fld126 like zscr_defect_data-defect_val,
fld127 like zscr_defect_data-defect_val,
fld128 like zscr_defect_data-defect_val,
fld129 like zscr_defect_data-defect_val,
fld130 like zscr_defect_data-defect_val,
fld131 like zscr_defect_data-defect_val,
fld132 like zscr_defect_data-defect_val,
fld133 like zscr_defect_data-defect_val,
fld134 like zscr_defect_data-defect_val,
fld135 like zscr_defect_data-defect_val,
dayst like zscr_data_hdr-dayst,
end of t_data.
In this fld1 to fld135 are defined in internal table.
But if the number of fields are more than 135 then the program is going to short dump.
Some times fld1 to fid170 or more fields will be there in my internal table.
Please suggest me how to make my requirement dynamic and display this data fetched into this internal table onto a .XLS file in the presentation server ?
Hi
You can try to use the type string:
form like zscr_data_hdr-form,
werks like zscr_data_hdr-werks,
matnr like zscr_data_hdr-matnr,
verid like zscr_data_hdr-verid,
lot like zscr_data_hdr-lot,
lot_qty like zscr_data_hdr-lot_qty,
udate like zscr_data_hdr-udate,
utime like zscr_data_hdr-utime,
zuser like zscr_data_hdr-zuser,
processed like zscr_data_hdr-processed,
defect like zscr_defect_data-defect,
vornr like zscr_route_data-vornr,
fieldxx type string,
dayst like zscr_data_hdr-dayst,
end of t_data.
So you can save you informations of every fld<n> concatenating their values into fieldxx.
Max
Similar Messages
-
How to Increase the Length of Condition table in OV20
While creating a condition table in T.code OV20 if fields length is more that 50 bytes table is not getting generated.it gives error as Too Many Fields Selected(More than 50 Bytes).
Actually i need to create a tabel with Basic Material(WRKST) which has length of 48 bytes.
Is there a solution on how to increase the length so that error is avoided.
There is no such error occuring while crating condition table in V/03Hi,
You can try to use the type string:
form like zscr_data_hdr-form,
werks like zscr_data_hdr-werks,
matnr like zscr_data_hdr-matnr,
verid like zscr_data_hdr-verid,
lot like zscr_data_hdr-lot,
lot_qty like zscr_data_hdr-lot_qty,
udate like zscr_data_hdr-udate,
utime like zscr_data_hdr-utime,
zuser like zscr_data_hdr-zuser,
processed like zscr_data_hdr-processed,
defect like zscr_defect_data-defect,
vornr like zscr_route_data-vornr,
fieldxx type string,
dayst like zscr_data_hdr-dayst,
end of t_data.
So you can save you informations of every fld<n> concatenating their values into fieldxx.
Regards -
How to know the length of internal table...
Hello experts,
How can I know the line size of my internal table since it will be dynamic
and I am just writing my report manually(not ALV) so I will be using sy-uline,
sy-vline, sy-linsz, etc.
So I can declare my sy-ulines according to the total length of my output.
Also, is this possible in ALV:
Header 1 *
Header 2 *
-OUTPUT-
Thanks again!Hi
You can use the DESCRIBE statement to get the number of lines in an internal table:
DATA: num_lines TYPE i.
DESCRIBE TABLE itab LINES num_lines.
num_lines will now hold the number of lines in your table.
I don't believe you can have multiple header rows in ALV you will probably need to group your records or summarise them to achieve a similar result.
Hope this helps
Andy
Message was edited by: Andrew Wright
Sorry, I misunderstood your requirement, using the DESCRIBE TABLE statement will fill the system field sy-tleng with the line size so immediately after doing DESCRIBE... just pass sy-tleng to an integer type variable.
Kind regards
Andy -
How to increase field size in Internal table
Hi friends,
I want to concatenate around 20 fields in one internal table field,
i declared the destination filed as character, now i am able to get around 12 to 13 fileds only , how to increase the length of this field to include all fields ?
or how can i do this ? can any body help me ?
I concatenate this to create a file which will be send as email attachment.
its very urgent issue, kindly help me to resolve as early as possible.
Thanks in advance.
JosephHi,
Use the string data type..
Example
DATA: IT_STRING TYPE STRING OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF WA,
MATNR(18),
WERKS(4),
VBELN(10),
END OF WA.
CONCATENATE WA-MATNR WA-WERKS WA-VBELN INTO IT_STRING.
APPEND IT_STRING.
Thanks,
Naren -
How to increase the length of the identifier?
I want to create a table with a column name as:
"domainnameregistrationassistance"
oracle 9i does not allow me to do this.
as the identifier length is fixed to 30 characters.
how do i increase the length of the identifier?
any help on this will be great!Don't forget that there is a comment space for each table
and column, so calling the column DNR_ASSIST doesnt
revent you from doing ...
COMMENT ON TABLE M_SCHEMA.DNR_ASSIST IS '
Domain Name Registration Assistance'; -
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 increase the length of the subject line in email using FM
Hi
we have maintained 50 characters for the subject line initially, but some subjects are having more than 50 characters. how can we increase the length of the subject line in email.
urgent.
points will be rewarded generousely.Hi Rana,
In this case, you have to create a user defined field of required length under Journal Transactions Header to fill the data.
Regards,
Vijay Kumar
SAP Business One Forums Team -
How to increase the length of a columnin existing publication item
We need to urgently increase the length of three columns in one of the tables that is sent offline as a publication item. I have searched everywhere to see if there is a procedure to see this. I only found process to add/drop columns but not modify to JUST increase the length.
Can we just alter the tables on the server and republish the application? Will that cause any data loss on the client end?
Any help is greatly appreciated.
Thanks
SireeshaI totally forgot about this method. Metalink had it in the headlines today and remembered your question.
This should work for you.
Applies to:
Oracle Lite - Version: 10.2.0.1.0 to 10.2.0.2.0
Information in this document applies to any platform.
Goal
The Goal of this Document is to show the right steps when it is necessary to increase the Column Size for a table
which is used for the Synchronization with Oracle Lite 10GR2
BECAREFULL, it is not supported to change the Column Size or make any Schema Evolution on the Primary key
as The Synchronization Algorithm is based on Primary key
Solution
Create table test_sec (col1 number(10); varchar2(10));
alter table test_sec add primary key (col1));
Create Publication: PUB_TEST_SEC
Create Publication: PI_TEST_SEC: select COL1, COL2 from scott.TEST_SEC fast
Refresh, server wins, weight = 1 and add it to the Publicatio PUB_TEST_SEC
Synchronize this PUB_TEST_SEC
On the Server: increase the col2 WHICH IS NOT A PK, from 10 to 15
alter Table scott.TEST_SEC modify (col2 (varchar2(15));
To get the new Column Size on the olite DB, you need to alter the Publication item too using for example this code:
import java.sql.*;
import java.io.*;
import oracle.lite.sync.Consolidator;
import oracle.lite.sync.ConsolidatorManager;
import oracle.mobile.admin.*;
public class PublicationChange {
public static void main(String argv[]) throws Throwable
DriverManager.registerDriver ((Driver)Class.forName ("oracle.jdbc.driver.OracleDriver").newInstance());
ConsolidatorManager consolidatorManager = new ConsolidatorManager();
consolidatorManager.openConnection("mobileadmin","manager","JDBC:ORACLE:thin:@suppolite1.fr.oracle.com:1521:PROD");
System.out.println("Connected");
try
/*You need to put a Select Statment lightly different from the Publication item,
if you will use the same select statment, it won't take in Account
if you used: select * from owner.table to create the Publication Item
you need to use: select * from owner.table for the alterPublicationItem API
consolidatorManager.alterPublicationItem("PI_TEST_SEC","SELECT * FROM SCOTT.TEST_SEC");
System.out.println("Pub Item recreated");
catch (Throwable e) {
e.printStackTrace();
try
consolidatorManager.closeConnection();
System.out.println("The installation is done!");
} catch (Throwable e) {
Compile and run this java code.
Synchronize
Check your table Description on Oracle Lite Database to verify that this Schema Evolution has worked as expected. -
How to increase the length of the Info object
Hi All
Any one have idea about how to increse the length of the Info object Char(beyond 60). Can you please explain me in detail we are using BI7.0.
Thanks
VaniHello Vani,
You cannot increase the length of an info-object beyond 60 chars.However if you want to store a characteristics data with more than length 60, then you may create separate info-objects
for example: if you need to store 'notes' which might have length more than 60,
then you may create info-objects like notes 1/3 ---store first 60 chars.
notes 2/3 --- store next 60 characters and so on.
Thanx
Priyanka -
How to increase the length of a message in message class
Hi Friends,
Is there any way to increase the length of a message in a message class as the maximum length is 72 chars.
My requirement is I cannot use the Long text option.
Thank YouHI,
We cannot change the message length in the message class
but you can do one thing ,
while giving the message in your msg class write till which you are allowed to and then you put '&'
eg : this is message &
now goto text elements and create a text element suppose T00
and write the remaining text in that text element.
and when you want to display the message do it like
message i00(zmsg_class) with text-T00.
it ll work.
*****Reward if useful,
Thanks & Regards,
Sunny Suren .C. -
How to increase the length of charcteristics
Hi all
I want to concatenate four characteristics into one, but the problem is that when i m doing the same, the length of my concatenated (resulted) char is excceded 60 char. Is there any other way to do the concatenation or can i increase the length of resulted characteristics by any means.
Regards
RiteshHi Ritesh,
You can not increase size of infoobject more than 60 chars.
Have a look, it may helps
/people/sap.user72/blog/2006/05/27/long-texts-in-sap-bw-modeling
Srini -
How to increase the length of message in status bar
Hi all,
I need to show an error message in the status bar of the ABAP editor when an error occurs in the program. But the error message is not fully getting displayed, it is getting truncated. Is there any way to increase the length of the message in the status bar.You can display upto 73 charcters ,if you need more than this then create one text element .
here you can have 132 charcters.
parameters p_matnr like mara-matnr.
start-of-selection.
message s999(z01) with text-005.
Create message class with & & & & & & ( Message short text ).
This way you can show maximum 132 charcters.
Thanks
Seshu -
How to increase the length of Remarks in Journal Vouchers
Hi SAP Guru,
I am new in SAP Business One. Normally our Narration which we feed in Details of Journal Voucher is longer than the space provided. Is there any way to increase the length of Details field in Journal Voucher or Some other way we can cater this requirement.
Thanks for answers in advance
J.S.RanaHi Rana,
In this case, you have to create a user defined field of required length under Journal Transactions Header to fill the data.
Regards,
Vijay Kumar
SAP Business One Forums Team -
How to increase the length of description
Dear Guru's
we want to increase the length of Decription field in thBOM Item line 1 item line 2.can we increase the length.presently its having 40 characters capacity.
Thanks & Rgds
Pankaj Agarwal1.I dont think this is possible as this is a standard SAP requriement.
2.check the data eleaement -which has the 40 as character lenth.
so it is not recomended to change it.
Solution
3.You can use the ItemLongTEXT - which doesnt have any restriction in the lenght.
so dont change the standard setting use the itmelONGTEXT this should solve ur issue
Reg
Dsk
Edited by: SatheeshkumarD on May 8, 2008 11:01 AM -
How to increase the length of selection texts
Hi to all..
please do a favour......
My problem is ,I am not able to enter long text in SELECTION TEXTS after certain length ,but we need long texts .So what I have to do to enter long texts..
plz respondHi Suribabu,
In SE63 We can increase the length of the text.
There is one option called Praposal,Edit Icon, There you can increase the length Max 255(see the Data element LXEUNITLIN) of the selection text.
Regards
Bhavani
Maybe you are looking for
-
Ipod Shuffle 512MB doesn't show in Windows
My problem is that I was given an 512MB iPod Shuffle that does not seem to play anything while only blinking green and orange when you push the play button. I've been attempting to search a means of fixing this problem throughout the internet, but no
-
What are the maximum temperatures for my MacBook Pro?
I have this MacBook Pro (3,1). I know there are maximum temperatures at which the system will shut itself down in order to prevent damage. I know this because I have seen it happen a couple of times When I run Windows, apparently the OS doesn't care
-
Pass parameter from report to report generates error
I am new to Portal. Please help me with this one. I created two reports using report wizard. Report A lists termination infor group by leaving reasons. Report A takes two parameters: p_termination_date_from, p_termination_date_to. When Report A is re
-
I took the plunge and upgrade my ipad and 6 + to IOS 8.3. I am no long able to connect to the exchange server at my office. Does anyone have a hint or solution? TIZ
-
How to see my photos on iCloud Photo Library
I'm online in iCloud.com on my iPad Air 2 running iOS 8.1.3, with iCloud photos optimized. How can I see my photos