Application Development and Automation 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: 
Read only

second record not inserting into ztable

Former Member
0 Likes
851

Hi All,

I have designed z table with following fields.

1) CONSULTANT

2) MODULE_NAME

3) CR_DATE

4) ISSUE

5) RPT_NAME

6) TCODE

7) REQ_NO

😎 DEV_STA

9) QA_STA

10) PRD_STA.

the ztable contains no primaty key as we are storing the duplicates values

I have created One screen with all above fields using module pooled programming. One Input screen is designed containing all above fields. after that when i click on SAVE Button all above fields are getting inserted into ztable. But when i again fill the data the second record is not getting inserted into ztable.

I have written the following code for this :

wa_issue-CONSULTANT = ZISSUE-CONSULTANT.

wa_issue-MODULE_NAME = ZISSUE-MODULE_NAME.

wa_issue-CR_DATE = ZISSUE-CR_DATE.

wa_issue-ISSUE = ZISSUE-ISSUE.

wa_issue-RPT_NAME = ZISSUE-RPT_NAME.

wa_issue-TCODE = ZISSUE-TCODe.

wa_issue-REQ_NO = ZISSUE-REQ_NO.

wa_issue-DEV_STA = ZISSUE-DEV_STA.

wa_issue-QA_STA = ZISSUE-QA_STA.

wa_issue-PRD_STA = ZISSUE-PRD_STA.

insert into zissue values wa_issue .

commit work.

9 REPLIES 9
Read only

former_member210123
Active Participant
0 Likes
833

the mandt field is a must.Add that field it will work.

Read only

0 Likes
833

Also use ENQUEUE_E_TABLEE and DEQUEUE_E_TABLEE for the same also.While inserting also insert with the mandt field.

Read only

Former Member
0 Likes
833

Hi,

Try using this.

MODIFY zissue FROM wa_issue.

Also check whether the mandt field is present in the table as primary key.

Regards.

Abhisek

Read only

Former Member
0 Likes
833

Hi,

hcheck the key fields in the table

Regards,

V.Balaji

Reward if Usefull...

Read only

Former Member
0 Likes
833

HI,

We should have one primery key in our table than only we can give more than one value.

U want give a itam value means u can use Cardinality.

Regards,

Kendi.

Edited by: Kendi on Mar 28, 2008 11:39 AM

Read only

Former Member
0 Likes
833

Hi Ulhas

At the end of assigning all parrameters to work area

include the statement

CLEAR ZISSUE.

This will clear the data in the screen fields.

Regards

lakshman

Read only

Former Member
0 Likes
833

Hi,

Any table should have atleast one primary key. But in your scenario You cant until you have a primary key. So just have a primary key with your table. Then only your requirement will meet.

Regards,

Sanki.

Read only

Former Member
0 Likes
833

Hi,

Try <Insert> along with <accept duplicate values> syntax

It ll work

Regards,

Dilip

Read only

Former Member
0 Likes
833

You must have a primary key. As far as I know this is mandatory and is always unique. So you need to change your table definition. You could generate a number for this key or use a conbination of the fields if possible. To verify this check the sy-subrc status after you attempt the second insert