‎2007 Jul 03 10:14 AM
Hello Genuis
I m inserting values in database throught screen
i had made a button with SAVE fcode
<b>when 'SAVE'.
select max( empno ) from zsun_emp INTO MM.
MM = MM + 1.
WA_ZSUN_EMP-EMPNO = zsun_emp-empno.
WA_ZSUN_EMP-ENAME = ZSUN_EMP-ENAME.
WA_ZSUN_EMP-DOJ = ZSUN_EMP-DOJ.
WA_ZSUN_EMP-COMM = ZSUN_EMP-COMM.
WA_ZSUN_EMP-SAL = ZSUN_EMP-SAL.
WA_ZSUN_EMP-DEPTNO = ZSUN_EMP-DEPTNO.
INSERT INTO ZSUN_EMP FROM WA_ZSUN_EMP.</b>this code i had written and its giving some error
that error is
<u>"VALUES field.", "CONNECTION ... VALUES field.", "CLIENT SPECIFIED
VALUES field.", or "CLIENT SPECIFIED CONNECTION ..." expected after
"ZSUN_EMP". </u>
please tell me how to solve it
Please reply urgent as i m goin on with that
i m new to Module Pool tooo
With Best Regards
Ruby
Hoping for Quick Reply
‎2007 Jul 03 11:11 AM
Hi Ruby,
Use this code it will execute perfectly.
when 'SAVE'.
select max( empno ) from zsun_emp INTO MM.
MM = MM + 1.
MOVE MM TO ZSUN_EMP-<VARIABLE NAME>.
WA_ZSUN_EMP-EMPNO = zsun_emp-empno.
WA_ZSUN_EMP-ENAME = ZSUN_EMP-ENAME.
WA_ZSUN_EMP-DOJ = ZSUN_EMP-DOJ.
WA_ZSUN_EMP-COMM = ZSUN_EMP-COMM.
WA_ZSUN_EMP-SAL = ZSUN_EMP-SAL.
WA_ZSUN_EMP-DEPTNO = ZSUN_EMP-DEPTNO.
APPEND WA_ZSUN.
INSERT ZSUN_EMP.
IF USEFULL REWARD
‎2007 Jul 03 10:16 AM
hi,
U did not give the values extension to the insert statement.Give it and check it ones.
‎2007 Jul 03 10:18 AM
Hi
Something wrong with syntax, remove INTO and see
INSERT ZSUN_EMP FROM WA_ZSUN_EMP
Keep the Cursor on INSERT keyword and press F1 you will get the help for INSERT
see and correct it
Reward points for useful Answers
Regards
Anji
‎2007 Jul 03 10:24 AM
friend
wen i write
<b>
INSERT ZSUN_EMP FROM WA_ZSUN_EMP.</b>
then
error comes
<u>The type of the database table and work area (or internal table)
"WA_ZSUN_EMP" are not Unicode convertible. Unicode convertible.</u>
now wats this friend
Ruby
‎2007 Jul 03 10:40 AM
for the above error i code like this
<b>INSERT ZSUN_EMP FROM WA_ZSUN_EMP UNICODE ENABLING 'X'.</b> .
but it gives some other error
<u>
"." expected after "WA_ZSUN_EMP".</u>
please now tell me how do i solve
Hoping for quick answer
With Best Regards
Ruby
‎2007 Jul 03 10:44 AM
declare WA_ZSUN_EMP like zsun_emp. and then insert. one more thing i can not under stand what is the use MM variable here when you are not using it any where. If you are trying to insert the duplicate entries in database then you cannot enter that(i.e duplicate key values).
for avoiding error you can use
INSERT ZSUN_EMP FROM WA_ZSUN_EMP accepting duplicate keys.
here it will not insert your data but it is for just avoiding the error.
regards
shiba dutta
‎2007 Jul 03 10:46 AM
friend
i had declared the table
<b>DATA: BEGIN OF WA_ZSUN_EMP OCCURS 0,
EMPNO LIKE ZSUN_EMP-EMPNO,
ENAME LIKE ZSUN_EMP-ENAME,
DOJ LIKE ZSUN_EMP-DOJ,
COMM LIKE ZSUN_EMP-COMM,
SAL LIKE ZSUN_EMP-SAL,
DEPTNO LIKE ZSUN_EMP-DEPTNO,
END OF WA_ZSUN_EMP.</b>
and for mm
<u>DATA: MM LIKE ZSUN_EMP-EMPNO.</u>
now tell how to solve
Hope now u got the problem
With Best Regards
ruby
‎2007 Jul 03 10:51 AM
check whether you have declared all the fields of that ztable have you define in the internal table or not ? if not declare all the fields there and check whether you are repeating the key fields in insert or not?
regards
shiba dutta
‎2007 Jul 03 10:48 AM
Hi Ruby,
Check with this code.
INSERT <work_area> INTO <internal_table>
<b>INSERT WA_ZSUN_EMP INTO ZSUN_EMP.</b>
Thanks,
Vinay
‎2007 Jul 03 10:53 AM
if i go like this
<b>INSERT WA_ZSUN_EMP from ZSUN_EMP .</b>
then error
<u>Field "FROM" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement.</u>
if i go like this
<b>INSERT ZSUN_EMP from WA_ZSUN_EMP.</b>
then error comes
<u>The type of the database table and work area (or internal table)
"WA_ZSUN_EMP" are not Unicode convertible. Unicode convertible.</u>
and if i solve above by
<b>INSERT ZSUN_EMP from WA_ZSUN_EMP UNICODE ENABLING 'X'.</b>
then
error comes
<u>"." expected after "WA_ZSUN_EMP".</u>
Now tell wats the solution
Please for sure as i struct out here.
With Best Regards
ruby
‎2007 Jul 03 11:11 AM
Hi Ruby,
Use this code it will execute perfectly.
when 'SAVE'.
select max( empno ) from zsun_emp INTO MM.
MM = MM + 1.
MOVE MM TO ZSUN_EMP-<VARIABLE NAME>.
WA_ZSUN_EMP-EMPNO = zsun_emp-empno.
WA_ZSUN_EMP-ENAME = ZSUN_EMP-ENAME.
WA_ZSUN_EMP-DOJ = ZSUN_EMP-DOJ.
WA_ZSUN_EMP-COMM = ZSUN_EMP-COMM.
WA_ZSUN_EMP-SAL = ZSUN_EMP-SAL.
WA_ZSUN_EMP-DEPTNO = ZSUN_EMP-DEPTNO.
APPEND WA_ZSUN.
INSERT ZSUN_EMP.
IF USEFULL REWARD
‎2007 Jul 03 11:27 AM
Friend
i had done
when 'SAVE'.
select max( empno ) from zsun_emp INTO MM.
MM = MM + 1.
MOVE MM TO ZSUN_EMP-empno.
WA_ZSUN_EMP-EMPNO = zsun_emp-empno.
WA_ZSUN_EMP-ENAME = ZSUN_EMP-ENAME.
WA_ZSUN_EMP-DOJ = ZSUN_EMP-DOJ.
WA_ZSUN_EMP-COMM = ZSUN_EMP-COMM.
WA_ZSUN_EMP-SAL = ZSUN_EMP-SAL.
WA_ZSUN_EMP-DEPTNO = ZSUN_EMP-DEPTNO.
APPEND WA_ZSUN_emp.
INSERT ZSUN_EMP.
but its not inserting values in database
errors are removed
Please tell me how could i insert the values
Hoping for earlier and apprpiate answer
With Best Regards
Ruby