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

ADD DATA

Former Member
0 Likes
860

I've created ZTABLE....

How do I append data to that tables thru 1)Report and using 2)Std Transaction....Waiting for your reply...Thank you.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
804

1) REPORT

TABLES: ZTABLE.

ZTABLE-MANDT = SY-MANDT.

ZTABLE-KEY_FIELD = 'TEST'.

INSERT ZTABLE.

2) Inserting using standard transaction. U need to take help of Functional people. In configuration, there is a method where u can attach the Ztable. So, when the transaction is saved, the contents of the Ztable gets automatically populated.

7 REPLIES 7
Read only

Former Member
0 Likes
804

Hi,

1) REPORT

TABLES: ZTABLE.

ZTABLE-MANDT = SY-MANDT.

ZTABLE-KEY_FIELD = 'TEST'.

INSERT ZTABLE.

Thanks,

Naren

Read only

gopi_narendra
Active Contributor
0 Likes
804

u cant append data to the tables thru any <b>standard transaction</b>.

u need to generate table maintenance for the table.

follow these steps

1. you need generate the table maintenance using the Menu Utilities->Table maintenance generator

2. give the authorization group, package, function group, overview screen number etc.

3.create the table maintenance

4. now go to se93

5. give custom tcode and say create

then enter description , and then

choose the radio button Transaction with parameters

6. now enter tcode as SM30 and check the check box skip intial screen

7. Check all gui support buttons

8. now go down and enter VIEWNAME from F4 help and value as table name

9. and add UPDATE(choose it from F4) and value as 'X'.

VIEWNAME ZTABLE

UPDATE X

and save it, now check the Tcode.

Regards

- Gopi

Read only

Former Member
0 Likes
805

1) REPORT

TABLES: ZTABLE.

ZTABLE-MANDT = SY-MANDT.

ZTABLE-KEY_FIELD = 'TEST'.

INSERT ZTABLE.

2) Inserting using standard transaction. U need to take help of Functional people. In configuration, there is a method where u can attach the Ztable. So, when the transaction is saved, the contents of the Ztable gets automatically populated.

Read only

0 Likes
804

Thanx there for helpful answers...Could you explain in detail what we are doin in the report..as I am novice to ABAP...........

Read only

0 Likes
804

Thanx there for helpful answers...Could you explain in detail what we are doin in the report..as I am novice to ABAP...........

Read only

0 Likes
804

Hi,

The following procedure is always followed when a table is updated using an ABAP report.

<b>1.</b> Check whether the user has authorization to perform the database updates. If the user is not authorised, then raise an exception.

Click the link below to know more about Authorization Concept in SAP.

<b>Checking Authorizations</b>

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3ba5358411d1829f0000e829fbfe/content.htm

<b>Checking User Authorizations.</b>

http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbacbe35c111d1829f0000e829fbfe/content.htm

<b>2.</b> First of the table is locked. Each table in SAP can have lock. Before updating the table table should be locked. This allows the user to have complete/ exclusive access to the table. Click the link below to know more about Locks in SAP.

http://help.sap.com/saphelp_47x200/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/content.htm

http://help.sap.com/saphelp_47x200/helpdata/en/41/7af4c8a79e11d1950f0000e82de14a/content.htm

<b>3.</b> Use Database update commands INSERT, MODIFY or UPDATE to add entries in the table. Click the links below to know more about these commands.

<b>INSERT</b>

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3a6d358411d1829f0000e829fbfe/content.htm

<b>UPDATE</b>

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3a94358411d1829f0000e829fbfe/content.htm

<b>MODIFY</b>

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3ac8358411d1829f0000e829fbfe/content.htm

<b>4.</b> Check the SY-SUBRC after above statements. If the data is inserted successfully, then the database should be committed. for COMMIT WORK command is used. If the database update is unsuccessful, the ROLLBACK the update by using ROLLBACK command.

Clikc the link below for more information.

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3b64358411d1829f0000e829fbfe/content.htm

<b>5.</b>

After the database is updated unlock the table.

Click the link to know about Database locks.

<b>Structrure of Locks</b> http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm

<b>LOCK MODE</b>

http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eeb2446011d189700000e8322d00/content.htm

<b>Function module for Locks</b>

http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eebf446011d189700000e8322d00/content.htm

<b>Lock Mechanism</b>

http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eed9446011d189700000e8322d00/content.htm

<b>Examples of LOCK Objects</b>

http://help.sap.com/saphelp_47x200/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/content.htm

<b>It is always a good practice to follow the above mentioned steps.</b>

Check the below sample code....

-


<b>Start-of-selection.</b>

<Check Authorization> - Step 1

if success

< process the records>

else.

exit.

endif.

<b>end-of-selection.</b>

if authoriszation is successful.

<lock the table> - step 2.

<update database> - step 3.

<commit/ rollback> - step 4.

<unlock the table > - step 5.

endif.

I hope this gives you a clear picture of database updates using reports.

Regards,

Vara

Read only

Former Member
0 Likes
804

Hi,

REPORT AD_DATA " Report name

TABLES: ZTABLE.

ZTABLE-MANDT = SY-MANDT.

ZTABLE-FIELD1 = 'TEST'.

INSERT ZTABLE. " Inserting the values to the Table

ZTABLE-MANDT = SY-MANDT.

ZTABLE-FIELD2 = 'TEST1'.

INSERT ZTABLE. " Inserting the values to the Table

if you want to add the records through a transaction code, then follow the steps as GOPI described in the above

Regards

Sudheer