Switch statement in ABAP ( 7.4+)
First Refer * - Introduction to case and switch
Report
REPORT zab_rp_switch.
PARAMETERS: p_day TYPE i.
DATA(lv_output) = SWITCH char40( p_day WHEN 1 THEN TEXT-000
WHEN 2 THEN TEXT-001
WHEN 3 THEN TEXT-002
WHEN 4 THEN TEXT-003
WHEN 5 THEN TEXT-004
WHEN 6 THEN TEXT-005
WHEN 7 THEN TEXT-006
ELSE TEXT-007 ).
WRITE: lv_output.
Input1
Output1
Input2
Output2
*****************************Thank You*******************
Comments
Post a Comment