‎2007 Aug 13 1:28 PM
Dear All,
I have a typical requirement.
There are three fields(select options) in the selection screen and all the three are mandatory.
the fields are s_matnr , s_batch, s_lifnr.
Here if there is input for s_batch or s_lifnr or for both then no input should be allowed to the s_matnr and data selection is based on only s_batch and s_lifnr.
If input is given then no input allowed to the fields s_batch and s_lifnr and data collection is only based on s_matnr.
Please let me know how to do this.
‎2007 Aug 13 1:33 PM
Hi,
You need to use the LOOP AT SCREEN option,
AT SELECTION-SCREEN OUTPUT, use this LOOP AT SCREEN then modify the selection screen
Regards
Sudheer
‎2007 Aug 13 1:35 PM
Hi,
Try this.
at selection-screen output.
if s_batch ne '' or s_lifnr ne ''.
flag = 1.
elseif s_matnr ne ''.
flag = 2.
case flag.
when '1'.
write query for batch and vendor.
when '2'.
write query for material.
Regards,
Himanshu
Message was edited by:
Himanshu Verma
‎2007 Aug 13 2:25 PM
Hi ,
Try this
REPORT ZK_SAMPLE_SS.
TABLES : FEBEP,MARA,LFA1.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_MATNR FOR MARA-MATNR MODIF ID GP2,
S_BATCH FOR FEBEP-BATCH MODIF ID GP1,
S_LIFNR FOR LFA1-LIFNR MODIF ID GP1.
SELECTION-SCREEN : END OF BLOCK B1.
AT SELECTION-SCREEN OUTPUT.
IF NOT S_BATCH IS INITIAL OR NOT S_LIFNR IS INITIAL.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'GP2'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF NOT S_MATNR IS INITIAL .
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'GP1'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Reward if usefull.
Regards,
Krishna Kishore .K
‎2007 Aug 13 1:37 PM
Hi,
take S_BATCH and S_LIFNR as one group and S_MATNR as another group and use AT SELECTION-SCREEN OUTPUT event.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: s_matnr TYPE gs_mara-matnr MODIF ID abc.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: pa_kunnr TYPE vbak-kunnr MODIF ID def.
SELECT-OPTIONS: s_lifnr FOR gs_lfa1-lifnr MODIF ID def,
s_batch FOR gs_....-batch MODIF ID def.
SELECTION-SCREEN END OF BLOCK b2.
For matnr
if not s_matnr is initial
LOOP AT SCREEN.
IF screen-group1 = gc_abc.
screen-input = gc_zero_num.
ELSEIF screen-group1 = gc_def.
screen-active = gc_one_num.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-group1 = gc_def.
screen-input = gc_zero_num.
ELSEIF screen-group1 = gc_abc.
screen-active = gc_one_num.
ENDIF.
MODIFY SCREEN.
endif.
Regards
Kannaiah
‎2007 Aug 13 1:45 PM
Hi,
Try with this code:
REPORT ZTMP_ENHD163.
DATA gi_ddshretval TYPE STANDARD TABLE OF ddshretval.
DATA wa_ddshretval type ddshretval.
data : begin of itab occurs 0,
matnr like mara-matnr,
end of itab.
DATA ITAB1 LIKE ITAB OCCURS 0 WITH HEADER LINE.
----
PARAMETERS / SELECT-OPTIONS *
----
*first box containing radio button
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_r_uom RADIOBUTTON GROUP gr1 DEFAULT 'X' MODIF ID FIX USER-COMMAND A,
p_r_rep RADIOBUTTON GROUP gr1 MODIF ID FIX.
SELECTION-SCREEN END OF BLOCK b1.
Selection-screen begin of block b2 with frame title text-002.
parameters: p_matnr type mara-matnr modif id d1,
p_uom type marm-meinh modif id d2.
selection-screen end of block b2.
AT SELECTION-SCREEN OUTPUT.
IF P_r_uom = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 EQ 'D1'.
SCREEN-ACTIVE = '1'.
MODIFY SCREEN.
CLEAR: p_uom.
ENDIF.
IF SCREEN-ACTIVE EQ 'D2'.
SCREEN-ACTIVE = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF P_r_rep = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 EQ 'D1'.
SCREEN-ACTIVE = '0'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 EQ 'D2'.
SCREEN-INPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Thanks,
Sandeep.