05-04-2009 12:17 PM
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
05-04-2009 12:21 PM
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.
05-04-2009 12:21 PM
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.
05-04-2009 12:21 PM
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.
05-04-2009 12:21 PM
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
05-04-2009 12:22 PM
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.
05-04-2009 12:36 PM
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
05-04-2009 12:49 PM
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
05-04-2009 1:06 PM
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
05-04-2009 1:21 PM
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
05-05-2009 6:33 AM
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??
05-05-2009 6:40 AM
05-05-2009 6:57 AM
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