10-16-2008 10:50 AM
10-16-2008 10:52 AM
Hi
In the Command Box , I mean where you write T-codes in that box write BACK and enter.
Regards
Pavan
10-16-2008 10:55 AM
If you want to return to the selection screen, put the error message under AT SELECTION-SCREEN event.
*----------------------------------------------------------------------*
* AT SELECTION-SCREEN EVENT *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN.
MOVE sy-ucomm TO sscrfields-ucomm.
CHECK sscrfields-ucomm EQ 'ONLI'.
* To validate the user input vendor number.
PERFORM validate_vendor.
*----------------------------------------------------------------------*
* FORM VALIDATE_VENDOR *
*----------------------------------------------------------------------*
* Subroutine for validating the user input vendor number. *
*----------------------------------------------------------------------*
* There are no interface parameters to be passed to this subroutine. *
*----------------------------------------------------------------------*
FORM validate_vendor .
SELECT SINGLE
lifnr " Vendor number
name1 " Vendor name
ort01 " City
INTO (w_lifnr,
w_vend_name,
w_vend_city)
FROM lfa1
WHERE lifnr IN s_lifnr.
IF sy-subrc NE 0.
MESSAGE e888(sabapdocu)
WITH text-nov.
ENDIF. " IF SY-SUBRC NE 0
ENDFORM. " VALIDATE_VENDOR
If the user enters the wrong vendor, the error message will be triggered and the user will be returned to the selection screen. If you are in the START-OF-SELECTION event and the processing needs to be stopped immediately, then use a success or information message and write EXIT command. That too will return the selection screen for the user to change the selection-criteria.
10-16-2008 10:55 AM
use At selection-screen on <field> which would allow to back at the same position.
Regards
Shashi
10-16-2008 10:56 AM
hii
you can use
set screen '0'.
leave screen.
or make message type as warning message by using
message 'Message' type ' w '.
regards
twinkal
10-16-2008 10:56 AM
No, after calling ALV function module, if I get an error message like no data found, I should bring the control back to initial selection screen.
10-16-2008 11:02 AM
in event end-of-selection do this.
end-of-selection.
IF IT_ALVFINAL is initial.
Message I000 'No records found for the selection criteria'.
set screen '0'.
leave screen.
endif.
10-16-2008 11:04 AM
You should be checking if the report output table contains any data or not, even before calling the function module.
10-16-2008 10:57 AM
Hi,
Instead putting a error message, you can put a warning message, which makes the user to continue with his program execution after that.
Regards,
Sumalatha
10-16-2008 10:57 AM
Hi,
you can use leave to transaction.
e.g
AT selection-screen output
IF <CONDITION>
MESSAGE <msg type>.
LEAVE TO TRANSACTION '<tcode>'.
ENDIF.
10-16-2008 10:58 AM
10-16-2008 10:59 AM
10-16-2008 11:01 AM
1 .use information message
after that write stop statement to brig back to selection screen
2. use at user command
write down the query under Execute's(F8) user command
if no data found give eroor msg which will bring to selection screen
10-16-2008 11:01 AM
Hi
Before passing the internal table to ALV function module you check whether Any data exists or not if there is not data then simply print a message.
Regards
Pavan
10-16-2008 11:02 AM
Hi
AT SELECTION-SCREEN provides a facility to get back your focus even got the ERROR message
Thanks