‎2005 Dec 14 10:49 AM
Hi,
I have a requirement, while updating records in a Z table
using SM30 Transaction.
The Structure of the table is below:
APMOD Primary Key Char(3)
KONST Primary Key Char(20)
ENDDA Primary Key DATS
BEGDA Non Key DATS
and some other non key fields....
Problem: This table should act something like Infotype in HR. I mean Delimition of Records while creating or changeing the existing record.
Say there is a record
APMOD = OGMT
KONST = Organization Management
BEGDA = 01/01/2004
ENDDA = 12/31/9999
Whenever i am Inserting a new record with key
APMOD = OGMT and KONST = 'Organization Management'
and BEGDA = '01/01/2006'.
First it should update the old record with
BEGDA = 01/01/2004 and ENDDA = 12/31/2005
Then the new record needs to be inserted with
BEGDA = 01/01/2006 and ENDDA = 12/31/9999.
How can I achieve this using SM30? Can we write our own code somewhere? If yes Where and How? Or is there any settings available for this requirement?
I can write a Z program to update this Table, but i should achieve this using SM30 only.
Let me know if you need any additional info.
Regards,
Sudhakar.
‎2005 Dec 14 11:56 AM
Hi Amit,
Thanks for your step by step explanation: But still i observed one Problem.
The record is being delimited working greatly. When i saw the contents of table i found 2 entries in SE11. But in SM30 it is still showing one record. Why it is happining so?
SE11 Contents:
APMOD = OGMT
KONST = Organization Management
BEGDA = 01/01/2004
ENDDA = 12/31/2005
APMOD = OGMT
KONST = Organization Management
BEGDA = 01/01/2006
ENDDA = 12/31/9999
SM30 Showing
APMOD = OGMT
KONST = Organization Management
BEGDA = 01/01/2004
ENDDA = 12/31/2005
Any Idea?
Regards,
Sudhakar.
‎2005 Dec 14 10:53 AM
Hi,
Use SE54 transaction to generate table maintenance view and then it will allow the Z table to be maintained via SM30 transaction.
regards,
Satya
‎2005 Dec 14 10:56 AM
Hi,
You can do in sm30.
You only need to follow the next steps:
In the <b>SE11</b>, go yo <b>utilities --> table maintenance generator</b>.
there, you go to <b>environment --> modification --> events.</b>
there you can create a code to attend what you need, use the events 05 and 21. You have to create a FORM. it will enter in your form for each line of your screen in sm30.
I hope it helps.
Alexandre Nogueira
‎2005 Dec 14 11:10 AM
Hi Sudhakar,
1. I tried the same at my end. It works fantastic !
In SM30 it shows
'Delimit' Button
'Expand <--> Collapse' Button.
and accordingly delmits the records.
2. in SE11,
Use the menu
Utilities ---> Table Maintenance Generator
and finally build a table maintenance
to use in SM30.
3. When u use in SM30,
u will achieve what u want.
4. Just make sure your field
ENDDA has the data element ENDDA
in table definition.
It should also be key.
5. After this ENDDA column,
there should be no other key column
( not even BEGDA)
I Hope it helps.
Regards,
Amit M.
‎2005 Dec 14 11:22 AM
Hi Amit,
I have given data element for ENDDA as ENDDA. And after that no Other Primary keys defined. The only Primary Keys and order as follows:
APMOD
KONST
ENDDA
Eventhough I click on Delimit button, It is actually updating the current record. It is not delimiting the current record and inserting the new record.
Example: existing reocrd
APMOD = OGMT
KONST = Organization Management
BEGDA = 01/01/2004
ENDDA = 12/31/9999
when i tried to create record with
APMOD = OGMT
KONST = Organization Management
BEGDA = 01/01/2006
ENDDA = 12/31/9999
It is updating the BEGDA of the Old record with New BEGDA.
Let me know if i am missing something here, as it is working for you.
Regards,
Sudhakar.
‎2005 Dec 14 11:35 AM
Hi again,
Assumption : U have already generated table maintenance.
A. do the following step-by-step.
-
-
1 Choose the transaction Generate Table Maintenance Dialog (SE54).
2 Enter the table name.
3 Set the Generated Objects flag.
4 Choose Create/Change.
5 Choose Environment ® Time-Dep. in the next screen.
Then Generate.
B Now again test in SM30.
It will work.
(And it works FANTASTIC)
regards,
amit m.
Message was edited by: Amit Mittal
‎2005 Dec 14 11:57 AM
Hi sudhakar
U cant create new record using
<b>APMOD = OGMT
KONST = Organization Management
ENDDA = 12/31/9999</b>
BEGDA = 01/01/2006
because U all ready have a record
<b>APMOD = OGMT
KONST = Organization Management
ENDDA = 12/31/9999</b>
BEGDA = 01/01/2004
U cant create a new record with by using a same primary key.
for eg.
a is prim key
b is non prim.
u create
a=10,b=asd
u give now
a=10, b=sdf
it cant create
rec1. 10,asd
rec2. 10,sdf as each primary key is unique.
it ll create single rec. 10,sdf only
<b>try with new prim.key</b>
let me know if u ve further probs
regards
vijay
‎2005 Dec 14 11:56 AM
Hi Amit,
Thanks for your step by step explanation: But still i observed one Problem.
The record is being delimited working greatly. When i saw the contents of table i found 2 entries in SE11. But in SM30 it is still showing one record. Why it is happining so?
SE11 Contents:
APMOD = OGMT
KONST = Organization Management
BEGDA = 01/01/2004
ENDDA = 12/31/2005
APMOD = OGMT
KONST = Organization Management
BEGDA = 01/01/2006
ENDDA = 12/31/9999
SM30 Showing
APMOD = OGMT
KONST = Organization Management
BEGDA = 01/01/2004
ENDDA = 12/31/2005
Any Idea?
Regards,
Sudhakar.
‎2005 Dec 14 12:00 PM
Hi again,
1. don't worry,
the table has got 2 records.
2. on the toolbar
use the button Expand <--> Collapse
(Before to this, just select
the record which u want to expand,
and then press the button)
3. This is the default behaviour
to show like this.
(it should not be a problem)
regards,
amit m.
‎2005 Dec 14 12:12 PM
Hi,
Pls reward points if answers were helpful / solved the query!
regards,
amit m.
‎2005 Dec 14 12:19 PM
HI Amit,
Thanks You, My problem was solved.
Actullay i missed the 5 point.
5 Choose Environment ® Time-Dep. in the next screen.
Points alloted.
Regards,
Sudhakar.