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: 

Table inserting 999 recorgs

Former Member
0 Kudos

Hi all,

My uploading file contains 12000 records but my table inserting 999 records only. can any help me to resolve this issue?

Thanks,

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Can I see your program?

Regards,

Rich Heilman

20 REPLIES 20

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Can I see your program?

Regards,

Rich Heilman

0 Kudos

DO.

READ DATASET P_DATA INTO IT_DATA.

IF SY-SUBRC NE 0.

CLOSE DATASET P_DATA.

EXIT.

ENDIF.

W_SRNUM = W_SRNUM+1 .

IT_SUSPEN-SRNUM = W_SRNUM.

IT_SUSPEN-BUKRS = IT_DATA-BUKRS.

IT_SUSPEN-POLNO = IT_DATA-POLNO.

IT_SUSPEN-SSTATUS = IT_DATA-SSTATUS .

IT_SUSPEN-DSKCODE = IT_DATA-DSKCODE.

IT_SUSPEN-SUSPEND = IT_DATA-SUSPEND .

IT_SUSPEN-SKEY = IT_DATA-SKEY .

IT_SUSPEN-SUSAMOUNT = IT_DATA-SUSAMOUNT .

IT_SUSPEN-ZSIGN1 = IT_DATA-ZSIGN1.

IT_SUSPEN-SYSTEMID = IT_DATA-SYSTEMID .

IT_DATA-ACCOUNTNO = IT_SUSPEN-ACCOUNTNO.

IT_SUSPEN-JDATE = IT_DATA-JDATE .

IT_SUSPEN-PENDIND = IT_DATA-PENDIND .

IT_SUSPEN-LBILL = IT_DATA-LBILL .

IT_SUSPEN-SLFORM = IT_DATA-SLFORM.

IT_SUSPEN-MPREM = IT_DATA-MPREM .

IT_SUSPEN-PDATE = IT_DATA-PDATE .

IT_SUSPEN-CURDATE = IT_DATA-CURDATE .

SELECT SINGLE BUKRS INTO IT_SUSPEN-SBUKRS

FROM ZCCODEDLC

WHERE OLD_SID = IT_SUSPEN-SYSTEMID

AND OLD_BUKRS = IT_SUSPEN-SBUKRS

.

IF SY-SUBRC NE 0.

IT_SUSPEN-SBUKRS = '999999'.

ENDIF.

SELECT SINGLE SAP_ACCT_NO INTO IT_SUSPEN-SAP_ACCT_NO

FROM ZACCTDLC

WHERE SYSID = IT_SUSPEN-SYSTEMID

AND AG_COMP_CODE = IT_SUSPEN-SYSTEMID

AND AG_ACCT_NO = IT_SUSPEN-ACCOUNTNO.

IF SY-SUBRC NE 0.

IT_SUSPEN-SAP_ACCT_NO = '9999999999'.

ENDIF.

APPEND IT_SUSPEN.

w_srnum = w_srnum + 1.

CLEAR IT_DATA.

ENDDO.

LOOP AT IT_SUSPEN.

DATA : COUNT TYPE I VALUE 0.

COUNT = COUNT + 1.

MOVE IT_SUSPEN-SRNUM TO ZFDLCSUSPENSE-SRNUM.

MOVE IT_SUSPEN-BUKRS TO ZFDLCSUSPENSE-BUKRS.

MOVE IT_SUSPEN-POLNO TO ZFDLCSUSPENSE-POLNO.

MOVE IT_SUSPEN-SSTATUS TO ZFDLCSUSPENSE-SSTATUS.

MOVE IT_SUSPEN-DSKCODE TO ZFDLCSUSPENSE-DSKCODE.

MOVE IT_SUSPEN-SUSPEND TO ZFDLCSUSPENSE-SUSPEND.

MOVE IT_SUSPEN-SKEY TO ZFDLCSUSPENSE-SKEY.

MOVE IT_SUSPEN-SUSAMOUNT TO ZFDLCSUSPENSE-SUSAMOUNT.

MOVE IT_SUSPEN-SYSTEMID TO ZFDLCSUSPENSE-SYSTEMID.

MOVE IT_SUSPEN-ACCOUNTNO TO ZFDLCSUSPENSE-ACCOUNTNO.

MOVE IT_SUSPEN-JDATE TO ZFDLCSUSPENSE-JDATE.

MOVE IT_SUSPEN-PENDIND TO ZFDLCSUSPENSE-PENDIND.

MOVE IT_SUSPEN-LBILL TO ZFDLCSUSPENSE-LBILL.

MOVE IT_SUSPEN-SLFORM TO ZFDLCSUSPENSE-SLFORM.

MOVE IT_SUSPEN-MPREM TO ZFDLCSUSPENSE-MPREM.

MOVE IT_SUSPEN-PDATE TO ZFDLCSUSPENSE-PDATE .

MOVE IT_SUSPEN-CURDATE TO ZFDLCSUSPENSE-CURDATE.

MOVE IT_SUSPEN-ZSIGN1 TO ZFDLCSUSPENSE-ZSIGN1.

INSERT ZFDLCSUSPENSE.

ENDLOOP.

FORMAT COLOR COL_HEADING.

WRITE : / 'FILE LOADED SUCCESFULLY'.

SKIP TO LINE 5.

WRITE : / 'NO. OF RECORDS FOUND = ', SY-TABIX.

SKIP TO LINE 7.

WRITE 😕 'TOTAL NO OF RECORDS INSERTED =',COUNT.

FREE IT_SUSPEN.

endform.

0 Kudos

What is the length of the W_SRNUM field. I'm thinking that is may only be 3? If so, this field will need to be big enough to hold the counter that you are using. So for 12000 records, it will need to be 5 character in length. Please check this and get back.

Also check how SRNUM in your internal table is defined.

Regards,

Rich Heilman

0 Kudos

Hello priya,

1. Go to SE14 and check the memory parameter.

2 Use "commit work" after the insert statement or "commit work and wait."

try this

Thanks,

A

0 Kudos

no W_srnum length is 5 only.

0 Kudos

I assume that SRNUM is the key of the table. How is this defined in the "Z" table.

Regards,

Rich Heilman

0 Kudos

yes it is key (srnum).

0 Kudos

What is the length in your custom table and what is the data type.

Regards,

Rich Heilman

0 Kudos

Amit ,

Before it was working fine in se14 i used delete database table option after that its taking 999 records only.

0 Kudos

SRNUm - char -5

0 Kudos

Hello Priya,

I never asked you to delete the records. I just asked your to check the memory status. Can you copy and paste your table structure also.

Thanks,

Amit

0 Kudos

How do you know its only taking that many records? Where are you seeing this? Go to SE16, and click the "Number of records" button. WHat does it say there.

Regards,

Rich Heilman

0 Kudos

No i done it before only .Now its working for 999 records only

0 Kudos

Hello Priya,

One more thing. Please put the break point at

LOOP AT IT_SUSPEN.

and check how many records are in IT_SUSPEN table. If this table contains only 999 records then there is a problem in the file itself.

Thanks,

Amit

0 Kudos

That cannot be happening. I am just curious here. Look at the highlighted code here. Why are you doing it twice?


DO.
  READ DATASET p_data INTO it_data.

  IF sy-subrc NE 0.

    CLOSE DATASET p_data.
    EXIT.
  ENDIF.
<u>  w_srnum = w_srnum + 1. </u><b><---here</b>
  it_suspen-srnum = w_srnum.
  it_suspen-bukrs = it_data-bukrs.
  it_suspen-polno = it_data-polno.
  it_suspen-sstatus = it_data-sstatus .
  it_suspen-dskcode = it_data-dskcode.
  it_suspen-suspend = it_data-suspend .
  it_suspen-skey = it_data-skey .
  it_suspen-susamount = it_data-susamount .
  it_suspen-zsign1 = it_data-zsign1.
  it_suspen-systemid = it_data-systemid .
  it_data-accountno = it_suspen-accountno.
  it_suspen-jdate = it_data-jdate .
  it_suspen-pendind = it_data-pendind .
  it_suspen-lbill = it_data-lbill .
  it_suspen-slform = it_data-slform.
  it_suspen-mprem = it_data-mprem .
  it_suspen-pdate = it_data-pdate .
  it_suspen-curdate = it_data-curdate .


  SELECT SINGLE bukrs INTO it_suspen-sbukrs
  FROM zccodedlc
  WHERE old_sid = it_suspen-systemid
  AND old_bukrs = it_suspen-sbukrs
  .
  IF sy-subrc NE 0.
    it_suspen-sbukrs = '999999'.
  ENDIF.

  SELECT SINGLE sap_acct_no INTO it_suspen-sap_acct_no
  FROM zacctdlc
  WHERE sysid = it_suspen-systemid
  AND ag_comp_code = it_suspen-systemid
  AND ag_acct_no = it_suspen-accountno.

  IF sy-subrc NE 0.
    it_suspen-sap_acct_no = '9999999999'.
  ENDIF.

  APPEND it_suspen.


<u>  w_srnum = w_srnum + 1. </u><b><---here again</b>
  CLEAR it_data.

ENDDO.

0 Kudos

What is the value present in se16.

Maximum no. of hits

Or click Number of entries.

Former Member
0 Kudos

What is the value of the variable COUNT when the program completes?

Rob

0 Kudos

12000

0 Kudos

I think the statement:

  w_srnum = w_srnum+1 .

at the beginning of the DO is causing you grief. It looks like it's not adding 1, but trying to add a portion of the original number. And you repeat it correctly at the end. How is W_SRNUM defined?

Rob

0 Kudos

I think this is your problem. It is messing up your key fields and you are probably trying to inadvertantly insert keys with duplicate records. If you fix that, it should work.

Rob