Application Development 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: 

Dont' want to disply output of called report tell me code.

Former Member
0 Kudos
259

Hi,

I am calling custom report B from my report A..

I can not edit report B

I dont want to display output of report B.

I have written code as below:-

SUBMIT B

EXPORTING LIST TO MEMORY

WITH s_rdate EQ p_wmdate

WITH p_gapno EQ s_lidd-low

AND RETURN.

1) I tried to write 'EXPORTING LIST TO MEMORY' in all positions in above code but still report B is displaying it's output which I don't want.

so please guide me.

2) Another question is I want to access final output Internal table of report B in my report A. I have to write code on that Itab in my report A.

Plese tell me code.

Title was edited by:

Alvaro Tejada Galindo

11 REPLIES 11

Former Member
0 Kudos
234

1) You can use the SUBMIT.. to SAP-SPOOOL option to avoid list display

2). Could get tricky, if you can't edit Report B & don't wnat to EXPORT to memory.

You've to read the SPOOL back to report A & parse thru' the list to meet your reqt.

Arya

Former Member
0 Kudos
234

Your code looks fine.

Rob

0 Kudos
234

This works:

REPORT ztest MESSAGE-ID 00.

DATA: BEGIN OF listobject OCCURS 0.
        INCLUDE STRUCTURE abaplist.
DATA: END OF listobject.

SUBMIT ztest1
  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.

CALL FUNCTION 'LIST_FREE_MEMORY'
  TABLES
    listobject = listobject.

and

REPORT ztest1 NO STANDARD PAGE HEADING MESSAGE-ID 00.

WRITE: /001 'Hello world'.

Rob

0 Kudos
234

I have written code as below to call custom report B from report A.

Report A

SUBMIT B

EXPORTING LIST TO MEMORY

WITH s_rdate EQ p_wmdate

WITH p_gapno EQ s_lidd-low

AND RETURN.

But still report B displays ALV report.

Please advise me that how to avoid dispay of report B output.

0 Kudos
234

Ahh - ALV - you should have said so earlier; it behaves differently. Is the ALV report custom or SAP?

Rob

0 Kudos
234

ALV report (Report B)is custom.

But I can not edit that report B.

I am working on report A.

0 Kudos
234

Is the ALV report ALV list, ALV grid or OOPS?

If it's ALV grid, as a test only, try copying it to another Z program and change the call TO FM REUSE_ALV_GRID_DISPLAY to REUSE_ALV_LIST_DISPLAY and try calling that instead.

Rob

0 Kudos
234

Hi,

I have changes

REUSE_ALV_GRID_DISPLAY to REUSE_ALV_LIST_DISPLAY .

Now I am able to hide output of called report.

But is there any solution because I don't want to edit my called report program.

0 Kudos
234

If there is another solution, I don't know it. Try bumping this thread on Monday morning. Maybe some new eyes will look at it.

However, if al else fails, and the people who don't want the program changed agree, you can:

Put a hidden parameter on the ALV program, say X_SUB. this will normally be blank and the users won't see it.

In the calling program call the alv program as you have done, but add

WITH X_SUB = 'X'

In the ALV program, check the value of X_SUB. If it is blank, call the grid. otherwise, call the list.

Hope this helps.

Rob

0 Kudos
234

how to pass hidden parameter to second report?

I mean to say how delare parameter in second report B which won't appear on screen.

0 Kudos
234

Like this:

REPORT ztest MESSAGE-ID 00.

DATA: BEGIN OF listobject OCCURS 0.
        INCLUDE STRUCTURE abaplist.
DATA: END OF listobject.

SUBMIT zrobsdn3
  WITH x_hid = 'X'             <==============
  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.

CALL FUNCTION 'LIST_FREE_MEMORY'
  TABLES
    listobject = listobject.

and

REPORT ztest1 NO STANDARD PAGE HEADING MESSAGE-ID 00.

PARAMETERS: x_hid(1) NO-DISPLAY.

IF x_hid IS INITIAL.
  WRITE: /001 'Hello world'..         "submitted normally
ELSE.
  WRITE: /001 'Goodbye world'..       "submitted via program
ENDIF.

Rob