2011 Feb 03 8:16 AM
Hello Guys,
I am making a report using smartforms. I am successful in showing data but problem is if if i put a value in parameters that does not exist is database, the smartform runs and related fields shows as empty fields. But the form is running. I want to show error message if the parameter values dose not matches with the database values. The message will show as Document not exists
So i used related error msg here like
if sy-subrc ne 0.
message e357.
endif.
But it is not working for passing values to smartform. It works if i use in classical report. Plz help me on this issue.
Thanks,
Rosaline.
Hello Guys,
I am making a report using smartforms. I am successful in showing data but problem is if if i put a value in parameters that does not exist is database, the smartform runs and related fields shows as empty fields. But the form is running. I want to show error message if the parameter values dose not matches with the database values. The message will show as Document not exists
So i used related error msg here like
if sy-subrc ne 0.
message e357.
endif.
But it is not working for passing values to smartform. It works if i use in classical report. Plz help me on this issue.
Thanks,
Rosaline.
2011 Feb 03 8:32 AM
Dear Rosaline,
Before calling the smartform, check whether the data that you are passing to smartform is initial or not.
So the approach can be:
1. Read the data from the database tables based on the entries made by the user on the selection screen.
2. Prepare the data to be printed / displayed
3. Check if there is any data to be displayed / printed. If there is not data, display the message 'No records found' else display it in an ALV grid or call the smartform for the printout (as per your requirement).
Hope it answers your query.
Cheers!!!
Amit
2011 Feb 03 8:37 AM
Hi,
Hope you are giving this error message in the Report.
You must assign the Error Message number to a Message class.
Example.
Message e000(8i) with 'Parameter value not found'.
Here 000 is the message number in the message class 8i.
Then please check the whether the internal table which you are passing to the smartform is not initial.
Please try with this.
With Regards,
Sumodh.P
2011 Feb 03 9:09 AM
Thanks all for reply. Should i have to use message before call function 'SSF_FUNCTION_MODULE_NAME' ? I tried it but not working.
if it_final[] is not initial.
if sy-subrc ne 0.
Message e000(8i) with 'Parameter value not found'.
endif.
endif.
2011 Feb 03 10:02 AM
Hi
You should check that you fields are not initial before calling the FM.
Thanks
Rahul Jain
2011 Feb 03 10:59 AM
>
> Thanks all for reply. Should i have to use message before call function 'SSF_FUNCTION_MODULE_NAME' ? I tried it but not working.
>
>
if it_final[] is not initial. >* if sy-subrc ne 0. ---> "Remove this condition check, it not required > Message e000(8i) with 'Parameter value not found'. > endif. > * endif. ---> "remove this >
Hi,
Sy-subrc doesnt need to be validated here, remove that If condition and check again.
Regards,
Karthik D
2011 Feb 03 8:58 AM
hi,
write like this...
if sy-subrc ne 0.
message e357.
exit.
endif.
Regards
Ganesh Reddy
2011 Feb 03 9:03 AM
hi,
try this
if sy-subrc <> 0.
message 'document not exsist' type 'S'
endif
2011 Feb 03 9:03 AM
Hi,
Can you please tell me your program flow to call a smartform from driver program?In more specific I would like to know whether you have written the SQL query retrieve from the database and pass it to smartform as import parameter and or tables or you just call the smartforms in the driver program and did all the query parts in smartforms?
In case of first one means if you retrieve all the data which you need to show in smartforms in the driver program then before call SSF_FUNCTION_MODULE_NAME you check whether the Tables you are passing or the work area you are passing is initial or not.
In the second case first you check the data is there or not in the database by using selection screen values before storing in internal table.then do a sy-subrc check before the smartform calling.
Regards,
Suvajit.
2011 Feb 03 11:47 AM
Hi,
write in this way.
IF ITAB IS NOT INITIAL.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'.
.........................................
.........................................
ELSE.
MESSAGE 'NO Parameter Found' TYPE 'S'.
LEAVE TO SCREEN 0.
ENDIF.
Regards,
Suvajit.
2011 Feb 06 5:04 AM
Thanks Suvajit. My problem is solved now.
With regards,
Tripod.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |