Checking naming convention of internal tables in code inspector
Can anyone please explain how in the code inspector can I check names of internal tables (like it_) that I use in a report program ? I know that I can specify it_ in Programming Convention -> Naming Convention->Program Global -> Data but this entry is not specific to internal tables as it also applies to variables and work areas. Apart from this is there any entry I can maintain in the Extended Naming Conventions for Programs(introduced in ECC 6.0)? Kindly reply at the earliest.
Hi,
Check these links for implementing the custom conventions in the code inspector
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/nw/how%20to%20build%20a%20new%20check%20for%20the%20code%20inspector
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/evaluating%20the%20quality%20of%20your%20abap%20programs%20and%20other%20repository%20objects%20with%20the%20code%20inspector
hope it helps you.
Thanks!
Similar Messages
-
Can anyone tell me the naming conventions for PSa tables
hi all,
After the data is loaded into the psa. how to look at the records that are there in psa. And can anyone tell me the naming conventions for psa tables.
like BIC/????
thanxs in advance
regds
hariHi Hari,
You want to know the naming convention of PSA table. For that there is a simple technique try this.
Go to - T code SE11
In the database table check box give /BI* and click search
next window in the Description Text box give the r data source name(master) like
YIO_ID_ATTR which is assigned to infosource. then click OK.
then you get the psa table structure.
You can take structure and check in the T code SE 11
Hope this is fine.
Regards
Sreekanth -
Capturing check box value into internal table
Hi all,
I am displaying the output including check box through following internal table.
The checkbox is displayed before every record.
<b>LOOP AT it_qals.
WRITE:/ it_qals-t_val AS CHECKBOX,
5 it_qals-werk,
12 it_qals-prueflos,
30 it_qals-matnr,
50 it_qals-charg,
62 it_qals-lagortchrg.
hide: it_qals .
ENDLOOP.</b>
I selected some of the records through check the checkboxes. when i click the <b>PUSHBUTTON TRANSFER</b>, those selected records only should transfer. i don't know how to modify the internal table with latest checkbox values. Initially checkbox values are blank.
Is there any solution except Function Module.
i would appreciate an earlier reply.
Regards
PrabhuHello,
Create one more table and transfer your entries into new table.
I have attached my code for you.
Regards,
Naimesh
REPORT ZTEST_NP NO STANDARD PAGE HEADING.
TABLES: MARA, MAKT.
DATA: BEGIN OF IT_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MAKTX LIKE MAKT-MAKTX,
SEL,
END OF IT_MARA.
DATA: IT_MARA1 LIKE IT_MARA OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
SET PF-STATUS 'ZTEST'.
PERFORM GET_DATA.
PERFORM WRITE_DATA.
TOP-OF-PAGE.
PERFORM HEADER.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'SELECT'.
PERFORM GET_DATA_SELECTED.
PERFORM WRITE_DATA_SELE.
WHEN 'SELALL'.
PERFORM SELECT_ALL.
SY-LSIND = 0.
PERFORM HEADER.
PERFORM WRITE_DATA.
WHEN 'DESEL'.
PERFORM DESELECT_ALL.
SY-LSIND = 0.
PERFORM HEADER.
PERFORM WRITE_DATA.
ENDCASE.
*& Form GET_DATA
FORM GET_DATA.
SELECT MATNR
INTO TABLE IT_MARA
FROM MARA
WHERE MATNR LIKE 'IN10020%'.
LOOP AT IT_MARA.
SELECT SINGLE MAKTX
INTO IT_MARA-MAKTX
FROM MAKT
WHERE MATNR = IT_MARA-MATNR
AND SPRAS = SY-LANGU.
MODIFY IT_MARA.
CLEAR IT_MARA.
ENDLOOP.
ENDFORM. " GET_DATA
*& Form WRITE_DATA
FORM WRITE_DATA.
ULINE /(50).
LOOP AT IT_MARA.
WRITE: / '|' NO-GAP, IT_MARA-SEL AS CHECKBOX NO-GAP,
'|' NO-GAP, (10) IT_MARA-MATNR NO-GAP,
'|' NO-GAP, (35) IT_MARA-MAKTX NO-GAP,
'|' NO-GAP.
ENDLOOP.
ULINE /(50).
ENDFORM. " WRITE_DATA
*& Form HEADER
FORM HEADER.
ULINE /(50).
WRITE: / '|' NO-GAP, (1) ' ' NO-GAP,
'|' NO-GAP, (10) 'Material' NO-GAP,
'|' NO-GAP, (35) 'Description' NO-GAP,
'|' NO-GAP.
ENDFORM. " HEADER
*& Form GET_DATA_SELECTED
FORM GET_DATA_SELECTED.
DATA: L_CNT TYPE I.
DO.
L_CNT = L_CNT + 1.
READ LINE L_CNT FIELD VALUE IT_MARA-MATNR INTO IT_MARA1-MATNR
IT_MARA-MAKTX INTO IT_MARA1-MAKTX
IT_MARA-SEL INTO IT_MARA1-SEL.
IF SY-SUBRC = 0.
IF IT_MARA1-SEL = 'X'.
APPEND IT_MARA1.
CLEAR IT_MARA1.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDFORM. " GET_DATA_SELECTED
*& Form WRITE_DATA_SELE
FORM WRITE_DATA_SELE.
PERFORM HEADER.
ULINE /(50).
LOOP AT IT_MARA1.
WRITE: / '|' NO-GAP, IT_MARA1-SEL AS CHECKBOX,
'|' NO-GAP, (10) IT_MARA1-MATNR NO-GAP,
'|' NO-GAP, (35) IT_MARA1-MAKTX NO-GAP,
'|' NO-GAP.
ENDLOOP.
ULINE /(50).
ENDFORM. " WRITE_DATA_SELE
*& Form SELECT_ALL
FORM SELECT_ALL.
LOOP AT IT_MARA.
IT_MARA-SEL = 'X'.
MODIFY IT_MARA.
CLEAR IT_MARA.
ENDLOOP.
ENDFORM. " SELECT_ALL
*& Form DESELECT_ALL
FORM DESELECT_ALL.
LOOP AT IT_MARA.
IT_MARA-SEL = ' '.
MODIFY IT_MARA.
CLEAR IT_MARA.
ENDLOOP.
ENDFORM. " DESELECT_ALL -
How to check duplicate entries in internal table??
Dear Friends,
How to check duplicate entries in internal table??
Exp: In my internal table if I am having the same records more then ones then I need to print the error message, here I am using steploop for selecting the values from screen, and the values are coming into my internal table if user enter the same value more then ones I need to print the error message.
Thanks,
SridharHi,
After storing the data into internal table say ITAb, move the data into another internal table.
t_dup[] = itab[].
LOOP AT itab.
count1 = count1 + 1.
itab-count1 = count1.
MODIFY itab.
ENDLOOP.
LOOP AT t_dup.
count2 = count2 + 1.
t_dup-count2 = count2.
MODIFY t_dup.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM itab.
LOOP AT t_dup.
record_dup = 'N'.
READ TABLE itab WITH KEY count1 = t_dup-count2.
IF sy-subrc = 0.
record_dup = 'Y'.
ENDIF.
IF record_dup NE 'Y'.
t_dup-message = 'DUPLICATE ENTRY'.
t_dup-flag = 1.
MODIFY t_dup.
ENDIF.
ENDLOOP.
Use this sample code.
Reward pts if it is helpfull.
Regards
Srimanta -
NAMING CONVENTION OF X$ TABLES IN 10GR2
Hi All
I want to know if oracle follows any
naming convention to x$ tables ...and also for the column
names .if yes what is it.
Thanks in Advance.....Well, I would second to Hemant that for these structures ( they are not tables exactly) , whatever convention Oracle has, its with it only. That said, the tables basically are the representations of the layers that work with the Kernel of Oracle. So the table names follow or represnt the layer on which they are based on. For example, X$KCBWDS is Kernel Cache(cache layer) Buffer Working Set Descriptor. So would be the column names within them , representing what the layer is doing .
In anyways, its not really important to know the convetion, yes to some extent meanings of these strucutres may help butthat too is limited to some extreme cases only.
HTH
Aman.... -
Checking the entries in internal table with Ztable
Hi ,
Please go through the below requirement and please give me the code.
I am having an internal table ITAB with 5 entries and also having a Ztable with 10 entries. I should check weather any of the entry in the internal table ITAB is present in the Ztable or not?
Please give me the code
Thanks in advance,
AjaySelect f1 f2 f3 from ztable into itab1 "say ur ztab entries
*now say ur itab contents are in itab2.
sort itab2 by f1 " set the primary key in both .
delete adjacent duplicates from itab2 comparing f1.
Loop at itab2.
read table itab1 with key f1 = itab2-f1.
if sy-subrc eq 0 .
write:/ 'Entry exists '.
endif.
endloop.
On every sy-subrc hit i.e eq 0 write statement tells u a hit and no of times = number of the entries.
Vijay. -
Declare Internal Table in Code or in Data Dictionary...Opinions needed?
Is it better to define your internal table and all of its fields in a begin of/end of declaration stmt in your code's data definitions. Or, is it better to create a structure in the Data Dictionary, which means one line of code in your program? Why does one choose the method they prefer?
I am thinking it is best to declare in Data Dictionary, especially since ABAP is now leaning towrds objects. However, I am seeing a lot of field by field definitions in programs. I am very interested in how most programmers accomplish this and why.
Thank-YouI would say that if the internal table is to be used in more than one program, then I would create a structure and/or table type in the ABAP dictionary. If it is to be used in just one program, then I would define it locally.
Regards,
Rich Heilman -
Checking every entry into internal table
hii i have taken material from lips in first internal table and material from vepo in second internal table
now i want only those entries in second table which r present in first table.
one delivery can have multiple materials in it.
please provide logic.. <REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 12, 2008 2:45 PMLOOP AT itab2.
lv_index = sy-index.
READ TABLE itab1 WITH KEY matnr = itab2-matnr.
IF sy-subrc NE 0.
DELETE itab2 AT INDEX lv_index.
ENDI.
ENDLOOP.
At the end of loop itab2 will have only entries available in itab1.
Regards
Sudhir Atluru -
How to create new check for SELECT* , Naming conventions etc..
Hi all,
I would like have a solution for the below checks are possible or not in ABAP - CODE INSPECTOR. If possible can you please give me the solution..
a). Performance checks i.e, SELECT* , LOOP without field strings, FOR ALL ENTRIES IN SELECT STATEMENT.
b). Custom naming conventions.
c). to check if further modularization can be done in the program,
d). also the coding standards.
PLEASE help me , i am struck with it for long time in getting the solution...> a). Performance checks i.e, SELECT* , LOOP without field strings, FOR ALL ENTRIES IN SELECT STATEMENT.
> b). Custom naming conventions.
> c). to check if further modularization can be done in the program,
> d). also the coding standards.
the code inspector allows the creation of new checks, you should consult the documentation how to do it.
The main problem of the code inspector are hits, which are actually no problem. And I think this is a problem with your checks:
+ SELECT* this is no performance problem, only in cases when the table is really wide then a field list makes sense, i.e your check
will find a lot of false hits
+ LOOP without field strings ... you mean fs =field symbols, same as with SELECT *
+ FOR ALL ENTRIES IN SELECT STATEMENT ???? FOR ALL ENTRIES is fine
+ Custom naming conventions ... hmmm be more precise, I think it can be hard
+ to check if further modularization can be done in the program,
before you want to program can you please explain how you check manually .... I would be interested
+ also the coding standards. .... what is that? -
Hi,
What is the naming conventions in the table which starts with i.e. ( V_, VV_,VC_)
Regards
RajeshHi Rajesh,
Views will start with the value "V_".
VV should be view variant not sure. You can post this question in abab forum.
Regards,
Brinda -
Extended Program Check results in Internal table
HI,
How to get the Extended program check results into an internal table .
Thanks in advance.
ManoharHi,
Try using function module EXTENDED_PROGRAM_CHECK
Make sure the import parameter TEST_ALL = 'X' (By default it is not checked
Regards -
Hello,
I find the following table naming conventions from the manuals BW systems
/BIx/E<InfoCube> - E Fact table
/BIx/F<InfoCube> - F Fact table
/BIx/D<InfoCube> - Dimension table
I have the following questions
1.Could you please let me know whether all the tables starting with '/BIx/D' will be dimension table only or there could be other tables ?
2. From the description field in SE11, I could not find the details for some of the tables.Please let me know whether there is any other way to identify the table type(Dimension,Fact..)
3. Also I would like to know the naming convention for aggregate tables.
Thanks,
AravinthanHi ,
http://www.learnsapbw.blogspot.com/2008/03/naming-convention-in-sap-bw.html
Antonio Voce -
Error in uploading excel sheet data into internal table
Dear all,
i am facing problem when uploading data from excel. i used KD_GET_FILENAME_ON_F4.i select the file and pass on to ALSM_EXCEL_INTO_INTERNAL_TABLE.and i get the ERROR....
Illegal type when transferring an internal table to a FORM. this is my code .
types : begin of ty_mm01,
matnr like rmmg1-matnr,
mbrsh like rmmg1-mbrsh,
mtart like rmmg1-mtart,
maktx like makt-maktx,
meins like mara-meins,
matkl like mara-matkl,
bismt like mara-bismt,
spart like mara-spart,
mtpos like mara-mtpos_mara,
end of ty_mm01.
data : tt_mm01 type standard table of ty_mm01,
wa_mm01 like TT_MM01.
data : t_bdcdata like standard table of bdcdata,
t_bdcmsgcoll like standard table of bdcmsgcoll.
constants: begcol TYPE i value 1 ,
begrow TYPE i value 1,
endcol TYPE i value 100,
endrow TYPE i value 32000.
selection-screen : begin of block bdc with frame.
parameter : tfile like rlgrap-filename obligatory.
selection-screen : end of block bdc.
at selection-screen on value-request for tfile.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = 'ZMM_MAT_MAS_BASIC_DATA'
DYNPRO_NUMBER = '1000'
FIELD_NAME = 'TFILE'
STATIC = 'X'
MASK = ',*.xls,'
CHANGING
FILE_NAME = tfile
start-of-selection.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = tfile
I_BEGIN_COL = begcol
I_BEGIN_ROW = begrow
I_END_COL = endcol
I_END_ROW = endrow
TABLES
INTERN = tt_mm01
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks in advanceHi,
Check these FM : KCD_EXCEL_OLE_TO_INT_CONVERT
Report ZPSP_TEST.
data: bdc_DATA like bdcdata occurs 0 with header line,
mess_tab like bdcmsgcoll occurs 0 with header line.
DATA: BEGIN OF ITAB OCCURS 0 ,
tcnt TYPE i, "Table Counter &H0D
WERKS LIKE T001W-WERKS,
BNFPO LIKE EBAN-BNFPO,
MATNR LIKE MARA-MATNR,
MENGE LIKE EBAN-MENGE,
END OF ITAB.
start-of-selection.
PERFORM upload_data.
loop at itab.
perform bdc_dynpro using 'SAPMM06B' '0100'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-BSART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-BSART'
'NB'.
perform bdc_field using 'RM06B-LPEIN'
'T'.
perform bdc_field using 'EBAN-WERKS'
ITAB-WERKS.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'RM06B-EKGRP'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RM06B-BNFPO'
ITAB-BNFPO.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-MATNR(01)'
ITAB-MATNR.
perform bdc_field using 'EBAN-MENGE(01)'
ITAB-MENGE.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'RM06B-EEIND'
record-EEIND_010.
*perform bdc_field using 'RM06B-LPEIN'
record-LPEIN_011.
*perform bdc_field using 'EBAN-EKGRP'
record-EKGRP_012.
*perform bdc_field using 'EBAN-BADAT'
record-BADAT_013.
*perform bdc_field using 'EBAN-FRGDT'
record-FRGDT_014.
*perform bdc_field using 'EBAN-PREIS'
record-PREIS_015.
*perform bdc_field using 'EBAN-WAERS'
record-WAERS_016.
*perform bdc_field using 'EBAN-PEINH'
record-PEINH_017.
*perform bdc_field using 'EBAN-REPOS'
record-REPOS_018.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE(02)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'RM06B-BNFPO'
record-BNFPO_019.
*perform bdc_field using 'EBAN-MATNR(02)'
record-MATNR_02_020.
*perform bdc_field using 'EBAN-MENGE(02)'
record-MENGE_02_021.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'EBAN-MENGE'
ITAB-MENGE_023.
*perform bdc_field using 'RM06B-EEIND'
record-EEIND_024.
*perform bdc_field using 'RM06B-LPEIN'
record-LPEIN_025.
*perform bdc_field using 'EBAN-EKGRP'
record-EKGRP_026.
*perform bdc_field using 'EBAN-BADAT'
record-BADAT_027.
*perform bdc_field using 'EBAN-FRGDT'
record-FRGDT_028.
*perform bdc_field using 'EBAN-PREIS'
record-PREIS_029.
*perform bdc_field using 'EBAN-WAERS'
record-WAERS_030.
*perform bdc_field using 'EBAN-PEINH'
record-PEINH_031.
*perform bdc_field using 'EBAN-REPOS'
record-REPOS_032.
perform bdc_field using 'EBAN-TXZ01'
'BEARING 2"X2"'.
perform bdc_field using 'EBAN-MENGE'
'65'.
perform bdc_field using 'RM06B-EEIND'
'2005/01/03'.
perform bdc_field using 'RM06B-LPEIN'
'D'.
perform bdc_field using 'EBAN-EKGRP'
'M11'.
perform bdc_field using 'EBAN-BADAT'
'2005/01/03'.
perform bdc_field using 'EBAN-FRGDT'
'2005/01/03'.
perform bdc_field using 'EBAN-PREIS'
' 1,120.00'.
perform bdc_field using 'EBAN-WAERS'
'EUR'.
perform bdc_field using 'EBAN-PEINH'
'1'.
perform bdc_field using 'EBAN-REPOS'
'X'.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-TXZ01'
'DRILLING PIPE 10"'.
perform bdc_field using 'EBAN-MENGE'
'75'.
perform bdc_field using 'RM06B-EEIND'
'2005/01/03'.
perform bdc_field using 'RM06B-LPEIN'
'D'.
perform bdc_field using 'EBAN-EKGRP'
'M11'.
perform bdc_field using 'EBAN-BADAT'
'2005/01/03'.
perform bdc_field using 'EBAN-FRGDT'
'2005/01/03'.
perform bdc_field using 'EBAN-PREIS'
' 0.53'.
perform bdc_field using 'EBAN-WAERS'
'EUR'.
perform bdc_field using 'EBAN-PEINH'
'1'.
perform bdc_field using 'EBAN-REPOS'
'X'.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'RM06B-BNFPO'
perform bdc_field using 'BDC_OKCODE'
'&H3DBU'.
*perform bdc_field using 'RM06B-BNFPO'
CALL TRANSACTION 'ME51' USING BDC_DATA MODE 'A'.
endLOOP.
FORM upload_data.
*local variable declaration
DATA : lv_index TYPE i,
l_count TYPE i.
*local constants declaration
CONSTANTS:
lc_start_col TYPE i VALUE '1' ,
lc_start_row TYPE i VALUE '2' ,
lc_end_col TYPE i VALUE '256' ,
lc_end_row TYPE i VALUE '65536'.
*local field symbol declaration
FIELD-SYMBOLS : <lf_s>.
*loacal internal table declaration
DATA : li_intern TYPE kcde_cells OCCURS 0 WITH HEADER LINE.
*refresh internal table for each loop
CLEAR: li_intern,
l_count .
REFRESH li_intern.
to upload the data in excel on the presentation server this function
module converts the data from excel file into an internal table
containing row no col no and value
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename &H3D 'Give file location here'
i_begin_col &H3D lc_start_col
i_begin_row &H3D lc_start_row
i_end_col &H3D lc_end_col
i_end_row &H3D lc_end_row
TABLES
intern &H3D li_intern
EXCEPTIONS
inconsistent_parameters &H3D 1
upload_ole &H3D 2.
checking for data in internal table
CHECK NOT li_intern[] IS INITIAL.
sorting internal table
SORT li_intern BY row col.
collecting data into an internal table
LOOP AT li_intern.
MOVE: li_intern-col TO lv_index.
lv_index &H3D lv_index + 1.
ASSIGN COMPONENT lv_index OF STRUCTURE itab TO <lf_s>.
MOVE : li_intern-value TO <lf_s>.
AT END OF row.
l_count &H3D l_count + 1.
itab &H3D l_count.
APPEND itab.
ENDAT. " at end of row
ENDLOOP. " loop at li_intern
Reg,
Siva
Edited by: Siva Prasad on Jun 1, 2009 8:41 AM
Edited by: Siva Prasad on Jun 1, 2009 4:25 PM -
Delete rows dynmically from internal table
Hi Gurus,
I have got an problem. I have an internal table itab.
Case 1. It has got some 10 rows. I want to delete rows between those two rows containing same field value of a Field 'X'. Here same value of that field could come on 1st and 7th row. Then mean, I need to delete 2nd to 6th row.
It could come in 4th and 10th row. Then I need to delete 5th to 9th row.
Case 2. It has got some 20 rows. Now same I want to delete rows between those two rows containing same field value of a Field 'X'. Here again, same value of that field could come on 1st and 17th row. Mean I will delete 2nd to 16th row. It could come in 7th and 19th row. Then I need to delete 8th to 18th row.Hi Vaibhav
Please find the code, I hope it helps
DATA: BEGIN OF itab OCCURS 10,
val,
END OF itab.
DATA: jtab LIKE itab OCCURS 0 WITH HEADER LINE,
l_ind1 TYPE i,
l_ind2 TYPE i,
l_lines TYPE i,
l_flg.
itab-val = 'a'.
append itab.
itab-val = 'b'.
append itab.
itab-val = 'c'.
append itab.
itab-val = 'd'.
append itab.
itab-val = 'e'.
append itab.
itab-val = 'f'.
append itab.
itab-val = 'c'.
append itab.
itab-val = 'g'.
append itab.
itab-val = 'c'.
append itab.
itab-val = 'h'.
append itab.
jtab[] = itab[].
DESCRIBE TABLE itab[] LINES l_lines.
LOOP AT itab.
MOVE sy-tabix to l_ind1.
l_ind2 = l_ind1 + 1.
LOOP AT jtab FROM l_ind2 to l_lines WHERE val eq itab-val.
l_ind1 = l_ind2.
l_ind2 = sy-tabix.
l_flg = 'X'.
exit.
ENDLOOP.
IF l_flg eq 'X'.
exit.
ENDIF.
ENDLOOP.
delete itab FROM l_ind1 to l_ind2.
LOOP AT itab.
WRITE: /2 itab-val.
ENDLOOP.
Still if you want to apply this multiple values, create another internal table and store the values which have been deleted already. So before you going to delete them again you can check from these new internal table.
Please let me know, if any issues still exists.
Regards
Praveen -
hello all,
i am confusing how affectively we can use the internal table key words. observe the following two sample codes, plz clarify what is the difference between these two.
1.
REPORT z_sample_report1 .
TYPES: t_spfli
TYPE STANDARD TABLE OF spfli.
DATA: itab_flinfo TYPE t_spfli,
wa_flinfo LIKE LINE OF
itab_flinfo.
SELECT * FROM spfli INTO TABLE itab_flinfo.
READ TABLE itab_flinfo INTO wa_flinfo
WITH KEY carrid = 'LH'
connid = '2463'.
IF sy-subrc = 0.
WRITE:/ wa_flinfo-carrid,
wa_flinfo-connid,
wa_flinfo-cityfrom,
wa_flinfo-cityto,
wa_flinfo-deptime,
wa_flinfo-arrtime.
ENDIF.
2.
REPORT z_sample_report1 .
DATA: BEGIN OF itab_flinfo OCCURS 6.
INCLUDE STRUCTURE spfli.
DATA: END OF itab_flinfo.
DATA: wa_flinfo like line of itab_flinfo.
SELECT * FROM spfli INTO TABLE itab_flinfo.
READ TABLE itab_flinfo INTO wa_flinfo
WITH KEY carrid = 'LH'
connid = '2463'.
IF sy-subrc = 0.
WRITE:/ wa_flinfo-carrid,
wa_flinfo-connid,
wa_flinfo-cityfrom,
wa_flinfo-cityto,
wa_flinfo-deptime,
wa_flinfo-arrtime.
ENDIF.hi,
both declarations are same
The difference comes when you want to add one more field to your internal table
Say you want to add one more field say CHECK(1) to your internal table , you cannot add this using the first method but you can do this using the second method
DATA: BEGIN OF itab_flinfo OCCURS 6.
INCLUDE STRUCTURE spfli.
data : CHECK(1).
DATA: END OF itab_flinfo.
Maybe you are looking for
-
How I show only 20 rows per pages in a rtf report in BI Publisher 11g
I'm making a report and i want show only 20 rows per pages in a formatt RTF. I get this with anything as a xls, xslt.... I'm a new user....please . Any idea..??? Thank for all. Edited by: 844565 on Mar 15, 2011 7:34 AM
-
How do I import my data from Firefox Sync after an uninstall?
''Locking thread - duplicate of [/questions/966728]'' So, I recently reinstalled Windows. Now, after installing Firefox on the fresh Windows, I'm trying to log in to Sync so I can recover my bookmarks, passwords, settings etc. Problems: 1. Why does i
-
Unable to connect to the server - windows sockets
//////socket connector method//// bool SocketConnecter::connect(const std::string& ip, size_t port) size_t uport = htons(port); std::string sPort = toString(uport); // Resolve the server address and port const char* pTemp = ip.c_str(); iResult = geta
-
Folks after the last updates I have the following error I used cat /var/log/boot | grep -C 10 'FAIL' | awk '{for (i =5; i <=NF; i++) printf("%s",$i); printf("\n")}' to get it. The query is outputing a LOT of garbage maybe someone can help me to impro
-
Move undo and temporary tablespace to new path
Hi All, I want to move my undo and temporary tablespace to new path because of space issue. I am using Oracle 10g release 2 and working on production server can't take shutdown without prior permission. Please tell me the steps to do so... thanks Api