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

CALL TRANSACTION using function module 'REUSE_ALV_GRID_DISPLAY' showing ABAP list

hubert_heitzer
Contributor
0 Likes
2,981

Hello,

I have a program, which is calling another program:

    DATA:
      lv_posid   TYPE                   prps-posid,
      lt_bdcdata TYPE STANDARD TABLE OF bdcdata,
      ls_bdcdata LIKE LINE OF           lt_bdcdata
      .

    CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'
      EXPORTING
        input  = iv_pspnr
      IMPORTING
        output = lv_posid.

    ls_bdcdata-program  = 'Z_DPLE_PP_PS_UEBERSICHT'.
    ls_bdcdata-dynpro   = '1000'.
    ls_bdcdata-dynbegin = 'X'.
    APPEND ls_bdcdata TO lt_bdcdata.

    CLEAR ls_bdcdata.
    ls_bdcdata-fnam     = 'S_PSPNR'.
    ls_bdcdata-fval     = lv_posid.
    APPEND ls_bdcdata TO lt_bdcdata.
    ls_bdcdata-fnam     = 'S_MATNR-LOW'.
    ls_bdcdata-fval     = gc_root_matnr.
    APPEND ls_bdcdata TO lt_bdcdata.
    ls_bdcdata-fnam     = 'S_WERKS-LOW'.
    ls_bdcdata-fval     = gc_werks_aue.
    APPEND ls_bdcdata TO lt_bdcdata.

    CALL TRANSACTION 'ZPP_PSV'
      USING  lt_bdcdata
      MODE   'E'
      UPDATE 'S'.

ZPP_PSV is a transaction code for program Z_DPLE_PP_PS_UEBERSICHT.
Z_DPLE_PP_PS_UEBERSICHT is using function module 'REUSE_ALV_GRID_DISPLAY' to display some data.

If I call program Z_DPLE_PP_PS_UEBERSICHT like shown in code above, the data is displayed in an ABAP list without using standard layout.

If I call program Z_DPLE_PP_PS_UEBERSICHT in SE80 or SE38, or if I use transaction code ZPP_PSV directly, the data is displayed in an ALV with using of standard layout.

Both calls, direct and indirect end up in the selection screen of Z_DPLE_PP_PS_UEBERSICHT.
Execute (F8) in selection screen ends up in the different presentation.

Why does my code not show an ALV?
What do I have to change to achieve an ALV?

Regards, Hubert

1 ACCEPTED SOLUTION
Read only

tamitdassharma
Active Participant
2,339

Hello Hubert,

Instead of using Call Transaction try using Submit Program with selection parameters.

Hope this will help you acheive the functionality that you are trying.

Update me about ur result after trying this.

5 REPLIES 5
Read only

tamitdassharma
Active Participant
2,340

Hello Hubert,

Instead of using Call Transaction try using Submit Program with selection parameters.

Hope this will help you acheive the functionality that you are trying.

Update me about ur result after trying this.

Read only

Sandra_Rossi
Active Contributor
2,339

To answer your question "Why does my code not show an ALV?"

First, it's not well formulated because you explained that the ALV is shown, but not "using the standard layout".

In fact, the ALV is shown through an "ABAP list" with CALL TRANSACTION … USING, but through an "ALV grid control" in the classic call mode.

This is due to the fact that the ALV detects that it's called via CALL TRANSACTION … USING (which means "batch input" is used), so because it's assumed a batch (background) it presumes that it's best to "display" via an "ABAP list" which can be transformed into a spool file in background, while displaying via an ALV Grid would make the batch job fail.

Read only

hubert_heitzer
Contributor
0 Likes
2,339

Sorry, [Comment]-link is not working at the moment.

@Sandra:

1. Sorry maybe you misunderstodd my description. I explained

  • ABAP list is displayed without using standard layout.
  • ALV is displayed with using standard layout.

.

2. Strange behaviour of ALV:
Why assume CALL TRANSACTION … USING => background, instead of evaluating SY-BATCH?

assume > evaluate ?

Read only

hubert_heitzer
Contributor
0 Likes
2,339

Sorry, [Comment]-link is not working at the moment.

@Tamit: your solution works fine, thank you.

Read only

Sandra_Rossi
Active Contributor
2,339

Sorry, [Comment]-link is not working at the moment.

hubert.heitzer I understood well, but your question is "Why does my code not show an ALV?" Don't you agree that your ABAP list is an ALV? (this is the old format of ALV, but it's an ALV)

To answer the question, this is the way SAP did it, cf the code inside REUSE_ALV_GRID_DISPLAY:

   or ( sy-binpt eq abap_true ). " <=== here is the test for batch input
    perform globals_push.
    call function 'REUSE_ALV_LIST_DISPLAY' " <== display in old format "ABAP List"