2005 Sep 12 8:13 PM
HI all,
Hi this is abt Exporting Reports to Memory and Listing from Memory, I got excellent answers for my last post. For Standard Reports, i am able to do it, it works great.
But my Program FAILS for ALV based Reports, It is unable to EXPORT It to Memory, what should be my approach to solve this problem.
I am trying to Figure out the Structure of the Selection Screen of a REPORT, Any database Stucture which stores Selection screen information.
I need to also know the Structure of OUTPUT of a REPORT.
Any ideas are appreciated and rewarded....
Thanks.
Ravi.
2005 Sep 12 8:41 PM
You can get selection screen information using the function module RS_REFRESH_FROM_SELECTOPTIONS.
Getting the output structure is not easy. Search in this forum with the text "output structure". You will see lot of discussion.
Are these ALV reports, your custom reports or standard ones? Which ALV(GRID or LIST or OO)? You need to have a logic in your program to check if the program is run in background and if so, then you call REUSE_ALV_LIST_DISPLAY otherwise call the current ALV. Grid display requires GUI.
Srinivas
You can get selection screen information using the function module RS_REFRESH_FROM_SELECTOPTIONS.
Getting the output structure is not easy. Search in this forum with the text "output structure". You will see lot of discussion.
Are these ALV reports, your custom reports or standard ones? Which ALV(GRID or LIST or OO)? You need to have a logic in your program to check if the program is run in background and if so, then you call REUSE_ALV_LIST_DISPLAY otherwise call the current ALV. Grid display requires GUI.
Srinivas
2005 Sep 12 8:41 PM
You can get selection screen information using the function module RS_REFRESH_FROM_SELECTOPTIONS.
Getting the output structure is not easy. Search in this forum with the text "output structure". You will see lot of discussion.
Are these ALV reports, your custom reports or standard ones? Which ALV(GRID or LIST or OO)? You need to have a logic in your program to check if the program is run in background and if so, then you call REUSE_ALV_LIST_DISPLAY otherwise call the current ALV. Grid display requires GUI.
Srinivas
2005 Sep 12 10:01 PM
HI Srinivas,
I am talking abt the Standard SAP ALV reports in the SAP System, I am not worried abt the Custom Reports.
When i try to execute it using "SUBMIT PROGRAM ==> EXPORT TO MEMORY ==> lIST FROM MEMORY ==> COnverting it to Acsii values and returning it"
This seems to work for Ordinary Reports, but not of ALV type.Unable to export to Memory.
Ideas please,
-RAVI.
2005 Sep 12 10:30 PM
Ravi - I ran the following simple report:
REPORT ztest LINE-SIZE 132 MESSAGE-ID zc.
DATA: BEGIN OF listobject OCCURS 0.
INCLUDE STRUCTURE abaplist.
DATA: END OF listobject.
SUBMIT zfvr036
USING SELECTION-SET 'PERIODIC'
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'WRITE_LIST'
TABLES
listobject = listobject
EXCEPTIONS
empty_list = 1
OTHERS = 2.It produced output without the gui status active, so I think EXPORTING LIST TO MEMORY does work for ALV. The program I submitted used REUSE_ALV_LIST_DISPLAY.
I changed the submitted program to use REUSE_ALV_GRID_DISPLAY and it also worked - this time with the GUI more or lsess intact.
Rob
Message was edited by: Rob Burbank
2005 Sep 12 10:32 PM
Hi Ravi
I run a my program (called by submit) that uses a ALV list and it works fine.
This is code:
DATA: LISTOBJECT TYPE STANDARD TABLE OF ABAPLIST,
LISTASCI(3000) OCCURS 0.
Call program with ALV
SUBMIT ZFAGRD11
WITH P_BUKRS = 'MATE'
EXPORTING LIST TO MEMORY AND RETURN.
Import list from memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = LISTOBJECT
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Convert list to ASCII
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
LIST_INDEX = -1
WITH_LINE_BREAK = ' '
TABLES
LISTASCI = LISTASCI
LISTOBJECT = LISTOBJECT
EXCEPTIONS
EMPTY_LIST = 1
LIST_INDEX_INVALID = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
In internal table LISTASCI I see right list: which your problem?
Max
2005 Sep 12 11:41 PM
I did SUBMIT a couple of programs which used ALV GRID but they abended. The one with ALV LIST worked. So what are doing differently or is it the version?
Srinivas
2005 Sep 13 2:30 PM
2005 Sep 13 4:33 AM
Hi
Export to memory will only work with normal List or ALV list , not with ALV grid.
Cheers
2005 Sep 13 8:55 AM
if you submit a ALV gird exporting list to memory, it wont abort, it would simply show the gird in the screen.
if its in batch, it may abort
Regards
Raja
2005 Sep 14 10:05 PM
HI Raja,
For Std SAP report of type ALV GRID, i am not able to Export it to memory, the List just Pops out.
Is there any way , i can read Export such Reports to memory and list them back to my Internal table.
Thanks
-Ravi.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |