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

code for the following

Former Member
0 Likes
1,206

Hi all,

Thanks for all the help to this point. I would be thankful if someone has the codes for the

ADD

DISPLAY

EDIT

DELETE buttons on a screen.

The screen is a result of a custom transaction that has been created. This screen is connected to a Ztable.

For each of the above functions we need to even store the username and sysdate when the record was changed. From yesterday information that i obtained i could get the userid and date from the following objects sy-uname, the current date from sy-datum.

Thanks in advance

amit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,078

Hi Amit,

have a look at VIEW_MAINTENANCE_CALL documentation.

10 REPLIES 10
Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
1,078

Hi Amit,

Have you tried using Table Generator in SE11? It is easy and will generate all the buttons you need automatically. To do this:

1. Go to SE11.

2. Enter your ZTABLE

3. Maintain it.

4. Select Utilities->Table Maintenance Generator

5. Put in Authorization Group (you can use w/out auth group if you want to secure by transaction code), function group (the Z one that your program will be stored), Maintenance Type (select 2 if you want the detail screen separated), and Overview/Single screens (put it 1 and 2)

6. Click on Create button.

7. To see the result, you can use transaction SM30 and enter the table name.

8. Or you can create a parameter transaction using SE93 to link SM30 to this table automatically.

Read only

0 Likes
1,078

Nablan,

Thanks for the information . I will try that.

thanks

amit

Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
1,078

Hi

It would be an easy way to utilize table maintenance generator. But it seems you need a more specific solution since you require time-stamping, authority checks, etc.... So, I guess you have already created a module-pool or a report program. That will be better to go on with that since it will provide flexibility.

*--Serdar

Read only

0 Likes
1,078

I am new to ABAP and hence did not get a clue of what you said about pools and stuff.

Well let me clarify , let us say we use the table maintenance generator . Does that link to a add, delete and edit function tabs on the screen. Also what would be the code that will take care of the authorization stuff.

thanks

amit

Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
1,078

Hi Amit

Table maintenance generator generates a program which includes utilities to add, delete or edit records of a specific database table .

You can interfere the generated program to some extent. However, it will be difficult and not flexible because you require additional features. That interference will require approximately same knowledge level as required for developing a new program.

So, if you do not feel comfortable to write an ABAP program including screen programming, first try to learn it. You can refer some resources for that:

1. The book :

<b>"ABAP Objects — The Official Reference"</b>A comprehensive guide to all ABAP language elements

by Horst Keller & Joachim Jacobitz

--> You can find more info from

http://www.sap-press.com/H958.html

2. <b>SAP Help Portal</b> at http://help.sap.com

3. Standard <b>SAP courses</b>

"BC400 - ABAP Workbench: Foundations and Concepts"

"BC402 - ABAP Programming Techniques"

"BC410 - Programming User Dialogs"

"BC414 - Programming Database Updates"

*--Serdar

Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
1,078

From my experience, using Table Maintenance Generator is always the fastest to develop a screen for maintaining a custom table. Once you generate it, all the standard functionality of maintaining a table is already there. If you have some additional functionalities like downloading to excel, you can add it to the logic. The effort will be definitely less than writing it from scratch.

In terms of authorization, it is also taken care already. As I said in the previous answer, you can select an authorization group when you generate the screen. You can create a custom authorization group. Or you can simply use no authorization, but then create a parameter transaction for Display and Maintenance using SE93 with main transaction as SM30. For display transaction, set field SHOW as 'X'. For maintain transaction, set field UPDATE as 'X'.

Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
1,078

Hi Nablan

It is OK if it were just adding an authorization check table-wise. However, from Amit's previous thread, he wants an authorization with respect to each specific record.

Secondly, Amit requires to update the date and time of that last action with the record update.

To insert these codings, you need to inspect the generated code and this will somehow require a basic understanding of screen programming in ABAP.

Don't you think so?

*--Serdar

Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
1,078

To check authorization for each record, you can do it in the PBO of the first screen. This is to skip the records that you are not authorized to see. You can check in the PAI of the second screen (assume you use 2 screens) for authorization if user enter records that he/she not supposed to maintain. For placing the user id and date/timestamp, you can also do it in the PAI of the second screen within the CHAIN-REQUEST command of the flow logic.

One more advantage with using table generator is that locking is automatically programmed.

Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
1,078

Hi Nablan

My point was just to say that the program generated by the table maintenance generator will be more restrictive about performing content operations. By the way, all the operations you've mentioned are about basics of screen programming which I recommend Amit to learn.

Advantages of table maintenance generator are obvious. I also make use of it, even modifying the original code.

I trust your experience, so I hope Amit can handle the generated code to insert his requirements.

Regards...

*--Serdar

Read only

Former Member
0 Likes
1,079

Hi Amit,

have a look at VIEW_MAINTENANCE_CALL documentation.