2010 Mar 23 6:32 AM
Hi all , I have wrote some codes ,but it show errors when it run to the last line .
The error is :You attempted to access an unassigned field symbol
could someone tell me how to solve this problem?
another question is when will SAPMM07M run ?
the codes are:
FIELD-SYMBOLS: <ITAB> TYPE ANY TABLE.
DATA: FIELD(50),
LT_MSEG LIKE STANDARD TABLE OF MSEG WITH HEADER LINE.
FIELD = '(SAPMM07M)XMSEG[]'.
IF <ITAB> IS ASSIGNED.
UNASSIGN <ITAB>.
ASSIGN (FIELD) TO <ITAB>.
ELSE.
ASSIGN (FIELD) TO <ITAB>.
ENDIF.
APPEND LINES OF <ITAB> TO LT_MSEG.
2010 Mar 23 7:57 AM
Hi,
SAPMM07M is not executed in your context.
SAPMM07M should be executed to capture the XMSEG.
Regards,
Srini.
Hi all , I have wrote some codes ,but it show errors when it run to the last line .
The error is :You attempted to access an unassigned field symbol
could someone tell me how to solve this problem?
another question is when will SAPMM07M run ?
the codes are:
FIELD-SYMBOLS: <ITAB> TYPE ANY TABLE.
DATA: FIELD(50),
LT_MSEG LIKE STANDARD TABLE OF MSEG WITH HEADER LINE.
FIELD = '(SAPMM07M)XMSEG[]'.
IF <ITAB> IS ASSIGNED.
UNASSIGN <ITAB>.
ASSIGN (FIELD) TO <ITAB>.
ELSE.
ASSIGN (FIELD) TO <ITAB>.
ENDIF.
APPEND LINES OF <ITAB> TO LT_MSEG.
2010 Mar 23 7:11 AM
2010 Mar 23 7:57 AM
Hi,
SAPMM07M is not executed in your context.
SAPMM07M should be executed to capture the XMSEG.
Regards,
Srini.
2010 Mar 23 8:03 AM
Hi Ling,
Where have you written the above code, is it in a User exit/Customer exit in the flow of program "SAPMM07M".
If yes, at runtime in the debug mode, enter (SAPMM07M)XMSEG[] and see if you can see the values.
Now if you have written your code in a report program and is not triggered in the flow of SAPMM07M, then your code will never work.
Because, when you say ASSIGN (FIELD) to <ITAB>, this is not pointing anywhere as (SAPMM07M)XMSEG[] is not avaialble at runtime.
And since the assign didn't work, any further reference to the Field-Symbol will fail.
APPEND LINES OF <ITAB> TO LT_MSEG.
Regards,
Chen
Edited by: Chen K V on Mar 23, 2010 9:04 AM
2010 Mar 23 8:15 AM
Thanks Chen.
You are correct.
These codes come from SAP user exit.
because I dont understand what these codes mean.
I copy these codes into my report.When I run my report with these codes , SAP showed error to me.
Now , I know the reason of error.
I should run these codes in program SAPMM07M.
Thanks so much.
2010 Mar 23 9:06 AM
2010 Mar 23 8:08 AM
Hi Ling Wang,
Modufy cod elike this.
FIELD-SYMBOLS: <itab> TYPE ANY TABLE.
DATA: field(50),
lt_mseg LIKE STANDARD TABLE OF mseg WITH HEADER LINE.
field = '(SAPMM07M)XMSEG[]'.
IF <itab> IS ASSIGNED.
ASSIGN (field) TO <itab>.
APPEND LINES OF <itab> TO lt_mseg.
ENDIF.
Regards,
Pravin
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |