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: 

Multiple calls to REUSE_ALV_HIERSEQ_LIST_DISPLAY and return directly to SC

Former Member
0 Kudos

Hello,

I have a report that calls function module REUSE_ALV_HIERSEQ_LIST_DISPLAY, and from the result list user command it is possible to call againg the same function module to show another related list (with diferent structures and internal tables). In this situation the problem is when the usser press the Back button it returns to the previous list, but it is required to return to the selection-screen.

I have tried: SET SCREEN 0 + LEAVE SCREEN, but it returns to the previous screen.

And also: SET SCREEN 1000 (defined selection-screen) + LEAVE SCREEN (or LEAVE TO SCREEN 1000 or SET SCREEN 9000 + LEAVE SCREEN where 9000 is a Dynpro created for my program), then i get dump DYNPRO_NOT_FOUND in program SAPLKKBL, which is not my program! (my program is Zxxxxxxxx).

Any solution or ideas ? Thank you

5 REPLIES 5

Former Member
0 Kudos

Hi Victor,

Check the GUI-STATUS of the second list by using menu system->status.

Copy the GUI-STATUS from above to your program say ZGUI and use it in the second list. And then handle the back function code to leave to screen 1000.

Hope this should work.

Thanks,

Rajesh.

0 Kudos

Hi Rajesh,

It not solved the problem, i got the same dump.

When i make System -> Status I see the following:

Program SAPLKKBL

Program (GUI) ZXXXXXXX

GUI status LIST01

The dump says that screen 1000 does not exist in program SAPLKKBL (which is true...).

0 Kudos

Can you send the source code so that i can have a look at it.

Thanks,

Rajesh.

0 Kudos

The program is very large.

Here are the relevant routines:

FORM DISPLAY_ALV_LIST TABLES P_TABLE_HEADER

P_TABLE_ITEM

USING P_TABLE_HEADER_NAME

P_TABLE_ITEM_NAME.

  • DATA: it_events TYPE slis_t_event.

FIELD-SYMBOLS: <OUTTAB_HEADER> TYPE TABLE,

<OUTTAB_ITEM> TYPE TABLE.

DATA: W_KEY_INFO TYPE SLIS_KEYINFO_ALV.

  • Key link of header and item table

W_KEY_INFO-HEADER01 = 'VBELN'.

W_KEY_INFO-ITEM01 = 'VBELN'.

W_KEY_INFO-ITEM02 = 'KSCHL'.

  • Assing dinamically corresponding table

ASSIGN P_TABLE_HEADER[] TO <OUTTAB_HEADER>.

ASSIGN P_TABLE_ITEM[] TO <OUTTAB_ITEM>.

IF <OUTTAB_HEADER> IS INITIAL.

MESSAGE S000(0K) WITH TEXT-017.

ELSE.

REFRESH XFIELD.

  • Build fieldcat

PERFORM BUILD_FIELDCAT USING P_TABLE_HEADER_NAME.

PERFORM BUILD_FIELDCAT USING P_TABLE_ITEM_NAME.

  • Modify fieldcat

PERFORM MODIFY_FIELDCAT USING P_TABLE_ITEM_NAME.

  • Define layout

PERFORM DEFINE_LAYOUT USING P_TABLE_ITEM_NAME.

  • Define events

PERFORM DEFINE_EVENTS.

REPID = SY-REPID.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = REPID

I_CALLBACK_PF_STATUS_SET = K_STATUS

I_CALLBACK_USER_COMMAND = K_USER_COMMAND

IS_LAYOUT = LAYOUT

IT_FIELDCAT = XFIELD

I_DEFAULT = K_MARK

I_SAVE = 'A'

IT_EVENTS = XEVENT

I_TABNAME_HEADER = P_TABLE_HEADER_NAME

I_TABNAME_ITEM = P_TABLE_ITEM_NAME

IS_KEYINFO = W_KEY_INFO

TABLES

T_OUTTAB_HEADER = <OUTTAB_HEADER>

T_OUTTAB_ITEM = <OUTTAB_ITEM>

EXCEPTIONS

PROGRAM_ERROR = 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.

ENDIF.

ENDFORM. " DISPLAY_ALV_LIST

FORM STATUS USING EXTAB TYPE SLIS_T_EXTAB.

  • Hide buttons if it is not the correct tab

IF NOT ACTIVE_TAB IS INITIAL AND

NOT ACTIVE_TAB EQ K_TAB_SHIP.

APPEND '&DELVS' TO EXTAB.

ENDIF.

IF NOT ACTIVE_TAB EQ K_TAB_DELV.

APPEND '&SHPMT' TO EXTAB.

APPEND '&DISPD' TO EXTAB.

ENDIF.

IF NOT ACTIVE_TAB EQ K_TAB_INVO.

APPEND '&INVLS' TO EXTAB.

ENDIF.

IF NOT ACTIVE_TAB EQ K_TAB_INVL.

APPEND '&INVOC' TO EXTAB.

ENDIF.

SET PF-STATUS 'LIST01'

EXCLUDING EXTAB.

FORM USER_COMMAND USING R_UCOMM TYPE SY-UCOMM

LS_SELFIELD TYPE SLIS_SELFIELD.

DATA: L_TRANS LIKE SYST-TCODE,

L_PARID LIKE DD04D-MEMORYID.

CASE R_UCOMM.

WHEN '&BACK' OR '&EXIT' OR '&CANC'.

leave to screen 1000.

    • Unmark all checkboxes at item level

WHEN '&ALL_I'.

PERFORM MARK_ITEM_CHECKBOXES.

LS_SELFIELD-REFRESH = K_MARK.

    • Unmark all checkboxes at item level

WHEN '&SAL_I'.

PERFORM UNMARK_ITEM_CHECKBOXES.

LS_SELFIELD-REFRESH = K_MARK.

    • Switch to deliveries

WHEN '&DELVS'.

PERFORM SWITCH_TO_DELIVERIES.

    • Switch to shipment

WHEN '&SHPMT'.

PERFORM SWITCH_TO_SHIPMENT.

    • Switch to invoices

WHEN '&INVOC'.

PERFORM SWITCH_TO_INVOICES.

    • Switch to invoice list

WHEN '&INVLS'.

PERFORM SWITCH_TO_INVOICE_LIST.

...

ENDFORM.

Then in form SWITCH_TO_DELIVERIES (for example) routine DISPLAY_ALV_LIST is called again with different tables.

Thanks,

Victor

0 Kudos

Below code looks fine.

However can you check if you are using your own pf-status which is copied from standard one or just using the standard one for the second list in form SWITCH_TO_DELIVERIES where in you are calling DISPLAY_ALV_LIST again. You may have to set pf-status again like you did in main list(SET PF-STATUS 'LIST01'

EXCLUDING EXTAB).

Thanks,

Rajesh.