‎2006 Jan 31 7:31 AM
Hello Friends,
Can any body tell me the logic of the following query?
If there are 3 fields in the selection screen...if we enter wrong number in the first field it automatically block the remaining fields.
Thanx in Advance.
‎2006 Jan 31 7:40 AM
just check this code...
REPORT ZTEST1223.
TABLES: MARA.
PARAMETERS: P_MATNR LIKE MARA-MATNR,
P_VBELN LIKE VBAK-VBELN,
P_POSNR LIKE VBAP-POSNR.
AT SELECTION-SCREEN OUTPUT.
IF NOT P_MATNR IS INITIAL.
SELECT SINGLE MATNR
FROM MARA
INTO MARA-MATNR
WHERE MATNR = P_MATNR.
IF SY-SUBRC <> 0.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_VBELN'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
CLEAR P_VBELN.
ENDIF.
IF SCREEN-NAME = 'P_POSNR'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
CLEAR P_POSNR.
ENDIF.
ENDLOOP.
ENDI
‎2006 Jan 31 7:39 AM
Use the below code..
SELECTION-SCREEN BEGIN OF BLOCK B1.
PARAMETERS: P1 TYPE I,
P2 TYPE I,
P3 TYPE I.
SELECTION-SCREEN END OF BLOCKB1.
AT SELECTION-SCREEN ON BLOCK B1.
IF P1 NE <SOME VALUE>.
<ERROR MESSAGE>
ENDIF.
‎2006 Jan 31 7:43 AM
Hi Abdul Hakim ,
using at-selection screen on BLOCK <block> will allow all the fields to be editable in side the block and other blocks will get grayed out.
Regards
Raja
‎2006 Jan 31 7:55 AM
Hi Raja,
I thought he is asking what u have said..
Nice letting me know about this..
Abdul
‎2006 Jan 31 7:39 AM
Try this code sample.
parameters: a(1),
b(1) ,
c(1) .
at selection-screen on a .
if a is initial .
message e398(00) with 'Enter value in A' .
endif .
Regards
Raja
‎2006 Jan 31 7:41 AM
the key here is if you issue the error message in
at selection-screen on <parameter name> .
that parameter alone will be available for editing and the others will be grayed out.
Regards
Raja
‎2006 Jan 31 7:40 AM
just check this code...
REPORT ZTEST1223.
TABLES: MARA.
PARAMETERS: P_MATNR LIKE MARA-MATNR,
P_VBELN LIKE VBAK-VBELN,
P_POSNR LIKE VBAP-POSNR.
AT SELECTION-SCREEN OUTPUT.
IF NOT P_MATNR IS INITIAL.
SELECT SINGLE MATNR
FROM MARA
INTO MARA-MATNR
WHERE MATNR = P_MATNR.
IF SY-SUBRC <> 0.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_VBELN'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
CLEAR P_VBELN.
ENDIF.
IF SCREEN-NAME = 'P_POSNR'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
CLEAR P_POSNR.
ENDIF.
ENDLOOP.
ENDI
‎2006 Jan 31 7:51 AM
‎2006 Jan 31 7:57 AM
Hi jak,
though the method given by Vijay Babu works, i suggest that you should be using "At selection-screen on <param>"
parameters: a(1),
b(1) ,
c(1) .
at selection-screen on a .
check it against DB table and throw the error message here in this event.
Regards
Raja