Deletion of digit in internal table field
Hi friends,
i have internal table itab.That itab contains the field A the contents of a is
"@01' i want to delete that @ before uploading.Where can i put that logic after uploading function or anywhere? and tell me the best logic to delete that @.
Thanks for all.
Hi Bharat,
data : temp(20) .
loop at itab.
Temp = itab-A+1(*). "suppose itab-A is having @01 then temp will contain 01
itab-A = Temp.
modify itab.
clear temp.
endloop.
Reward points if helpful.
Regards,
Hemant
Similar Messages
-
How to Delete a Column in Internal Table
Hi All,
Does any one know ,How to Delete a Column in Internal Table?Hi,
For deleting the column in the internal table, you have to eliminate the field which you want to delete.
loop at itab into wa.
move corresponding wa to wa1.
append wa1 to itab1.
clear wa1.
clear wa.
endloop.
wa1 is the workarea without the field which you want to delete.
itab1 is the internal table which consists of the deleted column. -
How to delete records from dynamic internal table.
Hi Experts,
Need urgent help!!!
Issue is with Dynamic internal tables.
Below is code written by me :
FORM select_query USING Lw_tabnam
TYPE t682i-kotabnr.
DATA : lw_line TYPE REF TO data,
lw_line1 TYPE REF TO data.
CREATE DATA Lw_line TYPE (lw_TABNAM).
ASSIGN Lw_line->* TO <WA_tbl>.
CREATE DATA LW_LINE TYPE STANDARD TABLE OF (Lw_tabnam)
WITH NON-UNIQUE DEFAULT KEY.
ASSIGN Lw_line->* TO <TBL>.
SELECT * FROM (Lw_tabnam)
INTO CORRESPONDING FIELDS OF TABLE <TBL>
WHERE (t_keys).
Endform.
code is working fine.
here even the table name and where condition are dynamic,everything is fine upto this point.
Now i have to delete some record from <TBL> based on some conditons.
for ex : ( here lc_fieldname is KUNNR)
loop at t_kunnr.
lw_tabix = sy-tabix.
Read table <tbl>
with key (lc_fieldname) = t_kunnr-kunnr ASSIGNING <wa_tbl>.
If sy-subrc = 0.
*Delete
delete <tbl> from <wa_tbl>
delete <tbl> index lw_tabix.
Endif.
Endloop.
The above delete statement doesn't work ,even we can't use index as it gives a syntax error " something related to "index is not allowed in standard table or hash table.
Can you help me ab't how to delete records in Dynamic internal table?
Other option that i am thinking of is to create a static table of type dynamic table.
means, data itab type standard table of <tbl> .I know the syntax is wrong ,however is there any way to do this?
Thanks in advance ,
If you have any suggestion ab't this then do let me know.
bye,
Gaurav.Hi
I wrote this code and it works fine:
DATA LW_TABNAM(10) VALUE 'LFA1'.
DATA : LW_LINES TYPE REF TO DATA,
LW_LINE TYPE REF TO DATA.
FIELD-SYMBOLS: <TABLE> TYPE TABLE,
<WA> TYPE ANY.
CREATE DATA LW_LINES TYPE TABLE OF (LW_TABNAM)
WITH NON-UNIQUE DEFAULT KEY.
ASSIGN LW_LINES->* TO <TABLE>.
CREATE DATA LW_LINE TYPE (LW_TABNAM).
ASSIGN LW_LINE->* TO <WA>.
DO 10 TIMES.
APPEND INITIAL LINE TO <TABLE>.
ENDDO.
SY-TABIX = 4.
DELETE <TABLE> INDEX SY-TABIX.
WRITE SY-SUBRC.
I hope it help you
Max -
Deleting blank spaces in internal table
Hi Gurus,
I want to delete the empty spaces of a particular field in internal table.I used condense and shift statements but didnt work because the work area value is already condensed.I am not sure why the internal table field is having so much of empty spaces to its left.It's a character field with length 60.
Please suggest.Hi,
This is the rellevant code
LOOP AT IT_HIER INTO WFL_HIER.
WFL_FINAL-NODEID = WFL_HIER-NID.
WFL_FINAL-IOBJNM = WFL_HIER-IOBJ.
WFL_FINAL-NODENAME = WFL_HIER-NNAME.
WFL_FINAL-PID = WFL_HIER-PID.
condense wfl_hier-desc.
WFL_FINAL-DESCRIPTION = WFL_HIER-DESC.
SHIFT WFL_FINAL-DESCRIPTION LEFT DELETING LEADING SPACE.
APPEND WFL_FINAL TO E_T_DATA.
CLEAR WFL_FINAL.
CLEAR: WFL_HIER,OUT.
ENDLOOP.
The problem is not with the work area.
Say if I have a value apple in the work area wa, (wa - 'apple').
It doesnt have any leading sapces to the left.
But when I am appending it to the internal table it gets posted at the last say like this (it - ' apple'.
It occupies the last five characters.
Not sure how to resolve this. -
Regarding Internal Table Field Validation [Modification]
Hi All,
I have a small issue with formatting of a field.
The Field is POTX1 - it would get the value as 'New MT-EPPE0097-COMP02',
Means i have one internal table field as i_error-POTX1 in that some times we get value as 'New MT-EPPE0097-COMP02'.
Whenever i get 'New' literal in that internal table field i have to remove that literal from that internal table field. And Left Justify the remaining part of the field.
Ex: 'New MT-EPPE0097-COMP02'
should become 'MT-EPPE0097-COMP02'.
For this first i have to find wether 'New' Literal exists in the Internal table field or not then i have to remove it.
Can anybody tell me how can i solve this issue.
Thanks in advance.
Thanks & Regards,
Rayeezuddin.Hi,
Take a look :
loop at i_error.
if i_error-potx1(3) = 'New'
w_potx1 = i_error-potx1.
i_error-potx1 = w_potx1+3(37).
MODIFY i_error.
endif.
ENDLOOP.
Regards,
Erwan.
Message was edited by: Erwan LE BRUN -
Assigning value to Field - Symbol ( which is type of internal table field )
Hi All,
I am facing problem to assign the value to a field symbol. My requirement is creating a dynamic internal table and populate values into that internal table, so that i can display the values .
I am having a structure with fields like status , Plant1 name , Plant2 name.....Plant n .
So i declared an internal table it_tab with this structure.
I am having one more table which having number of records for Plant1 ,Plant 2 ,....Plant n based on some condition.
I need to count the number of records for Plant1 and i need to put in the internal table it_tab.
For this i created field-symbol .
Here, t_deployment table will have the plants 1,2,3...and
t_devobject will have some records for these plants.
LOOP AT T_DEPLOYMENT.
clear w_count.
LOOP AT T_DEVOBJECT WHERE ZDEPLOYMENT = T_DEPLOYMENT-DOMVALUE_L AND
ZADSTATUS = '10'.
w_count = w_count + 1.
ENDLOOP.
concatenate 'it_tab-' t_deployment-domvalue_l into var_bet_name.
assign var_bet_name to <bet_var_name>.
now my internal table field i.e. it_tab-plant1 came into <bet_var_name> . But i want to assign a value for it.
at last what i need is it_tab-plant1 = w_count.
whaterver the w_count has value that needs to assign to it_tab-plant1. But i don't want to assign directly it it_tab-plant1. I want to assign dynamically. Because tommorrow some more plants added to t_deployments , i don't want to make changes to my program. It should take care....w/o changing the program.
I tried the following statement.
(<bet_var_name>) = w_count. But its not working.
Please let me know how i can get this.
Thanks in Advance.
Pavan.Hi pavan,
As ur requirement is creating a dynamic internal table,
try the following way,
remember the fieldcat should be of type LVC not SLIS.
BUILD LT_LVCFIELDCAT in a way that, the value from the internal table becomes the fieldname
ex:-
loop at it_models INTO WA_MODELS.
LS_LVCFIELDCAT-FIELDNAME = WA_models-MODEL.
LS_LVCFIELDCAT-SELTEXT = WA_models-MODEL.
append ls_lvcfieldcat to lt_lvcfieldcat.
endloop.
DATA: DREF TYPE REF TO DATA,WA_REF TYPE REF TO DATA.
FIELD-SYMBOLS: <TEMP_TAB> TYPE TABLE, <TEMP_WA> TYPE ANY.
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = LT_LVCFIELDCAT
IMPORTING
EP_TABLE = DREF.
ASSIGN dref->* TO <TEMP_TAB>.
now basing on the fieldcatalog <temp_tab> is build.
NOW FILL <TEMP_TAB>.
WHILE FILLING, ASSIGN COMPONENT IDX/NAME.....
this statement will be very usefull.
i hope this will be help full.
pls reward the points if it helps u.
regards
Hyma -
How to populate dynamic internal table fields with data??
Hi Folks,
How to assign a particular internal table field to a dynamically assigned internal table?
I have an excel sheet, and i upload the excel sheet data into an internal IT_EXLOAD table using FM ALSM_EXCEL_TO_INTERNAL_TABLE
Now i created a dynamic internal table which has the same column as in my DB table.
I have to fill the dynamically created Internal table with the IT_EXLOAD data dynamically.
Suppose in future if i add some field in DB table and for that field if i add some column in excel sheet there is no need to change in the program.
Looking for reply...
Best Regards,
Sayakhi,
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_path
i_begin_col = '1'
i_begin_row = '2'
i_end_col = '2'
i_end_row = '1000'
TABLES
intern = intern
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
*declare intern_tmp as internal table tb_data in wich you want the data
*and declare a field symbol <fs_123>
LOOP AT intern.
ASSIGN COMPONENT intern-col OF STRUCTURE
intern_tmp TO <fs_123>.
IF NOT <fs_123> IS ASSIGNED.
CLEAR intern.
CLEAR intern_tmp.
CONTINUE.
ENDIF.
<fs_123> = intern-value.
AT END OF row.
CLEAR tb_data.
MOVE-CORRESPONDING: intern_tmp TO tb_data.
APPEND tb_data.
CLEAR intern_tmp.
ENDAT.
CLEAR intern.
ENDLOOP.
**paste this code and you can see the data in ur tables dynamically.
Thanks
Nitin Sachdeva -
An internal table field has been defined too small
Hi,
We are getting a dump when trying to get the Financial Statements.
The error in the dump is u201CAn internal table field has been defined too smallu201D.
The field with the problem is u201CYou should define the field "HSL03" larger in program "SAPLFAGL_GLT0".The maximum size allowed for fields of type P is 16 (31 digits).
Itu2019s caused by a list of documents where the exchange rate must to be u201D/699,94001u201D but it was entered without the forward slash and it caused very big numbers
The biggest number in one document is 99,401,074,527.31 USD
The sum of all them is 13,008,701,915,208.50
Any ideas to fix this?
Thanks in advance
Jorgehave you reversed those documents with fb08 and post it with the correct exchange rate???
have you searched in SMP for similar problems - I think you've to correct the DB-values- but only in agreement with your audit firm / revision
A.
Edited by: Andreas Mann on Apr 6, 2010 3:13 PM
Edited by: Andreas Mann on Apr 6, 2010 3:16 PM -
Accessing Dynamic Internal table fields
Hello All,
I have one internal table ep_tabx having 138 columns whose data is getting displayed
by using function module reuse_alv_grid_display.
Now my query is, i have created one custom button on the appl toolbar to download ep_tabx data.
IF the user changes the the layout of the output at runtime and then presses that custom button
then i have created one dynamic internal table using call method cl_alv_table_create=>create_dynamic_table suppose <dyn_table> whose struc will be that of
dynamic fieldcatalog returned by using FM REUSE_ALV_GRID_LAYOUT_INFO_GET.
And then I have put a loop on the int table ep_tabx and move corresponding to the int table
<dyn_table>. But when i download the <dyn_table> data through GUI_DOWNLOAD the
date fields data is not getting downloaded correctly. I have 4 date fields in my ep_tabx.
In the alv grid output the date is getting displayed like 08/30/2004(ie mon/date/yr) but in download
file it comes like 20040830(ie yr/mon/date and that too without /).How to access the dynamic
internal tables fields separately so asto convert them in the pgm before the download.
Kindly Help.
Thanks in advance.
MansiHi,
Search in SDN you would get loads of info on accessing dynamic itab's .
in order to convert your date format use WRITE stmt to convert the value in your itab before passing it to download FM.
Regards,
Raghavendra -
Coloring of Particular Cells in a dynamic internal table(field symbols)
Hi,
I have a requirement to introduce color into some particular cells in a dynamic internal table(Field symbol) based on some conditions.I know that color can be introduced at cell level in the case of static internal table.But, can anybody tell me whether it is possible to introduce color to particular cells in the dynamic internal table(Field Symbol) .Please suggest me on this issue.
Thanks in advance,
RajeshHi,
This is the sample coding for the colour cell report.
Kindly go through it. It will helps u.
REPORT YMS_COLOURTEST .
DATA: BEGIN OF TP OCCURS 10, ID, NR(8), TEXT(255), END OF TP.
DATA: LENGTH TYPE I VALUE 8, " Length of list
TESTSTRING(15) TYPE C VALUE '012345678901234',
WIDTH TYPE I. " Width of list
DATA: TXT_REPORT LIKE DOKHL-OBJECT.
START-OF-SELECTION.
PERFORM HEADING.
PERFORM OUTPUT_BODY.
FORM HEADING.
FORMAT INTENSIFIED OFF. " Remove any INTENSIFIED
ULINE AT (WIDTH). " Upper frame border
FORMAT COLOR COL_HEADING INTENSIFIED." Title color
WRITE: / SY-VLINE. " Left border
WRITE: 'No |Colour |intensified |intensified off|',
'inverse' NO-GAP.
WRITE: AT WIDTH SY-VLINE. " Right border
ULINE AT (WIDTH). " Line below titles
FORMAT COLOR OFF.
ENDFORM.
FORM OUTPUT_BODY.
DO LENGTH TIMES.
PERFORM WRITE_LINE USING SY-INDEX.
ENDDO.
ENDFORM.
FORM WRITE_LINE USING COUNT TYPE I.
DATA: HELP(14) TYPE C,
COUNT1 TYPE I.
COUNT1 = SY-INDEX - 1.
WRITE: / SY-VLINE NO-GAP.
WRITE: (4) COUNT1 COLOR COL_KEY INTENSIFIED NO-GAP.
WRITE: SY-VLINE NO-GAP.
CASE COUNT1.
WHEN '0'.
HELP = 'COL_BACKGROUND'.
WHEN '1'.
HELP = 'COL_HEADING'.
WHEN '2'.
HELP = 'COL_NORMAL'.
WHEN '3'.
HELP = 'COL_TOTAL'.
WHEN '4'.
HELP = 'COL_KEY'.
WHEN '5'.
HELP = 'COL_POSITIVE'.
WHEN '6'.
HELP = 'COL_NEGATIVE'.
WHEN '7'.
HELP = 'COL_GROUP'.
ENDCASE.
WRITE: HELP COLOR COL_KEY INTENSIFIED NO-GAP.
WRITE: SY-VLINE NO-GAP.
WRITE: TESTSTRING COLOR = COUNT1 INTENSIFIED NO-GAP.
WRITE: SY-VLINE NO-GAP.
WRITE: TESTSTRING COLOR = COUNT1 INTENSIFIED OFF NO-GAP.
WRITE: SY-VLINE NO-GAP.
WRITE: TESTSTRING COLOR = COUNT1 INVERSE NO-GAP.
WRITE AT WIDTH SY-VLINE NO-GAP.
ENDFORM.
Thanks,
Shankar -
How to check two internal table fields
Hi all,
I need to check two internal table fields are equal or not means which statement i can use.
Not internal table ,table contents i need to check i.e
it1-pernr = it2-pernr.
like this
if i put loop it'll check one table field for one loop.
if i put two loop means some fields reflecting 2 in it1 then it'll pring 4 times like that.i want to print whatever in internal table only .
pernr(0001) two times there in it1 means
it1-pernr = it2-pernr then
it's printing
0001
0001
0001
0001
like this but actually in it1 only two records.
Anybody know solution.tell me.
Thanks
Regards,
NandhaHi,
code for your view
data : begin of it1 occurs 0,
z_pernr like pa9012-pernr,
z_fac_c like pa9012-zz_fac_c,
end of it1.
data : it2 like Zsc1 occurs 0 with header line,
It1 data
pernr FAC C
0001 5555
0001 5555
0002 4444
0003 3333
0006 8888
It2 data
pernr FAC C
0001 5555
0001 5555
0005 6666
0003 3333
output(My code)
loop at it2 .
loop at it1 where pernr = it2-pernr.
write:/01 it1-1pernr,
10 it1-z_fac_c.
endloop.
endloop.
out put i need.
0001 5555
0001 5555
0002 4444
0003 3333
Thanks,
Nandha -
Regarding passing blank characters to internal table field
Hi All,
I have small issue.
Actual issue is
I am having one internal table field as <b>oper_table-arbid</b> in the program i will actually pass first 4 characters of that field into another internal table <b>i_download_operation-arbid.</b>
Then if <b>oper_table-arbid</b> is blank i need to pass
4 blank characters into <b>i_download_operation-arbid.</b>
Can anybody tell me how can i do it.
Code is like this
IF oper_table-arbid NE space.
MOVE oper_table-arbid+0(4) TO i_download_operation-arbid.
ELSE.
I need to pass 4 blank char's to i_download_operation-arbid
ENDIF.
oper_table-arbid is of 8 char length & i_download_operation-arbid is of 4 char length.
Can any body tell me what i need to do here.
Thanks in advance.
Thanks & Regards,
Rayeez.hi ,
shaik.
data: var(8) type c value 'abcdefgh'.
write var.
data: bar(8) type c value 'ijkl',
p1(8) .
move bar to p1.
write:/ p1 right-justified.
just execute the program and see the o/p.
if u r trying to pass character then default position is left-justfied .
so u need to explicitly say right-justified so it will take positions 5,6,7,8.
so here u need append blank spaces .
after seeing the o/p u will hav a clear picture .
vijay. -
Header to internal table fields
Hi All,
How can I add header description to the internal table fields and download this internal table to desktop as EXCEL form.
I want to show heading in the first line of the excel and then 2 - 3 blank lines and then next line should be populated with DATE and Exec. Time, then 2-3 blank lines , then the data with the header description to be displayed.
My sample internal table data is as below,
John M 12 2344
Thomas M 17 8960
Lin F 10 8467
Jan M 12 4323
I need to add, description as NAME above John, Thomas, Lin etc.
as GENDER above M,M,F etc.
as CODE above 12, 17,10 etc. and
as EXTENTION above 2344, 8960,8467 etc
final execl sheet should be as below,
COMPANY DATA
DATE 28 - 08 - 2009 TIME 12:32
NAME GENDER CODE EXTENTION
John M 12 2344
Thomas M 17 8960
Lin F 10 8467
Jan M 12 4323
Please let me know, how to do this.
Thanks in advance ,
SabuHi,
Kindly go through this sample code below:
"Create T_Head internal table with the required structure for the header
*func mod to download header and contents to the given path
call function 'GUI_DOWNLOAD'
exporting
write_field_separator = 'X'
filename = v_pathname "path entered by the user
tables
data_tab = t_head. "Header Internal table
refresh t_head.
clear t_head.
call function 'GUI_DOWNLOAD'
exporting
* BIN_FILESIZE =
filename = v_pathname
filetype = 'ASC'
append = 'X' "Here by giving 'X', header will be appended in the download int table
write_field_separator = 'X'
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
* IMPORTING
* FILELENGTH =
tables
data_tab = itab
* FIELDNAMES =
exceptions
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
others = 22
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endif.
Hope it helps
Regards
Mansi -
What are internal table fields?
hi sdn,
Somebody asked me what are the internal table fields?hi,
data or varaibles that u declare inside the internal table are internal table fields
eg
BEGIN OF itab_final , "OCCURS 0 ,
mtart LIKE mara-mtart ,
wwghb1 LIKE t023d-wwghb , " DIVISION DESCRIPTION
wwgha LIKE t023d-wwgha , " MAJOR CATEGORY
wwghb LIKE t023d-wwghb , " MAJOR CATEGORY DESCRIPTION
wwgpa LIKE t023d-wwgpa , " CATEGORY
matkl LIKE mara-matkl , " MERCHANDISE CATEGORY
ean11 LIKE mara-ean11 , " International Article Number (EAN/UPC)
numtp LIKE mara-numtp ,
END OF itab_final .
mtart wwghb1 wwgha wwghb wwgpa matkl ean11 numtp . these are internal table fields
Regards,
pankaj -
Internal Table field description.
Hi everybody, I need in runtime the datails of a internal table field, for example the description of the field's data type. Do you know how can I get that information? Thanks and Regards.
Use RTTI .
[http://www.liveabap.com/index.php?abapid=11|http://www.liveabap.com/index.php?abapid=11]
Maybe you are looking for
-
Hey, I just bought the third-generation iPad. I have been reading on the iPad 2 for a year now, and have hundreds of books in my library. Because I'm such an intense reader, and value my highlights, it upset me when I bought the new iPad, synced it t
-
Hi, I am trying to run a long running process, by redirecting to the LongRunningView using the code below. But its throwing exception Can anyone please help string strCurrentUrl = SPUtility.OriginalServerRelativeRequestPath; strCurrentUrl = strCurren
-
I've attempted disabling all firewalls (both PC and anti-virus), disabling ipv6, rebooting the airport unit itself, but no luck. I'm not prompted with an error, however, as itunes is attempting to connect the airplay icon turns blue, and when it does
-
Flash in PDF: linking to another page?
Hi! I need to add some interactive flash elements to a PDF, including some buttons that should make que document jump to a given page. Can't find any documentation on this. How can it be done? thanks
-
Shell script to start, stop and restart a JAR under linux
Hi everyone, Does anyone have idea to write a shell script to start, stop and restart a JAR under linux? it can also indicate a method or parameter? Thanks! this JAR inculdes a class with main method like this: public class Client(){ public Client(St