i have 2 fields on selection screen of a Report along with
a check box.My requirement is initially that first field
sud be mandatory but when we click on the check box the
first field which was mandatory sud now be optional and the
second field now sud be mandatory.Please provide the
solution asap. thank u.
Answer Posted / madan
REPORT ztest2.
TABLES t001w.
SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECT-OPTIONS s_werks FOR t001w-werks OBLIGATORY.
SELECT-OPTIONS s_land FOR t001w-land1.
SELECTION-SCREEN BEGIN OF BLOCK b2.
PARAMETERS chk AS CHECKBOX USER-COMMAND click.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN.
* This event is then triggered when a user selects an
option from CHECKBOX
IF chk = ''.
LOOP AT SCREEN.
IF screen-name = 'S_WERKS-LOW'.
screen-required = '1'.
MODIFY SCREEN. " INDEX sy-tabix.
ELSEIF screen-name = 'S_LAND-LOW'.
screen-required = ''.
MODIFY SCREEN. " INDEX sy-tabix.
ENDIF.
ENDLOOP.
ELSEIF chk = 'X'.
LOOP AT SCREEN.
IF screen-name = 'S_WERKS-LOW'.
screen-required = ''.
MODIFY SCREEN. " INDEX sy-tabix.
ELSEIF screen-name = 'S_LAND-LOW'.
screen-required = '1'.
MODIFY SCREEN. " INDEX sy-tabix.
ENDIF.
ENDLOOP.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
* This event is also trigged to re-draw ABAP report screen
so can be
* used to hide or display fields
IF chk = ''.
LOOP AT SCREEN.
IF screen-name = 'S_WERKS-LOW'.
screen-required = '1'.
MODIFY SCREEN. " INDEX sy-tabix.
ELSEIF screen-name = 'S_LAND-LOW'.
screen-required = ''.
MODIFY SCREEN. " INDEX sy-tabix.
ENDIF.
ENDLOOP.
ELSEIF chk = 'X'.
LOOP AT SCREEN.
IF screen-name = 'S_WERKS-LOW'.
screen-required = ''.
MODIFY SCREEN. " INDEX sy-tabix.
ELSEIF screen-name = 'S_LAND-LOW'.
screen-required = '1'.
MODIFY SCREEN. " INDEX sy-tabix.
ENDIF.
ENDLOOP.
ENDIF.
Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
How is conversion of data types done between abap/4 & external level? : abap data dictionary
What is modularization and its benefits?
What is luw?
What happens when you post goods issue after delivery? How does the inventory get reduced after the delivery?
What does an exec sql statement do in abap? What is the disadvantage of using it?
Reports: Event functionality.
What functions does a data dictionary perform? : abap data dictionary
What is logo in sap script?
What are the types of indexes in abap?
What is meant by read lock? : sap abap data dictionary
Explain the differences between sap memory and abap memory?
Differentiate between abap memory and sap memory?
Why do we use dynamic where conditions?
What type of user exits have you written ?
What is abap work bench?