|
<< Click to Display Table of Contents >> Navigation: All About ABAP Technique > English > ABAP Tutorial > ABAP Syntax > Comment |
Inside the source code, comment is explanation or infomation for statement or block statement. It's important to give explanation about steps or algoritm of ABAP program. If someone else want edit that program, it's not difficult to study the logic algoritm in code of program.
There are 2 kind of comment in ABAP, these are:
1.Use key star (*), and locate it in the first character at line program..
Example :
FORM fm_process_data.
*Get other requirement information
LOOP AT gi_header.
* Get Material Description
READ TABLE gi_makt WITH KEY matnr = gi_header-matnr.
IF sy-subrc = 0.
gi_header-maktx = gi_makt-maktx.
ENDIF.
* Get Measurement Text
READ TABLE gi_t006a WITH KEY msehi = gi_header-meins.
IF sy-subrc = 0.
gi_header-mseht = gi_t006a-mseht.
ENDIF.
MODIFY gi_header.
ENDLOOP.
ENDFORM.
2.Use double sitation ("), it's free to locate it.
Example :
FORM fm_process_data.
"Get other requirement information
LOOP AT gi_header.
"Get Material Description
READ TABLE gi_makt WITH KEY matnr = gi_header-matnr.
IF sy-subrc = 0.
gi_header-maktx = gi_makt-maktx.
ENDIF.
"Get Measurement Text
READ TABLE gi_t006a WITH KEY msehi = gi_header-meins.
IF sy-subrc = 0.
gi_header-mseht = gi_t006a-mseht.
ENDIF.
MODIFY gi_header.
ENDLOOP.
ENDFORM.