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

Former Member
0 Likes
816

Hi all,

i got an input/output field of length 5 characters.My requirement is if the user enters 3 character in tht I/O field and pushes a button.A pop up should be displayed showing tht it does not accept .Pls give me the logic or an sample code.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
789

Hi ,

Use this logic when user click button

v_data = strlen( screen-field ).

if v_data = 3.

CALL FUNCTION 'POPUP_CONTINUE_YES_NO'

EXPORTING

TEXTLINE1 = WSC-DECISION_TEXT1

TEXTLINE2 = WSC-DECISION_TEXT2

TITEL = '??? DECISION TIME ???'

IMPORTING

ANSWER = WSC-ANSWER

EXCEPTIONS

OTHERS = 1.

endif.

Regards

amole

7 REPLIES 7
Read only

Former Member
0 Likes
790

Hi ,

Use this logic when user click button

v_data = strlen( screen-field ).

if v_data = 3.

CALL FUNCTION 'POPUP_CONTINUE_YES_NO'

EXPORTING

TEXTLINE1 = WSC-DECISION_TEXT1

TEXTLINE2 = WSC-DECISION_TEXT2

TITEL = '??? DECISION TIME ???'

IMPORTING

ANSWER = WSC-ANSWER

EXCEPTIONS

OTHERS = 1.

endif.

Regards

amole

Read only

Former Member
0 Likes
789

Hi alex,

In the PAI

field fieldname module modulename

v_len = strlen( v_str ).

if v_len = 3.

CALL FUNCTION 'POPUP_FOR_INTERACTION'

EXPORTING

HEADLINE = 'Warning'

TEXT1 = 'Enter 5 character value'

TICON = 'W'

BUTTON_1 = 'Ok'.

endif.

Regards,

Vidya

Read only

Former Member
0 Likes
789

In the PAI event write this logic.

DATA : V_LENGTH TYPE I.

V_LENGTH = STRLEN( INPUTFIELD ).

IF V_LENGTH <> 5.

*--If length is not equal to 5.

CALL FUNCTIN 'POPUP_TO_DISPLAY'.... to display the message..

endif.

Read only

Former Member
0 Likes
789

in PAI section:

module check.

in program:

module check.

data: v_len type i.

case sy-ucomm.

when '<your fcode for button>.

v_len = strlen( v_field ).

if v_len < 5.

message w001(zz) with 'Not acceptible'.

endif.

endcase.

endmodule.

in se91 create a message class with name zz and have an entry 001 with a place holder &.

Regards,

Ravi

Read only

vladimir_golovtchiner
Participant
0 Likes
789

Hi,

in the flow logick of your dynpro in PAI area write

the word 'module' and press F1 you could see than what is possible to do.

regards

Vladimir

Read only

Former Member
0 Likes
789

Thanks for the given help but I'm not getting it Wright. I presume the module check is to check the data in the field, but the data is only considered to be written after I press ENTER without passing to next screen. Is there any way to force the field to be read without pressing ENTER.

Best Regards

Read only

Former Member
0 Likes
789

in my opinion no it is not possibile without press ENTER or another button.

but if you press enter is not obligatory pass to next screen

Message was edited by: rita cortese