2006 Oct 30 9:47 AM
I am trying to add a check when a user tries to save changes to a custom table (event 01). I have added the below code but the matter what I do I always get a 'statement is not accessable' syntax error at either my loop or where i try to move data from the extract or total tables. It just does not seem to like the extract and total tables?
CAn anyone point me in the right direction?
TYPES: BEGIN OF t_users,
MANDT TYPE MANDT,
USERNAME TYPE ZUSERNAME,
COMPANY_CODES TYPE ZCOMPANY_CODES,
ENTRY TYPE CHAR9,
END OF t_users.
DATA : itab_users TYPE TABLE OF t_users INITIAL SIZE 0,
wa_users TYPE t_users,
wa_bukrs TYPE bukrs.
BREAK-POINT.
itab_users[] = extract_s[].
Loop around the Modifed entries only.
LOOP AT total_l.
wa_user = total_l.
Ensure entry is left aligned
CONDENSE wa_users-ENTRY.
Only interested in checking co.code roles not role 'ALL'
IF wa_users-ENTRY = 'M' AND
wa_users-company_codes(1) = 'ALL'.
EXIT.
ELSE.
SELECT SINGLE bukrs
INTO wa_bukrs
FROM t001
WHERE bukrs = wa_users-company_codes.
IF SY-SUBRC <> 0.
Co.Code doesn't exist
MESSAGE e026(ZAR) with wa_users-company_codes.
ENDIF.
ENDIF.
ENDLOOP.
I am trying to add a check when a user tries to save changes to a custom table (event 01). I have added the below code but the matter what I do I always get a 'statement is not accessable' syntax error at either my loop or where i try to move data from the extract or total tables. It just does not seem to like the extract and total tables?
CAn anyone point me in the right direction?
TYPES: BEGIN OF t_users,
MANDT TYPE MANDT,
USERNAME TYPE ZUSERNAME,
COMPANY_CODES TYPE ZCOMPANY_CODES,
ENTRY TYPE CHAR9,
END OF t_users.
DATA : itab_users TYPE TABLE OF t_users INITIAL SIZE 0,
wa_users TYPE t_users,
wa_bukrs TYPE bukrs.
BREAK-POINT.
itab_users[] = extract_s[].
Loop around the Modifed entries only.
LOOP AT total_l.
wa_user = total_l.
Ensure entry is left aligned
CONDENSE wa_users-ENTRY.
Only interested in checking co.code roles not role 'ALL'
IF wa_users-ENTRY = 'M' AND
wa_users-company_codes(1) = 'ALL'.
EXIT.
ELSE.
SELECT SINGLE bukrs
INTO wa_bukrs
FROM t001
WHERE bukrs = wa_users-company_codes.
IF SY-SUBRC <> 0.
Co.Code doesn't exist
MESSAGE e026(ZAR) with wa_users-company_codes.
ENDIF.
ENDIF.
ENDLOOP.
2006 Oct 30 10:08 AM
Solved it. When I created my new subroutine for some reason SAP just took me stright into the F01 include but didn;t create the start and end form parameters. Don't know how I missed it - doh
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |