How to validate data entered in table maintenance for Z table?
Hi,
I created a Z-table with table maintenance. I'd like to perform some validation on the entered data.
I know there are events for these : "If this pre-defined time is reached in extended table maintenance, the FORM routine specified for the current view and for this time is processed. This is useful, for example, for performing consistency checks before saving or specific actions when creating new entries."
I also found some info in the Online help:
http://help.sap.com/saphelp_47x200/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/frameset.htm
However it's not clear which event I can use for validation.
I tried event 01, however when I added a message, in the SM30 in case of message, I got the SM30 initial screen.
Do you have any example about validation?
Thanks in advance,
Peter
Hi,
Once you are on the table maintenance generator screen.
GOTO --> Enviornment --> Modification --> Events.
Here specify Event as '01' and the Subroutine name that will hold the data for the validation.
As you know we need to specify a function group.
GOTO SE80 and Open your function group.
Now in the PBO of the screen write a subroutine for the validation before saving an entry in the table.
Refer the code below for validation.
*& Form F9000_CHECK_BEFORE_SAVE
Subroutine called dynamically to check values before saving
FORM f9000_check_before_save.
TYPES : BEGIN OF ty_flmt,
zz_flmt_type TYPE zz_flmt_type,
zz_gsm_flmt_code TYPE zz_flmt_code,
END OF ty_flmt.
Internal Table
DATA : lit_flmt_code TYPE TABLE OF ty_flmt,
wa_flmt_code LIKE LINE OF lit_flmt_code.
DATA: lv_subrc TYPE sy-subrc VALUE '0',
lv_tabix TYPE sy-tabix,
lv_total_rec TYPE i,
lv_rec TYPE i,
flg_upd TYPE flag.
DESCRIBE TABLE total LINES lv_total_rec.
LOOP AT total.
lv_tabix = sy-tabix.
READ TABLE extract WITH KEY total.
IF sy-subrc EQ 0.
IF extract+3(10) IS INITIAL.
DELETE total.
DELETE extract INDEX sy-tabix.
DELETE extract INDEX lv_tabix.
lv_subrc = '4'.
flg_upd = 'X'.
MESSAGE s119(zcrm_appl) DISPLAY LIKE 'S'.
SET SCREEN 0.
ENDIF.
ENDIF.
wa_flmt_code-zz_flmt_type = total+13(3).
wa_flmt_code-zz_gsm_flmt_code = total+16(10).
APPEND wa_flmt_code TO lit_flmt_code.
ENDLOOP.
IF flg_upd IS INITIAL.
SORT lit_flmt_code BY zz_flmt_type zz_gsm_flmt_code.
DELETE ADJACENT DUPLICATES FROM lit_flmt_code.
DESCRIBE TABLE lit_flmt_code LINES lv_rec.
IF lv_total_rec <> lv_rec.
LOOP AT extract.
READ TABLE total WITH KEY extract.
IF sy-subrc EQ 0.
DELETE total INDEX sy-tabix.
DELETE extract INDEX 1.
lv_subrc = '4'.
MESSAGE s289(zcrm_appl) DISPLAY LIKE 'S'.
SET SCREEN 0.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
sy-subrc = lv_subrc.
ENDFORM.
<b>Please reward points and close the thread.</b>
Regards,
Amit Mishra
Similar Messages
-
Data Maintenance For Pooled Table
Hi,
I have to make table maintenance for pooled table T052S , Can I make table maintenace , if I have access key, is it feaseable, as I have some requirement , which is to be done. or is there any other method by which user can maintain this table except through SPRO.
thanks
bobbyWe're on ECC 5.0 here and this table already has a maintenance transaction defined - OBB9.
This is how SAP sets up maintenance for a lot of the config tables:
Define a Maintenance View - e.g. V_T052S
Define a Maintenance Dialog
Define a transaction variant on SM30
A user can be given maintenance access for only OBB9 -
Hi,
We have a date field in the form. I am validating date format as YYYY-MM-DD, validation works fine. But If user enters invalid date, how to validate date? For examples:
2006-02-31 It is an invalid date. How can i validate it.
If anybody have sample code, it will help me a lot.
thanks
Neopal.Hi Neopal,
You can use something like the following to test the date is valid, use the validation event on the <Field> which you want to validate to call a Rule something like this (not complete)..
<Rule name='isDateValid'>
<RuleArgument name='date'/>
<block>
<script>
var dateToTest = env.get('date');
var formatter = new java.text.SimpleDateFormat('YYYY-MM-DD');
Date validDate = formatter.parse(dateToTest); -
How to read data from a CLUSTER STRUCTURE not cluster table.
Hi,
how to read data from a CLUSTER STRUCTURE not cluster table.
regards,
Usha.Hello,
A structre doesnt contain data.. so u cannot read from it. U need to find out table of that structure and read data from it.
Regards,
Mansi. -
How to delete data from single field in a database table?
Hi guys,
Plz suggest me How to delete data from single field in a database table?
thnks,
pavanhi
in addition to abv details..chk this:
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3aef358411d1829f0000e829fbfe/content.htm
http://dev.mysql.com/doc/maxdb/en/34/ee7fbd293911d3a97d00a0c9449261/content.htm
regards,
madhu -
How to extract data from info cube into an internal table using ABAP code
HI
Can Anyone plz suggest me
How to extract data from info cube into an internal table using ABAP code like BAPI's or function modules.
Thankx in advance
regds
AJAYHI Dinesh,
Thankq for ur reply
but i ahve already tried to use the function module.
When I try to Use the function module RSDRI_INFOPOV_READ
I get an information message "ERROR GENERATION TEST FRAME".
can U plz tell me what could be the problem
Bye
AJAY -
How to retrieve data from domain(Value Range) of the table
hi
how to retrieve data from domain(Value Range) of the table
thanksHello,
You can try using the FM: DOMAIN_VALUE_GET TB_DOMAINVALUES_GET.
BR,
Suhas
Edited by: Suhas Saha on Mar 24, 2009 10:08 AM -
Error in creating Table Maintenance for TABLES: J_2IRG1BAL ,Dump error show
Dear Gurus
I have Created one Table Maintenance for TABLES: J_2IRG1BAL ,
1) I have take function group as same as table name like J_2IRG1BAL
3) Authorization Group &NC&
4) Authorization object S_TABU_DIS
5) Function group J_2IRG1BAL
6) Package J1I5
7) Maintenance type one step.
8) Maint. Screen No. Overview screen 2009.
9) Recording routine STD recording routines .
I have assign screen single screen 1 but it will not take the screen so ill put screen 2009 ,the system will not not accept the screen but I proposed to Save and activate the table maintenance generator and created and save the function group ,the table is ready to save the entries
We have to go to SM30 then put 4-5 entries ,after that a dump error shows
Which i have attachéd in this mail kindly help me out
Its effect in production server.
I have found that the error is given below I have mentioned all the details
Kindly read this
I have created function group J_2IRG1BAL and assign Package J1I5 and function group,J1I5 is already a Function group so problem occurs a dump error message displays
Kindly give me the right solution all the Clients are effected
110,100 150,250 these all are effected development clients
300 is prod client this is also affected because I have created a table maintenance generator and send the req to production .
*Dump Error Shows in Production*
Runtime Errors SYNTAX_ERROR
Date and Time 11.12.2008 09:26:30
What happened?
| Error in ABAP application program.
Error analysis
In program "SAPLJ1I5 ", the following syntax error occurred:
"The program "SAPLJ1I5" is not Unicode-compatible, according to its pro"
"gram attributes."
The current ABAP program "SAPLSVIM" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
In program "SAPLJ1I5 ", the following syntax error occurred
in the Include "SAPLJ1I5 " in line 0:
"The program "SAPLJ1I5" is not Unicode-compatible, according to its pro"
"gram attributes."
rigger Location of Runtime Error |
Program SAPLSVIM
Include LSVIMU01
Row 107
Module type (FUNCTION)
| Module Name VIEW_MAINTENANCE
Author and last person to change the Include are:
Author "TTLABAP2 "
Last changed by "TTLABAP2 "
105
Initialisierung des Abgleichsmandanten zum View *
106
>>>>>
vim_default_upgr_clnt-viewname = x_header-viewname.
108
vim_default_upgr_clnt-client = client_for_upgrade.
109
PERFORM vim_set_global_field_value IN PROGRAM (fpool)
| 110| USING 'VIM_DEFAULT_UPGR_CLNT' 'C' vim_default_upgr_clnt rc.I have send you all the details regarding the table maintenance generator
error is shown below
I have Created one Table Maintenance for TABLES: J_2IRG1BAL ,
1) I have take function group as same as table name like J_2IRG1BAL
3) Authorization Group &NC&
4) Authorization object S_TABU_DIS
5) Function group J_2IRG1BAL
6) Package J1I5
7) Maintenance type one step.
8) Maint. Screen No. Overview screen 2009.
9) Recording routine STD recording routines .
I have assign screen single screen 1 but it will not take the screen so ill put screen 2009 ,the system will not not accept the screen but I proposed to Save and activate the table maintenance generator and created and save the function group ,the table is ready to save the entries
We have to go to SM30 then put 4-5 entries ,after that a dump error shows
Which i have attachéd in this mail kindly help me out
Its effect in production server.
I have found that the error is given below I have mentioned all the details
Kindly read this
I have created function group J_2IRG1BAL and assign Package J1I5 and function group,J1I5 is already a Function group so problem occurs a dump error message displays
Kindly give me the right solution all the Clients are effected
110,100 150,250 these all are effected development clients
300 is prod client this is also affected because I have created a table maintenance generator and send the req to production .
Runtime Errors SYNTAX_ERROR
Date and Time 11.12.2008 09:26:30
ShrtText
Syntax error in program "SAPLJ1I5 ".
What happened?
Error in ABAP application program.
The current ABAP program "SAPLSVIM" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
In program "SAPLJ1I5 ", the following syntax error occurred
in the Include "SAPLJ1I5 " in line 0:
"The program "SAPLJ1I5" is not Unicode-compatible, according to its pro"
"gram attributes."
Author and last person to change the Include are:
Author "TTLABAP2 "
Last changed by "TTLABAP2 "
Error analysis
In program "SAPLJ1I5 ", the following syntax error occurred:
"The program "SAPLJ1I5" is not Unicode-compatible, according to its pro"
"gram attributes."
Trigger Location of Runtime Error
Program SAPLSVIM
Include LSVIMU01
Row 107
Module type (FUNCTION)
Module Name VIEW_MAINTENANCE
Source Code Extract
Line
SourceCde
77
TRANSPORTING NO FIELDS.
78
IF sy-subrc NE 0.
79
SELECT SINGLE * FROM tfdir WHERE funcname EQ <function_name>.
80
IF sy-subrc NE 0.
81
RAISE no_editor_function.
82
ELSE.
83
length = strlen( function_name1 ).
84
ASSIGN function_name1(length) TO <function_name>.
85
SELECT SINGLE * FROM tfdir WHERE funcname EQ <function_name>.
86
IF sy-subrc NE 0.
87
RAISE no_database_function.
88
ENDIF.
89
ENDIF.
90
INSERT x_header-viewname INTO alr_checked_views INDEX sy-tabix.
91
ELSE.
92
length = strlen( function_name1 ).
93
ASSIGN function_name1(length) TO <function_name>.
94
ENDIF.
95
96
Initialisierung der RFC-Destination zum View *
97
98
FPOOL+4 = X_HEADER-AREA.
99
fpool = x_header-fpoolname.
100
vim_default_rfc_dest-viewname = x_header-viewname.
101
vim_default_rfc_dest-rfcdest = rfc_destination_for_upgrade.
102
PERFORM vim_set_global_field_value IN PROGRAM (fpool)
103
USING 'VIM_DEFAULT_RFC_DEST' 'C' vim_default_rfc_dest rc.
104
105
Initialisierung des Abgleichsmandanten zum View *
106
>>>>>
vim_default_upgr_clnt-viewname = x_header-viewname.
108
vim_default_upgr_clnt-client = client_for_upgrade.
109
PERFORM vim_set_global_field_value IN PROGRAM (fpool)
110
USING 'VIM_DEFAULT_UPGR_CLNT' 'C' vim_default_upgr_clnt rc.
111
112
set flag if complex selection conditions in sellist *
113
114
IF complex_selconds_used NE space.
115
READ TABLE dba_sellist INDEX 1.
116
IF sy-subrc EQ 0 AND dba_sellist-cond_kind EQ space.
117
dba_sellist-cond_kind = 'C'. MODIFY dba_sellist INDEX 1.
118
ENDIF.
119
ENDIF.
120
121
direkter Vergleich: Flagge setzen usw. *
122
123
IF view_action EQ vim_direct_upgrade.
124
view_action = aendern.
125
PERFORM vim_set_global_field_value IN PROGRAM (fpool)
126
USING 'VIM_SPECIAL_MODE' 'C' vim_direct_upgrade rc. -
How to hide table header for empty table
Hi,
I wanna to hide table header for all tables which doesn't contain any data in my Adobe form. How can I do this? Helpful answers will be rewarded .HI Aliaksandr,
You can use javascript to do this dynamically.
For example, i used Adobe Designer 7.1 to add a table to a subform.
Now, i have the object hierchy as:
Level 1 - form1
Level 2 - form2
Level 3 - Table1
-->HeaderRow
--> Cell1
--> Cell2
-->Row1
--> Cell1
--> Cell2
Now, i sleect the Table1 element, and write the javascript which is executed on Initialization, as
if(this.Row1.Cell1.rawValue == "")
this.HeaderRow.presence = "hidden" ;
This will check that if the first row is empty, it will hide the header from the layout.
You can use something similar for your requirement.
Hope this helps,
Siddhartha Jain -
How to find the TCODE that is created for the table maintanance generator
Hi ,
How to find the TCODE that is created for the table maintanance generator of particular table,if we only know the table name.
Regards
Ramakrishna LHello,
I try it this way
1. Goto SE16 --> enter table TSTCP.
2. In the selection-screen displayed, enter
PARAM = *<ZTABNAME>*
You will get the t-code for the TMG.
BR,
Suhas
PS: Are you sure a t-code has been created for this TMG ? -
How to use data function using characterstics variable for calculation on
how to use data function using characterstics variable for calculation on attribute as key figure
Hi Gayatri
Did you not see my answer for CASE because CASE does indeed offer the use of the BETWEEN clause, but DECODE does not. Let me give you a little synopsis of DECODE.
In its most simple form it takes 4 values and looks like this: DECODE(A, B, C, D)
This essentially means, IF A = B THEN C ELSE D
The trick to solving BETWEEN in a DECODE is to work out algoriths where A = B. Because we don't know how many values are between 00 and 99, although I could guess there were 100 we could of course have 100 parts in the DECODE but that would be awful. How about if we look at it another way and say this:
IF PART_NUMBER < 'SDK00' THEN pay_amount
ELSE IF PART_NUMBER > 'SDK99' THEN pay_AMOUNT
ELSE pay_amount + 100
This statement only had 2 hard coded values, but how to make DECODE work with less than? Easy, we use the LEAST function. The LEAST function takes 2 values and returns the one with the lowest value. So I use LEAST(PART_NUMBER, 'SDK00') then whenever the PART_NUMBER is lower than SDK00 it will be true. A similar situation exists for the opposite function GREATEST. Putting all of this together then, you can do this:
DECODE(PART_NUMBER, GREATEST(PART_NUMBER, 'SDK00'), DECODE(PART_NUMBER, LEAST(PART_NUMBER, 'SDK99'), PAY_AMOUNT * 100, PAY_AMOUNT), PAY_AMOUNT)
In English this can be read as follows:
IF the PART_NUMBER is greater than or equal to SDK00 and the PART_NUMBER is less than or equal to SDK99 THEN PAY_AMOUNT x 100 ELSE 0
Best wishes
Michael -
Table maintenance for HRUS_D2 missing in SRM 7.0
Hi All,
The table maintenance for HRUS_D2 is missing in SRM 7.0. Is there any other other way of maintaining substitue on a large scale by an administrator.
i know we can assign substitute form portal , but initially we want some substitute set in the system and currently i cannot maintain this table HRUS_D2. The table maintenance is active in ECC system but not in SRM system.
Any help or oss note would be appreciated.
Thanks
Iftekhar AlamHi Masa,
The report mentioned is useful if we have to set substitution individually. i wanted to do in a mass way for 100-200 users and SM30 for HRUS_D2 would have helped.
Not sure why SAP provide the table maintenance in ECC but not in SRM.
I have got a FM RH_UPDATE_SUBST_LIST_SERVER which i can use to update the substitution table in a mass way and it worked.
Thanks
Iftekhar Alam -
How to find block free space and PCTUSED FOR THE TABLE
HI all,
Due to performance issues for my database , my management ask me to reset the PCTUSED and PCTFREE values , and my doubt is
1)How to find the current PCTUSED and PCTFREE values.
2)How to find block free space and PCTUSED FOR THE TABLE.
Please help me out regarding this.
Regards,
Vamsi.1)version is 10.2.0.4
2)output of query
tablespace extent_management allocation_type segment_space_management
SYSTEM LOCAL SYSTEM MANUAL
UNDOTBS1 LOCAL SYSTEM MANUAL
SYSAUX LOCAL SYSTEM AUTO
TEMP LOCAL UNIFORM MANUAL
USERS LOCAL SYSTEM AUTO
UNDOTBS2 LOCAL SYSTEM MANUAL
INS LOCAL SYSTEM AUTO
CONFTBS LOCAL SYSTEM AUTO
REINS LOCAL SYSTEM AUTO
ANALYST LOCAL SYSTEM AUTO
BI LOCAL SYSTEM AUTO
INTRFC LOCAL SYSTEM AUTO
COGNOS LOCAL SYSTEM AUTO
TS_INDX LOCAL SYSTEM AUTO
TS_CHOLAWEB LOCAL SYSTEM AUTO
TS_DASBOARD LOCAL SYSTEM AUTO -
About Table Maintance for An Table
Hi All
i would like create Table maintance for an table.kindly explain me how to create table maintance for an table...and what is the actual purpose of table maintance..
Thanks in advance.Hi Joe,
Table maintanance Generator is used to manually
input values using transaction sm30
follow below steps
1) go to se11 check table maintanance check box under
attributes tab
2) utilities-table maintanance Generator->
create function group and assign it under
function group input box.
also assign authorization group default &NC& .
3)
select standard recording routine radio in table
table mainitainence generator to move table
contents to quality and production by assigning
it to request.
4) select maintaience type as single step.
5) maintainence screen as system generated numbers
this dialog box appears when you click on create
button
6) save and activate table
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_46c/helpdata/en/a7/5133ac407a11d1893b0000e8323c4f/frameset.htm
/message/2831202#2831202 [original link is broken]
One step, two step in Table Maintenance Generator
Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
Plzz reward if it is useful,
Mahi. -
Hi ,
I have posted the following :
Full Table Scans for small tables... in Oracle10g v.2
and the first post of Mr. Chris Antognini was that :
"I'm sorry to say that the documentation is wrong! In fact when a full table scan is executed, and the blocks are not cached, at least 2 I/O are performed. The first one to get the header block (where the extent map is stored) and the second to access the first and, for a very small table, only extent."
Is it really wrong....????
Thanks...
SimFredrik,
I do not say in any way that the documentation in this point is wrong.....
In my first post , i have inserted a link to a thread made in another forum:
Full Table Scans for small tables... in Oracle10g v.2
Christian Antognini has written that the documentation is wrong....
I'm sorry to say that the documentation is wrong!
In fact when a full table scan is executed, and the
blocks are not cached, at least 2 I/O are performed. The
first one to get the header block (where the extent map
is stored) and the second to access the first and, for a
very small table, only extent.I'm just wondering if he has right......!!!!!!!
Thanks..
Sim
Maybe you are looking for
-
I have a 1TB WD external hard disk, which suddenly cannot be detected in my system. When i connect the hardisk to the macbook, the disk appears and immediately disconnects with the message "Disk not properly ejected". Any advice ?
-
I have not receive gems (just like coins) in a game the first time I purchased them it didn't do anything but it did charge me the second time I did it it said u already purchased this in app purchase but has not been downloaded yet plz help
-
How to create diagonal variable line pattern in CS6?
Hi guys I'm on the brink of insanity with creating my diagonal line pattern. I've tried everything I can think of but the pattern is an absolute mess! I want to create a diagonal line pattern but I want the lines not to be uniform. Basically I've mad
-
System recovery error in satellite A300
Hi. Sorry for the bad english. I have a problem. In my satellite A300 Vista comes a blue screen error. I followed the instructions in the manual to make system recovery. At the boot press f8 and select "Repair your computer". Seems to start properly
-
i have a macbook pro. i think i might have pushed some buttons that made my macbook look for a wireless keyboard.. i dont have any wireless keyboard. and now i cant use the keyboard on my macbook. how can i get the normal keyboard staring?