2006 Jul 26 3:45 PM
Hi All,
I am very new to ABAP. I have created a new table with fields 1. Client type mandt 2.Emp_Name 3. Emp_id.
I need to create a report to upload a set of values to this table.
My report is like this.
REPORT ZJAITESTREPORT .
DATA : begin of z_jai,
client like zjaitable-client,
Emp_Name like zjaitable-emp_name,
Emp_Id like zjaitable-emp_id,
end of z_jai.
z_jai-client = '501'.
z_jai-Emp_Name = 'Mani'.
z_jai-Emp_Id = '0001'.
insert zjaitable from z_jai.
commit work.
But the code is not working. Can any one tell me where I am going wrong?
Thanks & Regards,
Jai Shankar.
2006 Jul 26 3:55 PM
Hi,
Declare the Internal table properly.
REPORT zjaitestreport .
DATA : BEGIN OF z_jai <b>OCCURS 0</b>,
client LIKE zjaitable-client,
emp_name LIKE zjaitable-emp_name,
emp_id LIKE zjaitable-emp_id,
END OF z_jai.
z_jai-client = '501'.
z_jai-emp_name = 'Mani'.
z_jai-emp_id = '0001'.
<b>APPEND z_jai.</b>
INSERT zjaitable <b>FROM TABLE z_jai</b>.
COMMIT WORK.
Read the F1 help for INSERT statement for more Info.
Regards,
AS.
2006 Jul 26 3:48 PM
Hello Jai,
REPORT ZJAITESTREPORT .
DATA : begin of z_jai,
client like zjaitable-client,
Emp_Name like zjaitable-emp_name,
Emp_Id like zjaitable-emp_id,
end of z_jai.
z_jai-client = '501'.
z_jai-Emp_Name = 'Mani'.
z_jai-Emp_Id = '0001'.
insert zjaitable from z_jai.
commit work.
If ur code change this part alone
<b>insert zjaitable VAlues z_jai.</b>
If useful reward.
Vasanth
2006 Jul 26 3:51 PM
Hi Vasanth,
I tried that. It gives me an error unable to interpret "values".
Regards,
Jai Shankar.
2006 Jul 26 3:55 PM
Hello,
Jai,
Sorry .There is a mistake the my prevous syntax.
write: like this.
<b>INSERT INTO ZTABLE VALUE ZSTRUCTURE</b>
vasanth
2006 Jul 26 3:55 PM
Hi Vasanth,
Sorry. I missed "INTO" in that statement. Now I executed it. Still not successful.
Regards,
Jai Shankar.
2006 Jul 26 3:57 PM
Hellp Jai,
Check the key fields.
Change the employee name and Employee ID and Try.
Vasanth
2006 Jul 26 3:49 PM
Hi Jai,
REPORT ZJAITESTREPORT .
DATA : begin of z_jai.
<b>include structure zjaitable .</b>
end of z_jai.
z_jai-Emp_Name = 'Mani'.
z_jai-Emp_Id = '0001'.
insert zjaitable from z_jai.
commit work.
Try this way andsee if it works .
Regards,
Varun .
2006 Jul 26 3:51 PM
Hi,
REPORT ZJAITESTREPORT .
DATA : begin of z_jai,
Emp_Name like zjaitable-emp_name,
Emp_Id like zjaitable-emp_id,
end of z_jai.
z_jai-Emp_Name = 'Mani'.
z_jai-Emp_Id = '0001'.
insert into zjaitable values z_jai.
commit work.
Best regards,
Prashant
2006 Jul 26 3:54 PM
Hi
Create an internal table ITAB for the structure z_jai.
Use following statement:
INSERT zjaitable FROM TABLE ITAB.
At the mean time go to SE11 and try adding contents to the table manually (Utilities->Table Contents->Create Entries). If it is working fine then the above should work.
Thanks
Inder
2006 Jul 26 3:55 PM
Hi,
Declare the Internal table properly.
REPORT zjaitestreport .
DATA : BEGIN OF z_jai <b>OCCURS 0</b>,
client LIKE zjaitable-client,
emp_name LIKE zjaitable-emp_name,
emp_id LIKE zjaitable-emp_id,
END OF z_jai.
z_jai-client = '501'.
z_jai-emp_name = 'Mani'.
z_jai-emp_id = '0001'.
<b>APPEND z_jai.</b>
INSERT zjaitable <b>FROM TABLE z_jai</b>.
COMMIT WORK.
Read the F1 help for INSERT statement for more Info.
Regards,
AS.
2006 Jul 26 3:58 PM
z_jai-client = '501'.
z_jai-Emp_Name = 'Mani'.
z_jai-Emp_Id = '0001'.
INSERT INTO zjaitable VALUES z_jai.
And remove the COMMIT WORK. SAP's Logic Unit of Work concept will perform a Commit Work at the conclusion of the program. You (usually) do not want to perform one earlier. This allows for restarting an update program with data that has not been partially changed by a previous failed execution.
Don't forget the points.
2006 Jul 26 4:33 PM
Jai,
Have you completed your task?
If so, please close the thread and reward points accordingly.
If not, plz provide more details of the current error.
2006 Jul 26 4:48 PM