70 likes | 181 Views
ABAP/4 Assignments, Conversions and Calculations. User Defaults System>User Profile>Own Data Defaults tab 176 system variables available Use DDIC table Syst Finding System Variables Assignment Statements Assigns a value to a variable or field string Clear Move Move-corresponding.
E N D
ABAP/4 Assignments, Conversions and Calculations • User Defaults • System>User Profile>Own Data • Defaults tab • 176 system variables available • Use DDIC table Syst • Finding System Variables • Assignment Statements • Assigns a value to a variable or field string • Clear • Move • Move-corresponding
ABAP/4 Assignments, Conversions and Calculations • Clear v1 [with v2 with ‘A’ with Null] • Zeros or blanks (Default values) • Write v1 no-gap, v2. • No intervening space • Move v1 [+N(L) ] to v2 • Operators & Operands separated by spaces • v2 = v1. • V2 = v1 = vn… • Move-corresponding fs1 to fs2.
ABAP/4 Assignments, Conversions and Calculations • Performing calculations • Compute • Add Add-corresponding • Subtract Subtract-corresponding • Multiply Multiply-corresponding • Divide Divide-corresponding. • Dynamic Assignment • Field-symbols <f>. • Pointer assigned to a field • Use ASSIGN to assign a field to it (ASSIGN f1 to <dnf>
Common Control Statements • IF exp. ELSEIF exp. ELSE. ENDIF. • Every IF must have matching ENDIF. • CASE var. WHEN var or…. --------- WHEN var or… ENDCASE • EXIT statement – has varying effects depending on where it appears in the code.
Common Control Statements • DO Statement • DO 5 times. …. ENDDO. • Sy-index contains current iteration number • DO 5 TIMES VARYING var1 from t-t1 NEXT T-t2. (pg 118) • Modifying values with DO..VARYING (pg 119) • WHILE…ENDWHILE • CONTINUE statement Only coded within a loop Has no additions and causes a jump to the end of the current loop. • CHECK statement – • Same as CONTINUE but can accept logical expressions
Common Control Statements • Comparison of EXIT, CONTINUE and CHECK
Common Control Statements • Position and Length Specifications for the WRITE statement • WRITE /10(2) ……. • 10= 10th position on current line • (2) = number of bytes (characters) to output • /10(2) – must be coded without intervening spaces • Any part can be left out.