‎2009 Feb 05 11:46 AM
Hi,
Its going to short dump on execution of code.
there are two internal tables t_tab1, t_tab2 having the same work area.
fld1,fld2,fl3. t_tab1 having 3 records.
i am inserting the contents of t_tab1 into t_tab2. and then looping t_tab2 to display contents.
+ INSERT LINES OF t_tab1 FROM 1TO 2 INTO t_tab2 .+
its going to dump. Can i know the reason..
Regards,
Mdi.Deeba
‎2009 Feb 05 11:47 AM
Please paste your code here so that we can analyse the problem.
Regards,
Nitin.
‎2009 Feb 05 12:05 PM
TYPES:
BEGIN OF type_s_programmer,
name(15) TYPE c, " Name of the Programmer
dob TYPE d, " Date of birth
prof(10) TYPE c, " Proficiency
marks1 TYPE i,
marks TYPE i, " Marks Scored
END OF type_s_programmer.
*" Data declarations...................................................
*"--------------------------------------------------------------------*
* Declaration of Field String 'fs_prog' *
*"--------------------------------------------------------------------*
DATA:
fs_prog TYPE type_s_programmer.
*"--------------------------------------------------------------------*
* Declaration of Programmer DEtails table to hold the Data *
*"--------------------------------------------------------------------*
DATA:
t_prog LIKE
STANDARD TABLE
OF fs_prog WITH NON-UNIQUE KEY name
INITIAL SIZE 6,
t_prog2 LIKE
SORTED TABLE
OF fs_prog WITH UNIQUE KEY name
INITIAL SIZE 10.
*"Macro Definition....................................................
DEFINE prog.
clear fs_prog.
fs_prog-name = &1.
fs_prog-dob = &2.
fs_prog-prof = &3.
fs_prog-marks1 = &4.
fs_prog-marks = &5.
append fs_prog to t_prog.
END-OF-DEFINITION.
*"-------------------------------------------------------------------*
* Populating Data Into Programmer Information Table *
*"-------------------------------------------------------------------*
prog 'ALTAF' '19610207' 'CLIPPER' '40' '50'.
prog 'ANAND' '19661204' 'PASCAL' '50' '60'.
prog 'JULIANA' '19683101' 'COBOL' '20' '40'.
prog 'KAMALA' '19683010' 'C' '70' '26'.
prog 'MARY' '19702406' 'CPP' '30' '20'.
prog 'NELSON' '19851109' 'COBOL' '60' '59'.
APPEND INITIAL LINE TO t_prog.
CLEAR fs_prog.
fs_prog-name = 'XYZ'.
fs_prog-dob = '19001812'.
fs_prog-prof = 'c++'.
fs_prog-marks = 61.
APPEND fs_prog TO t_prog SORTED BY marks.
SORT t_prog.
INSERT LINES OF t_prog FROM 3 TO 10 INTO t_prog2.
*"-------------------------------------------------------------------*
* Displaying Data Of Programmer Details Table *
*"-------------------------------------------------------------------*
WRITE:/20
'Name of the Programmer'(001),space,
'Date of birth'(002),space,
'Proficiency'(003),
'Marks Scored'(004).
NEW-LINE.
WRITE:/18 space.
ULINE (53).
LOOP AT t_prog2 INTO fs_prog.
WRITE:/
fs_prog-name UNDER text-001,
(10) fs_prog-dob UNDER text-002,
fs_prog-prof UNDER text-003,
fs_prog-marks UNDER text-004,
fs_prog-marks1 .
ENDLOOP.
‎2009 Feb 05 12:18 PM
‎2009 Feb 05 12:20 PM
I think U have only 6 entries in the internal table where as UR trying to write as below .. and UR getting
dump.(from 3 to 10)
INSERT LINES OF t_prog FROM 3 TO 10 INTO t_prog2.
‎2009 Feb 05 12:31 PM
Hi,
Use this code:
INSERT LINES OF t_prog FROM 3 TO 6 INTO TABLE t_prog2.
instead of
INSERT LINES OF t_prog FROM 3 TO 6 INTO t_prog2.
This helps u.
Thanks.
‎2009 Feb 05 11:54 AM
‎2009 Feb 05 11:55 AM
Hi,
Insert statement will raise an exception when "A line to be inserted would cause a duplicate entry in tables with a unique table key ".
Check whether you are trying to insert duplicate rows with the same key field values.
Instead you can use Modify statement inpalce of Insert .
Regards,
Dwaraka.S
Edited by: Dwarakanath Sankarayogi on Feb 5, 2009 12:56 PM
‎2009 Feb 05 12:05 PM
Hi,
Please find the Code Below.
Its working fine..
DATA:
BEGIN OF t_tab1 OCCURS 0,
fld1 TYPE i,
fld2 TYPE i,
fld3 TYPE i,
END OF t_tab1.
DATA:
BEGIN OF t_tab2 OCCURS 0,
fld1 TYPE i,
fld2 TYPE i,
fld3 TYPE i,
END OF t_tab2.
t_tab1-fld1 = '1'.
t_tab1-fld2 = '1'.
t_tab1-fld3 = '1'.
APPEND t_tab1.
CLEAR t_tab1.
t_tab1-fld1 = '2'.
t_tab1-fld2 = '2'.
t_tab1-fld3 = '2'.
APPEND t_tab1.
CLEAR t_tab1.
t_tab1-fld1 = '3'.
t_tab1-fld2 = '3'.
t_tab1-fld3 = '3'.
APPEND t_tab1.
CLEAR t_tab1.
INSERT lines of t_tab1 INTO table t_tab2.
LOOP AT t_tab2.
write:
/ t_tab2-fld1,
t_tab2-fld2,
t_tab2-fld3.
ENDLOOP.
Hope this is helpful.
Thanks
Kalyan.b
‎2009 Feb 05 12:13 PM
‎2009 Feb 05 12:19 PM
HI BRO....
INSERT LINES OF t_tab1 FROM 1TO 2 INTO t_tab2
INSTEAD USE
INSERT LINES OF t_tab1 FROM 1TO 2 INTO TABLE t_tab2
REGARDS