To control no of lines in list output.
Hi,
Am using Reuse_alv_list_display in which i want display only 30 lines in a page how to control it.
thanks,
vino
Hi,
In the beginning of your report,
with your REPORT Statement you should use LINE-COUNT 30 and LINE-SIZE 100.
Hope it helps
Regrds
Mansi
Similar Messages
-
S_ALR_87012284 - List Output - ALV Tree Control
Dear Friends,
In Standard Financial statement report when I use List output -> ALV Tree Control lay out. In the display area is it possible to save the expanded folders in lay out. So that next time when I run the report with the same ALV Tree Contorl lay out, I would like to see folders expanded.
Thanks,
VenkyHi Venky,
There is no way to have expanded tree list. You must hit Expand tree button to.
You can also use ttrasaction code F.01 for balance sheet.
Best regards -
Hi all,
I need the list output of one program in my program in a grid(single column).
I am doing the below..
TYPES: BEGIN OF tp_ascitab ,
line(150),
END OF tp_ascitab.
DATA: dt_ascitab TYPE TABLE OF tp_ascitab,
ds_ascitab TYPE tp_ascitab.
SUBMIT zlist_program WITH p-gmn EQ matno
WITH p-plant EQ plant
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = gmn_info_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listobject = gmn_info_tab
listasci = dt_ascitab.
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 dg_gridcont IS INITIAL.
Create controls
CREATE OBJECT dg_gridcont
EXPORTING container_name = 'GRID_CONT'.
ENDIF.
CREATE OBJECT dg_grid
EXPORTING i_parent = dg_gridcont.
ds_layout-no_hgridln = 'X'.
ds_layout-no_toolbar = 'X'.
CALL METHOD dg_grid->set_table_for_first_display
EXPORTING
is_layout = ds_layout
CHANGING
it_fieldcatalog = dt_fcat[]
it_outtab = dt_ascitab.
The table dt_ascitab has data in correct format until it is passed to grid.
After that, there is change in alignmentt. The grid output has data with
improper alignment. Could anyone help me with this.
thanks,
Keerthi.Hi Keerthi,
Try Using following FM before Method 'set_table_for_first_display'
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_buffer_active = ' '
i_structure_name = 'structure in which format u need output'
i_client_never_display = 'X'
i_bypassing_buffer = 'X'
CHANGING
ct_fieldcat = dt_fcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
Hope, it will help u. -
List Output Default for F.01
Before the ECC upgrade the default selection for List Output was ALV grid control.
After the ECC upgrade the default selection for List Output is Classical list.
We would like to change the default back to ALV grid control and would greatly appreciated instructions for doing so.Hi Dan,
Please go to Line items tab in T. code FB00 and Change the Setting from "ALV classic list" to "ALV grid control".
Hope this is what you are looking for.
BR
Amitash -
LIST output and event handling in OO ALV
Hi Guys,
I am creating an ALV Report using cl_gui_alv_grid.
after the list is displayed i can change the display t output list from the ALV toolbar.
1. how can i shot list output by default.
2. why does hotspot event not work when the display is switched to list output.
3. how can i display the subtotal on all pages of the list.
Regards,
Tarun BahalHi,
for your questions
1. To shortlist thefields in output
In the fieldcatalog merge,select the fields which are to be populated in the outputlist.There standard list you can display.
On that you can select the fields in ALV toolbar.
2.To which field you need to HOTSPOT click, for that field in fieldcatalogue merge
select the hotspot = 'X'.
for example
If gs_fieldcat-fieldname = 'MATNR'.
gs_fieldcat-table_name = 'MARA'.
gs_fieldcat-ref_field = 'MATNR'.
Gs_fieldcat-hotspot = 'X'.
append gs_fieldcat to gt_fieldcat.
endif.
this will hotspot on the field material number.
After declaring this you need to maintain the hotspot click event.
~~~~~~~~~
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_hotspot_click
FOR EVENT HOTSPOT_CLICK OF cl_gui_alv_grid
IMPORTING e_row e_column.
PRIVATE SECTION.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD hotspot_click.
DATA: ls_sflight LIKE LINE OF gt_sflight.
read selected row from internal table gt_sflight
READ TABLE gt_sflight INDEX e_row-index INTO ls_sflight.
select corresponding lines of table sbook
PERFORM select_table_sbook USING ls_sflight
CHANGING gt_sbook.
call dialog screen and display new alv control
CALL SCREEN 101 STARTING AT 10 5.
ENDMETHOD. "handle_double_click
ENDCLASS.
This is very important after defining the events,you need to set the event before calling grid display.
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_double_click FOR grid1.
for your reference you check the standard program BCALV_GRID_03**
There they have declared Double click, in your case you maintain with
HOTSPOT CLICK **.
3. If you want subtotal on the field, sort that filed for sort structure.
and for which field do you need total, for that field do-sum = 'X'
in the fieldcatalogue merge.
gs_sort-fieldname ='MATNR'
gs_sort-up = 'X'.
gs_sort-subtot = 'X'.
append gs_sort to gt_sort.
for calculating the total to the field
gs_fieldcat-table_name = 'MARA'.
gs_fieldcat-ref_field = 'NTGEW'.(Gross weight)
Gs_fieldcat-dosum = 'X'.
append gs_fieldcat to gt_fieldcat.
endif.
For every new material
it calculates the subtotal on Gross weight.(because for NTGEW is gross weight).
and also it will show the grand total too.
Hope this will solve your problem
Dont forget to Reward pointsHi,
for your questions
1. To shortlist thefields in output
In the fieldcatalog merge,select the fields which are to be populated in the outputlist.There standard list you can display.
On that you can select the fields in ALV toolbar.
2.To which field you need to HOTSPOT click, for that field in fieldcatalogue merge
select the hotspot = 'X'.
for example
If gs_fieldcat-fieldname = 'MATNR'.
gs_fieldcat-table_name = 'MARA'.
gs_fieldcat-ref_field = 'MATNR'.
Gs_fieldcat-hotspot = 'X'.
append gs_fieldcat to gt_fieldcat.
endif.
this will hotspot on thefield material number.
3. If you want subtotal on the field, sort that filed for sort structure.
and for which field do you need total, for that field do-sum = 'X'
in the fieldcatalogue merge.
gs_sort-fieldname ='MATNR'
gs_sort-up = 'X'.
gs_sort-subtot = 'X'.
append gs_sort to gt_sort.
for calculating the total to the field
gs_fieldcat-table_name = 'MARA'.
gs_fieldcat-ref_field = 'NTGEW'.(Gross weight)
Gs_fieldcat-dosum = 'X'.
append gs_fieldcat to gt_fieldcat.
endif.
For every new material
it calculates the subtotal on Gross weight.(because for NTGEW is gross weight).
and also it will show the grand total too.
Hope this will solve your problem
Dont forget to Reward points
Edited by: varisetty madhavi on Mar 7, 2008 6:48 AM -
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 -
Hi,
i have a list output like this, i want to print this in an A4 size paper, how can i do this...
page no : 1
Name : 111111111111
Occupation : 22222222
Country : 33333333333
page no : 2
Name : 444444444444
Occupation : 555555
Country : 666666666
thanks in advance,
vinayakaHi,
Try out using the help of below programs.
Printing without archiving
DATA PARAMS LIKE PRI_PARAMS.
DATA: DAYS(1) TYPE N VALUE 2,
COUNT(3) TYPE N VALUE 1,
VALID TYPE C.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING DESTINATION = 'LT50'
COPIES = COUNT
LIST_NAME = 'TEST'
LIST_TEXT = 'Test NEW-PAGE PRINT ON'
IMMEDIATELY = 'X'
RELEASE = 'X'
NEW_LIST_ID = 'X'
EXPIRATION = DAYS
LINE_SIZE = 79
LINE_COUNT = 23
LAYOUT = 'X_PAPER'
SAP_COVER_PAGE = 'X'
RECEIVER = 'SAP*'
DEPARTMENT = 'System'
NO_DIALOG = ' '
IMPORTING OUT_PARAMETERS = PARAMS
VALID = VALID.
IF VALID <> SPACE.
NEW-PAGE PRINT ON PARAMETERS PARAMS NO DIALOG.
WRITE / 'First line'.
ENDIF.
Example
Printing with archiving
DATA: PARAMS LIKE PRI_PARAMS,
ARPARAMS LIKE ARC_PARAMS,
DAYS(1) TYPE N VALUE 2,
COUNT(3) TYPE N VALUE 1,
VALID TYPE C.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING DESTINATION = 'LT50'
COPIES = COUNT
LIST_NAME = 'TEST'
LIST_TEXT = 'Test NEW-PAGE PRINT ON'
IMMEDIATELY = 'X'
RELEASE = 'X'
NEW_LIST_ID = 'X'
EXPIRATION = DAYS
LINE_SIZE = 79
LINE_COUNT = 23
LAYOUT = 'X_PAPER'
SAP_COVER_PAGE = 'X'
RECEIVER = 'SAP*'
DEPARTMENT = 'System'
SAP_OBJECT = 'RS'
AR_OBJECT = 'TEST'
ARCHIVE_ID = 'XX'
ARCHIVE_INFO = 'III'
ARCHIVE_TEXT = 'Description'
NO_DIALOG = ' '
IMPORTING OUT_PARAMETERS = PARAMS
OUT_ARCHIVE_PARAMETERS = ARPARAMS
VALID = VALID.
IF VALID <> SPACE.
NEW-PAGE PRINT ON PARAMETERS PARAMS
ARCHIVE PARAMETERS ARPARAMS
NO DIALOG.
WRITE / 'First line'.
ENDIF.
Thanks,
Kartavya -
Hello Friends,
I am having issue with Invoice list output, when I print my invoice it prints the shipping quantity of material only as only ONE even when there is a multiple quantity, I want my invoice list output to print exact amount of quantity.Is there anyway I can deal with this issue to make sure that it prints multiple quantity in one line or in multiple line.,whatever--,I am a functional consultant not very comfortable with coding, detail explanation will be helpful.
Appreciate ur reply.
Thanks.
Mohammed.DEAR I HAVE TO ASK SOME QUESTIONS
what is the program logic
if you have ABAP person ask him what is the layout type
like SMARTFOEM, SCRIPT or ALV
really issue is in the program layout. -
Regarding Downloading of Report[List] output into Excel Sheet
Hi All,
Hi i have written one Classical report. I got the output Correctly.
Now i want to download that data into Excel Sheet in excatly the way it displayed in List[Report] output.
I had followed the path <b>System->List->Save->LocalFile->Spread Sheet</b> and tried to download the same.
Though it is downloaded it has not come in exact format.
Now what i want is to add a button above that report & write a program in that to download that data into Excel Sheet.
Can anybody tell me how can solve this issue. If i follow above procedure will the data[List Output] be downloaded into exact format into excel.
If anybody knows other way please sujjest.
Thanks in advance.
Thanks & Regards,
Prasad.Hi Prasad,
I have done a program which downloads the output in the excel sheet in the correct format.
Just check the program. The code given in bold is what you have to use.
REPORT zexp MESSAGE-ID f4 LINE-SIZE 195.
Tables Used ***********************************
TABLES : bseg, bkpf, bsak, lfa1, payr .
Declaring Internal Tables **************************
DATA :
Internal table to hold header data *************
BEGIN OF header OCCURS 0,
ext_date(10) TYPE c,
delimit(1) TYPE c,
ext_time(8) TYPE c,
END OF header,
Internal table to hold detail info **************
BEGIN OF i_data OCCURS 0,
belnr LIKE bsak-belnr,
gjahr LIKE bsak-gjahr,
bukrs LIKE bsak-bukrs,
bldat LIKE bsak-bldat,
xblnr LIKE bsak-xblnr,
blart LIKE bsak-blart,
augdt LIKE bsak-augdt,
augbl LIKE bsak-augbl,
wrbtr LIKE bsak-wrbtr,
shkzg LIKE bsak-shkzg,
lifnr LIKE bsak-lifnr,
name1 LIKE lfa1-name1,
chect LIKE payr-chect,
status(1) TYPE c,
END OF i_data,
Internal table to to collect *****************
BEGIN OF i_data1 OCCURS 0,
belnr LIKE bsak-belnr,
gjahr LIKE bsak-gjahr,
bukrs LIKE bsak-bukrs,
bldat LIKE bsak-bldat,
xblnr LIKE bsak-xblnr,
blart LIKE bsak-blart,
augdt LIKE bsak-augdt,
augbl LIKE bsak-augbl,
wrbtr LIKE bsak-wrbtr,
shkzg LIKE bsak-shkzg,
lifnr LIKE bsak-lifnr,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
chect LIKE payr-chect,
status(1) TYPE c,
END OF i_data1,
String variables for formatting file data *************
fidoc_year TYPE string,
comp_code TYPE string,
check_numbr TYPE string,
vendor TYPE string,
inv_date TYPE string,
inv_nbr TYPE string,
paid_dat TYPE string,
inv_amt TYPE string,
status TYPE string,
ref_doc TYPE string,
************Internal table to store the file contents **************
BEGIN OF i_final_file OCCURS 0,
record(300) TYPE c,
END OF i_final_file,
Internal table to store the list of allowed document types ****
BEGIN OF i_doctype OCCURS 0,
blart LIKE bsak-blart,
END OF i_doctype,
Internal table to hold vendor information ************
BEGIN OF i_lfa1 OCCURS 0,
lifnr LIKE lfa1-lifnr,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
END OF i_lfa1,
Internal table to hold check information *************
BEGIN OF i_payr OCCURS 0,
chect LIKE payr-chect,
vblnr LIKE payr-vblnr,
gjahr LIKE payr-gjahr,
zbukr LIKE payr-zbukr,
END OF i_payr.
Data declarations **************************
DATA : ws_stblg TYPE bkpf-stblg,
todate TYPE bsak-augdt,
fromdate TYPE bsak-augdt,
w_day LIKE dtresr-weekday,
day LIKE scal-indicator,
d TYPE n,
e_date LIKE sy-datum,
e_time LIKE sy-uzeit,
dd(2) TYPE c,
mm(2) TYPE c,
yy(4) TYPE c,
hh(2) TYPE c,
min(2) TYPE c,
sec(2) TYPE c.
DATA : wa_filepath(50) TYPE c,
wa_filename(50) TYPE c,
wa_c_filename(100) TYPE c,
arch_path(50) TYPE c.
<b>* Data for downloading to list
DATA : list LIKE TABLE OF abaplist WITH HEADER LINE.
DATA : BEGIN OF list_asc OCCURS 0,
msg(300) TYPE c,
END OF list_asc.
DATA: BEGIN OF i_invoiceheader OCCURS 0,
name(30) TYPE c,
END OF i_invoiceheader.
RANGES dates FOR bkpf-budat.</b>
Selection Screen ************************
SELECTION-SCREEN SKIP 2.
SELECT-OPTIONS:
s_bukrs FOR bkpf-bukrs ,
s_blart FOR bkpf-blart ,
s_augdt FOR bsak-augdt. " memory id todat TO fromdat.
PARAMETERS :submit AS CHECKBOX DEFAULT ' ' .
<b>* Download list to file.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'LIST'.
PERFORM download.
WHEN 'BACK'.
EXIT.
ENDCASE.</b>
<b>----
FORM download *
FORM download.
if s_augdt is initial.
dates-sign = 'I'.
dates-option = 'BT'.
dates-low = '20050901'.
dates-high = '20050920'.
APPEND dates.
else.
dates = s_augdt.
append dates.
endif.
/* Submit the same program .
SUBMIT zexp WITH s_augdt IN dates
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list
EXCEPTIONS
not_found = 1.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
LIST_INDEX = -1 "LIST_INDEX SY-LSIND.
TABLES
listasci = list_asc
listobject = list.
PERFORM download_file.
ENDFORM.
FORM download_file *
FORM download_file.
DATA fname TYPE rlgrap-filename VALUE 'c:\audit_report.xls'.
DATA ftype TYPE rlgrap-filetype VALUE 'DAT'.
DATA numeric_data(10) TYPE c VALUE '0123456789'.
*Table structure should match with list output.
DATA : BEGIN OF i_data1 OCCURS 0,
belnr(12) TYPE c,
gjahr(6) TYPE c,
bukrs(8) TYPE c,
chect(13) TYPE c,
lifnr(12) TYPE c,
name1(37) TYPE c,
bldat(14) TYPE c,
xblnr(18) TYPE c,
augdt(14) TYPE c,
wrbtr(17) TYPE c,
status(4) TYPE c,
augbl(18) TYPE c,
sortl(17) TYPE c,
END OF i_data1.
Header record of the excel sheet.
PERFORM fill_header.
LOOP AT list_asc.
Reads lines starting from the first record in the report. All informatory statements in the report are not read.
IF list_asc+1(10) CO numeric_data.
i_data1 = list_asc .
APPEND i_data1.
ENDIF.
ENDLOOP.
Call the download function.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
filename = fname
filetype = ftype
TABLES
data_tab = i_data1
FIELDNAMES = i_invoiceheader.
ENDFORM.
FORM fill_header *
FORM fill_header.
i_invoiceheader-name = 'Doc Number'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Fsc Year'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Cmp Code'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Check No'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Vendor No'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Entered by'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Doc Date'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Ref Doc No'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Clearing Date'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Amount'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Status'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Clearing Doc No'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Sort field'.
APPEND i_invoiceheader.
ENDFORM. " fill_header</b>
Initialization *************************
INITIALIZATION.
To initialize the date parameter on the selection screen.
The date by default ranges from previous Monday to Sunday.
todate = sy-datum.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
date = todate
IMPORTING
day = day.
d = day.
if d < 4.
todate = sy-datum - d - 4 .
else.
todate = sy-datum - d + 3 .
endif.
fromdate = todate - 6.
MOVE: 'BT' TO s_augdt-option,
fromdate TO s_augdt-low,
todate TO s_augdt-high.
APPEND s_augdt.
Start of Selection **************************
START-OF-SELECTION.
Checking the validity of the inputted dates ****************
IF s_augdt-low > sy-datum OR s_augdt-high > sy-datum.
MESSAGE i999 WITH 'You cannot input future date'.
EXIT.
ENDIF.
IF NOT s_bukrs IS INITIAL.
MESSAGE i999 WITH 'Program will run with input parameters in screen!!'.
ENDIF.
Initialize the header data ***********************
e_time = sy-uzeit.
MOVE e_time+0(2) TO hh.
MOVE e_time+2(2) TO min.
MOVE e_time+4(2) TO sec.
CONCATENATE hh min sec INTO header-ext_time SEPARATED BY ':'.
e_date = sy-datum.
MOVE e_date+0(4) TO yy.
MOVE e_date+4(2) TO mm.
MOVE e_date+6(2) TO dd.
CONCATENATE mm dd yy INTO header-ext_date SEPARATED BY '/'.
header-delimit = '~'.
APPEND header.
List allowed document types **********************
PERFORM fill_doc_types.
**To select the documents within the range of week or as inputted **
IF s_augdt IS INITIAL.
MOVE: 'I' TO s_augdt-sign,
'BT' TO s_augdt-option,
fromdate TO s_augdt-low,
todate TO s_augdt-high.
APPEND s_augdt.
ENDIF.
Selecting the records from the database ****************
IF s_bukrs IS INITIAL AND s_blart IS INITIAL.
Select all documents of company code 1000, *********
4200 and 8000, and allowed document types *********
SELECT belnr gjahr augdt augbl bukrs
blart bldat xblnr lifnr wrbtr shkzg
FROM bsak INTO CORRESPONDING FIELDS OF TABLE i_data
FOR ALL ENTRIES IN i_doctype
WHERE blart EQ i_doctype-blart
AND augdt IN s_augdt
AND ( bukrs = '1000' OR bukrs ='4200' OR
( bukrs = '8000' AND blart NE 'ZP' ) ).
loop at i_data.
Exclude reversed documents
select single stblg into ws_stblg
from bkpf
where bukrs = i_data-bukrs
and gjahr = i_data-gjahr
and belnr = i_data-belnr.
if not ws_stblg is initial.
delete i_data.
endif.
endloop.
ELSEIF s_blart IS INITIAL.
Select all documents of allowed document types ******
and inputted company code ************
SELECT belnr gjahr augdt augbl bukrs
blart bldat xblnr lifnr wrbtr shkzg
FROM bsak INTO CORRESPONDING FIELDS OF TABLE i_data
FOR ALL ENTRIES IN i_doctype
WHERE blart EQ i_doctype-blart
AND augdt IN s_augdt
AND bukrs IN s_bukrs .
LOOP AT i_data.
Exclude documents of type ZP
for company code 8000.
IF i_data-bukrs = '8000' AND i_data-blart = 'ZP'.
DELETE i_data.
continue.
ENDIF.
Exclude reversed documents
select single stblg into ws_stblg
from bkpf
where bukrs = i_data-bukrs
and gjahr = i_data-gjahr
and belnr = i_data-belnr.
if not ws_stblg is initial.
delete i_data.
continue.
endif.
ENDLOOP.
READ TABLE i_data INDEX 1.
IF sy-subrc NE 0.
MESSAGE i999 WITH 'No records have been selected'.
EXIT.
ENDIF.
ELSE.
Select the documents matching the company codes *****
and document types inputted in the selection screen ****
SELECT belnr gjahr augdt augbl bukrs bldat xblnr
blart lifnr wrbtr shkzg
FROM bsak INTO CORRESPONDING FIELDS OF TABLE i_data
WHERE bukrs IN s_bukrs AND blart IN s_blart
AND augdt IN s_augdt.
SORT i_data BY blart.
LOOP AT i_data.
Filtering the records selected
based on the document type
READ TABLE i_doctype WITH KEY blart = i_data-blart.
IF sy-subrc NE 0.
DELETE i_data.
continue.
ENDIF.
Exclude documents of type ZP
for company code 8000.
IF i_data-bukrs = '8000' AND i_data-blart = 'ZP'.
DELETE i_data.
continue.
ENDIF.
Exclude reversed documents.
select single stblg into ws_stblg
from bkpf
where bukrs = i_data-bukrs
and gjahr = i_data-gjahr
and belnr = i_data-belnr.
if not ws_stblg is initial.
delete i_data.
continue.
endif.
ENDLOOP.
READ TABLE i_data INDEX 1.
IF sy-subrc NE 0.
MESSAGE i999 WITH 'No records have been selected'.
EXIT.
ENDIF.
ENDIF.
IF sy-subrc NE 0.
MESSAGE i999 WITH 'No records have been selected'.
EXIT.
ENDIF.
credit/debit identification ***********************
LOOP AT i_data.
IF i_data-shkzg EQ 'H'.
i_data-wrbtr = i_data-wrbtr * 1.
ELSEIF i_data-shkzg EQ 'S'.
i_data-wrbtr = i_data-wrbtr * -1.
ENDIF.
MODIFY i_data.
ENDLOOP.
for summarizing ******************************
LOOP AT i_data.
MOVE-CORRESPONDING i_data TO i_data1.
COLLECT i_data1.
ENDLOOP.
Vendor informations and Check Informations *****************
SELECT lifnr name1 sortl
FROM lfa1
APPENDING CORRESPONDING FIELDS OF TABLE i_lfa1
FOR ALL ENTRIES IN i_data1
WHERE lifnr = i_data1-lifnr.
SELECT chect vblnr gjahr zbukr FROM payr APPENDING CORRESPONDING
FIELDS OF TABLE i_payr FOR ALL ENTRIES
IN i_data1 WHERE vblnr = i_data1-augbl
AND gjahr = i_data1-augdt(4)
AND zbukr = i_data1-bukrs.
SORT i_data1 BY augbl gjahr bukrs lifnr.
SORT i_payr BY vblnr gjahr zbukr.
SORT i_lfa1 BY lifnr.
LOOP AT i_data1.
READ TABLE i_payr WITH KEY vblnr = i_data1-augbl
gjahr = i_data1-gjahr
zbukr = i_data1-bukrs.
IF sy-subrc EQ 0.
i_data1-chect = i_payr-chect.
ENDIF.
READ TABLE i_lfa1 WITH KEY lifnr = i_data1-lifnr.
IF sy-subrc EQ 0.
i_data1-name1 = i_lfa1-name1.
i_data1-sortl = i_lfa1-sortl.
ENDIF.
i_data1-status = 'X'.
MODIFY i_data1.
ENDLOOP.
**The records are sorted by clearing date, check number and doc type**
SORT i_data1 BY augdt chect blart.
**********The header record is outputted on the screen****************
PERFORM write_header.
********Data is moved to internal table in the file format *************
PERFORM move_data.
Line items are outputted on the screen *********************
PERFORM write_output.
*& Form write_header &*
*& This outputs the header information to screen &*
FORM write_header.
SKIP.
SET PF-STATUS 'LIST'.
Outputting the header information *********************
WRITE : / 'Extraction Date : ' , header-ext_date.
WRITE : / 'Extraction Time : ' , header-ext_time.
FORMAT COLOR 1." INTENSIFIED.
SKIP.
ULINE AT 0(190) NO-GAP.
Outputting line level information **********************
WRITE:/ sy-vline NO-GAP,
(10) 'DOC NUMBER',
sy-vline NO-GAP,
(4) 'F-YR',
sy-vline NO-GAP,
(6) 'C-CODE',
sy-vline NO-GAP,
(10) 'CHECK NUM',
sy-vline NO-GAP,
(10) 'VENDOR NUM',
sy-vline NO-GAP,
(35) 'VENDOR NAME',
sy-vline NO-GAP,
(12) 'INVOICE DATE',
sy-vline NO-GAP,
(16) 'INVOICE NUMBER',
sy-vline NO-GAP,
(12) 'PAID DATE',
sy-vline NO-GAP,
(15) 'INVOICE AMOUNT',
sy-vline NO-GAP,
(2) 'SC',
sy-vline NO-GAP,
(16) 'REFERENCE FI DOC',
sy-vline NO-GAP,
(15) 'SORT FIELD',
sy-vline NO-GAP.
ULINE AT 0(190) NO-GAP.
ENDFORM. " write_header
*& FORM MOVE_DATA &*
*& Formats data in internal table as is required in the file &*
FORM move_data.
LOOP AT i_data1.
Document number and fiscal year should be separted by '|' *****
CONCATENATE i_data1-belnr i_data1-gjahr INTO fidoc_year
SEPARATED BY '|'.
MOVE i_data1-bukrs TO comp_code.
MOVE i_data1-chect TO check_numbr.
Vendor number and vendor name should be separted by '|' *****
CONCATENATE i_data1-lifnr i_data1-name1 INTO vendor
SEPARATED BY '|'.
SHIFT vendor LEFT DELETING LEADING '0'.
SHIFT vendor RIGHT DELETING TRAILING space.
Date fields converted to MM/DD/YYYY format ****************
MOVE i_data1-bldat+0(4) TO yy.
MOVE i_data1-bldat+4(2) TO mm.
MOVE i_data1-bldat+6(2) TO dd.
CONCATENATE mm dd yy INTO inv_date SEPARATED BY '/'.
MOVE i_data1-xblnr TO inv_nbr.
SHIFT inv_nbr RIGHT DELETING TRAILING space.
MOVE i_data1-augdt+0(4) TO yy.
MOVE i_data1-augdt+4(2) TO mm.
MOVE i_data1-augdt+6(2) TO dd.
CONCATENATE mm dd yy INTO paid_dat SEPARATED BY '/'.
MOVE i_data1-wrbtr TO inv_amt.
CONDENSE inv_amt.
SHIFT inv_amt RIGHT DELETING TRAILING space.
MOVE i_data1-status TO status.
MOVE i_data1-augbl TO ref_doc.
CONCATENATE fidoc_year
comp_code
check_numbr
vendor
inv_date
inv_nbr
paid_dat
inv_amt
status
ref_doc
INTO i_final_file-record SEPARATED BY '~'.
APPEND i_final_file.
ENDLOOP.
ENDFORM. " MOVE_DATA
*& Form write_output &*
*& Outputs all data to screen &*
FORM write_output.
LOOP AT i_data1.
FORMAT COLOR 2 INTENSIFIED.
Outputting line level information *******************
WRITE : / sy-vline NO-GAP,
(10) i_data1-belnr,
sy-vline NO-GAP,
(4) i_data1-gjahr,
sy-vline NO-GAP,
(6) i_data1-bukrs,
sy-vline NO-GAP,
(10) i_data1-chect,
sy-vline NO-GAP,
(10) i_data1-lifnr,
sy-vline NO-GAP,
(35) i_data1-name1,
sy-vline NO-GAP,
(12) i_data1-bldat MM/DD/YYYY,
sy-vline NO-GAP,
(16) i_data1-xblnr,
sy-vline NO-GAP,
(12) i_data1-augdt MM/DD/YYYY,
sy-vline NO-GAP,
(15) i_data1-wrbtr,
sy-vline NO-GAP,
(2) i_data1-status,
sy-vline NO-GAP,
(16) i_data1-augbl,
sy-vline NO-GAP,
(15) i_data1-sortl,
sy-vline NO-GAP.
ENDLOOP.
ULINE AT 0(190) NO-GAP.
ENDFORM. " write_output
In the program, I am downloading only the list.. The description of report outputted in the beginning of the report is not downloaded to excel.
What has to be taken into consideration is that, the structure of the table i_data1 which contains the data to be downloaded to the table.
I hope that this will help you.
Regards,
Susmitha -
To increase font size in List Output in Report
Hi, I have to increase the font size of my report's list output. I dont have to print it. So, please dont suggest print control. Only it needs to be displayed as an output.....
Thanks.Sagar,
If you want the font size to be more you can do that using the SAP GUI settings .The output will then appear in the increased format as it is only a list output that you are trying to see.press ALT+F12.Choose New Visual Design and then increase font size to maximum.
Hope this helps.
Cheers
Nishanth -
LIST output and event handling in OO ALV and
Hi,
I am creating an ALV Report.
How can i Display the Grid as a List. I am abke to change the view from the first grid that is created. but i need to show it as a list output from beginning.
Also i have created a hotspot in and it works when the ALV is displayed in Grid Format but it does not work when i switch the view to list output.
Any suggestions.
Regards,
Tarun Bahal*& Report ZFI_TRIAL_BALANCE
REPORT zfi_trial_balance LINE-SIZE 275 LINE-COUNT 3(2) NO STANDARD PAGE HEADING.
TABLES: bseg.
TYPES: BEGIN OF ty_bkpf ,
bukrs TYPE bkpf-bukrs,
belnr TYPE bkpf-belnr,
gjahr TYPE bkpf-gjahr,
budat TYPE bkpf-budat,
END OF ty_bkpf.
TYPES: BEGIN OF ty_bseg ,
bukrs TYPE bseg-bukrs,
belnr TYPE bseg-belnr,
gjahr TYPE bseg-gjahr,
hkont TYPE bseg-hkont,
END OF ty_bseg.
TYPES: BEGIN OF ty_bank,
hkont TYPE bseg-hkont,
txt50 TYPE skat-txt50,
open_dmbtr_dr TYPE p,
open_dmbtr_cr TYPE p,
trans_dmbtr_dr TYPE p,
trans_dmbtr_cr TYPE p,
close_dmbtr_dr TYPE p,
close_dmbtr_cr TYPE p,
END OF ty_bank.
TYPES: BEGIN OF ty_breakup,
bukrs TYPE bseg-bukrs,
blart TYPE bkpf-blart,
belnr TYPE bseg-belnr,
budat TYPE bkpf-budat,
umskz TYPE bseg-umskz,
rebzg TYPE bseg-rebzg,
lifnr TYPE bseg-lifnr,
kunnr TYPE bseg-kunnr,
name1 TYPE lfa1-name1,
dmbtr TYPE p,
END OF ty_breakup.
INITIALIZATION.
* CLASS handler DEFINITION
CLASS handler DEFINITION.
PUBLIC SECTION .
METHODS:handle_hotspot_click "handler definition for hotspot_click
FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id
e_column_id
es_row_no,
handle_top_of_page
FOR EVENT print_top_of_page OF cl_gui_alv_grid
IMPORTING table_index,
handle_subtotal_text
FOR EVENT subtotal_text OF cl_gui_alv_grid
IMPORTING es_subtottxt_info
ep_subtot_line
e_event_data.
ENDCLASS. "handler DEFINITION
* CLASS handler IMPLEMENTATION
CLASS handler IMPLEMENTATION.
METHOD handle_hotspot_click. "handler implementation for hotspot_click
PERFORM handle_hotspot_click USING e_row_id
e_column_id
es_row_no .
ENDMETHOD. "handle_hotspot_click
METHOD handle_top_of_page.
PERFORM handle_print_top_of_page.
ENDMETHOD. "handle_hotspot_click
METHOD handle_subtotal_text.
PERFORM handle_subtotal_text USING es_subtottxt_info
ep_subtot_line
e_event_data.
ENDMETHOD. "Subtotal_text
ENDCLASS. "handler IMPLEMENTATION
DATA: i_set_values TYPE TABLE OF rgsb4,
wa_set_values LIKE LINE OF i_set_values,
l_dmbtr TYPE dmbtr,
l_dmbtr2 TYPE dmbtr,
l_dmbtr3 TYPE dmbtr,
l_dmbtr4 TYPE dmbtr,
l_dmbtr_total TYPE dmbtr,
l_shkzg TYPE shkzg,
i_bkpf TYPE STANDARD TABLE OF ty_bkpf,
i_bseg TYPE STANDARD TABLE OF ty_bseg,
i_bank TYPE STANDARD TABLE OF ty_bank,
i_breakup TYPE STANDARD TABLE OF ty_breakup,
wa_bkpf LIKE LINE OF i_bkpf,
wa_bseg LIKE LINE OF i_bseg,
wa_bank LIKE LINE OF i_bank,
wa_breakup LIKE LINE OF i_breakup,
ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm,
l_ktopl TYPE ktopl.
DATA: gr_alvgrid TYPE REF TO cl_gui_alv_grid,
gr_alvgrid_0200 TYPE REF TO cl_gui_alv_grid,
gr_ccontainer TYPE REF TO cl_gui_custom_container,
gr_ccontainer_0200 TYPE REF TO cl_gui_custom_container,
gt_fieldcat TYPE lvc_t_fcat,
gs_layout TYPE lvc_s_layo,
gt_sort TYPE lvc_t_sort,
gt_roid TYPE lvc_t_roid,
gt_exclude TYPE ui_functions,
g_scrstatus TYPE i,
gs_variant TYPE disvariant,
o_handler TYPE REF TO handler.
CONSTANTS: c_doctype(22) TYPE c VALUE 'ZINFITR01_TRIALBALANCE'.
DATA gs_stbl TYPE lvc_s_stbl.
SELECTION-SCREEN: BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: l_date FOR sy-datum.
PARAMETERS : l_bukrs TYPE bukrs,
l_segent TYPE fb_segment.
SELECTION-SCREEN: END OF BLOCK block1.
START-OF-SELECTION.
gs_stbl-row = 'X'.
gs_stbl-col = 'X'.
CALL FUNCTION 'G_SET_GET_ALL_VALUES'
EXPORTING
setnr = c_doctype
table = 'SKA1'
class = '0000'
TABLES
set_values = i_set_values
EXCEPTIONS
set_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.
CLEAR i_bank.
LOOP AT i_set_values INTO wa_set_values.
CLEAR: l_dmbtr, l_dmbtr2, l_dmbtr3, l_dmbtr4, i_bkpf, i_bseg.
wa_bank-hkont = wa_set_values-from.
SELECT bukrs belnr budat gjahr FROM bkpf
INTO CORRESPONDING FIELDS OF TABLE i_bkpf
WHERE bukrs = l_bukrs
AND budat < l_date-low.
LOOP AT i_bkpf INTO wa_bkpf.
SELECT dmbtr shkzg FROM bseg INTO (l_dmbtr, l_shkzg)
WHERE bukrs = wa_bkpf-bukrs
AND belnr = wa_bkpf-belnr
AND gjahr = wa_bkpf-gjahr
AND hkont = wa_set_values-from.
IF l_shkzg = 'S'.
l_dmbtr2 = l_dmbtr2 + l_dmbtr.
ELSE.
l_dmbtr2 = l_dmbtr2 - l_dmbtr.
ENDIF.
CLEAR: l_dmbtr, l_shkzg.
ENDSELECT.
ENDLOOP.
IF l_dmbtr2 > 0.
wa_bank-open_dmbtr_dr = l_dmbtr2.
ELSE.
wa_bank-open_dmbtr_cr = l_dmbtr2.
ENDIF.
CLEAR: l_dmbtr, i_bkpf, i_bseg.
SELECT bukrs belnr budat gjahr FROM bkpf
INTO CORRESPONDING FIELDS OF TABLE i_bkpf
WHERE bukrs = l_bukrs
AND budat IN l_date.
LOOP AT i_bkpf INTO wa_bkpf.
SELECT dmbtr shkzg FROM bseg INTO (l_dmbtr, l_shkzg)
WHERE bukrs = wa_bkpf-bukrs
AND belnr = wa_bkpf-belnr
AND gjahr = wa_bkpf-gjahr
AND hkont = wa_set_values-from.
IF l_shkzg = 'S'.
l_dmbtr3 = l_dmbtr3 + l_dmbtr.
ELSE.
l_dmbtr4 = l_dmbtr4 - l_dmbtr.
ENDIF.
CLEAR: l_dmbtr, l_shkzg.
ENDSELECT.
ENDLOOP.
* IF l_dmbtr3 > 0.
wa_bank-trans_dmbtr_dr = l_dmbtr3.
* ELSE.
wa_bank-trans_dmbtr_cr = l_dmbtr4.
* ENDIF.
l_dmbtr = l_dmbtr2 + l_dmbtr3 + l_dmbtr4.
IF l_dmbtr > 0.
wa_bank-close_dmbtr_dr = l_dmbtr.
ELSE.
wa_bank-close_dmbtr_cr = l_dmbtr.
ENDIF.
CLEAR: l_dmbtr.
SELECT SINGLE ktopl FROM t001 INTO l_ktopl WHERE bukrs = l_bukrs.
SELECT SINGLE txt50 FROM skat INTO wa_bank-txt50
WHERE spras = sy-langu "( SELECT spras FROM t002 WHERE laiso = sy-langu )
AND ktopl = l_ktopl
AND saknr = wa_set_values-from.
APPEND wa_bank TO i_bank.
CLEAR wa_bank.
ENDLOOP.
LOOP AT i_bank INTO wa_bank.
* IF wa_bank-open_dmbtr_cr < 0.
wa_bank-open_dmbtr_cr = wa_bank-open_dmbtr_cr * -1.
* ENDIF.
* IF wa_bank-trans_dmbtr_cr < 0.
wa_bank-trans_dmbtr_cr = wa_bank-trans_dmbtr_cr * -1.
* ENDIF.
* IF wa_bank-close_dmbtr_cr < 0.
wa_bank-close_dmbtr_cr = wa_bank-close_dmbtr_cr * -1.
* ENDIF.
MODIFY i_bank FROM wa_bank.
ENDLOOP.
SORT i_bank ASCENDING BY hkont.
END-OF-SELECTION.
* SET SCREEN 100.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS01'.
SET TITLEBAR 'TITLE1'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module save_ok INPUT
* text
MODULE save_ok INPUT.
save_ok = ok_code.
CLEAR ok_code.
ENDMODULE. " save_ok INPUT
*& Module create_alv OUTPUT
* text
MODULE create_alv OUTPUT.
IF gr_alvgrid IS INITIAL.
CREATE OBJECT gr_ccontainer
EXPORTING
* PARENT =
container_name = 'CUSTOM_CONTAINER'
repid = sy-repid
dynnr = '0100'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT gr_alvgrid
EXPORTING
i_parent = gr_ccontainer
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 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.
PERFORM prepare_field_catalog CHANGING gt_fieldcat .
PERFORM prepare_layout CHANGING gs_layout .
PERFORM prepare_sort CHANGING gt_sort.
gs_variant-report = sy-repid.
gs_variant-variant = 'ABC'.
gs_variant-handle = '1'.
* IF sy-dynnr = '0100'.
CALL METHOD gr_alvgrid->set_table_for_first_display
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
* is_variant = gs_variant
* i_save = 'A'
* i_default = 'X'
is_layout = gs_layout
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
* IR_SALV_ADAPTER =
CHANGING
it_outtab = i_bank
it_fieldcatalog = gt_fieldcat
* it_sort = gt_sort
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 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.
ELSE.
CALL METHOD gr_alvgrid->refresh_table_display
EXPORTING
is_stable = gs_stbl
* i_soft_refresh = 'X'
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
CREATE OBJECT o_handler.
SET HANDLER o_handler->handle_hotspot_click FOR gr_alvgrid.
SET HANDLER o_handler->handle_top_of_page FOR gr_alvgrid.
SET HANDLER o_handler->handle_subtotal_text FOR gr_alvgrid.
* ENDIF.
ENDMODULE. " create_alv OUTPUT
*& Form prepare_field_catalog
* text
* <--P_GT_FIELDCAT text
FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA: ls_fcat TYPE lvc_s_fcat.
CLEAR pt_fieldcat.
CLEAR gt_fieldcat.
* IF sy-dynnr = '0100'.
ls_fcat-fieldname = 'HKONT' .
ls_fcat-ref_field = 'HKONT'.
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '15' .
ls_fcat-ref_table = 'BSEG' .
ls_fcat-coltext = 'G/L Account' .
ls_fcat-seltext = 'G/L Account' .
ls_fcat-hotspot = 'X'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'TXT50' .
ls_fcat-ref_field = 'TXT50'.
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '20' .
ls_fcat-ref_table = 'SKAT' .
ls_fcat-coltext = 'Description' .
ls_fcat-seltext = 'Description' .
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'OPEN_DMBTR_DR' .
ls_fcat-ref_field = 'DMBTR'.
ls_fcat-inttype = 'NUMC' .
ls_fcat-outputlen = '20' .
ls_fcat-ref_table = 'BSEG'.
ls_fcat-coltext = 'Opening Balance: Debit' .
ls_fcat-seltext = 'Opening Balance: Debit'.
ls_fcat-no_sign = 'X'.
ls_fcat-do_sum = 'X'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'OPEN_DMBTR_CR' .
ls_fcat-ref_field = 'DMBTR'.
ls_fcat-inttype = 'NUMC' .
ls_fcat-outputlen = '20' .
ls_fcat-ref_table = 'BSEG'.
ls_fcat-coltext = 'Opening Balance: Credit' .
ls_fcat-seltext = 'Opening Balance: Credit'.
ls_fcat-no_sign = 'X'.
ls_fcat-do_sum = 'X'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'TRANS_DMBTR_DR' .
ls_fcat-ref_field = 'DMBTR'.
ls_fcat-inttype = 'NUMC' .
ls_fcat-outputlen = '20' .
ls_fcat-ref_table = 'BSEG'.
ls_fcat-coltext = 'Trans Balance: Debit' .
ls_fcat-seltext = 'Trans Balance: Debit'.
ls_fcat-no_sign = 'X'.
ls_fcat-do_sum = 'X'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'TRANS_DMBTR_CR' .
ls_fcat-ref_field = 'DMBTR'.
ls_fcat-inttype = 'NUMC' .
ls_fcat-outputlen = '20' .
ls_fcat-ref_table = 'BSEG'.
ls_fcat-coltext = 'Trans Balance: Credit' .
ls_fcat-seltext = 'Trans Balance: Credit'.
ls_fcat-no_sign = 'X'.
ls_fcat-do_sum = 'X'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'CLOSE_DMBTR_DR' .
ls_fcat-ref_field = 'DMBTR'.
ls_fcat-inttype = 'NUMC' .
ls_fcat-outputlen = '20' .
ls_fcat-ref_table = 'BSEG'.
ls_fcat-coltext = 'Closing Balance: Debit' .
ls_fcat-seltext = 'Closing Balance: Debit'.
ls_fcat-no_sign = 'X'.
ls_fcat-do_sum = 'X'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'CLOSE_DMBTR_CR' .
ls_fcat-ref_field = 'DMBTR'.
ls_fcat-inttype = 'NUMC' .
ls_fcat-outputlen = '20' .
ls_fcat-ref_table = 'BSEG'.
ls_fcat-coltext = 'Closing Balance: Credit' .
ls_fcat-seltext = 'Closing Balance: Credit'.
ls_fcat-no_sign = 'X'.
ls_fcat-do_sum = 'X'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
* ELSE.
* ENDIF.
ENDFORM. " prepare_field_catalog
*& Form prepare_layout
* text
* <--P_GS_LAYOUT text
FORM prepare_layout CHANGING ps_layout TYPE lvc_s_layo.
DATA l_title(50) TYPE c.
CONCATENATE 'Trial Balance: ' l_date-low+6(2) '-' l_date-low+4(2) '-'l_date-low(4) ' to ' l_date-high+6(2) '-' l_date-high+4(2) '-'l_date-high(4) INTO l_title RESPECTING BLANKS.
* ps_layout-zebra = 'X' .
ps_layout-grid_title = l_title.
ps_layout-cwidth_opt = 'X' .
ps_layout-sel_mode = 'A'.
* ps_layout-no_toolbar = 'X'.
ps_layout-no_headers = 'X'.
ps_layout-frontend = 'L'.
ENDFORM. " prepare_layout
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE save_ok.
WHEN 'BACK'.
SET SCREEN 0.
LEAVE SCREEN.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form prepare_sort
* text
* <--P_GT_SORT text
FORM prepare_sort CHANGING pt_sort TYPE lvc_t_sort.
CLEAR: pt_sort, gt_sort.
DATA ls_sort TYPE lvc_s_sort .
IF sy-dynnr = '0100'.
ls_sort-spos = '1' .
ls_sort-fieldname = 'HKONT' .
ls_sort-up = 'X' . "A to Z
ls_sort-down = space .
APPEND ls_sort TO pt_sort .
ELSE.
ls_sort-spos = '1' .
ls_sort-fieldname = 'BELNR' .
ls_sort-up = 'X' . "A to Z
ls_sort-down = space .
APPEND ls_sort TO pt_sort .
* ls_sort-spos = '2' .
* ls_sort-fieldname = 'BELNR' .
** ls_sort-up = 'X' . "A to Z
** ls_sort-down = space .
* ls_sort-subtot = 'X'.
* APPEND ls_sort TO pt_sort .
ENDIF.
ENDFORM. " prepare_sort
*& Form handle_hotspot_click
* text
* -->P_E_ROW_ID text
* -->P_E_COLUMN_ID text
* -->P_ES_ROW_NO text
FORM handle_hotspot_click USING i_row_id TYPE lvc_s_row
i_column_id TYPE lvc_s_col
is_row_no TYPE lvc_s_roid.
CLEAR: wa_bank, i_breakup.
READ TABLE i_bank INTO wa_bank INDEX is_row_no-row_id.
*TYPES: BEGIN OF ty_breakup,
* bukrs TYPE bseg-bukrs,
* blart TYPE bkpf-blart,
* belnr TYPE bseg-belnr,
* budat TYPE bkpf-budat,
* umskz TYPE bseg-umskz,
* rebzg TYPE bseg-rebzg,
* lifnr TYPE bseg-lifnr,
* name1 TYPE lfa1-name1,
* dmbtr TYPE p,
* END OF ty_breakup.
SELECT bukrs belnr budat gjahr FROM bkpf
INTO CORRESPONDING FIELDS OF TABLE i_bkpf
WHERE bukrs = l_bukrs
AND budat IN l_date.
LOOP AT i_bkpf INTO wa_bkpf.
SELECT bukrs belnr umskz rebzg lifnr kunnr dmbtr shkzg FROM bseg
INTO (wa_breakup-bukrs, wa_breakup-belnr, wa_breakup-umskz, wa_breakup-rebzg, wa_breakup-lifnr, wa_breakup-kunnr, wa_breakup-dmbtr, l_shkzg)
WHERE bukrs = l_bukrs
AND belnr = wa_bkpf-belnr
AND gjahr = wa_bkpf-gjahr
AND hkont = wa_bank-hkont.
SELECT SINGLE blart budat FROM bkpf INTO (wa_breakup-blart, wa_breakup-budat)
WHERE bukrs = l_bukrs
AND belnr = wa_bkpf-belnr
AND gjahr = wa_bkpf-gjahr.
IF wa_breakup-lifnr IS NOT INITIAL.
SELECT SINGLE name1 FROM lfa1 INTO wa_breakup-name1
WHERE lifnr = wa_breakup-lifnr.
ELSE.
SELECT SINGLE name1 FROM kna1 INTO wa_breakup-name1
WHERE lifnr = wa_breakup-kunnr.
wa_breakup-lifnr = wa_breakup-kunnr.
ENDIF.
ENDSELECT.
IF l_shkzg = 'H'.
wa_breakup-dmbtr = wa_breakup-dmbtr * -1.
ENDIF.
IF wa_breakup IS NOT INITIAL.
APPEND wa_breakup TO i_breakup.
ENDIF.
CLEAR wa_breakup.
ENDLOOP.
SET SCREEN 200.
LEAVE SCREEN.
ENDFORM. " handle_hotspot_click
*& Module STATUS_0200 OUTPUT
* text
MODULE status_0200 OUTPUT.
SET PF-STATUS 'STATUS01'.
SET TITLEBAR 'TITLE2'.
ENDMODULE. " STATUS_0200 OUTPUT
*& Module USER_COMMAND_0200 INPUT
* text
MODULE user_command_0200 INPUT.
CASE save_ok.
WHEN 'BACK'.
* CLEAR: gr_alvgrid, gr_ccontainer.
SET SCREEN 100.
LEAVE SCREEN .
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
*& Module create_alv_0200 OUTPUT
* text
MODULE create_alv_0200 OUTPUT.
IF gr_alvgrid_0200 IS INITIAL.
CREATE OBJECT gr_ccontainer_0200
EXPORTING
* PARENT =
container_name = 'CUSTOM_CONTAINER'
repid = sy-repid
dynnr = '0200'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT gr_alvgrid_0200
EXPORTING
i_parent = gr_ccontainer_0200
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 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.
PERFORM prepare_field_catalog_0200 CHANGING gt_fieldcat .
* PERFORM prepare_layout CHANGING gs_layout .
PERFORM prepare_sort CHANGING gt_sort.
CALL METHOD gr_alvgrid_0200->set_table_for_first_display
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
is_layout = gs_layout
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
* IR_SALV_ADAPTER =
CHANGING
it_outtab = i_breakup
it_fieldcatalog = gt_fieldcat
it_sort = gt_sort
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 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.
ELSE.
CALL METHOD gr_alvgrid_0200->refresh_table_display
EXPORTING
is_stable = gs_stbl
* i_soft_refresh = 'X'
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
* SET SCREEN 100.
ENDMODULE. " create_alv_0200 OUTPUT
*& Form prepare_field_catalog_0200
* text
* <--P_GT_FIELDCAT text
FORM prepare_field_catalog_0200 CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA: ls_fcat TYPE lvc_s_fcat.
CLEAR: pt_fieldcat, gs_layout.
ls_fcat-fieldname = 'BUKRS' .
ls_fcat-ref_field = 'BUKRS'.
ls_fcat-inttype = 'c' .
ls_fcat-outputlen = '5' .
ls_fcat-ref_table = 'BSEG'.
ls_fcat-coltext = 'Co' .
ls_fcat-seltext = 'Company Code'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'BLART' .
ls_fcat-ref_field = 'BLART'.
ls_fcat-inttype = 'c' .
ls_fcat-outputlen = '5' .
ls_fcat-ref_table = 'BKPF'.
ls_fcat-coltext = 'Doc Typ' .
ls_fcat-seltext = 'Document Type'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'BELNR' .
ls_fcat-ref_field = 'BELNR'.
ls_fcat-inttype = 'NUMC' .
ls_fcat-outputlen = '12' .
ls_fcat-ref_table = 'BSEG'.
ls_fcat-coltext = 'Doc Num' .
ls_fcat-seltext = 'Document Number'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'BUDAT' .
ls_fcat-ref_field = 'BUDAT'.
ls_fcat-inttype = 'DATS' .
ls_fcat-outputlen = '13' .
ls_fcat-ref_table = 'BKPF'.
ls_fcat-coltext = 'G/L Date' .
ls_fcat-seltext = 'G/L Posting Date'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'UMSKZ' .
ls_fcat-ref_field = 'UMSKZ'.
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '5' .
ls_fcat-ref_table = 'BSEG'.
ls_fcat-coltext = 'G/L Indicator' .
ls_fcat-seltext = 'Special G/L Indicator'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'REBZG' .
ls_fcat-ref_field = 'REBZG'.
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '13' .
ls_fcat-ref_table = 'BSEG'.
ls_fcat-coltext = 'Reference' .
ls_fcat-seltext = 'Invoice Number'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'LIFNR' .
ls_fcat-ref_field = 'LIFNR'.
ls_fcat-inttype = 'NUMC' .
ls_fcat-outputlen = '13' .
ls_fcat-ref_table = 'LFA1'.
ls_fcat-coltext = 'Vendor/Customer' .
ls_fcat-seltext = 'Vendor/Customer Number'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'NAME1' .
ls_fcat-ref_field = 'NAME1'.
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '50' .
ls_fcat-ref_table = 'LFA1'.
ls_fcat-coltext = 'Description' .
ls_fcat-seltext = 'Description'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'DMBTR' .
ls_fcat-ref_field = 'DMBTR'.
ls_fcat-inttype = 'NUMC' .
ls_fcat-outputlen = '25' .
ls_fcat-ref_table = 'BSEG'.
ls_fcat-coltext = 'Amount' .
ls_fcat-seltext = 'Amount'.
ls_fcat-no_sign = 'X'.
ls_fcat-do_sum = 'X'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR ls_fcat.
ENDFORM. " prepare_field_catalog_0200
*& Form handle_print_top_of_page
* text
* --> p1 text
* <-- p2 text
FORM handle_print_top_of_page .
WRITE: sy-uline.
WRITE: /(255)'Tecnimont ICB' CENTERED.
WRITE: /(255)'Trial Balance' CENTERED.
WRITE: 'Trial Balance for ', l_bukrs, ': From Period - ', l_date-low, 'To Period - ', l_date-high. "LEFT-JUSTIFIED .
WRITE: /.
WRITE: / sy-uline.
FORMAT COLOR 1.
WRITE: sy-vline, AT 2(59)'Account Code and Name'CENTERED, AT 60 sy-vline, AT 61(45) 'Opening Balance' CENTERED, AT 107 sy-vline, AT 108(41) 'Transactions' CENTERED , AT 150 sy-vline, AT 155(41) 'Closing Balance' CENTERED, AT 197 sy-vline.
FORMAT COLOR 4.
WRITE: sy-vline,'GL Account'LEFT-JUSTIFIED, AT 16(50)'Description'CENTERED, AT 60 sy-vline, AT 61(23) 'Debits'CENTERED, AT 85(23) 'Credits.'CENTERED, AT 107 sy-vline, AT 108(23) 'Debits'CENTERED, AT 128(23)'Credits'CENTERED, AT 150 sy-vline, AT 151(23)
'Debits'CENTERED, AT 174(23) 'Credits'CENTERED, AT 197 sy-vline.
FORMAT COLOR OFF.
* WRITE: sy-uline.
ENDFORM. " handle_print_top_of_page
*& Form handle_subtotal_text
* text
* --> p1 text
* <-- p2 text
FORM handle_subtotal_text USING es_subtottxt_info TYPE lvc_s_stxt
ep_subtot_line TYPE REF TO data
e_event_data TYPE REF TO
cl_alv_event_data.
DATA l_bank LIKE wa_bank.
FIELD-SYMBOLS: <fs1> STRUCTURE wa_bank DEFAULT l_bank,
<fs2>.
IF es_subtottxt_info-criteria = 'TXT50'.
ASSIGN ep_subtot_line->* TO <fs1>.
ASSIGN e_event_data->m_data->* TO <fs2>.
CONCATENATE es_subtottxt_info-keyword 'Grand Summary: '
INTO <fs2>.
ENDIF.
ENDFORM. " handle_subtotal_text
This is the Code............... this code creates a Grid and not list and hotspot event wors on grid and not on list.
Regards,
Tarun Bahal -
Simple report list output sent as attachment thru email
Hi All,
Here's my task : I need to schedule a bi-weekly report that obviously runs in the background and produces output. From that output, I want to capture (with no manual intervention) the list output to an attachment and email a recipient. I've looked over code snippets and understand most of the <b>LIST</b> functions, but most deal with uploading a file from the frontend, which I do not want. Any ideas? Thx in advance.
JimHi
see the sample report to send mail as attachement
modify it as per your requirement
Mailing with Attachment by ABAP Coding
Refer this link:
Mail with attachment.
FORM send_list_to_basis .
DATA: w_path LIKE rlgrap OCCURS 0 WITH HEADER LINE,
lt_index TYPE sy-tabix,
doc_type(3) TYPE c,
descr LIKE it_objpack_basis-obj_descr,
temp_data LIKE w_path,
temp1 TYPE string,
tab_lines TYPE i,
langu(15) TYPE c,
expirydate TYPE so_obj_edt,
L_FILE1(100).
CONCATENATE 'C:\' sy-repid '_' sy-datum '.XLS' INTO L_FILE1.
W_PATH-FILENAME = L_FILE1.
APPEND w_path.
CLEAR w_path.
wa_doc_chng-obj_descr = 'User List not logged on for 180 days'.
wa_doc_chng-obj_langu = 'E'.
wa_doc_chng-obj_expdat = sy-datum.
CLEAR w_subject.
CONCATENATE 'Please find attached document with list of users'
'not logged on for 180 days for client' sy-mandt
INTO w_subject SEPARATED BY space.
it_objtxt_basis-line = w_subject.
APPEND it_objtxt_basis.
CLEAR it_objtxt_basis.
it_objtxt_basis-line = text-004.
APPEND it_objtxt_basis.
CLEAR it_objtxt_basis.
CLEAR w_tab_line.
DESCRIBE TABLE it_objtxt_basis LINES w_tab_line.
READ TABLE it_objtxt_basis INDEX w_tab_line INTO l_cline.
wa_doc_chng-doc_size =
( w_tab_line - 1 ) * 255 + STRLEN( l_cline ).
CLEAR it_objpack_basis-transf_bin.
it_objpack_basis-head_start = 1.
it_objpack_basis-head_num = 0.
it_objpack_basis-body_start = 1.
it_objpack_basis-body_num = w_tab_line.
it_objpack_basis-doc_type = 'RAW'.
APPEND it_objpack_basis.
CLEAR it_objpack_basis.
LOOP AT w_path.
temp1 = w_path.
descr = w_path.
CALL FUNCTION 'STRING_REVERSE'
EXPORTING
string = descr
lang = 'E'
IMPORTING
rstring = descr.
CALL FUNCTION 'STRING_SPLIT'
EXPORTING
delimiter = '\'
string = descr
IMPORTING
head = descr
tail = temp_data.
CALL FUNCTION 'STRING_REVERSE'
EXPORTING
string = descr
lang = 'E'
IMPORTING
rstring = descr.
CALL FUNCTION 'STRING_SPLIT'
EXPORTING
delimiter = '.'
string = descr
IMPORTING
head = temp_data
tail = doc_type.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = temp1
filetype = 'BIN'
header_length = 0
read_by_line = 'X'
replacement = '#'
TABLES
data_tab = it_upload.
DESCRIBE TABLE it_upload LINES tab_lines.
DESCRIBE TABLE it_objbin_basis LINES lt_index.
lt_index = lt_index + 1.
LOOP AT it_upload.
wa_objbin_basis-line = it_upload-line.
APPEND wa_objbin_basis TO it_objbin_basis.
CLEAR wa_objbin_basis.
ENDLOOP.
it_objpack_basis-transf_bin = 'X'.
it_objpack_basis-head_start = 0.
it_objpack_basis-head_num = 0.
it_objpack_basis-body_start = lt_index.
it_objpack_basis-body_num = tab_lines.
it_objpack_basis-doc_type = doc_type.
it_objpack_basis-obj_descr = descr.
it_objpack_basis-doc_size = tab_lines * 255.
APPEND it_objpack_basis.
CLEAR it_objpack_basis.
ENDLOOP.
it_reclist_basis-receiver = '[email protected]'.
it_reclist_basis-rec_type = 'U'.
APPEND it_reclist_basis.
CLEAR it_reclist_basis.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = it_objpack_basis
contents_txt = it_objtxt_basis
contents_bin = it_objbin_basis
receivers = it_reclist_basis
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
IF sy-subrc EQ 0.
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
ENDIF.
ENDFORM. " send_list_to_basis
Reward points if useful
Regards
Anji -
Financial statement version list output
Hi all,
I would like to set as default the list output: ALV grid control in trasaction code S_ALR_87012284 in version 6.0 Is there anyway to do it? Everytime we enter to this report we have to change the list output from classical list to ALV grid control.
Thanks!One way is to create a transaction variant using SHD0 that will default the ALV grid control. See the following thread for more info.
Documentation about t-code SHD0 -
How to control rendering logic of static list element defintion?
We are using 10gR4 version of site studio and are working with region templates and element definitions. We created a reporters static lits element definition which contains 3 columns (Name, About, Details) and added that to Reporters region template. Next defined a place holder defintion and associated region defintion and the region template fo reporters. Finally I added that place holder onto a article template. In the contribution mode for article we were able to add reporters rows (static list). BUt in the presentation of article I don't to see any listing of reporters. How could I control the display of static list element defintions from the region template forreporters? I don't see a way I could retrieve the individual rows and columns of static list and display the the results. The detail column of static lits just contatin a link to toher content item which is contributed through other region template. I would like to display the contents of that content items in line in the reporters template by making a wcm-place_holder service call for the embedded content items. How to achieve this?
Regards,
PratapYou are not making a remote call. Take a look at java RMI for more info:
http://docs.oracle.com/javase/6/docs/api/java/rmi/package-summary.html
You can do it using a change listener.
Take a look at this thread: https://forums.oracle.com/thread/2554119
Change your class name (Menu ). There is already a menu control:
http://docs.oracle.com/javafx/2/api/javafx/scene/control/Menu.html -
Printing report list output in A4 paper
Hi!
Is it possible to fit the list output of a report having a line-size of 240 into an A4 paper ?...when I was trying to print the output is being cut. Some columns at the right were not printed since all columns do not fit on the paper even on landscape. The system defaults format is X_65_255 which has 65 rows and 255 lines. How can I make it fit an A4 paper?
Thanks in advance!Hi Mervin,
To make printing possible on A4 paper you'll need to define a new output format.
For this use transaction SPAD.
Press the button "Full Administration" (F7).
Select the tab "Device Types".
Press the button "Page formats".
Set the screen in Change Mode (press Change button or F8).
Press the Create button (Shift+F1).
Give a name (starting with Z, like Z_LAND).
Select Orientation "Landscape".
Set papersize width/unit to 255 CH
Set papersize height/unit to 65 LN
Save your work.
Go back to tha SPAD tabpages.
Press the button "Format Types".
Set the screen in Change Mode (press Change button or F8).
Press the Create button (Shift+F1).
Enter in the screen a format name (starting with Z or Y).
Set the format type to type L (Format type for ABAP lists).
Set the page format to your created format (like Z_LAND).
Enter the number of lines that can be printed on A4 (e.g. 65)
Enter the number characters (columns) that can be printed on one row on A4 (e.g. 255).
Give a comprehensive comment.
Save your work.
Go back to tha SPAD tabpages.
Select tab "Devices / servers".
Press the button "Output devices".
Select your printer.
Set the screen in Change Mode (press Change button or F8).
Go to tabpage "Tray info".
Choose the right tray for your selected printer and fill in the previously created page format.
Save your work.
Leave transaction SPAD.
This format can be used to print your reports.
Remove your own printerdefault (Via menu System --> User profile --> Own data, tabpage Defaults).
When printing a dialog appears where you now can choose the modified printer (with modified page settings).
As you can see, this is more of a job the the admin guys.
As a remark: The default page formax X_65_255 should print 255 columns on paper (landscape). Most likely a small character set is used for this. The character size can also be modified (in the same transaction) to fit an entire row.
Hope this gives you a clue where you can influence the way lists are printed.
Regards,
Rob.
Maybe you are looking for
-
Dear friends, some time I meet a strange class path problem under windows enviroment. that is, the class path uses "/" to splite directory while not "\". so java will report error message like "NoClassFoundError: com/boland/...". I think there should
-
Multiple choice question in intractive pdf?
Hi, I have a question about Multiple option question. How to create Multiple option single answer question with explanation popup in interactive PDF. Please guide me. Regards Anil
-
Every time I try to open firefox, a window pops up saying that another instance of firefox is already running (still open from the last time firefox was open) and that another instance can't be opened. To solve this, I have to go into task manager an
-
Fatal error at printing report
When i add a table with records more than 500 rows to the report and print it to pdf with FreePdfXP, an Error-Dialog shew up with the note " Error: -2147352567 occurred at failed to open printer". After clicking on the button "Stop" an other dialog s
-
Ipod 4th generation can't get it to recover, any suggestions
I cannot get my ipod touch to recover. It only displays the itunes logo with a image of the usb connector and arrow. It's 4th generation.