Application Development and Automation 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: 
Read only

module pool initial screen

Former Member
0 Likes
1,176

Hi experts,

I am doing a module pool program, in the initial screen there a filed licence number. i have created it and raised an error message if the user enters incorrect licence number. The problem is when i enter incorrect licence number it's getting grayed out, rather tha resting it.

the code i have written is below

SELECT SINGLE zz_licno

FROM zlec_master

INTO zlec_master-zz_licno

WHERE zz_licno = zlec_master-zz_licno.

IF sy-subrc <> 0.

MESSAGE e000(zmj) WITH 'ENTER VALID LICENCE NUMBER'.

ENDIF.

plz suggest me the best solution.

thanks and regards,

alson.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,151

hi seema,

I am sorry i am unable to place your piece of code in the existing. plz suggest me where to write. This is urgent plz help me with the code and fields below mentioned.

CASE sy-ucomm.

WHEN 'BACK'.

LEAVE PROGRAM.

ENDCASE.

IF NOT zlec_master-zz_licno IS INITIAL.

SELECT SINGLE zz_licno

FROM zlec_master

INTO zlec_master-zz_licno

WHERE zz_licno = zlec_master-zz_licno.

IF sy-subrc <> 0.

MESSAGE e000(zmj) WITH 'ENTER VALID LICENCE NUMBER'.

ENDIF.

ENDIF.

IF NOT zlec_master-zz_licno IS INITIAL.

SELECT zz_licno

zz_lec

zadd_line_1

zadd_line_2

zadd_line_3

zlandline_no

zmobile_no

zlicence_val_dt

FROM zlec_master

INTO CORRESPONDING FIELDS OF TABLE itab

WHERE zz_licno = zlec_master-zz_licno.

ENDIF.

CALL SCREEN 200.

ENDMODULE. " USER_COMMAND_0100 INPUT

thanks and Regards,

alson

10 REPLIES 10
Read only

Former Member
0 Likes
1,151

Hi,

Use FIELD ..MODULE.. in the PAI..Now that input field will not be grayed out..

Ex..

PROCESS AFTER INPUT.

FIELD zlec_master-zz_licno MODULE valid_licno.

    • Code..

MODULE valid_licno.

SELECT SINGLE zz_licno

FROM zlec_master

INTO zlec_master-zz_licno

WHERE zz_licno = zlec_master-zz_licno.

IF sy-subrc <> 0.

MESSAGE e000(zmj) WITH 'ENTER VALID LICENCE NUMBER'.

ENDIF.

ENDMODULE.

Thanks,

Naren

Read only

Former Member
0 Likes
1,151

u can also use CHAIN .... ENDCHAIN in PAI

in PAI

CHAIN
 FIELDs: field1,
              field2... " here specify all the screen fields

ENDCHAIN.

Read only

Former Member
0 Likes
1,151

hi

in the PAI of the screen write

<b>field <field name> module <module name> on request</b>

it will solve ur problem

regards

ravish

<b>plz reward if helpful</b>

Read only

Former Member
0 Likes
1,151

hi alson,

u can write the statement field for the license number in PAI.

<b>Process after input.

field zlec_master-zz_licno values (between '10' and '1000');

</b>

if u give a incorrect value this field will be enabled. u can re enter the correct value.

Regards....

Arun.

Reward points if useful.

Read only

Former Member
0 Likes
1,151

hi

good

dont use the SINGE statement in the select statement,instead of that you can use the corresponding fields of and you r selecting the field from zlec_master and also putting into the same table ,i cant able to understnad that,plz check that line,and change accordingly.

thanks

mrutyun^

Read only

Former Member
0 Likes
1,151

hi muthukumaran,

i postin u my complete code in PAI. plz suggest where to use the code suggested by u. As i am new to module pool plz help in solving the issue.

the code is as follows:

MODULE user_command_0100 INPUT.

CASE sy-ucomm.

WHEN 'BACK'.

LEAVE PROGRAM.

ENDCASE.

IF NOT zlec_master-zz_licno IS INITIAL.

SELECT SINGLE zz_licno

FROM zlec_master

INTO zlec_master-zz_licno

WHERE zz_licno = zlec_master-zz_licno.

IF sy-subrc <> 0.

MESSAGE e000(zmj) WITH 'ENTER VALID LICENCE NUMBER'.

ENDIF.

ENDIF.

IF NOT zlec_master-zz_licno IS INITIAL.

SELECT zz_licno

zz_lec

zadd_line_1

zadd_line_2

zadd_line_3

zlandline_no

zmobile_no

zlicence_val_dt

FROM zlec_master

INTO CORRESPONDING FIELDS OF TABLE itab

WHERE zz_licno = zlec_master-zz_licno.

ENDIF.

CALL SCREEN 200.

ENDMODULE. " USER_COMMAND_0100 INPUT

thanks and regards

alson.

Read only

Former Member
0 Likes
1,151

Hi

Write like this

here licence is the screen field name

PROCESS AFTER INPUT.

FIELD licence MODULE check_licence ON INPUT.

MODULE check_licence INPUT.

IF licence NE space.

SELECT SINGLE zz_licno

FROM zlec_master

INTO zlec_master

WHERE zz_licno = licence.

IF sy-subrc NE 0.

MESSAGE e 'Licence No does not exist'.

ENDIF.

ENDIF.

ENDMODULE.

Hope this helps

Regds

Seema

Read only

Former Member
0 Likes
1,152

hi seema,

I am sorry i am unable to place your piece of code in the existing. plz suggest me where to write. This is urgent plz help me with the code and fields below mentioned.

CASE sy-ucomm.

WHEN 'BACK'.

LEAVE PROGRAM.

ENDCASE.

IF NOT zlec_master-zz_licno IS INITIAL.

SELECT SINGLE zz_licno

FROM zlec_master

INTO zlec_master-zz_licno

WHERE zz_licno = zlec_master-zz_licno.

IF sy-subrc <> 0.

MESSAGE e000(zmj) WITH 'ENTER VALID LICENCE NUMBER'.

ENDIF.

ENDIF.

IF NOT zlec_master-zz_licno IS INITIAL.

SELECT zz_licno

zz_lec

zadd_line_1

zadd_line_2

zadd_line_3

zlandline_no

zmobile_no

zlicence_val_dt

FROM zlec_master

INTO CORRESPONDING FIELDS OF TABLE itab

WHERE zz_licno = zlec_master-zz_licno.

ENDIF.

CALL SCREEN 200.

ENDMODULE. " USER_COMMAND_0100 INPUT

thanks and Regards,

alson

Read only

0 Likes
1,151

Hey Alson,

in SCREEN 1000's flow logic,

there would be statement like....

<b>MODULE user_command.</b>

<u>instead of that write...</u>

<b>FIELD zlec_master-zz_licno MODULE user_command.</b>

This will solve your problem.

<b>

Dont forget to Reward Points if helpful,</b>

Regards,

Tejas

Read only

0 Likes
1,151

Hi Alson

I had already written in the code u have to write it in PAI.

Regds

Seema