2006 Mar 22 2:37 PM
Hi,
I have created a ztable and did table maintainance generator. Even though first 3 fields are primary keys but still system is allowed to store the entries without any value (blank). pls suggest how to make it mandatory?
thanks,
Pradeep
2006 Mar 22 2:47 PM
Hi Pradeep,
if you don't want blank entries you can
- set the allowed values in the field domain
- if the table can only be modified by the maintainance view, modify the logic flow of the screen (insert a module in which you check the values and display an error message if the user inserts a blank value)
Regards, Manuel
Hi,
I have created a ztable and did table maintainance generator. Even though first 3 fields are primary keys but still system is allowed to store the entries without any value (blank). pls suggest how to make it mandatory?
thanks,
Pradeep
2006 Mar 22 2:41 PM
Hi,
It is possible to create one line as blank line,but not one more.
2006 Mar 22 2:44 PM
Hello Pradeep,
field entry mandatory( shud not left blank)
This cannot be done in SE11 while creating a table.
This needs to be done in screen painter.
regards,
Kinshuk Saxena
2006 Mar 22 2:44 PM
you have to add your own custom checks in table maintenance by modifying the generated code. Go to the screen editor and create your own module in PAI and create a z include and add ur validations there.
2006 Mar 22 2:47 PM
Hi Pradeep,
if you don't want blank entries you can
- set the allowed values in the field domain
- if the table can only be modified by the maintainance view, modify the logic flow of the screen (insert a module in which you check the values and display an error message if the user inserts a blank value)
Regards, Manuel
2006 Mar 22 3:03 PM
Hi Manuel,
Thanks for the answer. it will be great if you could let me know where to do add the pai (own logic). I am able to write the code but do't know where to write.
Thanks,
Pradeep
2006 Mar 22 3:16 PM
Hi,
- Se11 -> Modify
- choose Utilities -> Table maintenance generator (i presume that a maintenace view already exists)
- Environment -> Modification -> Maintenace screen
- Double click on dynpro number
- Inside the LOOP statement (because you have to check all the entries) for example just before the ENDLOOP statement, insert:
FIELD ZFIELD.
MODULE CHECK_ZFIELD.
Regards, Manuel
2006 Mar 22 4:45 PM
Hi Manuel,
As you suggested I have added the code but during debugging still system is not able to recognised this module "MODULE CHECK_ZPRPTN1_SPART INPUT."
Code is given below :
Flow Logic :
**
PROCESS AFTER INPUT.
MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND.
MODULE LISTE_BEFORE_LOOP.
LOOP AT EXTRACT.
FIELD ZPRPTN1-SPART .
MODULE CHECK_ZPRPTN1_SPART.
endloop.
-
code in include is :
MODULE CHECK_ZPRPTN1_SPART INPUT.
IF ZPRPTN1-spart eQ ' '.
MESSAGE E000(VA) WITH 'PLS FILL VALUE'.
EXIT.
ENDIF.
ENDMODULE. " MODULE CHECK_ZPRPTN1_SPART
-
Pls suggest how to resolve this problem.
Thanx,
2006 Mar 22 4:46 PM
2006 Mar 22 4:50 PM
2006 Mar 22 4:59 PM
Here is a way. Go to SE54. Enter you table name. In the menu, 'Environment-->Events'. Hit 'enter' on the subsequent popup warning. In the next screen, you will see a table control with three columns. First one is 'T' and the next one is 'FORM routine' and the last one is 'Editor'. Click on 'New Entries' button. Enter '01' in the column 'T' and 'VALIDATE_BEFORE_SAVE' under the 'FORM routine' column. I am just taking an example here, but the name can be anything. What is important is the 01.
Now click on the source code icon that appears in the third column. Next you will get a popup asking for the include name where you want to write the code for this routine. This include will be part of your function group's main program. Once you are in the editor, use the following code for validating the blank values.
FORM validate_before_save.
DATA: BEGIN OF s_myztable.
INCLUDE STRUCTURE zmyztable.
INCLUDE STRUCTURE vimtbflags.
DATA: END OF s_myztable.
LOOP AT total.
CLEAR s_myztable.
MOVE total TO s_myztable.
*-- only if it is not marked for deletion
CHECK s_myztable-vim_action <> neuer_geloescht.
IF s_myztable-keyfield1 IS INITIAL OR
s_myztable-keyfield2 IS INITIAL.
MESSAGE i000 WITH 'Key Field1 and Key Field2 cannot be blank.'.
sy-subrc = 4.
EXIT.
ENDIF.
ENDLOOP.
ENDFORM. " VALIDATE_BEFORE_SAVE
2006 Mar 22 5:00 PM
2006 Nov 09 1:24 PM
Hi Pradeep,
can u tell me the code or explain what u have done as i have the same issue.
Thanxs in advance.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |