2016 Mar 02 9:58 AM
Hello mates,
i am calling the program 'rs_abap_source_scan' via submit in my own report.
I debugged the program and found an useful table for my issue named 'gt_alv_item'. Now i want to use this table in my own report.
How can i Import the table 'gt_alv_item' into my own report?
Thank you in advance.
Emre
Hello mates,
i am calling the program 'rs_abap_source_scan' via submit in my own report.
I debugged the program and found an useful table for my issue named 'gt_alv_item'. Now i want to use this table in my own report.
How can i Import the table 'gt_alv_item' into my own report?
Thank you in advance.
Emre
2016 Mar 02 10:17 AM
Hi Emre,
you can try some dirty assignment:
[code]
...
SUBMIT 'RS_ABAP_SOURCE_SCAN' AND RETURN.
FIELD-SYMBOLS <fs> TYPE table.
ASSIGN ('(RS_ABAP_SOURCE_SCAN)GT_ALV_ITEM[]') TO <fs>.
...
[\code]
Regards, Hubert
2016 Mar 02 12:41 PM
Hi,
thank you for your reply. I did it exactly like you mentioned it and i dont get any error Messages, but it doesn't work. I think it is not possible.. at least in my case.
I'll just copy the program and use it as a function module.
Have a nice day
Emre
2016 Mar 02 1:40 PM
Hi Emre
Don't copy the program.
Think about it - the called program has ended when your program regains control so where is the table ?
If you are looking for the results use the clause 'EXPORTING LIST TO MEMORY' of the SUBMIT command and then the function modules 'LIST_FROM_MEMORY' and 'LIST_TO_ASCI' to get the details back.
Then parse the table returned in your abap program.
Rich
2016 Mar 02 1:41 PM
Hubert.....
The called program has ended by the time you regain control. Where would the internal table be stored ?
Rich
2016 Mar 02 1:54 PM
maybe its still somewhere in the memory but unfortunallay ABAP RT cannot address it anymore
2016 Mar 02 1:59 PM
Yes, until the next malloc() which then eats half of it and invalidates the rest.....
2016 Mar 03 6:43 AM
Hi,
Try the below
SUBMIT report_name WITH selectoption1 eq variable
exporting list to memory AND RETURN.
*get list from memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = IT_TAB.
* convert into asci format
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listasci = text_TAB
listobject = it_TAB
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
loop at text_tab.
*copy the contents of the output here into your variable / internal table.
endloop.
*then free memory
call function 'LIST_FREE_MEMORY'.
2016 Mar 03 8:47 AM
2016 Mar 08 2:12 PM
Hello,
i wasn't active for a while, sorry for that.
Sounds like a solution, but what type does text_tab and it_tab have? Are they both abaplist?
My program crashes when using text_tab as a abaplist in the asci function. For list_from_memory it's ok.
Regards
Emre
2016 Mar 08 2:18 PM
ListAsci is a table of char the width of your report
ListObject is your abaplist
2016 Mar 08 2:19 PM
Well gt_alv_item seems related to ALV, no?
So use search tool on cl_salv_bs_runtime_info to retrieve this internal table and prevent display of ALV (or read Gain Programmatic Access to Data of SAPGUI ALV Reports)
Regards,
Raymond
2016 Mar 08 2:23 PM
Hi Raymond,
And this is available after the scan has returned to the calling program ?
Rich
2016 Mar 08 2:41 PM
Hi Richard,
Yes, the ALV is not displayed (optional) but exported to memory, and you get it back in the caller. Check sample in Creating my own custom a report from t-code rsusr200 or in Glen's document.
Regards,
Raymond
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |