‎2009 Jul 10 6:34 AM
hi all,
there is validation for SELECT-OPTIONS:
Need to take Material No.s and Base Code from the selection-screen, i need to check to see if assignment to certificate profile exits(KOTI001(Table)-material and KOTI905(table)-Base Code). if No need to pop-up message.
Thanks,
‎2009 Jul 10 6:52 AM
‎2009 Jul 10 6:56 AM
Hi,
Use 'At Selection Screen' event for validation and 'POPUP_TO_CONFIRM' for the pop up message.
Thanks,
Sri.
‎2009 Jul 10 7:02 AM
No Need of pop-up message jut it is enough to show error message. tell me how to give logic .
‎2009 Jul 10 7:05 AM
Hi!!!
Check this code snippet.
TABLES: koti001.
TYPES: BEGIN OF ty_koti001,
matnr TYPE matnr,
knumh TYPE knumh,
END OF ty_koti001.
DATA: it_koti001 TYPE TABLE OF ty_koti001.
SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
select-OPTIONS: pa_matnr FOR koti001-matnr,
pa_knumh FOR koti001-knumh.
SELECTION-SCREEN END OF BLOCK blk1.
START-OF-SELECTION.
SELECT matnr FROM koti001 INTO CORRESPONDING FIELDS OF TABLE it_koti001
WHERE matnr in pa_matnr.
IF sy-subrc NE 0.
MESSAGE 'No material found' TYPE 'I'.
ENDIF.P.S. Do similar check for base code(koti001-knumh).
Thanks
‎2009 Jul 10 7:23 AM
Try something like
TYPES: BEGIN OF ty_koti001,
matnr TYPE matnr,
knumh TYPE knumh,
END OF ty_koti001.
DATA: gt_koti001 TYPE TABLE OF ty_koti001,
l_matnr TYPE matnr.
SELECTION-SCREEN: BEGIN OF BLOCK so01 WITH FRAME TITLE text-001.
SELECT-OPTIONS: so_matnr FOR koti001-matnr,
so_knumh FOR koti001-knumh.
SELECTION-SCREEN END OF BLOCK so01.
AT SELECTION-SCREEN ON BLOCK so01.
IF sscrfields-ucomm EQ 'ONLI'
OR sscrfields-ucomm EQ 'PRIN'.
SELECT matnr
INTO CORRESPONDING FIELDS OF TABLE gt_koti001
FROM koti001
WHERE matnr IN so_matnr
AND knumh IN so_knumh.
ELSE.
SELECT SINGLE matnr
INTO l_matnr
FROM koti001
WHERE matnr IN so_matnr
AND knumh IN so_knumh.
ENDIF.
IF sy-subrc NE 0.
MESSAGE e019(k6).
ENDIF.
START-OF-SELECTION.Regards,
Raymon
‎2009 Jul 10 7:41 AM
‎2009 Jul 10 7:43 AM
You can use at selection screen event for this purpose.
For example
parameters: p_matnr like mara-matnr.
at selection-screen on p_matnr.
write your logic to give the error message.
select-options: s_matnr for mara-matnr.
at selection-screen.
if not s_matnr[] is initial.
loop at s_matnr.
check the every material no in s_matnr-low and if the material no not satifid the condition then give the error message.
if s_matnr-high is initial.
check the every material no in s_matnr-low and if the material no not satifid the condition then give the error message.
endif.
endloop.