2013 Sep 18 11:03 AM
hi
I have a statement like
Parameters : material type mara-matnr which actually gives me all the values that can be entered when i press F4
however i can also enter any other value....Is their a way i can force the user to enter from only those values coming in F4
Hi,
you can do validation for the material number(matnr)
or
Using foreign keys, you can easily create value checks for input fields
2013 Sep 18 11:10 AM
Hi Hema,
Validate using
At selection-screen on p_matnr.
example
DATA : wa_matnr TYPE mara-matnr.
PARAMETERS : p_matnr TYPE mara-matnr.
AT SELECTION-SCREEN ON p_matnr.
SELECT matnr FROM mara
INTO wa_matnr
WHERE matnr = p_matnr.
ENDSELECT.
IF sy-subrc NE 0.
MESSAGE 'Wrong Material' TYPE 'E'.
ENDIF.
2013 Sep 18 11:12 AM
2013 Sep 18 11:14 AM
Hi Hema,
You should do a validation check. While execution, you can check if the value entered in the field matches an entry in MARA table with Select MATNR from MARA into LMatnr where
matnr = P_matnr ( your Parameter ).
If sy-subrc NE 0.
Message ..Not valid.
2013 Sep 18 11:18 AM
Hi,
Try this below code.
At Selection screen on p_matr.
IF p_matr IS NOT INITIAL.
SELECT SINGLE matnr
FROM mara
INTO lv_matnr
WHERE matnr EQ p_matr.
IF sy-subrc NE 0.
"Display your error message.
ENDIF.
ENDIF.
Best Regards,
Abirami
2013 Sep 18 11:38 AM
Hi,
you can do validation for the material number(matnr)
or
Using foreign keys, you can easily create value checks for input fields
2013 Sep 18 11:42 AM
Hi,
your parameters is material type?
if so, field is mara-mtart and not mara-matnr.
For Validate You can try use
AT SELECTION SCREEN on p_mtart.
Regards
Ivan
2013 Sep 18 12:52 PM
TYPES: BEGIN OF ty_field,
matnr TYPE matnr,
END OF ty_field.
DATA :t_rtn TYPE STANDARD TABLE OF ddshretval,
x_rtn TYPE ddshretval,
t_field TYPE STANDARD TABLE OF ty_field,
dynpfields TYPE TABLE OF dynpread WITH HEADER LINE.
PARAMETERS: p_id(20) TYPE c MODIF ID grp.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'GRP'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_id.
SELECT DISTINCT matnr
FROM mara
INTO TABLE t_field
UP TO 10 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'P_ID'
value_org = 'S'
TABLES
value_tab = t_field
return_tab = t_rtn
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
READ TABLE t_rtn INTO x_rtn INDEX 1.
IF sy-subrc EQ 0.
dynpfields-fieldname = 'P_ID'.
MOVE x_rtn-fieldval TO dynpfields-fieldvalue.
APPEND dynpfields.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = dynpfields.
ENDIF.
2013 Sep 18 2:35 PM
2013 Sep 21 2:55 PM
Hi,
You can modify SCREEN, dynamically,in your ABAP program during the PBO event of a screen. Its contents override the static attributes of the screen fields for a single screen call.
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbab6f35c111d1829f0000e829fbfe/content.htm
For this you need to write the below code in one of the MODULEs in PBO event (1000 screen of your program ).
LOOP AT SCREEN.
* you can specify IF conditions here according to your screen elements
screen-input = 0. " 0 will disable accepting input ; 1 will enable accepting input
MODIFY SCREEN.
ENDLOOP.
This link will be helpful to you:
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbab6f35c111d1829f0000e829fbfe/content.htm
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |