09-17-2008 9:57 AM
hi all,
i have a parameter called - pa_telf1.
what is my requirment is that
1. the field should not be empty
2. if give any value it should not accept and i should give me error message
3. it should accept only the valid value from the table.
can any one tell me as to how to do it.
thanks in adv
09-17-2008 10:05 AM
You can achieve the 1st requirement with
CHECK field IS INITIAL. "the check command aborts the current program flow if the field is empty.
The 2nd requirement you can achieve with something like
IF field IS NOT INITIAL.
MESSAGE 'Socorro' TYPE 'I'. "if you want the message to be an error message, use TYPE 'E' instead.
I didn't understand exactly your 3rd requirement.
Hope this helps, anyway.
Avraham
09-17-2008 10:06 AM
hi all,
i have a parameter called - pa_telf1.
what is my requirment is that
1. the field should not be empty
2. if give any value it should not accept and i should give me error message
3. it should accept only the valid value from the table.
can any one tell me as to how to do it.
thanks in adv
Hi,
1. To appear any value use 'defalut' in parameter statement.
2. For The second requirement 'at selection-screen', use function module 'f4if_int_table_value_requset' to get values from table and populate it in the internal table and when you enter value, check it with the values in internal table . If entered value is wrong display error message.
Regards,
Narasimhulu P.
09-17-2008 10:17 AM
Hi,
As per your requirement:
1. make it Obligatory,
parameters: pa_telf1 type <xyz> OBLIGATORY.
For 2 & 3.
In event
AT SELECTION-SCREEN ON pa_telf1.
perform check_input.
**********************************************
in Form Check_input.
write the code to fetch data from the database table where you want to check its validity from.
select single <field>
from <DB table>
into g_telf1
where telf1 = pa_telf1.
if sy-subrc NE 0.
raise error message.
endif.
09-17-2008 10:19 AM
if u have define like this,
parameter : matnr like mara-matnr.
1. the field should not be empty
--> for this u can do like this
parameter : matnr like mara-matnr obligatory default 'ABC' .
by this u r 2nd problem also solve.
3. simply take mara table data into an one internal table say it_mara.--->
At selection-screen on output.
select * from mara into table it_mara.
and here u check u r values in parameter : matnr.
read table it_mara with key matnr = matnr.
if sy-subrc <> '0'.
Message 'Value Not found chk ur values' Type 'E'.
endif.
Regards,
Sanket.
09-17-2008 10:19 AM
Hi,
Qustion no 1.
Solution : Use keyword OBLIGATORY.
Qustion no 2 and 3.
Solution : In ' AT SELECTION-SCREEN ', Use function module 'F4IF_INT_TABLE_VALUE_REQUEST' and get the input values and display the values in input field.
09-17-2008 10:22 AM
To make the field non-empty, in the parameter declaration statement add 'Obligatory' keyword. To check it in a value table, use the following statement assuming zvalue_tab is the value table and the field is telf1 in the value table.
select count(*)
from zvalue_tab
where telf1 = pa_telf1.
if sy-subrc ne 0.
'Display error message.
endif.
The above code should be written in 'at selection-screen on pa_telf1' event.
Regards
Farzan
Edited by: Farzan Mohamed on Sep 17, 2008 11:22 AM