Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

graying the input field

Former Member
0 Kudos

hi,

-


selection-screen begin of block a with frame title text-001.

selection-screen skip.

parameters:z like vbak-vbeln,l like oigs-shnumber.

selection-screen skip.

selection-screen begin of block b with frame title text-002.

selection-screen skip.

parameters:sales radiobutton group g default 'X',

trans radiobutton group g.

selection-screen end of block b.

selection-screen skip.

selection-screen pushbutton 10(12) pu_text user-command CANC.

selection-screen pushbutton 30(12) qu_text user-command STAT.

selection-screen end of block a.

Initialization.

pu_text = 'Cancel Order'.

qu_text = 'Status'.

-


please see the code and send me code for

when i selcect the radiobutton of sales the corresponding field that is first field only present and the second input field have to be grayed and viceversa.

it is urgent..............

thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

selection-screen begin of block a with frame title text-001.

selection-screen skip.

parameters:z like vbak-vbeln,l like oigs-shnumber.

selection-screen skip.

selection-screen begin of block b with frame title text-002.

selection-screen skip.

parameters:sales radiobutton group g default 'X' USER-COMMAND 'UCOM',

trans radiobutton group g.

selection-screen end of block b.

selection-screen skip.

selection-screen pushbutton 10(12) pu_text user-command CANC.

selection-screen pushbutton 30(12) qu_text user-command STAT.

selection-screen end of block a.

Initialization.

pu_text = 'Cancel Order'.

qu_text = 'Status'.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCRREN.

IF sales EQ 'X'.

IF SCREEN-NAME = 'FIRST FIELDNAME'.

SCREEN-INPUT = 1

MODIFY SCREEN.

ELSEIF SCREEN-NAME = 'SECOND FIELDNAME'.

SCREEN-INPUT = 0.

ENDIF.

ENDLOOP.

Any further help please revert.

Regards,

A.Singh

MODIFY SCREEN.

-


please see the code and send me code for

when i selcect the radiobutton of sales the corresponding field that is first field only present and the second input field have to be grayed and viceversa.

it is urgent..............

thanks in advance.

5 REPLIES 5

Former Member
0 Kudos

hi

<b>copy paste the code</b>

TABLES: eban,

SSCRFIELDS.

SELECTION-SCREEN BEGIN OF SCREEN 100 TITLE title.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.

PARAMETER:rad1 RADIOBUTTON GROUP rad USER-COMMAND frad1 DEFAULT 'X',

rad2 RADIOBUTTON GROUP rad .

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.

PARAMETER: mtr AS CHECKBOX MODIF ID g3 USER-COMMAND chk1,

p_matnr TYPE eban-matnr MODIF ID g1,

sloc AS CHECKBOX MODIF ID g3 USER-COMMAND chk2,

str_loc TYPE eban-lgort MODIF ID g4.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.

SELECT-OPTIONS: matnr1 FOR eban-matnr MODIF ID g2.

SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN PUSHBUTTON /20(10) name USER-COMMAND UCOM.

SELECTION-SCREEN END OF SCREEN 100.

name = 'FETCH'.

title = 'Test Report'.

CALL SELECTION-SCREEN '100'.

TYPE-POOLS slis.

  • declaration of internal tables and work areas to be used

DATA: BEGIN OF it_pr OCCURS 0,

banfn TYPE eban-banfn,

bnfpo TYPE eban-bnfpo,

loekz TYPE eban-loekz,

statu TYPE eban-statu,

ekgrp TYPE eban-ekgrp,

matnr TYPE eban-matnr,

werks TYPE eban-werks,

lgort TYPE eban-lgort,

preis TYPE eban-preis,

peinh TYPE eban-peinh,

END OF it_pr.

DATA: BEGIN OF it_mat OCCURS 0,

matnr TYPE eban-matnr,

END OF it_mat.

*DATA:BEGIN OF ITAB1 OCCURS 0,

DATA: l_answer.

DATA: it_fieldcat TYPE slis_t_fieldcat_alv,

wa_fieldcat LIKE LINE OF it_fieldcat,

it_event TYPE slis_t_event,

wa_event TYPE slis_alv_event.

  • declaration of variables to be used

DATA: r_ucomm TYPE sy-ucomm,

mat_no TYPE eban-matnr,

len TYPE i VALUE 1,

count TYPE i VALUE IS INITIAL,

iflag TYPE i VALUE IS INITIAL,

iflag1 TYPE i VALUE 0.

DATA :pr_id TYPE sy-repid,

rt_extab TYPE slis_t_extab.

INITIALIZATION.

AT SELECTION-SCREEN OUTPUT.

IF rad1 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'G1' OR screen-group1 = 'G4'.

screen-active = '1'.

screen-input = 0.

ELSEIF screen-group1 = 'G2'.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSEIF rad2 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'G1' OR screen-group1 = 'G4' OR screen-group1 = 'G3' OR screen-group1 = 'G5'.

screen-active = '0'.

ELSEIF screen-group1 = 'G2'.

screen-active = '1'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

IF mtr = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'G1'.

screen-input = 1 .

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

IF sloc = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'G4'.

screen-input = 1 .

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

clear sy-ucomm.

  • iflag = 1.

  • endif.

<b> it will solve ur purpose</b>

regards

ravish

<b>plz dont forget to reward points if helpful</b>

Former Member
0 Kudos

Hi

you can loop at screen and when the field comes make the input field as 0.

ex :

  • when the radio button is selected

loop at screen.

*if first radio button is selected

if screen-name = z

screen-input = 0.

endif.

if screen-name = l

screen-input = 1.

endif.

*if second radio button is selected

if screen-name = l

screen-input = 0.

endif.

if screen-name = z

screen-input = 1.

endif.

endloop.

hope this is helpful

regards,

Prasanth

  • reward all helpful answers

Former Member
0 Kudos

Hi,

See the Following code


  LOOP AT SCREEN.
    IF screen-group1 = 'g' AND sales= 'X'.
      screen-output = 0.
      screen-active = 0.
      screen-input = 0.
    ELSEIF screen-group1 = 'g' AND sales= ' '.
      screen-output = 0.
      screen-active = 0.
      screen-input = 0.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Regards,

Nandha

Reward if it helps

Former Member
0 Kudos

Hi Sudarashan,

write one event like,

at selection-screen output.

loop at screen.

if sales = 'X' and name = 'Z' (parameter).

screen-INPUT = '0'.

endif.

modify screen.

endloop.

Reward if useful!

Former Member
0 Kudos

selection-screen begin of block a with frame title text-001.

selection-screen skip.

parameters:z like vbak-vbeln,l like oigs-shnumber.

selection-screen skip.

selection-screen begin of block b with frame title text-002.

selection-screen skip.

parameters:sales radiobutton group g default 'X' USER-COMMAND 'UCOM',

trans radiobutton group g.

selection-screen end of block b.

selection-screen skip.

selection-screen pushbutton 10(12) pu_text user-command CANC.

selection-screen pushbutton 30(12) qu_text user-command STAT.

selection-screen end of block a.

Initialization.

pu_text = 'Cancel Order'.

qu_text = 'Status'.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCRREN.

IF sales EQ 'X'.

IF SCREEN-NAME = 'FIRST FIELDNAME'.

SCREEN-INPUT = 1

MODIFY SCREEN.

ELSEIF SCREEN-NAME = 'SECOND FIELDNAME'.

SCREEN-INPUT = 0.

ENDIF.

ENDLOOP.

Any further help please revert.

Regards,

A.Singh

MODIFY SCREEN.

-


please see the code and send me code for

when i selcect the radiobutton of sales the corresponding field that is first field only present and the second input field have to be grayed and viceversa.

it is urgent..............

thanks in advance.