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

getting problem in displaying messages...

Former Member
0 Likes
1,312

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
Read only

agnihotro_sinha2
Active Contributor
0 Likes
1,279

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.

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

11 REPLIES 11
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,279

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.

Read only

agnihotro_sinha2
Active Contributor
0 Likes
1,280

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.

Read only

Former Member
0 Likes
1,279

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

Read only

GauthamV
Active Contributor
0 Likes
1,279

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.

Read only

Former Member
0 Likes
1,279

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

Read only

Former Member
0 Likes
1,279

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

Read only

Former Member
0 Likes
1,279

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

Read only

Former Member
0 Likes
1,279

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

Read only

Former Member
0 Likes
1,279

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??

Read only

0 Likes
1,279

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

Read only

Former Member
0 Likes
1,279

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