‎2005 Oct 18 8:42 AM
Hi,
I have created one Z table which needs to be maintained using table maintenance. I have created table maintenance generator.
The problem is, I have one key field in that table (Sequence no), Which needs to be incremented or decremented when user creates entry or deletes entry automatically...
I am trying to doit using flowlogic osf screen or in maintenance dialog menu path Environment->Modifications-> Events... I ma not getting it properly...
Can anybody help me on this..
‎2005 Oct 18 9:04 AM
Hello rayudu_p,
You're on the right track:
Using the events should do the trick.
In the Function-Group of your table-maintenance, create a routine which reads the highest current SequenceNo. into a local variable (make sure you're not clearing the content currently in yourtable):
form new_record.
data: max_seqno like yourtable-seqno.
select max( seqno ) from yourtable into max_seqno.
add 1 to max_seqno.
endform.
Create an Event of Type '05': Creating a new entry. Assign the routine New_record to this Event.
The user can enter anything he wants in yourtable-seqno. When saving, the New_record routine will overwrite the value in yourtable-seqno.
Hope this helps.
‎2005 Oct 18 9:10 AM
Hi,
Here I am also on the same track. But I need different functionality.
Could you please help me.
I have 2 fields in Ztable.I also created function group, table maintenance generated .
The functionality i need is Pulldown for Key fields.
Where i need to code for this.
Thanks.
Message was edited by: Deepak333 k
Message was edited by: Deepak333 k
‎2005 Oct 18 9:14 AM
Hi rayudu p ,
I suggest you hide the field sequence number.
And use an event of type 21...
Event 21: Fill Hidden Fields
Use
This event occurs when fields which are flagged in the Data Dictionary as 'hidden', are to be filled.
Realization
This event has no standard routine. The table/view fields are available for the realization of the user routine.
Why ? Because changing a value entered by the end user by another one is not very user friendly.
BUT? Having this field has hidden or event DISABLE would be great!
So summary:
If field is disable : event 05
if field is hidden : event 21
If my answer was helpful let me know with a reward
‎2005 Oct 19 4:20 PM
Stephan,
I have created Z table with following fields.
Seqno
TextID
fld1
fld2
Created by
Created on
Changed by
Changed on
Here seqno and text id are key fields...
Text ID is Sales order Header texts (i.e Logistics texts, Fonance texts, General texts etc)..
I have created table maintenace generator. User dont want to enter seqno, created changed and dates.. These fields should be populated automatically...
I found one event called 05 which is for new entry creation...in that i have written one select and caliculated no of entries and assigned to screen field.. as per ur guidelines . It is working fine for single record entry...
If the user press new entry button and enters two lines and press save event will trigger 2 times but select will return same value two times.. So its giving error when i save it...
I dont have clear idea on table maintenance...How can we hide field on screen... Which property we have to set?
Rayudu
‎2005 Oct 19 4:50 PM
If you want to use event 5 or 21 - Use statics to define your data-
<b>statics : max_seqno like yourtable-seqno.
If max_seqno is initial.
select max( seqno ) from yourtable into max_seqno.
add 1 to max_seqno.
else.
add 1 to max_seqno.
endif</b>.
Else you can always use event 01 and modify internal table "TOTAL" correctly with the seq_no . Internal table "TOTAL" will have have the lines from database as well as lines new created. This routine is called once before database update.
Check here -
http://help.sap.com//saphelp_470/helpdata/EN/91/ca9f0ba9d111d1a5690000e82deaaa/content.htm
For individual lines in internal table TOTAL see the valid values for field <ACTION> .
Cheers.
‎2005 Oct 20 12:26 PM
Sanjya,
Thanks..Got it.. I have one more doubt, In table maintenance we will get POSITION button to locate records... When we click on this button it will show only key fields of table...
Can we add more fields on this screen? If so please provide solution...
and one more is How can we validate data in table maintenance..Is there any event????
Please help me on these two issues..
Thanks,
Rayudu
‎2005 Oct 21 10:46 AM
Hi Rayudu !
I'm glad the solution I provided helped you!
Yes you can add field to the screen you just have to modify the screen by yourself.
Of course the field have to belong to the table.
For example if you want to add 'created on' field you can just do it in the screenpainter.
I have done that! For example you can convert single char into checkbox or radio button...
If it helped, thanks for the reward
‎2005 Nov 07 2:09 AM
Sanjay,
I am appreciating your help to SAP-SDN people.
I am working in MRKO transaction, which is to create accounting document using vendor and material documet.
Problem is EXCHANGE RATE. I have to create accounting document as per Vendor suggested exchange rate, Not per system caliculated exchange rate.
So what i thought was, We have some exits in MRKO transaction. For each vendor we will ask user to get Vendor exchange rate and proceed with that rate. But system is taking exchange rate maintenained in system.
<b>Challange is: I have to create accounting document as per Vendor suggested exchange rate, Not per system caliculated exchange rate.</b>
Can you help me on this.
Thanks,
Rays
‎2005 Nov 07 2:22 AM
<i>have one more doubt, In table maintenance we will get POSITION button to locate records... When we click on this button it will show only key fields of table...
Can we add more fields on this screen? If so please provide solution...</i>
No Position Button will only show key fields .
For validation you can either use event 01 or 05 and give an error message in the code . This is as good as any validation you do in PAI.
If your query is answered , please close the thread and open new thread for your MRKO query . If answers were helpful , dont forget to reward.
Cheers.