Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Exporting and Importing from Memory

Former Member
0 Likes
1,282

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,217

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

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.

9 REPLIES 9
Read only

Former Member
0 Likes
1,218

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

Read only

Former Member
0 Likes
1,217

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.

Read only

0 Likes
1,217

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

Read only

0 Likes
1,217

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

Read only

0 Likes
1,217

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

Read only

0 Likes
1,217

I tried it on 4.6C.

Rob

Read only

Former Member
0 Likes
1,217

Hi

Export to memory will only work with normal List or ALV list , not with ALV grid.

Cheers

Read only

0 Likes
1,217

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

Read only

0 Likes
1,217

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.