ABAP常用小技巧-知识点积累
7.18 | 巧妙使用DO来循环表中字段 |
DATA: SFIELD LIKE TOBJ-FIEL1. | |
DO 10 TIMES VARYING SFIELD FROM TOBJ-FIEL1 NEXT TOBJ-FIEL2. | |
INTFLD-FIELD = SFIELD. | |
CLEAR DFIES. | |
IF SFIELD <> SPACE. | |
CALL FUNCTION ‘AUTH_FIELD_GET_INFO’ | |
EXPORTING | |
FIELDNAME = SFIELD | |
IMPORTING | |
DATEL = DFIES-ROLLNAME | |
LNG = DFIES-OUTPUTLEN | |
RC = RC | |
TEXT = DFIES-FIELDTEXT | |
INTTYPE = DFIES-INTTYPE. | |
ENDIF. | |
INTFLD-FLDTXT = DFIES-FIELDTEXT. | |
APPEND INTFLD. | |
ENDDO. |