Refresh basic list Output
Hi,
I am displaying a BASIC LIST. I have to place a u2018Refreshu2019 icon to refresh / re-execute the program from the output screen with the previously selected criteria. How can this be acheived?
For using TOP-OF-PAGE while refreshing, you will have to do the following:
START-OF-SELECTION.
PERFORM DISPLAY_REPORT.
TOP-OF-PAGE.
PERFORM TOP_PAGE.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'REFR'.
PERFORM DISPLAY_REPORT.
WHEN OTHERS.
ENDCASE.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE SY-LSIND.
WHEN '1'.
* Note: Though you are setting SY-LSIND = 0, it will only take effect *after* this code is executed
PERFORM TOP_PAGE.
WHEN OTHERS.
ENDCASE.
Similar Messages
-
Refreshing Basic list when i press Refresh button
My Requirement is that when i move from the Basic list to interactive list. i am going to make some changes to internal table.
when i came back to basic list. and when i press 'REFRESH' button in the Application Tool Bar. screen has to refresh and display with modified data.Hi,
When you press Back button you can call this method REFRESH_TABLE_DISPLAY which refresh the data in the screen in basic list if you are using the ALV Classes. -
Refreshing the list output upon clicking a push button
Hi All,
How do i refresh the <b>list output(not ALV)</b> already displayed upon clicking a push -button under AT USER-COMMAND ,if at all it is feasible ?
Any pointers will be rewarded with points.......
Regards
jaman
Message was edited by:
ABAP Techie
Message was edited by:
ABAP Techie
Message was edited by:
ABAP Techie
Message was edited by:
ABAP TechieHi,
Try with the method "refresh_table_display".
It has the syntax very similar to creating the table. It has two parameters. In the first one, you can mention if you want to refresh only the data (the icons are not refreshed)
Regards,
Bhaskar -
Font size in basic list output
Hello,
I am outputting a report with line size of 220. When i print the report, the font size appear small. Viewable but small. I know when we increase the line-size, the font gets low, but is there anyway to increase the font size ..
Thanks a lot.
Shehryar DaharHi,
Try with following example:
REPORT ZFONT NO STANDARD PAGE HEADING LINE-SIZE 80 LINE-COUNT 65.
Start of print-control
NEW-PAGE PRINT ON.
PRINT-CONTROL FUNCTION 'SF000'.
WRITE: / 'This is CPI 20'.
SKIP.
PRINT-CONTROL FUNCTION 'SF020'.
WRITE: / 'This is CPI 6'.
SKIP.
PRINT-CONTROL FUNCTION 'SF008'.
WRITE: / 'This is CPI 12'.
Depending on your SAP printer device, this may also work
PRINT-CONTROL FONT 1 LPI 6.
you can try to change font and LPI numbers
WRITE: / 'font 1 lpi 6'.
PRINT-CONTROL FONT 2 LPI 6.
WRITE: / 'font 2 lpi 6'.
PRINT-CONTROL FONT 3 LPI 6.
WRITE: / 'font 3 lpi 6'.
End of print-control
NEW-PAGE PRINT OFF.
*--- End of Program
Be aware that the PRINT-CONTROL is not supported in SAP Enterprise 4.7
For more information read SAP OSS notes 66478.
Regards,
Bhaskar -
Hai,
in my basic list (out put) i have column1 column2 column3...etc , in any column if all values are zero , that column should be hide in basic list(output),
thank u in advanceHi,
Please go thru the following logic, it will be helpful.
if all the columns are integers then add them, else concatenate into string.
After filling the internal table, create a work area of the table type .
suppose itab contains 3 fields
Loop at itab.
temp-f1 = temp-f1 + itab-f1.
if char .
take all values of the workarea as strings.
concatenate temp-f1 itab-f1 into temp-f1.
endloop.
in this way we can add all the columns incase of integers and concatenate incase of char.
Use a function module for filling FIELDCATALOG values.
now based on the value of this work area either 0 or space pass the field name .
Hope this is clear.
Reward points if helpful.
Thanks and regards. -
Refresh Classical report/basic list
Hi,
I have created a classical report/basic list where user can select check boxes and adjacent rows should be deleted. But after the action, I wish to refresh the report and remove the selected lines from displaying.
Please let me know how to achieve this.
Thanks in advance.
NitinHi Nitin,
Check the following program.
Here on pressing the delete push button(FCODE: DELETE) it will delete all
rows which has adjacent checkboxes checked.
REPORT ztest_list_processing NO STANDARD PAGE HEADING .
TYPES: BEGIN OF ty_tab,
delete,
f1(3) TYPE c,
f2(3) TYPE c,
f3(3) TYPE c,
END OF ty_tab.
DATA: it_tab TYPE TABLE OF ty_tab,
wa_tab TYPE ty_tab.
DATA: w_delete TYPE c,
w_lines TYPE i,
w_ind TYPE i.
wa_tab-f1 = '111'.
wa_tab-f2 = 'ABC'.
wa_tab-f3 = '123'.
APPEND wa_tab TO it_tab.
wa_tab-f1 = '222'.
wa_tab-f2 = 'DEF'.
wa_tab-f3 = '456'.
APPEND wa_tab TO it_tab.
wa_tab-f1 = '333'.
wa_tab-f2 = 'GHI'.
wa_tab-f3 = '789'.
APPEND wa_tab TO it_tab.
wa_tab-f1 = '444'.
wa_tab-f2 = 'JKL'.
wa_tab-f3 = '987'.
APPEND wa_tab TO it_tab.
wa_tab-f1 = '555'.
wa_tab-f2 = 'MNO'.
wa_tab-f3 = '654'.
APPEND wa_tab TO it_tab.
SET PF-STATUS '100'. "Contains Delete button
PERFORM print_output.
"Logic which you can implement
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'DELETE'.
DESCRIBE TABLE it_tab LINES w_lines.
DO w_lines TIMES. "To read all rows
CLEAR: wa_tab.
READ LINE w_ind FIELD VALUE wa_tab-delete
wa_tab-f1. "Getting the values
IF wa_tab-delete EQ 'X'. "Delete when check box is 'X'
DELETE it_tab WHERE f1 = wa_tab-f1.
ENDIF.
ADD 1 TO w_ind."Index for next line
ENDDO.
IF it_tab IS INITIAL.
WRITE: / 'There are no data in the table'.
ELSE.
PERFORM print_output. "Reprint the updated data(like refreshing)
ENDIF.
"Modified the existing Back button in standard Toolbar so that on
"pressin the back button it will come to program and not to
"previous displayed list
WHEN '&BACK'.
LEAVE SCREEN.
ENDCASE.
*& Form print_output
* text
* --> p1 text
* <-- p2 text
FORM print_output.
LOOP AT it_tab INTO wa_tab.
WRITE:/ wa_tab-delete AS CHECKBOX INPUT ON, "Display as checkbox
wa_tab-f1,
wa_tab-f2,
wa_tab-f3.
IF sy-tabix EQ 1.
w_ind = sy-linno. "Get the line position of first row
ENDIF.
ENDLOOP.
Hope this helps you.
Regards,
Manoj Kumar P -
Output screen basic list buttons
Hi frnds,
what are the steps to create buttons in the application toolbar in our output screen.
like i m getting sales header data in my basic list so in the output i m having a button which i press then i will get sales item details.
so can anyone help me how to create that button there in the ouput screen.
regards,
sanjayHi,
You can copy the GUI STATUS STANDARD of the program SAPLKKBL in SE41 and create a new one..
in that add a button in the application toolbar section..
Then use call back pf status parameter to pass the subroutine to display the gui status..
Then use call back subroutine parameter in the alv function module to give the subroutine name..
check this example for using double click to get the item details.
TYPE-POOLS: slis.
DATA: BEGIN OF itab1 OCCURS 0,
vbeln TYPE vbeln,
bstnk TYPE vbak-bstnk,
erdat TYPE vbak-erdat,
kunnr TYPE vbak-kunnr,
END OF itab1.
DATA: BEGIN OF itab2 OCCURS 0,
vbeln TYPE vbeln,
matnr TYPE vbap-matnr,
netpr TYPE vbap-netpr,
kwmeng TYPE vbap-kwmeng,
END OF itab2.
DATA: t_fieldcatalog1 TYPE slis_t_fieldcat_alv.
DATA: t_fieldcatalog2 TYPE slis_t_fieldcat_alv.
DATA: v_repid TYPE syrepid.
v_repid = sy-repid.
* Get the fieldcatalog1
PERFORM get_fieldcat1.
* Get the fieldcatalog2
PERFORM get_fieldcat2.
SELECT vbeln bstnk erdat kunnr UP TO 10 ROWS
INTO TABLE itab1
FROM vbak.
IF NOT itab1[] IS INITIAL.
SELECT vbeln matnr netpr kwmeng UP TO 10 ROWS
INTO TABLE itab2
FROM vbap
FOR ALL ENTRIES IN itab1
WHERE vbeln = itab1-vbeln.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_user_command = 'DISPLAY_DETAIL'
it_fieldcat = t_fieldcatalog1
TABLES
t_outtab = itab1.
* FORM display_detail *
* --> UCOMM *
* --> SELFIELD *
FORM display_detail USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
DATA: itab2_temp LIKE itab2 OCCURS 0 WITH HEADER LINE.
IF ucomm = '&IC1'.
READ TABLE itab1 INDEX selfield-tabindex.
IF sy-subrc = 0.
LOOP AT itab2 WHERE vbeln = itab1-vbeln.
MOVE itab2 TO itab2_temp.
APPEND itab2_temp.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
it_fieldcat = t_fieldcatalog2
TABLES
t_outtab = itab2_temp.
ENDIF.
ENDIF.
ENDFORM.
* FORM GET_FIELDCAT1 *
FORM get_fieldcat1.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'VBELN'.
s_fieldcatalog-hotspot = 'X'.
APPEND s_fieldcatalog TO t_fieldcatalog1.
CLEAR s_fieldcatalog.
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'BSTNK'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'BSTNK'.
APPEND s_fieldcatalog TO t_fieldcatalog1.
CLEAR s_fieldcatalog.
s_fieldcatalog-col_pos = '3'.
s_fieldcatalog-fieldname = 'ERDAT'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'ERDAT'.
APPEND s_fieldcatalog TO t_fieldcatalog1.
CLEAR s_fieldcatalog.
s_fieldcatalog-col_pos = '4'.
s_fieldcatalog-fieldname = 'KUNNR'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'KUNNR'.
APPEND s_fieldcatalog TO t_fieldcatalog1.
CLEAR s_fieldcatalog.
ENDFORM.
* FORM GET_FIELDCAT2 *
FORM get_fieldcat2.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'ITAB2'.
s_fieldcatalog-rollname = 'VBELN'.
APPEND s_fieldcatalog TO t_fieldcatalog2.
CLEAR s_fieldcatalog.
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'MATNR'.
s_fieldcatalog-tabname = 'ITAB2'.
s_fieldcatalog-rollname = 'MATNR'.
APPEND s_fieldcatalog TO t_fieldcatalog2.
CLEAR s_fieldcatalog.
s_fieldcatalog-col_pos = '3'.
s_fieldcatalog-fieldname = 'NETPR'.
s_fieldcatalog-tabname = 'ITAB2'.
s_fieldcatalog-rollname = 'NETPR'.
APPEND s_fieldcatalog TO t_fieldcatalog2.
CLEAR s_fieldcatalog.
s_fieldcatalog-col_pos = '4'.
s_fieldcatalog-fieldname = 'KWMENG'.
s_fieldcatalog-tabname = 'ITAB2'.
s_fieldcatalog-rollname = 'KWMENG'.
APPEND s_fieldcatalog TO t_fieldcatalog2.
CLEAR s_fieldcatalog.
ENDFORM.
Thanks
Naren -
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 -
Astericks appearing in place of a particular value in basic list ????
Hello,
I am outputting values thru a basic list, but the system is outputting ' *********** ' (Astericks) in place of the value. I have increased the length while outputtin on a basic list but to no avail. What can be the reason?
Thanks,
Shehryar Daharhi,
check whther both field type are identical..check for type..
thanks
jaideep
*reward points for useful answers.. -
ABAP Query - Sorting Issue in Basic List (SQ03)
Hi,
I have developed a ABAP Query. I want to sort some of the fields, for which I need to add some output fields to the sort sequence box in the Basic List page in SQ03/SQ01. But, I am not able to drag and drop the fields directly. Please suggest how can this be done? Thanks in advance.
Best Regards,
Tejas SavlaHi Abhishek,
There are three things related to Query.
1) You have to create the USER GROUP in SQ03.
2) You have to create the Infoset in SQ02. In this infoset you can write the logic of the program/Query what ever you want to perform.So you can sort the table in the infoset in the program logic.you have to create the output table of the query.
3) you have to create the Query in SQ01 and you have to associate the User group and infoset . you have to design the layput of the output you want to have.this output fields would be same as you have defined in infoset(step 2).
hope this will help you.
thanks
Tanmaya -
Interactive report basic list concept
Suppose in a basic list i have 7 parallel detail list.i am in basic list is there any way to go directly to 7 th detail list from basiclist or from 1st detail list to 7 th detail list vice-versa.
plz tell me..i am waiting.. for reply
thanx
aryaHi...
Just go through following code.... its for normal interactive reports...
TYPES : BEGIN OF st_kna1,
kunnr TYPE kna1-kunnr, "CUSTOMER NUMBER
name1 TYPE kna1-name1, "CUSTOMER NAME
END OF st_kna1.
TYPES : BEGIN OF st_vbak,
kunnr TYPE kna1-kunnr,
vbeln TYPE vbak-vbeln, "SALES DOCUMENT NUMBER
erdat TYPE vbak-erdat, "DATE ON WHICH THE RECORD WAS CREATED
audat TYPE vbak-audat, "DOCUMENT DATE
auart TYPE vbak-auart, "SALES DOCUMENT TYPE
ernam TYPE vbak-ernam, "NAME OF PERSON WHO CREATED THE OBJECT.
augru TYPE vbak-augru, "ORDER REASON
END OF st_vbak.
TYPES : BEGIN OF st_vbap,
vbeln TYPE vbak-vbeln,
posnr TYPE vbap-posnr, "SALES DOCUMENT ITEM
matnr TYPE vbap-matnr, "MATERIAL NUMBER
charg TYPE vbap-charg, "BATCH NUMBER
matkl TYPE vbap-matkl, "MATERIAL GROUP
posar TYPE vbap-posar, "ITEM TYPE
END OF st_vbap.
DATA : it_kna1 TYPE STANDARD TABLE OF st_kna1,
it_vbak TYPE STANDARD TABLE OF st_vbak,
it_vbap TYPE STANDARD TABLE OF st_vbap,
wa_kna1 TYPE st_kna1,
wa_vbak TYPE st_vbak,
wa_vbap TYPE st_vbap.
DATA : v_fld(15),
v_kunnr TYPE kna1-kunnr,
v_vbeln TYPE vbak-vbeln.
SELECT-OPTIONS
PARAMETERS
SELECT-OPTIONS so_kunnr FOR v_kunnr. "CUSTOMER NUMBER
PARAMETERS : p_max TYPE i. "NUMBER OF HITS
START-OF-SELECTION
START-OF-SELECTION.
PERFORM get_customerdata.
SET PF-STATUS 'MENU1'.
AT LINE-SELECTION
AT LINE-SELECTION.
IF sy-lsind = 1.
PERFORM get_salesheader.
ELSEIF sy-lsind = 2.
PERFORM get_salesitemdata.
ENDIF.
AT USER-COMMAND
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'DISP'.
PERFORM get_salesheader.
WHEN 'ITEM'.
PERFORM get_salesitemdata.
WHEN 'VA03'.
SET PARAMETER ID 'AUN' FIELD wa_vbak-vbeln.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDCASE.
TOP-OF-PAGE
TOP-OF-PAGE.
ULINE AT /1(56).
WRITE : /1 sy-vline ,
2(15) text-004 COLOR 1 ,
sy-vline ,
20(35) text-005 COLOR 1 ,
sy-vline.
ULINE AT /1(56).
TOP-OF-PAGE DURING LINE-SELECTION.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE sy-lsind.
WHEN 1.
PERFORM get_topofpage1.
WHEN 2.
PERFORM get_topofpage2.
ENDCASE.
FORM GET_CUSTOMERDATA
FORM get_customerdata.
SELECT kunnr name1
FROM kna1
INTO TABLE it_kna1
UP TO p_max ROWS
WHERE kunnr IN so_kunnr.
IF sy-subrc EQ 0.
LOOP AT it_kna1 INTO wa_kna1.
WRITE : / sy-vline,
2(15) wa_kna1-kunnr ,
sy-vline ,
20 wa_kna1-name1,
sy-vline.
HIDE : wa_kna1-kunnr , wa_kna1-name1.
CLEAR wa_kna1.
ENDLOOP.
ULINE AT : /1(56).
ELSE.
MESSAGE w000(z50871msg).
ENDIF.
ENDFORM. "GET_CUSTOMERDATA
FORM GET_SALESHEADER
FORM get_salesheader.
SET PF-STATUS 'MENU2'.
GET CURSOR FIELD v_fld VALUE v_kunnr.
IF v_fld = 'WA_KNA1-KUNNR'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kunnr
IMPORTING
output = v_kunnr.
SELECT kunnr vbeln erdat audat auart ernam augru
FROM vbak
INTO TABLE it_vbak
WHERE kunnr = v_kunnr.
IF sy-subrc EQ 0.
LOOP AT it_vbak INTO wa_vbak.
WRITE : / sy-vline ,
2(22) wa_vbak-vbeln ,
sy-vline,
27(25) wa_vbak-erdat ,
sy-vline ,
55(15) wa_vbak-audat ,
sy-vline ,
73(15) wa_vbak-auart ,
sy-vline,
91(16) wa_vbak-ernam ,
sy-vline,
109(13) wa_vbak-augru,
123 sy-vline.
HIDE : wa_vbak-vbeln.
CLEAR wa_vbak.
ENDLOOP.
ULINE AT : /1(123).
ELSE.
MESSAGE i015(z50871msg).
ENDIF.
ELSE.
MESSAGE i013(z50871msg).
ENDIF.
ENDFORM. "GET_SALESHEADER
FORM GET_SALESITEMDATA
FORM get_salesitemdata.
SET PF-STATUS space.
GET CURSOR FIELD v_fld VALUE v_vbeln.
IF v_fld = 'WA_VBAK-VBELN'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_vbeln
IMPORTING
output = v_vbeln.
SELECT vbeln posnr matnr charg matkl posar
FROM vbap
INTO TABLE it_vbap
WHERE vbeln = v_vbeln.
LOOP AT it_vbap INTO wa_vbap.
WRITE : /1 sy-vline,
2(13) wa_vbap-posnr ,
sy-vline,
18(18) wa_vbap-matnr ,
sy-vline,
40(13) wa_vbap-charg ,
sy-vline,
56(16) wa_vbap-matkl ,
sy-vline,
75 wa_vbap-posar,
112 sy-vline.
CLEAR wa_vbap.
ENDLOOP.
ULINE AT : /1(112).
ELSE.
MESSAGE i014(z50871msg).
ENDIF.
ENDFORM. "GET_SALESITEMDATA
FORM GET_TOPOFPAGE1
FORM get_topofpage1.
ULINE AT : /1(123).
WRITE : / sy-vline ,
2 text-000 ,
wa_kna1-kunnr ,
75 text-001 ,
wa_kna1-name1,
123 sy-vline.
ULINE AT : /1(123).
WRITE : / sy-vline ,
2(22) text-006 COLOR 1,
sy-vline,
27(25) text-007 COLOR 1 ,
sy-vline ,
55(15) text-008 COLOR 1 ,
sy-vline ,
73(15) text-009 COLOR 1 ,
sy-vline,
91(16) text-010 COLOR 1 ,
sy-vline,
109(13) text-011 COLOR 1,
123 sy-vline.
ULINE AT : /1(123).
ENDFORM. "GET_TOPOFPAGE1
FORM GET_TOPOFPAGE2
FORM get_topofpage2.
ULINE AT : /1(112).
WRITE : / sy-vline ,
2 text-000 ,
wa_kna1-kunnr ,
35 text-001 ,
wa_kna1-name1 ,
85 text-003 ,
wa_vbak-vbeln ,
112 sy-vline.
ULINE AT : /1(112).
WRITE : /1 sy-vline,
2(13) text-012 COLOR 1,
sy-vline,
18(18) text-013 COLOR 1 ,
sy-vline,
40(13) text-014 COLOR 1 ,
sy-vline,
56(16) text-015 COLOR 1 ,
sy-vline,
75 text-016 COLOR 1 ,
112 sy-vline.
ULINE AT : /1(112).
ENDFORM. "GET_TOPOFPAGE2
Thanks,
Naveen.I -
List output in Module pool programming
Hi Gurus.,
I need to use write statement to display output using Call Screen xxx starting at xx ending at xx as dialog box .. How can i achieve this ...I tried the following in PBO of the screen but only a blank screen comes as output ...
*& Module STATUS_0102 OUTPUT
text
MODULE STATUS_0102 OUTPUT.
SET PF-STATUS 'MENU1' OF PROGRAM 'ZHM053C_MB01_J1IFQ_J1IF13'.
SET TITLEBAR 'xxx'.
ULINE.
WRITE: / ' *************EXECUTION SUMMARY************* ' COLOR 4. ULINE.
WRITE / ''.
SKIP 1.
LOOP AT IT_MESS.
IF IT_MESS-MSGTYP EQ 'E'.
FORMAT COLOR 7 .
WRITE : IT_MESS-MESSAGE.
ELSE.
FORMAT COLOR 2 .
WRITE : IT_MESS-MESSAGE.
ENDIF.
AT END OF TCODE.
WRITE / SY-ULINE.
ENDAT.
ENDLOOP.
ENDMODULE. " STATUS_0102 OUTPUT
please help me its very urgent
Regards.,
S.SivakumarHi,
REPORT demo_leave_to_list_processing .
TABLES sdyn_conn.
DATA: wa_spfli TYPE spfli,
flightdate TYPE sflight-fldate.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE user_command_0100.
CALL SCREEN 500.
SET SCREEN 100.
ENDMODULE.
MODULE call_list_500 OUTPUT.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
SET PF-STATUS space.
SUPPRESS DIALOG.
SELECT carrid connid cityfrom cityto
FROM spfli
INTO CORRESPONDING FIELDS OF wa_spfli
WHERE carrid = sdyn_conn-carrid.
WRITE: / wa_spfli-carrid, wa_spfli-connid,
wa_spfli-cityfrom, wa_spfli-cityto.
HIDE: wa_spfli-carrid, wa_spfli-connid.
ENDSELECT.
CLEAR: wa_spfli-carrid.
ENDMODULE.
TOP-OF-PAGE.
WRITE text-001 COLOR COL_HEADING.
ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
WRITE sy-lisel COLOR COL_HEADING.
ULINE.
AT LINE-SELECTION.
CHECK not wa_spfli-carrid is initial.
SELECT fldate
FROM sflight
INTO flightdate
WHERE carrid = wa_spfli-carrid AND
connid = wa_spfli-connid.
WRITE / flightdate.
ENDSELECT.
CLEAR: wa_spfli-carrid.
This example switches to list processing during the screen processing for screen 100. Screen 100 has a single input field - the component CARRID from the ABAP Dictionary structure SDYN_CONN.
The flow logic of screen 100 is:
PROCESS BEFORE OUTPUT.
MODULE status_0100.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
MODULE user_command_0100.
The PAI module user_command_0100 calls screen 500 using the CALL SCREEN statement. This screen encapsulates a basic list. It has the following flow logic:
PROCESS BEFORE OUTPUT.
MODULE call_list_500.
PROCESS AFTER INPUT.
The module call_list_500 defines the basic list and switches to list processing. Since the next screen after list processing is screen 0, screen 500 is a one-screen screen chain. After list processing, control returns to the position in user_command_0100 from which screen 500 was called.
If the user selects a line on the basic list, a detail list appears. This is achieved through the event block AT LINE-SELECTION. The program also contains event blocks for TOP-OF-PAGE and TOP-OF-PAGE DURING LINE-SELECTION, which define page headers for both the basic list and detail list.
Since there is only one list system in this program, there is no need for case distinctions within the list events.
With thanks & regards,
Sravani yendru. -
Header & Footer in Basic list of infoset Query.
Dear Experts,
In an Infoset Query, I have been trying to make use of the Header & Footer Features (available in the Basic list screen) for quite sometime, but with no success.
Even though I add these, they do not appear in the list output.
Please throw some light of knowledge in this regard.
Regards
Jogeswara RaoThe Header & Footer text in the Basic list of Query will only be shown in the "ABAP List". Not sure if you are are looking at the Header & Footer text in SAP List Viewer.
-
Printing the list output.
Hi All,
I want to print the output of the report. I am printing it using NEW-PAGE PRINT ON . and concluded by NEW-PAGE PRINT OFF. I am doing this under the usercommand. The problem is,, when I say print,(user command), I can print the output but the it is leading to the previous screen. I want to be in the same screen after my printing. I am pasting the code also. Can any one suggest me, where I am doing the mistake.
<b><REMOVED BY MODERATOR></b>
CASE P_UCOMM1.
WHEN 'PRINT11'.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
COPIES = '1'
DESTINATION = 'LOCL'
IMMEDIATELY = 'X'
LINE_COUNT = 25
LINE_SIZE = 132
NO_DIALOG = 'X'
USER = SY-UNAME
ABAP_LIST = 'X'
IMPORTING
OUT_PARAMETERS = L_PARAMS
VALID = L_VALID.
&--'REUSE_ALV_HIERSEQ_LIST_DISPLAY'--
DATA:FLAG(1).
CLEAR FLAG.
IF L_VALID <> SPACE.
NEW-PAGE PRINT ON PARAMETERS L_PARAMS NO DIALOG.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GD_REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET1'
I_CALLBACK_USER_COMMAND = 'EXEC'
IS_LAYOUT = M_LAYOUT
IT_FIELDCAT = I_FLDCATALOG
IT_EVENTS = I_EVENTS
I_TABNAME_HEADER = 'I_MHEAD'
I_TABNAME_ITEM = 'I_MITEM'
IS_KEYINFO = M_KEYINFO
TABLES
T_OUTTAB_HEADER = I_MHEAD
T_OUTTAB_ITEM = I_MITEM.
REFRESH I_FLDCATALOG.
CLEAR M_LAYOUT.
CLEAR M_KEYINFO.
NEW-PAGE PRINT OFF.
CLEAR L_PARAMS.
CLEAR L_VALID.
ENDIF.
LOOP AT I_HITEM INTO W_HITEM.
IF W_HITEM-CHECK = 'X'.
W_HITEM-PFLAG = 'PRINTED'.
MODIFY I_HITEM FROM W_HITEM INDEX SY-TABIX TRANSPORTING PFLAG
ENDIF.
ENDLOOP.
IF SY-SUBRC = 0.
LOOP AT I_PFLAG INTO W_PFLAG.
UPDATE RESB SET WEMPF = 'X'
WHERE AUFNR = W_PFLAG-AUFNR
AND MATNR = W_PFLAG-MATNR
AND DUMPS = 'X'.
COMMIT WORK.
WAIT UP TO 1 SECONDS.
ENDLOOP.
ENDIF.
ENDCASE.
Thanks
Ramesh.
Message was edited by:
Alvaro Tejada GalindoHi,
When you get the list output .
click on print button to print it. A dialog box will come.
In that dialog box, there will be settings button . when you click on this button, you will get many options and the value of those options that can be set defualt for that report output.
In that there is s option of printer , select that option and enter a value and then set that as default.
I hope this will solve your problem.
For any more help, please revert back.
Thanks and regards
Gurpreet Singh -
JPA -- Best way to refresh a List association?
Hi,
I need to refresh a OneToMany association.
For example, I have two entities: Header & Detail.
@Entity
@Table(name="HEADERS")
public class Header implements Serializable {
@OneToMany(mappedBy="header")
private List<Detail> details;
@Entity
@Table(name="DETAILS")
public class Detail implements Serializable {
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="HDR_ID", referencedColumnName="HDR_ID")
private Header header;
}So, I fetch the Header along with all its Details.
At a later point of time, I know that some Detail rows in the database have been changed behind my back. I need to re-fetch the list of Details. What should I do?
1. I could add a cascade parameter to the @OneToMany association. I could specify:
@OneToMany(mappedBy="header", cascade={CascadeType.REFRESH})Then I could run:
entityManager.refresh(header);The trouble is that, since all the Details are already in the cache, the cached entities will be returned, not the ones fetched from the database. So, I won't refresh a thing. A query will be sent to the database indeed, but I will get the cached (i.e. stale) entities. I don't know of a way to specify something like
setHint(TopLinkQueryHints.REFRESH, HintValues.TRUE)dynamically for associations, so that the values in the cache would be replaced with the ones fetched from the database.
2. I could try to turn off the caching for the while Entity class. The trouble is that for some reason this doesn't work (see my other question here JPA -- How can I turn off the caching for an entity? Besides, even if it worked, I don't want to turn off the caching in general. I simply want to refresh the list sometimes.
Could anyone tell me what's the best way to refresh the association?
Best regards,
BisserHi Chris,
First, let me thank you that you take the time to answer my questions. I really appreciate that. I wish to apologize for my late reply but I wasn't around the PC for a while.
TopLink doesn't refresh an entity based on a view. I will try to explain in more detail. I hope you'll have patience with me because this might be a bit longer even than my previous post. I will oversimplify my actual business case.
Let's assume we have two tables and a view:
create table MASTERS
(id number(18) not null primary key,
master_name varchar2(50));
create table DETAILS
(id number(18) not null primary key,
master_id number(18) not null, -- FK to MASTER.ID
price number(7,2));
create view DETAILS_VW as
select id, master_id, price
from details;Of course, in real life the view is useful and actually peforms complex aggregate calculations on the details. But at the moment I wish to keep things as simple as possible.
So, I create Entities for the tables and the view. Here are the entities for MASTERS and DETAILS_VW, only the essential stuff (w/o getters, setters, sequence info, etc.):
@Entity
@Table(name="MASTERS")
public class Master {
@Id
@Column(name="ID", nullable=false)
private Long id;
@Column(name="MASTER_NAME")
private String masterName;
@OneToMany(mappedBy="master", fetch=FetchType.LAZY, cascade=CascadeType.REFRESH)
private List<DetailVw> detailsVw;
@Entity
@Table(name="DETAILS_VW")
public class DetailVw {
@Id
@Column(name="ID")
private Long id;
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="MASTER_ID", referencedColumnName="ID")
private Master master;
@Column(name="PRICE")
private Double price;
}So, now we have the tables and the entities. Let's assume one master row and two detail rows exist:
MASTER: ID=1, MASTER_NAME='Master #1'
DETAIL: ID=1, MASTER_ID=1, PRICE=3
DETAIL: ID=2, MASTER_ID=1, PRICE=8And now let's run the following code:
// List the initial state
Master master = em.find(Master.class, 1L);
List<DetailVw> detailsVw = master.getDetailsVw();
for (DetailVw dv : detailsVw) {
System.out.println(dv);
// Modify a detail
EntityTransaction tx = em.getTransaction();
tx.begin();
Detail d = em.find(Detail.class, 2L);
d.setPrice(1);
tx.commit();
// Refresh
System.out.println("----------------------------------------");
em.refresh(master);
// List the state AFTER the update
detailsVw = master.getDetailsVw();
for (DetailVw dv : detailsVw) {
System.out.println(dv);
}And here are some excerpts from the console (only the essentials):
DetailVw: id=1, price=3
DetailVw: id=2, price=8
UPDATE DETAILS SET PRICE = ? WHERE (ID = ?)
bind => [1, 2]
SELECT ID, MASTER_NAME FROM MASTERS WHERE (ID = ?)
bind => [1]
SELECT ID, PRICE, MASTER_ID FROM DETAILS_VW WHERE (MASTER_ID = ?)
bind => [1]
DetailVw: id=1, price=3
DetailVw: id=2, price=8You see, the UPDATE statement changes the DETAILS row. The price was 8, but was changed to 1. I checked the database. It was indeed changed to 1.
Furthermore, due to the refresh operation, a query was run on the view. But as you can see from the console output, the results of the query were completely ignored. The price was 8, and continued to be 8 even after the refresh. I assume it was because of the cache. If I run an explicit query on DETAILS_VW with the hint:
q.setHint(TopLinkQueryHints.REFRESH, HintValues.TRUE);then I see the real updated values. But if I only refresh with em.refresh(master), then the DetailVw entities do not get refreshed, even though a query against the database is run. I have tested this both in JavaSE and in OC4J. The results are the same.
An explicit refresh on a particular DetailVw entity works, though:
DetailVw dvw = em.find(DetailVw.class, 2L);
em.refresh(dvw);
System.out.println(dvw);Then the console says:
DetailVw: id=2, price=1So, the price is indeed 1, not 8.
If you can explain that to me, I will be really thankful!
Best regards,
Bisser
Maybe you are looking for
-
Good Afternoon, I purchased a Macbook Air as a hold over until I could get a Macbook Pro. Unfortunately some things have come up and I am going to have to wait a little longer than anticipated before buying the Macbook Pro. Since I initially intend
-
Can we script the compressing of OST files on users computers
After mailbox cleanups either manually by users or by using archiving software OST files remain large. Couple of questions. If the user does nothing, will Outlook 2010 automatically try to compress the OST file in the background? Read some things tha
-
It seems that since the last update to I Tunes some songs are ending too early (30 to 1:30 too ealry). The get info button does not indicate the songs should end early. When i download the song again, the problem stops.
-
How to apply template, existing reports
Post Author: satheesh CA Forum: WebIntelligence Reporting i have 100 reports in webintelligence documents, then i have to add company log for that all 100 existing repots. how this possible in one time . cleary my query is i have to apply template fo
-
ERROR installing itunes on Windows 8
Was told by error message in iTunes to uninstall and reinstall iTunes. Now iTunes will not install on my pc running Windows 8. It errors out even after I shut down and tried again.