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

DATA DICTIONARY

Former Member
0 Likes
863

Hi,

I have a zcustom table with 5 fields --

f1--Pri Key

f2--Pri Key

f3

f4

f5

We will enter values into first four fields.

The idea is that when we enter data (in SE11) into the table, F5 field will display as disabled and we will enter data to first four flds and then save it. At that instance it should show the value in F5 as the sum of f3 and f4 automatically and will update the value to database.

how we ll achieve it?

8 REPLIES 8
Read only

Former Member
0 Likes
837

Hi sam,

If you want to enter the data via se11 or se16, then it is not possible.

YOu have to create a table maintenance for the z table.

Refer this link for creation of table maintenance:

Regards,

Ravi

Read only

Former Member
0 Likes
837

Hi!

Do not store calculated fields, it is unneccessary.

If you wanted it, you have to create a small dialog to maintain the Z table, because there is no automated calculations in SE11, nor in SM30.

Regards

Tamá

Read only

former_member198270
Active Contributor
0 Likes
837

Hi Sam ,

What you can do is first create function group (for that go to SE37 transaction ,inside that GOTO thre you can find Function Groups ,then create group) after creating function group create your Ztable while creating assign it with Function Groups in technical settings, So that Table maintanence can be done using SM30 ..

Now for inserting data to a table(ztable) you can insert in two ways

1. Using SM30 table maintanence .

2. You can write a dialog Program to insert data here you can do computation also for f5. instead of storing computed value in Ztable try to store in internal table only . in this way you can reduce the load on database also .

Reward points if helpful .

Regards,

Amber

Read only

0 Likes
837

Thanks for the suggestion.

i am working on it.

Regards

Read only

0 Likes
837

Hi

I doubt if u can do it directly....

The Screen we get in SE11 is an automatically generated one, and hence we cannot make any changes to it. and your requirement can only be fulfilled if u come up with a screen of your own for this purpose........

Hope this guides u

Reward points if usefu;

Regards

Read only

Former Member
0 Likes
837

hi

good

use Table maintenance generator.

Thanks

mrutyun^

Read only

Former Member
0 Likes
837

I believe you can use events for table maintenance. Transaction <b>SE54</b>

Read only

Former Member
0 Likes
837

Create a maintenance view for this table and hide the fifth column. Generate the table maintenance for this view and then go to SE54, enter the view, in the menu "Environment-->Events". Click through the pop-up message and you will see a table control. Enter '01' in the first column (Table maintenance dialog event) and enter a routine name (something like FILL_XXXX_FIELD) and save it. Now you will see the editor icon come up in the third column. Click on it and create the routine in the same function group as that of your table maintenance. In the code for the routine, have the code as below.


  DATA: l_index LIKE sy-tabix.

  DATA: BEGIN OF ls_zmytable.
          INCLUDE STRUCTURE zmytable.
  DATA:   action TYPE c,
          mark   TYPE c.
  DATA: END OF ls_zmytable.

  LOOP AT total.
    CLEAR: ls_zmytable.
    ls_zmytable = total.
    CASE <action>.
      WHEN neuer_eintrag OR aendern.
*-- New entry or changed entry, update the fifth field
        ls_zmytable-field5 = ls_zmytable-field3 + ls_zmytable-field4.
        READ TABLE extract WITH KEY <vim_xtotal_key>.
        IF sy-subrc EQ 0.
          l_index = sy-tabix.
        ELSE.
          CLEAR l_index.
        ENDIF.
*-- make desired changes to the line total
        total = ls_zmytable.
        MODIFY total.
        CHECK l_index GT 0.
        extract = total.
        MODIFY extract INDEX l_index.
      WHEN geloescht.
*-- flagged for deletion
      WHEN update_geloescht.
*-- entry first changed and then flagged for deletion
      WHEN neuer_geloescht.
*-- entry first newly created, not yet saved, and then flagged for
*   deletion
      WHEN original.
*-- the same as the database status
    ENDCASE.
  ENDLOOP.