Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

dulpicate entry occur while select from edidc table

Former Member
0 Kudos

HI ,

internal table I_edidc declare as unique key DOC_NUM while select the value from the edidc table on basis of status ,msgtyp,direct ,sndprt.sndprn ,updat, updtim,cretim,credat giving the duplicate entry dump some time .ANY suggestion

13 REPLIES 13

former_member203305
Active Contributor
0 Kudos

Hi.

Check on tcode SE16 the table edidc and do the same selection as your program, check the result and compare.

Regards

Miguel

0 Kudos

Status of idoc is changes from 51 to 53 will it is causing the issue

nabheetscn
Active Contributor
0 Kudos

Please paste your sample code here.

nabheet

0 Kudos

SELECT docnum status direct rcvpor rcvprt rcvprn mescod mesfct sndpor

                 sndprt sndprn credat cretim mestyp idoctp cimtyp upddat updtim

                 FROM edidc INTO TABLE i_edidc

                      WHERE status IN s_status

                      AND   mestyp EQ g_msgtyp

                      AND   direct EQ l_direct

                      AND   sndprt IN s_sndprt

                      AND   sndprn IN s_sndprn

                      AND   credat IN s_credat

                      AND   cretim IN s_cretim

                      AND   upddat IN s_upddat

                      AND   updtim IN s_updtim.

in this select statement i am getting dump any idea

0 Kudos

Please paste the data deceleration part for internal table I_EDIDC as well as exact Dump message which you are getting.

I think there may be structure conflict i.e. the field sequence which you have written in select should be same as internal table structure.

Also check the internal table I_EDIDC should get refresh before selection.

Cheers,

Prakash

0 Kudos

Hi Prakash ,

thanks for your replying internal table is refreshed i checked it during the debugging time and this issue not occurs frequently .I think the reason is when the idoc status changes from 51 to 53 it is picking up 51 entry and the same time it status changes to 53 it again tries to pick the same idoc with status 53 .Please correct me if i am wrong and please give your valuable suggestion .Below is the code

SELECT docnum status direct rcvpor rcvprt rcvprn mescod mesfct sndpor

                 sndprt sndprn credat cretim mestyp idoctp cimtyp upddat updtim

                 FROM edidc INTO TABLE i_edidc

                      WHERE status IN s_status

                      AND   mestyp EQ g_msgtyp

                      AND   direct EQ l_direct

                      AND   sndprt IN s_sndprt

                      AND   sndprn IN s_sndprn

                      AND   credat IN s_credat

                      AND   cretim IN s_cretim

                      AND   upddat IN s_upddat

                      AND   updtim IN s_updtim.

0 Kudos

Please confirm the IDOC status get changed during the execution of this select query ?

Also yes your analysis is correct.

Thanks,

Prakash

0 Kudos

Hi Rohit ,

You are getting dumb because you are using ranges .To many values in ranges cause dumb due to database exception .

0 Kudos

in this query i need to select all the idoc with all status so i used the range can you please  suggest the other approach for the same .

0 Kudos

Try to remove the UNIQUE KEY option in internal table definition, SELECT/SORT BY upddat updtim DESCENDING and DELETE DUPLICATE RECORDS comparing only DOCUNUM.

Regards;

Raymond

0 Kudos

Hi Rohit,

If Range table contains huge entry then it will cause dump.

Just Share the DUMP message which you are getting here.

Also to reduce range in selection query , just select data based on few range tables and after the selection filter the entries from internal table.

Like:  DELETE ITAB where FIED1 NOT IN S_RANGE.

Or you can loop on selected entries and filter the values:

Loop at ITAB into WA.

if WA-FIELD1 IN S_RANGE.

APPEND WA to ITAB1.

ENDIF.

Endloop.

Also please declare your internal table as TYPE STANDARD TABLE OF in place of SORT / Unique key.

Cheers,

Prakash

0 Kudos

HI Prakash ,

The error is occur due to  duplicate entry occurs while select statement it not the time out error or other .

Thanks for replys

0 Kudos

Yes Rohit , EDIDC have only one key field , I dont thing range tables will fetch duplicate IDOC numbers.

Thanks

Prakash