i have a requirement.there are 2 fields and one check box
on my selection screen.initially first field sud be
mandatory, when we click on check box the first field which
was mandatory sud now be optional and second field sud be
mandatory?please provide me the solution asap.Thank you
Answer Posted / rinzy deena mathews
Declare the parameters with modification ID, and at the At
selection screen event, use screen-required to make the
fields manually mandatory.
Following is the code for this
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-
002.
PARAMETERS : fname(20) TYPE c MODIF ID f1,
lname(20) TYPE c MODIF ID l1.
PARAMETERS : check1 AS CHECKBOX DEFAULT 'X' USER-COMMAND
usc.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN OUTPUT.
IF check1 EQ 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'F1'.
screen-required = 1.
MODIFY SCREEN.
ELSEIF screen-group1 = 'L1'.
screen-required = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF check1 NE 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'L1'.
screen-required = 1.
MODIFY SCREEN.
ELSEIF screen-group1 = 'F1'.
screen-required = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
| Is This Answer Correct ? | 13 Yes | 0 No |
Post New Answer View All Answers
What are the advantages and disadvantages of using views in abap programming ?
What is a type group?
What is the meaning of abap editor integrated with abap data dictionary? : abap data dictionary
Mention the various databases integrities?
What are pooled tables? : abap data dictionary
Mention some important events in abap programming.
How do you write transaction programs in sap?
What are the dis-advantages of logical databases? : abap hr
In sap script how to print bar code in vertical manner
What is interactive reporting?
What is tcode se16?
What are indexes? : abap hr
How can we access the correction and transport system? : abap data dictionary
What is an Open Item in SAP? How will you find an Open Item in SAP?
What should be declared explicitly in the corresponding abap/4 statements to access internal tables without header lines & why? : abap modularization