LIST_TOO_MANY_LPROS error for alv list output
Hi All,
we are displaying two lists in one output by using resue_alv_list_output by passing list_append = 'X' to l IS_LAYOUT parameter.
when we are using like this we are getting the LIST_TOO_MANY_LPROS error.please suggest.
please find the below error.
Runtime Errors LIST_TOO_MANY_LPROS
Date and Time 08.09.2009 21:06:33
Short text
No further list processing possible.
What happened?
You requested too many consecutive nested call screens.
What can you do?
If possible, leave the current screen level before making a further
selection (function Back=F3 or Cancel=F12).
Note down which actions and inputs caused the error.
To process the problem further, contact you SAP system
administrator.
Using Transaction ST22 for ABAP Dump Analysis, you can look
at and manage termination messages, and you can also
keep them for a long time.
Error analysis
At present, the maximum permitted number of nested screen levels is
restricted to 50.
How to correct the error
If possible, unnecessary screens should be suppressed beforehand.
Remember that you can also output a list at the same screen level as
the details list.
In some cases, it is better to create a new screen level stack by
switching to another program or transaction.
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"LIST_TOO_MANY_LPROS" " "
"SAPLKKBL" or "LKKBLU01"
"K_KKB_LIST_DISPLAY"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.
Just want to give a hit in relevance to what Sandra suggested. You can set a breakpoint in one of callback subroutine but skip first 49 its calls. This means that only when it is called 50th time, processing will stop at this breakpoint. To do that, in debugger set a breakpoint -> go to Breakpoints tab -> enter 49 in Skip field. You will avoid counting number of calls yourself, system will do that for you.
Regards
Marcin
Similar Messages
-
Hide columns for ALV list output in SAP Query SQ01/SQ02
Hi All,
I have a requirement to hide the columns which are empty in sap query SQ01 alv list output.
Please let me know this functionality available in Query (SQ01) like normal reports
Regards,
VenkatHi,
We just can't make changes in this case as this are all system generated programs.
WE have to write our own reports to make things flexible to match our requirements.
Things you are asking is not possible.
Regards,
Suvendu -
End of page in alv list output.
Hi All,
Can any body help me out for how to show end of page in alv list output.
Thanks,
Rakesh SinghRefer this link:
http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
Regards,
Ravi -
I wnat to add new fieldtext in the alv list output plz tell me
hi,
i whant add new fieldtext in the list output, plz tell me where can i modify it.
CORRECTIONS
DATE CORRECTION NOTE AUTHOR DESCRIPTION
09.03.2001 L9CK045451 0388404 XSC Wrong list output for multiple Os
05.06.2001 AL0K023393 0410219 Lud Wrong keydate for search with
Pchbegda and pchendda.
22.04.2004 S6BK024775 730486 PS Too many selection parameters in
header
19.06.2006 S6BK035494 956731 JF No sorting by qualification
REPORT RHPK_FIND_PERS_WITH_EXPIRED_QU MESSAGE-ID PQ.
DATA AUFRUF(8).
TABLES : OBJEC, GDSET.
DATA LIST.
DATA MARKFIELD(1) TYPE C.
ALV_POOL
TYPE-POOLS SLIS.
INCLUDES
INCLUDE .
INCLUDE RHPEINI0.
TABLES
DATA: orgeh_BUFFER like hrobject OCCURS 1 WITH HEADER LINE.
DATA: OBJECTS LIKE HRSOBID OCCURS 1 WITH HEADER LINE.
DATA: h_OBJEC LIKE objec OCCURS 0 WITH HEADER LINE.
DATA: pers_objects LIKE HRSOBID OCCURS 1 WITH HEADER LINE.
DATA: QUALI_TAB LIKE QUALI_PROF OCCURS 1 WITH HEADER LINE.
DATA: PERSONS LIKE PERSQ_PROF OCCURS 1 WITH HEADER LINE.
DATA: H_PERSONS LIKE HRPE_PROFL OCCURS 1 WITH HEADER LINE.
DATA: LIST_OUTPUT LIKE PERSQ_PROF OCCURS 1 WITH HEADER LINE.
DATA: BOOK_EVENT_TAB LIKE PERSQ_PROF OCCURS 1 WITH HEADER LINE.
DATA: PLAN_EVENT_TAB LIKE PERSQ_PROF OCCURS 1 WITH HEADER LINE.
DATA H_SUITED LIKE DYNP_PCRIT-SUITED.
DATA: O_COLOR LIKE STREEATTR-COLOR.
DATA: O_INTENSIV LIKE STREEATTR-INTENSIV.
DATA SHOW_KEY.
DATA EVENT.
DATA: HTEXT LIKE P1000-STEXT.
DATA: EVENT_TAB LIKE PERSQ_PROF OCCURS 1 WITH HEADER LINE.
DATA: COLLECTED_EVENTS LIKE PERSQ_PROF OCCURS 1 WITH HEADER LINE.
DATA: SUBTY_TAB LIKE HRPE_OTYPE_SUBTY OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF HIDE_STRU,
PERSTYPE LIKE HROTYPE-OTYPE,
PERSOBID LIKE HRSOBID-SOBID,
PERSTXT LIKE PERSQ_PROF-STEXT,
SCALE_ID LIKE HRPE_PROFQ-SCALE_ID,
TRAININGTYPE LIKE HRP1000-OTYPE,
TRAININGID LIKE HRP1000-OBJID,
TRAININGSTXT LIKE HRP1000-STEXT,
QUALID LIKE QUALI_PROF-QUALID,
QUALTEXT LIKE QUALI_PROF-QUALSTXT,
END OF HIDE_STRU.
DATA: BEGIN OF EXTAB OCCURS 10,
FCODE LIKE RSMPE-FUNC,
END OF EXTAB.
DATA: CURRENT_QUALID LIKE QUALI_PROF-QUALID.
DATA: CURRENT_TRAININGSID LIKE HRP1000-OBJID.
DATA: CURRENT_TRAININGTYPE LIKE HRP1000-OTYPE.
DATA: SUBRC LIKE SY-SUBRC.
VARIABLES
DATA: OBJID LIKE P1000-OBJID.
DATA: H_LINE_COUNT TYPE I.
DATA: H_TABIX1 LIKE SY-TABIX.
ALV-Variables
DATA: alv_events_line TYPE slis_alv_event. "header line
DATA ALV_EVENTS TYPE SLIS_T_EVENT.
DATA GT_ALV_LIST_TOP_OF_LIST TYPE SLIS_T_LISTHEADER.
DATA: gt_events TYPE SLIS_T_EVENT.
DATA G_REPID LIKE SY-REPID.
DATA G_VARIANT LIKE DISVARIANT.
DATA ALV_USERCOMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
DATA G_USERCOMMAND_FOR_RANKINGLIST TYPE SLIS_FORMNAME VALUE
'USER_COMMAND_FOR_RANKINGLIST'.
DATA ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: ALV_OUTPUT LIKE HRPDV_EXPIRED_Q OCCURS 0 WITH HEADER LINE.
DATA: Help_OUTPUT LIKE HRPDV_EXPIRED_Q OCCURS 0 WITH HEADER LINE.
begin of Dynpro 5020 - POPUP: WEITER
DATA: OK_CODE_5020 LIKE SY-UCOMM.
DATA: NO_ORG. "if no org selected
DATA: H_TABIX LIKE SY-TABIX.
begin of Dynpro 20nn - Header
TABLES: DYNP_RHPP.
SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-005.
PARAMETERS:
H_EVENTS LIKE DYNP_RHPP-GEN_TRAIN, "with training sugg
H_QUAL LIKE DYNP_RHPP-EXPIRED_QUAL. "with Qual
SELECTION-SCREEN END OF BLOCK B3.
INITIALIZATION
INITIALIZATION.
PERFORM READ_T77S0_PARAMETERS_FOR_PE.
get user parameters/Planvariante und Beginndatum setzen:
PCHOTYPE = $ORGEH.
CALL FUNCTION 'RHP0_USER_PARAMETERS_GET'
EXPORTING
FILL_IF_INITIAL = 'X'
IMPORTING
PLVAR = PCHPLVAR
BEGDA = PCHBEGDA
endda = Pchendda "Correction 0410219
WITH_KEY = SHOW_KEY
SUBSTITUTE =
ESSENTIAL = only_essential
ORG_UNIT = PCHOBJID-LOW
EXCEPTIONS
OTHERS = 0.
PCHBEGDA = LOW_DATE. "Correction note: 0410219 / AL0K023393
get menu text for key on/off
PERFORM USER_MENU_TEXT_KEY(SAPLRHP0) USING G_MENU_TEXT_KEY.
start-of-selection
START-OF-SELECTION.
terminate the selection if objid isn't given
READ TABLE PCHOBJID INDEX 1 TRANSPORTING NO FIELDS.
IF SY-SUBRC <> 0
AND PCHOBJID IS INITIAL.
PCHOBJID-SIGN = 'I'.
PCHOBJID-OPTION = 'EQ'.
PCHOBJID-LOW = '00000001'.
APPEND PCHOBJID.
NO_ORG = TRUE.
ELSE.
NO_ORG = FALSE.
ENDIF.
GET OBJEC.
terminate the selection if objid isn't given
IF NO_ORG = TRUE.
EXIT.
ENDIF.
OBJECTS-PLVAR = PCHPLVAR.
OBJECTS-OTYPE = PCHOTYPE.
OBJECTS-SOBID = OBJEC-REALO.
APPEND OBJECTS.
Für das lesen der Organisationseinheit
h_OBJEC-PLVAR = OBJEC-PLVAR.
h_OBJEC-OTYPE = OBJEC-OTYPE.
h_OBJEC-OBJID = OBJEC-objid.
append h_objec.
Read table h_objec index 1 transporting no fields.
if sy-subrc = 0.
Fill Buffer
orgeh_BUFFER = h_OBJEC.
orgeh_BUFFER[] = h_OBJEC[].
CALL FUNCTION 'RH_TEXT_BUFFER_FILL'
TABLES
OBJECTS = orgeh_BUFFER.
Loop at h_OBJEC.
H_TABIX = SY-TABIX.
Read text of organisation
CALL FUNCTION 'RH_READ_OBJECT'
EXPORTING
PLVAR = h_OBJEC-plvar
OTYPE = h_OBJEC-otype
OBJID = h_OBJEC-OBJID
IMPORTING
OBEG = h_objec-begda
OEND = h_objec-endda
SHORT = short
STEXT = h_OBJEC-stext
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
modify h_OBJEC index H_TABIX.
ENDIF.
endloop.
endif.
end-of-selection
END-OF-SELECTION.
read objects of the organizational unit
OBJID = OBJECTS-SOBID.
CALL FUNCTION 'RHPH_PICK_UP_PERSONS'
EXPORTING
BEGDA = PCHBEGDA "Correction 0410219
ENDDA = PCHENDDA "Correction 0410219
STATUS = '1'
WITH_STEXT = 'X'
TABLES
OBJECTS = OBJECTS
PERSONS = H_PERSONS
EXCEPTIONS
UNDEFINED = 1
OTHERS = 2.
IF SY-SUBRC = 0.
prepare objects !
objects-otype = h_persons-ttype.
objects-sobid = h_persons-tobid.
append objects.
ELSE.
EXIT.
ENDIF.
CLEAR OBJECTS. REFRESH OBJECTS.
prepare sel_objects !
pers_objects-PLVAR = PCHPLVAR.
LOOP AT H_PERSONS.
pers_objects-OTYPE = H_PERSONS-TTYPE.
pers_objects-SOBID = H_PERSONS-TOBID.
APPEND pers_objects.
ENDLOOP.
sort objects and delete adjacent duplicates
SORT Pers_OBJECTS BY PLVAR OTYPE SOBID.
DELETE ADJACENT DUPLICATES FROM Pers_OBJECTS COMPARING PLVAR OTYPE
SOBID.
CALL FUNCTION 'RHPK_FIND_PERS_WITH_EXPIRED_Q'
EXPORTING
PLVAR = PCHPLVAR
CHECK_BEGDA = PCHBEGDA
CHECK_ENDDA = PCHENDDA
SUBTY = $ownsb "'B032'
only_essential =
target_otype =
target_ap_iea =
TABLES
IMP_PER_TAB = pers_objects
QUALI_TAB = QUALI_TAB
PERSONS = LIST_OUTPUT
altq_tab =
EXCEPTIONS
NO_QUALIFICATION = 1
NO_PERSON_FOUND = 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.
100% case
READ TABLE pers_objects INDEX 1 TRANSPORTING NO FIELDS.
IF SY-SUBRC = 0.
sort pers_objects by otype sobid.
check the selected persons: if org.unit was selected !
Loop at pers_objects.
H_TABIX = SY-TABIX.
READ TABLE LIST_OUTPUT WITH KEY OTYPE = pers_objects-OTYPE
SOBID = pers_objects-SOBID
BINARY SEARCH.
IF SY-SUBRC <> 0.
person doesn't belong to the selected org.unit
DELETE LIST_OUTPUT INDEX H_TABIX.
ENDIF.
ENDLOOP.
ENDIF. "org.unit check needed ?
end-of-selection.
sort h_objec by otype objid.
sort list_output by otype sobid.
sort h_persons by ttype tobid.
ALV-Liste aufbauen
loop at h_objec.
loop at h_persons where otype = h_objec-otype "XSC
and sobid = h_objec-objid. "XSC
Read table list_output with key
otype = h_persons-ttype
sobid = h_persons-tobid
binary search.
if sy-subrc = 0.
h_tabix1 = sy-tabix.
while sy-subrc = 0.
clear alv_output. "XSC
ALV_OUTPUT-otype = h_objec-otype.
ALV_OUTPUT-sobid = h_objec-objid.
ALV_OUTPUT-stext = h_objec-stext.
ALV_OUTPUT-Ptype = LIST_OUTPUT-otype.
ALV_OUTPUT-pobid = LIST_OUTPUT-sobid.
ALV_OUTPUT-pshort = LIST_OUTPUT-short.
ALV_OUTPUT-ptext = LIST_OUTPUT-stext.
ALV_OUTPUT-qualid = LIST_OUTPUT-qualid.
ALV_OUTPUT-qualstxt = LIST_OUTPUT-qualstxt.
ALV_OUTPUT-expbegda = LIST_OUTPUT-vbegda.
ALV_OUTPUT-expendda = LIST_OUTPUT-vendda.
PERFORM FIND_TRAINING TABLES QUALI_TAB EVENT_TAB COLLECTED_EVENTS
USING $PLVAR $GDATE H_EVENTS H_QUAL.
IF NOT EVENT_TAB[] IS INITIAL.
READ TABLE COLLECTED_EVENTS WITH KEY
QUALID = LIST_OUTPUT-QUALID.
IF SY-SUBRC = 0.
ALV_OUTPUT-ICON_S_EVENTS = ICON_BOOKEVENT.
endif.
ENDIF.
Append ALV_OUTPUT.
h_tabix1 = h_tabix1 + 1.
READ TABLE list_output INDEX h_tabix1
COMPARING otype sobid.
endwhile.
endif.
endloop.
endloop.
check if indicator for qualification view is set
IF h_qual = 'X'. "note 956731
SORT alv_output by qualid OTYPE SOBID ptype pobid "note 956731
expbegda expendda. "note 956731
ELSE. "note 956731
SORT alv_output by OTYPE SOBID ptype pobid qualid expbegda expendda.
ENDIF. "note 956731
DELETE ADJACENT DUPLICATES FROM ALV_OUTPUT COMPARING OTYPE SOBID ptype
pobid qualid expbegda expendda.
stext_AQ und icon-Feld noch nicht gefüllt
perform PREPARE_TOP_OF_LIST.
perform Build_FIELDCAT using GT_FIELDCAT[] H_EVENTS.
perform ALV_LAYOUT USING alv_layout.
G_REPID = SY-REPID.
G_VARIANT-REPORT = G_REPID.
PERFORM EVENTTAB_BUILD USING GT_EVENTS.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = 'X'
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = ALV_USERCOMMAND
I_STRUCTURE_NAME = 'HRPDV_EXPIRED_Q'
IS_LAYOUT = ALV_LAYOUT
IT_FIELDCAT = GT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT = G_VARIANT
IT_EVENTS = GT_EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ALV_OUTPUT
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.
*& Form FIND_TRAINING
text
-->P_QUALI_TAB text
-->P_EVENT_TAB text
-->P_$PLVAR text
-->P_GDATE text
-->P_H_EVENT text
-->P_H_QUAL text
FORM FIND_TRAINING TABLES P_QUALI_TAB STRUCTURE QUALI_TAB
P_EVENT_TAB STRUCTURE EVENT_TAB
P_COLLECTED_EVENTS STRUCTURE COLLECTED_EVENTS
USING VALUE(P_$PLVAR) LIKE P1000-PLVAR
VALUE(P_GDATE) LIKE P1000-GDATE
VALUE(P_H_EVENT) TYPE ANY
VALUE(P_H_QUAL) TYPE ANY.
IF NOT P_H_EVENT IS INITIAL.
READ TABLE EVENT_TAB INDEX 1 TRANSPORTING NO FIELDS.
IF SY-SUBRC <> 0.
CLEAR P_EVENT_TAB. REFRESH EVENT_TAB.
CLEAR P_COLLECTED_EVENTS. REFRESH P_COLLECTED_EVENTS.
IF EVENT = FALSE.
EVENT = TRUE.
ELSE.
EVENT = FALSE.
ENDIF.
CALL FUNCTION 'RHPH_FIND_TRAINING_FOR_QUAL'
EXPORTING
PLVAR = PCHPLVAR
GDATE = SY-DATUM
GET_NAME = 'X'
TABLES
QUALI_TAB = QUALI_TAB
TO_Q_TAB = EVENT_TAB
EXCEPTIONS
NO_QUALIFICATION = 1
NO_OBJECT_FOUND = 2
TECHNICAL_ERROR = 3
OTHERS = 4.
IF SY-SUBRC = 0.
the found qualifications are picked up into table event_tab
ENDIF.
IF SY-SUBRC = 1.
MESSAGE S015. "Zu den Eingaben wurden keine Daten gefunden
ENDIF.
IF SY-SUBRC > 2.
EXIT.
ENDIF.
collect events when there are double.
Veranstaltungen kollektieren, Können mehrfach auftauchen, da
verschiedenen Qualifikationen von gleichen Veranstaltungen vermittelt
LOOP AT P_EVENT_TAB INTO P_COLLECTED_EVENTS.
APPEND P_COLLECTED_EVENTS.
ENDLOOP.
SORT P_COLLECTED_EVENTS BY QUALID STEXT.
ENDIF.
ENDIF.
ENDFORM. " FIND_TRAINING
*& Form PREPARE_TOP_OF_LIST
text
--> p1 text
<-- p2 text
FORM PREPARE_TOP_OF_LIST.
DATA ALV_TOP_OF_LIST TYPE SLIS_LISTHEADER. "typ, key, info
DATA STEXT LIKE HRPDV_SUCCESSOR_VIEW-TTEXT.
DATA P_SUBRC LIKE SY-SUBRC.
DATA P_STEXT LIKE T777O-OTEXT.
DATA l_tabix like sy-tabix value 0.
DATA: h_counter TYPE i. "note 730486
ALV_TOP_OF_LIST-TYP = 'H'.
ALV_TOP_OF_LIST-INFO = TEXT-REQ.
APPEND ALV_TOP_OF_LIST TO GT_ALV_LIST_TOP_OF_LIST.
Organisationseinheit
ALV_TOP_OF_LIST-typ = 'S'.
Read text for organisationunit
PERFORM READ_TEXT_OTYPE_T777O(SAPLRHP0) USING SY-LANGU $ORGEH
P_STEXT P_SUBRC.
ALV_TOP_OF_LIST-key = P_STEXT.
fill buffer for read organisation-text
CALL FUNCTION 'RH_TEXT_BUFFER_FILL'
EXPORTING
CHECK_STRU_AUTH = 'X'
WITH_EXTINT = ' '
TABLES
OBJECTS = OBJECTS.
loop at objects for multipleselection
clear h_counter. "note 730486
LOOP AT OBJECTS.
$OBJID = OBJECTS-SOBID.
CALL FUNCTION 'RH_READ_OBJECT'
EXPORTING
PLVAR = OBJECTS-PLVAR
OTYPE = OBJECTS-OTYPE
OBJID = $OBJID
IMPORTING
SHORT = short
STEXT = STEXT
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.
IF h_counter >= 15. "note 730486
MOVE '( ... )' TO ALV_TOP_OF_LIST-INFO. "note 730486
APPEND ALV_TOP_OF_LIST TO gt_alv_list_top_of_list.
"note 730486
EXIT. "note 730486
ENDIF. "note 730486
CONCATENATE $ORGEH OBJECTS-SOBID STEXT INTO
ALV_TOP_OF_LIST-INFO SEPARATED BY SPACE.
APPEND ALV_TOP_OF_LIST TO GT_ALV_LIST_TOP_OF_LIST.
CLEAR ALV_TOP_OF_LIST.
ALV_TOP_OF_LIST-typ = 'S'.
l_tabix = l_tabix + 1.
ADD 1 TO h_counter. "note 730486
ENDLOOP.
CLEAR ALV_TOP_OF_LIST.
ALV_TOP_OF_LIST-TYP = 'S'.
ALV_TOP_OF_LIST-key = TEXT-003.
WRITE PCHBEGDA TO ALV_TOP_OF_LIST-INFO.
APPEND ALV_TOP_OF_LIST TO GT_ALV_LIST_TOP_OF_LIST.
clear ALV_TOP_OF_LIST-INFO.
ALV_TOP_OF_LIST-key = TEXT-004.
WRITE PCHENDDA TO ALV_TOP_OF_LIST-INFO.
Append ALV_TOP_OF_LIST TO GT_ALV_LIST_TOP_OF_LIST.
ENDFORM. " PREPARE_TOP_OF_LIST
*& Form BUILD_FIELDCAT
text
-->P_GT_FIELDCAT[] text
FORM BUILD_FIELDCAT USING P_GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV
P_H_EVENTS.
DATA: WA_FIELDCAT LIKE LINE OF P_GT_FIELDCAT.
DATA: P_REPNAME LIKE SY-REPID,
L_TABIX LIKE SY-TABIX. "local variable for sy-tabix.
P_REPNAME = SY-REPID.
Erstellen des Feldkataloges
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = P_REPNAME
I_INTERNAL_TABNAME =
I_STRUCTURE_NAME = 'HRPDV_EXPIRED_Q'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = PRONAME
CHANGING
CT_FIELDCAT = P_GT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 0
PROGRAM_ERROR = 0
OTHERS = 0.
LOOP AT P_GT_FIELDCAT INTO WA_FIELDCAT.
l_tabix = sy-tabix.
CASE WA_FIELDCAT-FIELDNAME.
when 'OTYPE'.
WA_FIELDCAT-DDICTXT = 'L'.
when 'SOBID'.
WA_FIELDCAT-DDICTXT = 'L'.
WHEN 'STEXT'.
WA_FIELDCAT-DDICTXT = 'L'.
when 'PTYPE'.
WA_FIELDCAT-DDICTXT = 'L'.
when 'POBID'.
WA_FIELDCAT-DDICTXT = 'L'.
when 'PSHORT'.
WA_FIELDCAT-DDICTXT = 'L'.
WHEN 'PTEXT'.
WA_FIELDCAT-DDICTXT = 'L'.
WHEN 'QUALID'.
WA_FIELDCAT-DDICTXT = 'L'.
WHEN 'QUALSTXT'.
WA_FIELDCAT-DDICTXT = 'L'.
WHEN 'EXPBEGDA'.
WA_FIELDCAT-DDICTXT = 'L'.
WHEN 'EXPENDDA'.
WA_FIELDCAT-DDICTXT = 'L'.
WHEN 'ICON_S_EVENTS'.
IF P_H_EVENTS IS INITIAL.
WA_FIELDCAT-NO_OUT = 'X'.
else.
WA_FIELDCAT-DDICTXT = 'X'.
endif.
ENDCASE.
MODIFY P_GT_FIELDCAT FROM WA_FIELDCAT INDEX l_tabix.
ENDLOOP.
ENDFORM. " BUILD_FIELDCAT
*& Form ALV_LAYOUT
text
-->P_L_ALV_LAYOUT text
FORM ALV_LAYOUT USING P_ALV_LAYOUT TYPE slis_layout_alv.
build layout
P_LAYOUT-BOX_FIELDNAME = 'MARK_X'. "fieldname for checkbox
P_ALV_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
P_ALV_LAYOUT-BOX_TABNAME = ALV_OUTPUT. "tabname for checkbox
p_ALV_layout-info_fieldname = 'ALV_COLOR'.
ENDFORM. " ALV_LAYOUT
FORM eventtab_build USING
FORM EVENTTAB_BUILD USING RT_EVENTS TYPE SLIS_T_EVENT.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
MOVE 'TOP_OF_PAGE' TO LS_EVENT-NAME.
MOVE 'TOP_OF_PAGE' TO LS_EVENT-FORM.
APPEND LS_EVENT TO RT_EVENTS.
ENDFORM. "EVENTTAB_BUILD
*FORM TOP_OF_PAGE
FORM TOP_OF_PAGE. "#EC CALLED
NEW-PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = GT_ALV_LIST_TOP_OF_LIST[].
ENDFORM. "TOP_OF_PAGE
FORM USER_COMMAND *
USER_COMMAND for the list of successor view *
--> r_ucomm *
--> rs_selfield *
FORM USER_COMMAND USING ALV_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD. "#EC CALLED
DATA: SELECTED_LINE LIKE HRPDV_expired_q.
DATA: SOBID_QUA LIKE P1000-OBJID.
DATA: LT_PERS_TAB LIKE HRSOBID OCCURS 0 WITH HEADER LINE.
CASE ALV_UCOMM.
WHEN '&IC1'. "per Doppelklick auswählen
READ TABLE ALV_OUTPUT INDEX
RS_SELFIELD-TABINDEX INTO SELECTED_LINE.
CASE RS_SELFIELD-FIELDNAME.
WHEN 'POTYPE' or 'POBID' or 'PTEXT' or 'OTYPE' or 'SOBID' or
'STEXT' or 'QUALID' or 'QUALSTXT' or 'EXPBEGDA' or 'EXPENDDA'.
READ TABLE ALV_OUTPUT INDEX RS_SELFIELD-TABINDEX INTO
Help_output.
IF SY-SUBRC <> 0.
MESSAGE S027. "Bitte gültige Zeile auswählen
EXIT.
Endif.
IF ALV_OUTPUT-SOBID IS INITIAL.
MESSAGE S015. "Zu den Eingaben wurden keine Daten gefunden
ELSE.
converte the variable because of the different types
SOBID_QUA = SELECTED_LINE-SOBID_QUA.
CALL FUNCTION 'RHPP_SHOW_PROFILE'
EXPORTING
PLVAR = pchplvar
OTYPE = SELECTED_LINE-PTYPE "XSC
OBJID = SELECTED_LINE-POBID "XSC
BEGDA = PCHBEGDA
ENDDA = PCHENDDA
MAINTAIN = ' '
EXCEPTIONS
NO_AUTHORITY = 1
NOT_FOUND = 2
OTHERS = 3.
CASE SY-SUBRC.
WHEN 0.
All right.
WHEN 1.
MESSAGE S015.
Zu Ihren Eingaben konnten keine Daten gefunden werden!
WHEN 2.
MESSAGE E000.
Dazu haben sie keine berechtigung!
WHEN OTHERS.
MESSAGE E008.
Es ist ein unvorhergesehener Fehler aufgetreten.
ENDCASE. "sy-subrc.
CLEAR ALV_OUTPUT.
ENDIF. "IF ALV_OUTPUT-SOBID IS INITIAL.
CLEAR ALV_OUTPUT-SOBID.
when 'ICON_S_EVENTS'.
IF SELECTED_LINE-ICON_S_EVENTS IS INITIAL.
MESSAGE S027. "Bitte gültige Zeile auswählen
EXIT.
ENDIF.
CLEAR LT_PERS_TAB.
REFRESH LT_PERS_TAB.
LT_PERS_TAB-PLVAR = pchPLVAR.
LT_PERS_TAB-OTYPE = SELECTED_LINE-PTYPE. "XSC
LT_PERS_TAB-SOBID = SELECTED_LINE-POBID. "XSC
APPEND LT_PERS_TAB.
SOBID_QUA = SELECTED_LINE-QUALID.
CALL FUNCTION 'RHPP_SHOW_SUGGEST_EVENTS'
EXPORTING
P_PLVAR = pchPLVAR
P_SOBID_QUA = SOBID_QUA
P_PROFCY_REQ = SELECTED_LINE-RATING_REQ
P_GDATE = sy-datum
TABLES
EVENT_TAB =
PERS_TAB = LT_PERS_TAB.
endcase.
CLEAR SELECTED_LINE.
ENDCASE. "case sy-ucomm
CLEAR SY-UCOMM.
ENDFORM. "USER_COMMANDPls be more specific in your question. If you want to include an extra field in your alv output, then read the field catalog table you created through "Reuse_alv_fieldcatalog_merge" and then add an extra entry in it giving the details of the field you want to add.. and then call the "resuse_alv_grid_display",
Hope this helps. To be able to help you in a better way, kindly revert with any specific issue.
Reward if helpful,
Karan -
Regarding Runtime error in ALV List Display.
am using following to display data in ALV List.
but after executing of program am getting runtime error called 'Field Symbol has Not been assigned' .
please tell me how to correct the error.
Very urgent
Suitable answers rewarded with Maximum Ponits...
REPORT zmatrix.
TYPE-POOLS: slis.
TABLES: agr_define, sza5_d0700.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-006.
SELECT-OPTIONS: s_role FOR agr_define-agr_name OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
D A T A *
TYPES: BEGIN OF ty_agr_1251_inf,
agr_name TYPE agr_1251-agr_name,
object TYPE agr_1251-object,
field TYPE agr_1251-field,
low(20) TYPE c,
high TYPE agr_1251-high,
infty TYPE t582s-infty,
itext TYPE t582s-itext,
END OF ty_agr_1251_inf.
TYPES: BEGIN OF ty_agr_1251_tcode,
agr_name TYPE agr_1251-agr_name,
object TYPE agr_1251-object,
field TYPE agr_1251-field,
low(20) TYPE c,
high TYPE agr_1251-high,
tcode TYPE tstct-tcode,
ttext TYPE tstct-ttext,
END OF ty_agr_1251_tcode.
TYPES: BEGIN OF ty_t582s,
infty TYPE agval,
itext TYPE t582s-itext,
END OF ty_t582s.
TYPES: BEGIN OF ty_code,
tcode TYPE tstct-tcode,
ttext TYPE ttext_stct,
END OF ty_code.
TYPES: BEGIN OF ty_inf,
infty TYPE t582s-infty,
itext TYPE t582s-itext,
END OF ty_inf.
TYPES: BEGIN OF ty_role,
agr_name TYPE agr_1251-agr_name,
END OF ty_role.
TYPES: BEGIN OF tys_role_dtls,
agr_name TYPE agr_name,
value TYPE c,
property TYPE c,
END OF tys_role_dtls.
TYPES: BEGIN OF tys_infotype_final,
text(60),
text1(60),
value(4),
END OF tys_infotype_final.
I N T E R N A L T A B L E S *
DATA: wa_infotyp_final TYPE tys_infotype_final.
DATA: t_infotyp_final TYPE TABLE OF tys_infotype_final.
DATA: BEGIN OF wa_infotyp_dtls,
infty TYPE infty,
itext TYPE intxt,
role_dtls TYPE TABLE OF tys_role_dtls,
END OF wa_infotyp_dtls.
DATA: BEGIN OF wa_tcode_dtls,
tcode TYPE tcode,
ttext TYPE ttext_stct,
role_dtls TYPE TABLE OF tys_role_dtls,
END OF wa_tcode_dtls.
DATA: t_infotyp_dtls LIKE TABLE OF wa_infotyp_dtls,
t_tcode_dtls LIKE TABLE OF wa_tcode_dtls,
t_role_dtls TYPE TABLE OF tys_role_dtls,
wa_role_dtls TYPE tys_role_dtls.
DATA: wa_inf TYPE ty_inf,
t_inf TYPE STANDARD TABLE OF ty_inf.
DATA: wa_role TYPE ty_role,
t_role TYPE STANDARD TABLE OF ty_role.
DATA: wa_tcode TYPE ty_code,
t_tcode TYPE TABLE OF ty_code.
DATA: wa_agr_1251_inf TYPE ty_agr_1251_inf.
DATA: wa_agr_1251_tcode TYPE ty_agr_1251_tcode.
DATA: t_agr_1251_inf TYPE STANDARD TABLE OF ty_agr_1251_inf.
DATA: t_agr_1251_tc TYPE STANDARD TABLE OF ty_agr_1251_tcode.
DATA: wa_582s TYPE ty_t582s.
DATA: t_582s TYPE STANDARD TABLE OF ty_t582s.
DATA: t_range_tcode TYPE RANGE OF tcode.
DATA: t_range_inf TYPE RANGE OF infotyp.
DATA: wa_range_inf LIKE LINE OF t_range_inf.
DATA: wa_range_tcode LIKE LINE OF t_range_tcode.
DATA: wa_field TYPE slis_fieldcat_alv.
DATA: t_field TYPE slis_t_fieldcat_alv.
VARIABLES FOR OLE *
DATA: text(20),
count(20).
DATA: text1(30).
DATA: agr_name TYPE agr_1251-agr_name.
DATA: flag TYPE i VALUE '0'.
DATA: string1 TYPE string.
DATA: str TYPE string VALUE 'SAP%'.
DATA: count1 TYPE i VALUE '0'.
*& Event START-OF-SELECTION
START-OF-SELECTION.
PERFORM f100_get_inf_data.
PERFORM f200_process_inf_data.
count1 = 1.
PERFORM f300_prepare_field_catalog.
PERFORM f110_main_data.
PERFORM f400_display_data.
PERFORM f100_get_trans_data.
*& Form f110_main_data
text
FORM f110_main_data.
wa_infotyp_final-text = 'Access to Infotypes'.
APPEND wa_infotyp_final TO t_infotyp_final.
wa_infotyp_final-text = 'Infotype'.
wa_infotyp_final-text1 = 'Description'.
APPEND wa_infotyp_final TO t_infotyp_final.
wa_infotyp_final-text = '*'.
wa_infotyp_final-text1 = 'Acess to all Infotypes'.
LOOP AT t_role INTO wa_role WHERE agr_name <> ' '.
READ TABLE t_agr_1251_inf INTO wa_agr_1251_inf
WITH KEY agr_name = wa_role-agr_name field = 'INFTY' low = '*'.
IF syst-subrc = 0.
wa_infotyp_final-value = 'X'.
ENDIF.
ENDLOOP.
APPEND wa_infotyp_final TO t_infotyp_final.
LOOP AT t_inf INTO wa_inf WHERE infty <> ' '.
wa_infotyp_final-text = wa_inf-infty.
wa_infotyp_final-text1 = wa_inf-itext.
LOOP AT t_role INTO wa_role WHERE agr_name <> ' '.
Role Name
CLEAR wa_role_dtls.
flag = 1.
wa_role_dtls-agr_name = wa_role-agr_name.
For Value D & F
READ TABLE t_agr_1251_inf INTO wa_agr_1251_inf
WITH KEY agr_name = wa_role-agr_name field = 'AUTHC'..
IF syst-subrc EQ 0.
IF wa_agr_1251_inf-low = 'R'.
wa_infotyp_final-value = 'D'.
ELSE.
wa_infotyp_final-value = 'F'.
ENDIF.
ENDIF.
APPEND wa_role_dtls TO t_role_dtls.
APPEND wa_infotyp_final TO t_infotyp_final.
ENDLOOP.
ENDLOOP.
ENDFORM. "f110_main_data
*& Form f100_get_inf_data
text
FORM f100_get_inf_data.
Logic for Infotypes *
SELECT aagr_name aobject
afield alow a~high
INTO TABLE t_agr_1251_inf
FROM agr_1251 AS a INNER JOIN agr_define AS b
ON aagr_name EQ bagr_name
WHERE ( ( aobject EQ 'P_ORGIN' OR aobject EQ 'P_PERNR' )
AND ( aagr_name IN s_role ) AND ( bagr_name NOT LIKE str ) ).
ENDFORM. "f100_get_inf_data
*& Form f200_get_inf_process_data
text
FORM f200_process_inf_data.
LOOP AT t_agr_1251_inf INTO wa_agr_1251_inf.
IF wa_agr_1251_inf-high IS INITIAL.
CLEAR wa_range_inf.
wa_range_inf-sign = 'I'.
wa_range_inf-option = 'EQ'.
wa_range_inf-low = wa_agr_1251_inf-low.
APPEND wa_range_inf TO t_range_inf.
ELSE.
CLEAR wa_range_inf.
wa_range_inf-sign = 'I'.
wa_range_inf-option = 'BT'.
wa_range_inf-low = wa_agr_1251_inf-low.
wa_range_inf-high = wa_agr_1251_inf-high.
APPEND wa_range_inf TO t_range_inf.
ENDIF.
ENDLOOP.
SORT t_range_inf.
DELETE ADJACENT DUPLICATES FROM t_range_inf.
IF t_range_inf IS NOT INITIAL.
SELECT infty itext FROM t582s
INTO TABLE t_582s
WHERE sprsl = 'EN' AND infty IN t_range_inf.
IF syst-subrc EQ 0.
ENDIF.
ENDIF.
LOOP AT t_agr_1251_inf INTO wa_agr_1251_inf.
IF wa_agr_1251_inf-high IS INITIAL.
READ TABLE t_582s INTO wa_582s
WITH KEY infty = wa_agr_1251_inf-low.
IF syst-subrc EQ 0.
wa_agr_1251_inf-infty = wa_582s-infty.
wa_agr_1251_inf-itext = wa_582s-itext.
MODIFY t_agr_1251_inf FROM wa_agr_1251_inf
TRANSPORTING infty itext.
IF syst-subrc EQ 0.
ENDIF.
ENDIF.
ELSE.
CLEAR count.
LOOP AT t_582s INTO wa_582s
WHERE infty GE wa_agr_1251_inf-low
AND infty LE wa_agr_1251_inf-high.
IF count LE 1.
wa_agr_1251_inf-high = space.
wa_agr_1251_inf-infty = wa_582s-infty.
wa_agr_1251_inf-itext = wa_582s-itext.
MODIFY t_agr_1251_inf FROM wa_agr_1251_inf
TRANSPORTING infty itext.
IF syst-subrc EQ 0.
CLEAR wa_582s.
ENDIF.
ELSE.
wa_agr_1251_inf-high = space.
wa_agr_1251_inf-infty = wa_582s-infty.
wa_agr_1251_inf-itext = wa_582s-itext.
APPEND wa_agr_1251_inf TO t_agr_1251_inf.
ENDIF.
CLEAR wa_agr_1251_inf.
count = count + 1.
ENDLOOP.
ENDIF.
ENDLOOP.
wa_role-agr_name = ' '.
APPEND wa_role TO t_role.
wa_role-agr_name = ' '.
APPEND wa_role TO t_role.
LOOP AT t_agr_1251_inf INTO wa_agr_1251_inf.
IF wa_agr_1251_inf IS NOT INITIAL.
wa_role-agr_name = wa_agr_1251_inf-agr_name.
wa_inf-infty = wa_agr_1251_inf-infty.
wa_inf-itext = wa_agr_1251_inf-itext.
APPEND wa_role TO t_role.
APPEND wa_inf TO t_inf.
ENDIF.
ENDLOOP.
SORT t_role BY agr_name.
DELETE ADJACENT DUPLICATES FROM t_role.
SORT t_inf BY infty.
DELETE ADJACENT DUPLICATES FROM t_inf.
ENDFORM. "f200_get_process_inf_data
*& Form f100_get_trans_data
text
FORM f100_get_trans_data.
Logic for Transaction Codes *
SELECT aagr_name aobject
afield alow a~high
INTO CORRESPONDING FIELDS OF TABLE t_agr_1251_tc
FROM agr_1251 AS a
INNER JOIN agr_define AS b ON aagr_name EQ bagr_name
WHERE a~agr_name IN s_role
AND a~object EQ 'S_TCODE'.
ENDFORM. "f100_get_trans_data
*& Form f200_process_trans_data
text
FORM f200_process_trans_data.
LOOP AT t_agr_1251_tc INTO wa_agr_1251_tcode.
IF wa_agr_1251_tcode-high IS INITIAL.
CLEAR wa_range_tcode.
wa_range_tcode-sign = 'I'.
wa_range_tcode-option = 'EQ'.
wa_range_tcode-low = wa_agr_1251_tcode-low.
APPEND wa_range_tcode TO t_range_tcode.
ELSE.
CLEAR wa_range_tcode.
wa_range_tcode-sign = 'I'.
wa_range_tcode-option = 'BT'.
wa_range_tcode-low = wa_agr_1251_tcode-low.
wa_range_tcode-high = wa_agr_1251_tcode-high.
APPEND wa_range_tcode TO t_range_tcode.
ENDIF.
ENDLOOP.
SORT t_range_tcode.
DELETE ADJACENT DUPLICATES FROM t_range_tcode.
IF t_range_tcode IS NOT INITIAL.
SELECT tcode
ttext
FROM tstct
INTO TABLE t_tcode
WHERE sprsl EQ 'E'
AND tcode IN t_range_tcode.
IF sy-subrc EQ 0.
ENDIF.
ENDIF.
SORT t_agr_1251_tc BY agr_name.
LOOP AT t_agr_1251_tc INTO wa_agr_1251_tcode.
IF wa_agr_1251_tcode-high IS INITIAL.
READ TABLE t_tcode INTO wa_tcode
WITH KEY tcode = wa_agr_1251_tcode-low.
IF syst-subrc EQ 0.
wa_agr_1251_tcode-tcode = wa_tcode-tcode.
wa_agr_1251_tcode-ttext = wa_tcode-ttext.
MODIFY t_agr_1251_tc FROM wa_agr_1251_tcode
TRANSPORTING tcode ttext.
IF syst-subrc EQ 0.
ENDIF.
ENDIF.
ELSE.
CLEAR count.
LOOP AT t_tcode INTO wa_tcode
WHERE tcode GE wa_agr_1251_tcode-low
AND tcode LE wa_agr_1251_tcode-high.
IF count LE 1.
agr_name = wa_agr_1251_tcode-agr_name.
wa_agr_1251_tcode-high = space.
wa_agr_1251_tcode-tcode = wa_tcode-tcode.
wa_agr_1251_tcode-ttext = wa_tcode-ttext.
MODIFY t_agr_1251_tc FROM wa_agr_1251_tcode
TRANSPORTING tcode ttext high.
IF syst-subrc EQ 0.
CLEAR wa_tcode.
ENDIF.
count = 1.
ELSE.
wa_agr_1251_tcode-high = space.
wa_agr_1251_tcode-agr_name = agr_name.
wa_agr_1251_tcode-low = wa_tcode-tcode.
wa_agr_1251_tcode-tcode = wa_tcode-tcode.
wa_agr_1251_tcode-ttext = wa_tcode-ttext.
APPEND wa_agr_1251_tcode TO t_agr_1251_tc.
ENDIF.
CLEAR wa_agr_1251_tcode.
count = count + 1.
ENDLOOP.
ENDIF.
ENDLOOP.
LOOP AT t_agr_1251_tc INTO wa_agr_1251_tcode.
wa_role-agr_name = wa_agr_1251_tcode-agr_name.
APPEND wa_role TO t_role.
ENDLOOP.
SORT t_role BY agr_name.
DELETE ADJACENT DUPLICATES FROM t_role.
SORT t_tcode BY tcode.
DELETE ADJACENT DUPLICATES FROM t_tcode.
ENDFORM. "f200_process_trans_data
*& Form f100_prepare_field_catalog
text
FORM f300_prepare_field_catalog.
LOOP AT t_role INTO wa_role.
wa_field-col_pos = count1.
wa_field-fieldname = wa_role-agr_name.
APPEND wa_field TO t_field.
count1 = count1 + 1.
ENDLOOP.
ENDFORM. "f100_prepare_field_catalog
*& Form f100_display_data
text
FORM f400_display_data.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-cprog
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT =
it_fieldcat = t_field[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = t_infotyp_final[]
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.
ENDFORM. "f100_display_datathis are the wasy u can build a field catalog...
1.----
FORM fill_fieldcat .
DATA: fld(30),
idx(2) TYPE n.
DEFINE no_output.
fieldcatalog-fieldname = &1.
fieldcatalog-no_out = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
END-OF-DEFINITION.
DEFINE catalog.
fieldcatalog-fieldname = &1.
fieldcatalog-seltext_s = &2.
if not &3 is initial.
fieldcatalog-seltext_m = &3.
else.
fieldcatalog-seltext_m = fieldcatalog-seltext_s.
endif.
if not &4 is initial.
fieldcatalog-seltext_l = &4.
else.
fieldcatalog-seltext_l = fieldcatalog-seltext_m.
endif.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
END-OF-DEFINITION.
catalog 'AVAIL_BASE'
'Base Qty.'
'Base Qty. Available'
'Base Quantity Available'.
catalog 'AVAIL_SALES'
'Sales Qty.'
'Sales Qty. Available'
'Sales Quantity Available'.
LOOP AT t_char_data.
idx = sy-tabix.
CONCATENATE 'CHR' idx INTO fld.
catalog fld
t_char_data-atbez
t_char_data-atbez
t_char_data-atbez.
ENDLOOP.
ADD 1 TO idx.
WHILE idx LE 15.
CONCATENATE 'CHR' idx INTO fld.
no_output fld.
ADD 1 TO idx.
ENDWHILE..
fieldcatalog-fieldname = 'EXACT'.
fieldcatalog-checkbox = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
2.----
FORM fieldcatalog.
REFRESH fc. CLEAR fc.
fc-tabname = 'HEADER'.
fc-fieldname = 'KUNNR'.
fc-ref_tabname = 'MSKU'.
APPEND fc. CLEAR fc.
fc-tabname = 'HEADER'.
fc-fieldname = 'NAME1_K'.
fc-ref_tabname = 'KNA1'.
fc-ref_fieldname = 'NAME1'.
APPEND fc. CLEAR fc.
fc-tabname = 'HEADER'.
fc-fieldname = 'TOTAL'.
fc-ref_tabname = 'MBEW'.
fc-ref_fieldname = 'SALK3'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'MATNR'.
fc-ref_tabname = 'MSKU'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'MAKTX'.
fc-ref_tabname = 'MAKT'.
fc-no_out = 'X'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'CHARG'.
fc-ref_tabname = 'MSKU'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'WERKS'.
fc-ref_tabname = 'MSKU'.
fc-no_out = 'X'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'NAME1_W'.
fc-ref_tabname = 'T001W'.
fc-ref_fieldname = 'NAME1'.
fc-no_out = 'X'.
APPEND fc. CLEAR fc. -
Hello,
I have a problem with my ALV List, I use a simple ALV List with much fields and I can't change with ALV Grid, on a specific client works correctly but on another client of the same system I've a dump.
Is it possible to set a client dependent limits for fields/characters to display for output?
Thanks
AntonioIt's a strange problem because if program runs on '100' client, runs correctly but on '200' client I have a dump but the system is the same...
If field catalog is wrong I should have the problem with all clients...
I've tried to remove/change some fields and works but with all fields I've dump only on one client...
I think there are limits on layout... is it possible?
Edited by: Aristoteles92 on Nov 23, 2009 5:22 PM -
ALV list output to smartforms (Urgent)
Hello Friends,
I have a requirement as below.
i have to copy standard report to Z-report(Customer Line Items). on the output of the report i have to add two pushbuttons(not on the Application tool bar or MENU bar) but on the body of the output list. these buttons are labelled as PRINT1 and PRINT2. this report displays all the line items for a customer with a checkbox at the begining of each item.
Now my requirement is
when the button PRINT1 is clicked all the selected line items (for which checkbox is clicked) should be printed in a smartform.
when the button PRINT2 is clicked each line item should be printed separately in the smartform. that is for each line item smartform should be called once.
And also how to create pushbuttons on the body of the list output. is it possible?
Any help in this regard is highly appreciated and rewarded.Your requirement seem to be achievable.
When you click PRINT1 your ALV program needs to accumulate the selected lines into a table, you need to create a smartform that has this table in its interface and call the form.
When you click PRINT2 your ALV program needs either to loop through the entries and call a smartform one for each loop or pass the whole table to the smartform and let the smartform perform the loop.
Not sure about putting a push buuton on an ALV grid, you may have to create some sort of hotspot.
Regards,
Nick -
Convert Tree output of IH01 transaction to simple ALV list output
Hi,
We have immediate requirement of changing the ALV TREE output of transaction IH01 to general ALV LIST display (with rows and columns) . To match with the requirement, I have to analyze the standard program first, copy the code to custom program and then do the changes which will consume lot of time.
Request your suggesttions if there are any simple ways to get the desired output so that i can quickly complete the development.
MurthyHi,
ALV Tree uses a different class and added logic. What logic is common is fetching and building of internal tables from data perspective. You can re-use this logic by calling the subroutine in the program and passing required values. It would be fast but in this case would take a bit of time, as you still need to analyse the code to make sure everything is right.
Regards,
Arnab. -
ALV List Output: How to avoid data statistics from printing in Background
Hi,
I am running an ALV list display in Background mode and the output is showing the data statistics first and then the actual output of the ALV...
I dont want the data statistics to be printed..
How to avoid that.. is there any to do it...Hi Neela
If you are using the good old REUSE_ALV_GRID_DISPLAY function module, you should be able to suppress the List Info if SY-BATCH is 'X' using the IS_PRINT parameter.
MOVE 'X' TO is_print-no_print_listinfos .
Presumably there is a similar parameter using classes.
Cheers
Lyal -
Hi,
I am Using ALV list to display data,In that when itry to display currency field it is giving run time error.
Following is the code i am using
lf_fcat-fieldname = 'SALARYE'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 15.
lf_fcat-ref_tabname = 'PA0008'. "<--- Ref table
lf_fcat-ref_fieldname = 'ANCUR'. "<-----ref field
lf_fcat-decimals_out = 2.
lf_fcat-seltext_l = text-061.
append lf_fcat to it_fcat.
clear lf_fcat.Hi,
Please check in the internal table 'IT_EMPLOYEE' , the relevant currency field as it should type compatible with your reference table field.
Thanks,
Dhruv Kumar Malhotra -
Hi Friends,
I want to save the ALV output as a excel file on local drive.
From the ALV output, I am using menu path : Views --> Microsoft Excel (Ctrl + Shift + F7) to switch from ALV to Excel mode.
It is switched to excel mode but not showing any data in the columns?
If I use the Path: List --> Export --> Local File --> Spread Sheet --> Gave excel file name.
Here, I am not able get data for all columns. Some columns are not being displayed.
What is the problem in this? Is this coding error? Do we need to apply any OSS notes?
Thanks in advance,
SreeniHi soumya,
I want to download from standard functionality only, that means I want to download using standard menu paths only.
I have tried giving .csv file also, but not able to download all fields. It is missing first 4 fields and downloading all the remaining
fields.
Please try to through some light on it.
Thanks in advance,
Sreenivas reddy -
Runtime Error in ALV Tree Output
Dear All, I am trying to create a ALV Tree using Class cl_gui_alv_tree. The Report Shows the Output with the first Node but when i try to expand it is dumping with a runtime error GETWA_NOT_ASSIGNED in class CL_ALV_TREE_BASE and method SET_ITEMS_FOR_COLUMN. The Reason being the data which was copied in the initial node display to mt_outtab is getting refreshed.
Can any one of you help me the reason for the table getting refreshed. Do i need to pass any data.
I am doing the following steps.
1. Create Container,
2. Create Tree Class object
3. Generate the Field Catalog.
4. Set table for first display " With empty internal table
5. Generate the Hierarchy
6. Call the Method Frontend Update.
Let me know if i had missed any steps in the process.
Thank you,
Regards,
Swaroop PatriOne reason for getting this error is using local defined tables for it_outtab parameter in the below code:
To get rid of the dump, define two distinct output tables globally: one is an empty table which you will pass to the below method, other one is your real output table whose size increases dependently.
CALL METHOD go_tree->set_table_for_first_display
EXPORTING
is_hierarchy_header = ls_hier_header
CHANGING
it_outtab = gt_data_e "Empty table
it_fieldcatalog = gt_fcat_tree. -
Error in ALV list at background job
Hello,
I am executing one custom report in bckground with layout 'Z_65_400'.After executed, it created spool.If we will try to look the output by using our spool, the layout is truncating.Here , in SP01. based on our spool, in menu bar->GOTO->REQUEST ATTRIBUTES->In this screen, it is showing X_65_255'Format. I tried all basic ways to resolve the issue.I am thinking that this is coming due to 'SAPKB62064(SAP_BASIS).I tried in sap service market place also.Could you please give the solution in detail .
Thanks and Regards
NTRHi NTR,
Pass the error records into a separate internal table and append them. once the Background processing was completed then loop on that error internal table and list them in the Basiclist for the identification.
-Thanks & Regards
Saurabh Goel -
Display ALV list output in PDF format
Hi All,
My requirement is :
I am displaying output using Function module 'REUSE_ALV_LIST_DISPLAY'. then i will click one button which placed in application tool bar say 'Download to PDF' when i click this button it will display the output in PDF format. I tried with exsting threads but i unable to get suitable solution.Anybody can send me the sample code please.
Thanks in advance.
Maheedharplease go throuh the below procedure and sample Code, this might help you.
Procedure
When we activate the Smartform the system generates a Function Module. The function module name we can get from Smartfrom screen from menubar
Environment => Function Module_Name . In a report we can get this Function module name by calling a Function Module standard SSF_FUNCTION_MODULE_NAME. This function module at runtime calls the FM generated by smartform, which in turn is then used to pass data from the report to Smartform. In the report given below the FM generated is /1BCDWB/SF00000152 . In this FM we can see CONTROL_PARAMETERS in import tab. This is of type SSFCTRLOP. We need to set the GETOTF of this to be X. Setting this field will activate the OTF field in smartform.
In export tab of the FM generated by smartform we can see a parameter JOB_OUTPUT_INFO which is of type SSFCRESCL. The SSFCRESCL is a structure of having one of fields as OTFDATA. OTFDATA in turn is a table of type ITCOO. ITCOO has two fields TDPRINTCOM and TDPRINTPAR. TDPRINTCOM represents command line of OTF format data and TDPRINTPAR contains command parameters of OTF format data.
In every Smartform output in OTF format, TDPRINTCOM begins and ends with //. EP represents the end-of-page value for TDPRINTCOM field.
In addition we need to set few fields at the place where we call this FM(generated by smartform) in our program. While calling this FM we should set control_parameters, output_options, user_settings and job_putput_info fields as shown in program.
Once these settings are done we can call Function Module CONVERT_OTF to convert the OTF data of smartfrom output to PDF data format. Once these are done we can call method cl_gui_fronted_services=>file_save_dialog to specify the directory path where we want to save the output PDF file. After this we can call Function Module GUI_DOWNLOAD to download the PDF file on our local system.
Here is a sample code of program to perform the function.
SAMPLE CODE
*& Report ZAMIT_SMART_FORM_PDF *
REPORT ZAMIT_SMART_FORM_PDF .
data: carr_id type sbook-carrid,
cparam type ssfctrlop,
outop type ssfcompop,
fm_name type rs38l_fnam.
DATA: tab_otf_data TYPE ssfcrescl,
pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE,
tab_otf_final TYPE itcoo OCCURS 0 WITH HEADER LINE,
file_size TYPE i,
bin_filesize TYPE i,
FILE_NAME type string,
File_path type string,
FULL_PATH type string.
parameter: p_custid type scustom-id default 1.
select-options: s_carrid for carr_id default 'LH' to 'LH'.
parameter: p_form type tdsfname default 'ZAMIT_SMART_FORM'.
data: customer type scustom,
bookings type ty_bookings,
connections type ty_connections.
start-of-selection.
suppressing the dialog box for print preview****************************
outop-tddest = 'LP01'.
cparam-no_dialog = 'X'.
cparam-preview = SPACE.
cparam-getotf = 'X'.
select single * from scustom into customer where id = p_custid.
check sy-subrc = 0.
select * from sbook into table bookings
where customid = p_custid
and carrid in s_carrid
order by primary key.
select * from spfli into table connections
for all entries in bookings
where carrid = bookings-carrid
and connid = bookings-connid
order by primary key.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting formname = p_form
variant = ' '
direct_call = ' '
importing fm_name = fm_name
exceptions no_form = 1
no_function_module = 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.
exit.
endif.
calling the generated function module
call function fm_name
exporting
archive_index =
archive_parameters =
control_parameters = cparam
mail_appl_obj =
mail_recipient =
mail_sender =
output_options = outop
user_settings = SPACE
bookings = bookings
customer = customer
connections = connections
importing
document_output_info =
job_output_info = tab_otf_data
job_output_options =
exceptions formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
if sy-subrc 0.
error handling
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
tab_otf_final] = tab_otf_data-otfdata[.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
IMPORTING
bin_filesize = bin_filesize
BIN_FILE =
TABLES
otf = tab_otf_final
lines = pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILE_NAME =
FILE_FILTER =
INITIAL_DIRECTORY =
WITH_ENCODING =
PROMPT_ON_OVERWRITE = 'X'
CHANGING
filename = FILE_NAME
path = FILE_PATH
fullpath = FULL_PATH
USER_ACTION =
FILE_ENCODING =
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
************downloading the converted PDF data to your local PC*******
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = bin_filesize
filename = FULL_PATH
filetype = 'BIN'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
IMPORTING
filelength = file_size
TABLES
data_tab = pdf_tab
FIELDNAMES =
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22
IF sy-subrc 0.
ENDIF.
Check this link it will help you.
https://forums.sdn.sap.com/click.jspa?searchID=5950895&messageID=2375150
Reward points if useful. -
Resolved:how to set default LAYOUT for ALV list display
hey guys,
In my alv report there are 20 cloumns.
after display i usualy choose 12 of them from CHOOSE LAYOUT option and then give it to print...
how to set this LAYOUT as default
sorry guys i figured it out..
but can we give it programiticlay?
Edited by: kumar gaurav on May 27, 2008 8:15 AMhi,
you can do it.
after declaring the catlog table you will give as
wa_catlog-seltext_l = 'material'.
wa_catlog-datatype = 'char'.
wa_catlog-outputlen = 18.
wa_catlog-fieldname = 'matnr'.
append wa_catlog to i_catlog.
clear wa_catlog.
wa_catlog-seltext_l = 'plantl'.
wa_catlog-datatype = 'char'.
wa_catlog-outputlen = 4.
wa_catlog-fieldname = 'werks'.
append wa_catlog to i_catlog.
clear wa_catlog.
similarly what sequence you give here i.e. material , plant etc. you get the output in the same oder you can even give only the fields you want in the output.
rewards points if useful.
siri
Maybe you are looking for
-
Hello. I'm new to Mac. Having MacBook with Mac OS X 10.6.3, I connected HP Laserjet P1505 printer via USB, and all seems to be OK, until I try to print several documents from Word. The first document is printing OK, but then I see the queue and must
-
Selecting a portion of the movie to darken using a continuous clip
I have a section of the video that I need to darken. But if I select that section and click inspector to darken it, it makes the whole video darken. Then when I split the clip and darken that section it works-but as soon as I join the clip it reverts
-
BAPI Error for BAPI_PO_Create1
hi all, i am supposed to create PO s for all the invoices in a Ztable.so i chose BAPI_po_create1.I am passing all the values but it throws some exception tht it was intercepted by some superior class. it says FAILURE Exception. Please help. Thanks a
-
Promotion a,d sales deal
Hi SAP Experts, What is Promotion and Sales Deal? plz give one example. for this 2.
-
How can i deploy a form developped with Forms 10g in IAS+Linux Please what is the modifications that i must add to .bash_profile (Library ....) thank you