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.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / harsh bansal
you shud code in AT Selectin
screen event
At selection screen.
If p_checkbox is initial.
If first_field is initial.
Message e000(zmsgclass).
Endif.
Elseif p_checkbox eq 'X'.
If second_field is initial.
Message e001(zmsgclass).
Endif.
Endif.
This vl b enuf..
Is This Answer Correct ? | 3 Yes | 2 No |
Answer / sunil kumar gautam
This example will be help full for this problem.
PARAMETERS check1 AS CHECKBOX USER-COMMAND check.
select-OPTIONS regio for kna1-regio MODIF ID mad.
select-OPTIONS kunnr for kna1-kunnr MODIF ID kad.
AT SELECTION-SCREEN .
"LOOP AT SCREEN.
if check1 = 'X'.
if kunnr is INITIAL.
Message 'Customer is manditory' type 'E'.
endif.
endif.
if check1 is INITIAL.
if regio is INITIAL.
Message 'Region is manditory' type 'E'.
endif.
endif.
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / sunil kumar gautam
This example will be help full for this problem.
PARAMETERS check1 AS CHECKBOX USER-COMMAND check.
select-OPTIONS regio for kna1-regio MODIF ID mad.
select-OPTIONS kunnr for kna1-kunnr MODIF ID kad.
AT SELECTION-SCREEN .
"LOOP AT SCREEN.
if check1 = 'X'.
if kunnr is INITIAL.
Message 'Customer is manditory' type 'E'.
endif.
endif.
if check1 is INITIAL.
if regio is INITIAL.
Message 'Region is manditory' type 'E'.
endif.
endif.
Is This Answer Correct ? | 0 Yes | 2 No |
if multiple badi can be active at a time, how will we know which implementation will be fired first . how to know the sequence in which implementation is fired.
how can we use the text randomly or circularly in smartforms.... means... suppose i have 'abap' horizantally... but i want it in vertically... how can... plz any body tell me this....
what is MSEG,MKPF?
What are table clusters?
In smart forms page no will be displayed as 2 of 15, 9 of 15 but while printing 10 of 15 it does not print correctly tell me how to handle this scenario.
Have you printed any report?
What is the difference between Exit and Stop?
how to transfer a specific record of a table from one system( eg:test system) to other system (eg: production system )?
What you did in BDC?
6 Answers Accenture, FutureSoft,
What is the meaning of client independent?
what is main diffrence b/w refresh ,clear and free? with example?
3 Answers Miracle Software, vCentric Technologies,
What is the difference between At selection screen and At selection screen on output?