2008 Jul 09 9:52 AM
Hi,
REPORT ZTEST.
data : pgm(40) value '(RM07DOCS) LIST[]',
it like LIST.
field-symbols: <fs> type TABLE.
assign (RM07DOCS) to <fs>.
it[] = <fs>.
LIST is an internal table which is declared globally in RM07DOCS program but, it is giving me an error saying
"LIST must be a flat structure.You cannot use internal tables,strings,references or structures or components"
Kindly let me know where I am going wrong.
Thanks,
K.Kiran.
2008 Jul 09 9:55 AM
Hi,
In the code you are trying to access the LIST table from the program RM07DOCS using the dynamic assign. But the LIST table is not accessible in you z program. You have to declare a internal table for LIST. Your custom program cannot access the LISt defined in the std program.
did you check this link
http://saptechnical.com/Tips/ExitsBADIs/inaccessible/tables.htm
Cheers
VJ
Hi,
In the code you are trying to access the LIST table from the program RM07DOCS using the dynamic assign. But the LIST table is not accessible in you z program. You have to declare a internal table for LIST. Your custom program cannot access the LISt defined in the std program.
did you check this link
http://saptechnical.com/Tips/ExitsBADIs/inaccessible/tables.htm
Cheers
VJ
2008 Jul 09 9:55 AM
Hi,
In the code you are trying to access the LIST table from the program RM07DOCS using the dynamic assign. But the LIST table is not accessible in you z program. You have to declare a internal table for LIST. Your custom program cannot access the LISt defined in the std program.
did you check this link
http://saptechnical.com/Tips/ExitsBADIs/inaccessible/tables.htm
Cheers
VJ
2008 Jul 09 9:57 AM
Hi
How have u defined the table LIST? It has to have the same definition:
TYPE-POOLS: SLIS.
DATA: BEGIN OF IT OCCURS 0.
INCLUDE STRUCTURE itab.
DATA: maktx LIKE makt-maktx,
name1 LIKE t001w-name1,
btext LIKE t156t-btext,
pspid LIKE prps-posid,
vornr TYPE vornr, "215929
color_line(03) type c, "n555893
color TYPE slis_t_specialcol_alv.
DATA: END OF IT.or
IT LIKE TABLE OF LIST.Max
2008 Jul 09 10:12 AM
Max,
REPORT ZTEST.
TYPE-POOLS:SLIS.
DATA: BEGIN OF list OCCURS 0.
INCLUDE STRUCTURE itab.
DATA: maktx LIKE makt-maktx,
name1 LIKE t001w-name1,
btext LIKE t156t-btext,
pspid LIKE prps-posid,
vornr TYPE vornr,
color_line(03) type c,
color TYPE slis_t_specialcol_alv.
DATA: END OF list.
data : pgm(40) value '(RM07DOCS)LIST[]',
it like LIST.
field-symbols: <fs> type TABLE.
assign (RM07DOCS) to <fs>.
it[] = <fs>.
Now it is showing "field rmo7docs is unknown,it is niether one of the specified tables nor defined by DATA statement.
Thanks,
K.Kiran.
2008 Jul 09 10:27 AM
Hi
If you use this declaration:
DATA: it like LIST.It means IT is a flat structure, but u need to an internal table so it should be:
DATA: it like STANDARD TABLE OF LIST WITH HEADER LINE.Anyway if you've just declared LIST u don't need to use IT, but u can directly use LIST:
assign (RM07DOCS) to <fs>.
LIST[] = <fs>.Max
2008 Jul 09 11:18 AM
Max.
REPORT ZTEST.
TYPE-POOLS:SLIS.
DATA: BEGIN OF list OCCURS 0.
INCLUDE STRUCTURE itab.
DATA: maktx LIKE makt-maktx,
name1 LIKE t001w-name1,
btext LIKE t156t-btext,
pspid LIKE prps-posid,
vornr TYPE vornr,
color_line(03) type c,
color TYPE slis_t_specialcol_alv.
DATA: END OF list.
data : pgm(40) value '(RM07DOCS)LIST[]'.
field-symbols: <FS> type any .
assign (pgm) to <FS>.
list[] = <FS>.
It is giving an error saying field symbol not yet assigned.Any wrong with ASSIGN Statement or the way I declared a field symbol ?.
If I use " assign (RM07DOCS) to <FS>" it is saying RM07DOCS unknown.
How does this ASSIGN gets the data from the LIST which is an internal table in RM07DOCS?
Thanks,
K.Kiran.
2008 Jul 09 11:26 AM
Hi
But how do you run the program ZTEST?
Remember the field-symbols has to be a TYPE TABLE, not ANY.
data : pgm(40) value '(RM07DOCS)LIST[]'.
field-symbols: <FS> type TABLE .
assign (pgm) to <FS>.
IF SY-SUBRC = 0.
list[] = <FS>.
ENDIF.and remember this trick works only if the program RM07DOCS is loaded in memory, so it's working while ZTEST is running.
Max
2008 Jul 09 11:26 AM
As i said this works only with Exits and BADI's.
Definitely Field symbol assignement error will happen.
It is not possible to access that (RM07DOCS)LIST[] Dynamically
in your code.
2008 Jul 09 11:38 AM
Max,
"trick works only if the program RM07DOCS is loaded in memory, so it's working while ZTEST is running".
what do you mean to say loaded in memory?
ZTEST is totally a seperate program into which I want to fetch the data stored in LIST which is the final internal table of RM07DOCS.How to have a link in between these two?
Can I use SUBMIT RM07DOCS followed by the above given code?
Thanks,
K.Kiran.
2008 Jul 09 11:46 AM
>
> what do you mean to say loaded in memory?
>
In the classical debugger, click on the "Calls" button, the program(RM07DOCS) should be listed under the Act Call Stack to access the table LIST(which is defined in the program RM07DOCS) for this technique to work.
2008 Jul 09 11:49 AM
You can try this options instead of fieldsymbols etc..
If you see the code RM07DOCS line 1551
EXPORT export_list TO MEMORY ID 'MB51_EXPORT_LIST'.make use of above export
1. in your program Submit the program RM07DOCS first
2. next import the list from memory with the id.
Now use the list data for your purpose.
2008 Jul 09 11:57 AM
Hi
It means the programs RM07DOCS and ZTEST are running simultaneously in the same mode.
So this trick is usually used in the exit, because the main program and the program of exit are loaded im memory and running simultaneously.
For example:
REPORT <PROGRAM>.
CALL FUNCTION <FUNCTION>The function <FUNCTION> doesn't belong to calling program <PROGRAM> and the fm can be see only the data transfered by interface (IMPORTING/EXPORTING parameter).
If in function module it needs to see other data of may program <PROGRAM> it can use the trick of field-symbols, because when the program <PROGRAM> starts, the system loads in memory all data of main program <PROGRAM> and all data of function group of function <FUNCTION>.
So if your program ZTEST is completally independent from main program, because the trick can't work.
Anyway just as Rajesh said, try to debug ZTEST and insert (RM07DOCS)LIST[] in the prompt.
If it can't work u should think another solution, for example u can create a copy of report RM07DOCS and works on it.
Max
2008 Jul 09 11:57 AM
In addition to what Vijay has suggested, you can also SUBMIT the standard program directly with the "... EXPORTING LIST TO MEMORY" addition and process the
LIST exported with the help of the FM 'LIST_FROM_MEMORY'
I'm copying the example in F1 help of SUBMIT statement for your reference
DATA list_tab TYPE TABLE OF abaplist.
SUBMIT report EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
CALL FUNCTION 'WRITE_LIST'
TABLES
listobject = list_tab.
ENDIF.
2008 Jul 09 10:07 AM
There is a modification to your code. Just check this...
But this works only in Exits
can you let me know what is the purpose of your coding..
data : pgm(40) value '(RM07DOCS) LIST[]',
it type standard table of LIST. <---modified
field-symbols: <fs> type TABLE.
assign (pgm) to <fs>. <--- this is modified
it[] = <fs>.
2008 Jul 09 11:31 AM
data : pgm(40) value '(RM07DOCS) LIST[]',
it type standard table of LIST.
field-symbols: <fs> type TABLE.
assign (pgm) to <fs>.
if sy-subrc eq 0. "This always ne 0
it[] = <fs>.
endif.
You always get the same error
Field symbol has not yet been assigned.the program (RM07DOCS) variables are not accessed here..
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |