‎2006 Feb 22 6:26 PM
hi Friends,
currenlty i am trying an DIALOG PROGRAM.
Ineed to have message ssayihn that if any entries have the value 0 then , it should ask the user to enter a non-zero value.
my dialog program is that, i have to enter the
1. employe name, employee no and deptno.
this is my PAI program
Now inside the SAVE code i need to enter an message id. how could i do that. Please help me regarding this.
odule INSERTTABLE .
Clear UserEntered.
CASE UserEntered.
When 'SAVE' or 'STORE'.
ZZEMP-EMPNO = PEMPNO.
ZZEMP-FIRSTNAME = PFIRSTNAME.
ZZEMP-DEPTNO = PDEPTNO.
insert zzemp.
If ZZEMP-EMPNO = 0.
message i001 with PEMPNO.
ENDIF.
When 'MOD'.
ZZEMP-EMPNO = PEMPNO.
ZZEMP-FIRSTNAME = PFIRSTNAME.
ZZEMP-DEPTNO = PDEPTNO.
update zzemp.
When 'DELETE'.
ZZEMP-EMPNO = PEMPNO.
ZZEMP-FIRSTNAME = PFIRSTNAME.
ZZEMP-DEPTNO = PDEPTNO.
DELETE ZZEMP.
When 'REFRESH'.
CLEAR ZZEMP.
CLEAR PEMPNO.
CLEAR PFIRSTNAME.
CLEAR PDEPTNO.
when 'BACK'.
set screen 0.
leave screen.
when 'EXIT' or 'CANCEL'.
Leave Program.
endcase.
endmodule. " USER_COMMAND_0010 INPUT
‎2006 Feb 22 6:31 PM
Why are you doing a 'clear UserEntered' before your 'case UserEntered'. It will clear the value of this and your case statement will never execute.
Your message statement is ok.
‎2006 Feb 22 6:31 PM
Why are you doing a 'clear UserEntered' before your 'case UserEntered'. It will clear the value of this and your case statement will never execute.
Your message statement is ok.
‎2006 Feb 22 6:33 PM
U CAN CREATE A MESSAGE CLASS(say zmes) IN se91 and create ur messages in it. like
001 Please enter & & ( & implies that u can enter variables in its place)
then in ur code u can write
message i001(zmes) with text-001 ( u can write what u want to display after 'Please enter' here).
Hope it helps.
Regards,
Bikash
‎2006 Feb 22 6:37 PM
I am a little confused about your requirement, but you want to issue a message if emp number is not filled in by the user correct?
When 'SAVE' or 'STORE'.
<b>Clear UserEntered.</b>
<b>If ZZEMP-EMPNO = 0.
message<b> E001</b> with PEMPNO.
ENDIF.</b>
ZZEMP-EMPNO = PEMPNO.
ZZEMP-FIRSTNAME = PFIRSTNAME.
ZZEMP-DEPTNO = PDEPTNO.
insert zzemp.
First, you should probably be check this before you write to the database, and second it should probably be an error, right?
You should also be clearing your <b>UserEntered</b> in the case statement after dropping into "SAVE" section.
Usually I would put these kinds of checks in a separate module and tie it directly to the field.
Regards,
Rich Heilman