Monday, 7 October 2013

What will be the output of the following code?

DATA: text TYPE string VALUE 'TEST-*-SAP*-NEW*'.
IF text IS NOT INITIAL AND text CS '*'.
  REPLACE FIRST OCCURRENCE OF '*' IN text WITH '^' .
  WRITE : / text.
ENDIF.
A. TEST-^
B. TEST-^-SAP*-NEW*
C. TEST-*-SAP^-NEW^
D. Syntax Error

Ans: B

No comments: