// InputScript "showstructure.txt" // Clear tables Set V[empty] "" CopyText toText="stab" fromString="empty" CopyText toText="struct" fromString="empty" // Call SAP function that reads the data dictionary Call "RPY_TABLE_READ" -try in.TABLE_NAME="&V[structid]" table.TABL_FIELDS(width:550)="stab" // Found? eLse error message if not Q[ok] if V[_exception=NOT_FOUND] Return "E: Structure &V[structid] not found in data dictionary" -statusline else Return "E: Data dictionary access: ""&V[_exception]"" " -statusline endif endif // process fields Set V[i] 0 Set V[from] 1 label nextline Set V[i] &V[i] + 1 CopyText fromText="stab" toString="stabline" line="&V[i]" if not Q[ok] goto done endif Set V[fldname] "&V[stabline](31-60)" // RPY_FIEL-FIELDNAME Set V[fldleng] "&V[stabline](531-536)" // RPY_FIEL-INTLENGTH Set V[fldtext] "&V[stabline](344-403)" // RPY_FIEL-DDTEXT Set V[fldtype] "&V[stabline](284-287)" // RPY_FIEL-DATATYPE // length 0? then skip entry (.include) if V[fldleng=000000] goto nextline endif Set V[to] &V[from] + &V[fldleng] Set V[to] &V[to] - 1 Set V[structline] "(&V[from]-&V[to]) &V[fldtext]: &V[fldname] Type=&V[fldtype]" CopyText toText="struct" fromString="structline" -appendline Set V[from] &V[from] + &V[fldleng] goto nextline // all fields processed label done Return "S: Components of &V[structid] generated" -statusline