Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

dialog programing-Urgent

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

3 REPLIES 3

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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