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: 

getting problem in displaying messages...

Former Member
0 Kudos

I have prepared this report and i want that if the user enters value < 1 on selection screen, a message should be displayed saying that its a lower value and same thing for value > 200. but when i'm executing this code, without checking its displaying d message at selection screen and its doing nothing if i give value > 200. Plz tell me d solution.

REPORT ZVENDORDATA.

tables: LFA1,lfb1.

data: ITAB LIKE LFA1 OCCURS 0 WITH HEADER LINE,

JTAB LIKE LFB1 OCCURS 0 WITH HEADER LINE.

SELECT-OPTIONS: vendor_n for lfa1-lifnr.

set pf-status 'MENU'.

INITIALIZATION.

vendor_n-low = '1'.

vendor_n-high = '200'.

vendor_n-option = 'BT'.

APPEND vendor_n.

clear vendor_n.

IF VENDOR_N-LOW < '1'.

MESSAGE S000(sabapdocu).

clear vendor_n.

ELSEIF vendor_n-HIGH > '200'.

MESSAGE S001(sabapdocu).

ENDIF.

Edited by: neha.7 on May 4, 2009 1:19 PM

1 ACCEPTED SOLUTION

agnihotro_sinha2
Active Contributor
0 Kudos

hi Neha,

Place ur code under AT SELECTION SCREEN.



IF VENDOR_N-LOW < '.
MESSAGE S000(sabapdocu).
clear vendor_n.
ELSEIF vendor_n-HIGH > '200'.
MESSAGE S001(sabapdocu).
ENDIF.

.

ags.

11 REPLIES 11

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

first check if vendor_n-HIGH is intial.

IF VENDOR_N-LOW < 1. ==> no value here

MESSAGE S000(sabapdocu).

clear vendor_n.

ELSEIF vendor_n-HIGH > '200'.

MESSAGE S001(sabapdocu).

ENDIF.

else.

if vendor_n-low < 1 and vendor_n-HIGH > 200 .

message.

endif.

endif.

agnihotro_sinha2
Active Contributor
0 Kudos

hi Neha,

Place ur code under AT SELECTION SCREEN.



IF VENDOR_N-LOW < '.
MESSAGE S000(sabapdocu).
clear vendor_n.
ELSEIF vendor_n-HIGH > '200'.
MESSAGE S001(sabapdocu).
ENDIF.

.

ags.

Former Member
0 Kudos

Hi,

Use it like this.

IF vendor_n < VENDOR_N-LOW.

MESSAGE S000(sabapdocu).

clear vendor_n.

ELSEIF vendor_n > vendor_n-HIGH.

MESSAGE S001(sabapdocu).

ENDIF.

hope it helps.

Regards

Rajesh Kumar

GauthamV
Active Contributor
0 Kudos

check this.



tables: LFA1,lfb1.
data: ITAB LIKE LFA1 OCCURS 0 WITH HEADER LINE,
JTAB LIKE LFB1 OCCURS 0 WITH HEADER LINE.
SELECT-OPTIONS: vendor_n for lfa1-lifnr.
set pf-status 'MENU'.

INITIALIZATION.
vendor_n-low = '1'.
vendor_n-high = '200'.
vendor_n-option = 'BT'.
APPEND vendor_n.
clear vendor_n.

At selection-screen on vendor_n.

IF VENDOR_N-LOW < '1'.
MESSAGE S000(sabapdocu).
clear vendor_n.
ELSEIF vendor_n-HIGH > '200'.
MESSAGE S001(sabapdocu).
ENDIF.

Former Member
0 Kudos

remove the following statement from ur code.

clear vendor_n.

and add VENDOR_N-SIGN = 'I'. before append in initialization.

and see the result in debug

Edited by: Tripat Pal Singh on May 4, 2009 5:07 PM

Former Member
0 Kudos

try this after 'START-OF-SELECTION'...

START-OF-SELECTION.

IF VENDOR_N-LOW < '.

MESSAGE S000(sabapdocu).

clear vendor_n.

ELSEIF vendor_n-HIGH > '200'.

MESSAGE S001(sabapdocu).

ENDIF

Former Member
0 Kudos

Put in at selection screen event.

At selection-screen on vendor_n.

IF VENDOR_N-LOW < 1.

MESSAGE S000(sabapdocu).

clear vendor_n.

ELSEIF vendor_n-HIGH > '200'.

MESSAGE S001(sabapdocu).

ENDIF.

Regards

Former Member
0 Kudos

Hi Neha,

Modify ur code like this

REPORT ZVENDORDATA.

tables: LFA1,lfb1.

data: ITAB LIKE LFA1 OCCURS 0 WITH HEADER LINE,

JTAB LIKE LFB1 OCCURS 0 WITH HEADER LINE.

SELECT-OPTIONS: vendor_n for lfa1-lifnr.

set pf-status 'MENU'.

INITIALIZATION.

vendor_n-low = '1'.

vendor_n-high = '200'.

vendor_n-option = 'BT'.

APPEND vendor_n.

clear vendor_n.

IF VENDOR_N-LOW < 0. """"""Insted of '0'

MESSAGE S000(sabapdocu).

clear vendor_n.

ELSEIF vendor_n-HIGH > 200 . """""""insted of '200'

MESSAGE S001(sabapdocu).

ENDIF.

I have checked that by executing.

Regards,

Yog

Former Member
0 Kudos

thanks a lot 4 ur replies....

after using at selection-screen and 1 & 200 instead of '1' and '200' while comparison, problem has been solved but i have 1 doubt.. while assigning the value i used '1' & '200' and its working but when i used it in comparison its not working properly. why so??

0 Kudos

try using LT instead of <......what it results into...??

Former Member
0 Kudos

Hi,

This problem is solved if you use proper event in your report.

Put your condition in 'At selection screen' event as this event check the selection screen value.

Regards,

Himanshu