Displaying list output in subscreen
Hi Experts,
Need a clarification from you people.
Is there a way with which we can display list output using 'WRITE' statements in a subscreen?
I am developing something which requires a list output to be displayed in a subscreen.
Note: I know the same can be done through ALV, but that is not a part of the requirement. The output should be normal list being displayed in a subscreen.
Please help.
Regards,
Sai.
Hi Experts,
Need a clarification from you people.
Is there a way with which we can display list output using 'WRITE' statements in a subscreen?
I am developing something which requires a list output to be displayed in a subscreen.
Note: I know the same can be done through ALV, but that is not a part of the requirement. The output should be normal list being displayed in a subscreen.
Please help.
Regards,
Sai.
Similar Messages
-
Is it Possible to display the output of the ALV list as POP-UP
Hi Experts,
Is it Possible to display the output of the ALV list as POP-UP, if yes then provide some ideas on it.
thanking in advance,
Samad.Hi samad, it is possible to display alv list as pop-up by using the FM " REUSE_ALV_POPUP_TO_SELECT"
try this sample code
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
I_TITLE = P1_TITLE
I_SELECTION = 'X'
I_ZEBRA = 'X'
I_CHECKBOX_FIELDNAME =
I_LINEMARK_FIELDNAME =
I_SCROLL_TO_SEL_LINE = 'X'
I_TABNAME = 'T_VBAP'
I_STRUCTURE_NAME = 'T_VBAP'
IT_FIELDCAT = T_FCAT2
I_CALLBACK_PROGRAM = 'ZTEST_ALV_POPUP'
IMPORTING
ES_SELFIELD = I_SELFIELD
E_EXIT = W_EXIT
TABLES
T_OUTTAB = T_VBAP.
i think it will solve your problem
Regards,
Vijay -
Download List output displayed
Hi Friends,
I want to donwload the list output displayed from the Report program with the exisitng formatting structure (displayed).
1)From SAP menu we can click on System > List > Save > Local file to download the file locally.
2) I want to obtain same functionality as mentioned in point 1 through a button on tool bar.
I dont want to prepare any internal table locally with the same data that is displayed on the screen, in the same formatting structure and Download, which is similar to a local download functionality.
Please let me know ur suggestions.
Regards,
Lavanya.Then you have to display your O/p in the ALV display ...
so that you can achive your requirement ..Because the ALV has the similar icon for downloading to pc ..etc
by Normal reporting you cannot get this Option .in the Application tool bar . one is there as you menioned
From SAP menu we can click on System > List > Save > Local file to download the file locally.
because by pacing the icon in the Apllication bar it will not call the path ..etc. you have to do the coding ...instead of that ALV is best .
But in the ALV it is there in the standard ALV GRID with Downlaod icon , summation,scroldown ,sorting (A/D) ,etc...
reward points if it is usefull ..
Girish -
Spool List output display 255 chars
Hi,
I am execuing the my report in back groung.The oupt list has more than 255 chars.
could u please let me know how Spool List output display > 255 char when the rpt is run in back ground.
regards,
Rayeez.Hello,
Try using the printer formatting as X_65_255.
Please check this [link|Report is truncating in background; for details.
BR,
Suhas -
Getwa_not_assigned - error in grid display - when trying for list output
Hi all,
i have searched the SDN before posting and tried all the possibilites given in the forum.
my problem is
data gr_alvgrid type ref to cl_gui_alv_grid.
data: gc_custom_control_name type scrfname value 'CC_ALV'.
data gr_ccontainer type ref to cl_gui_custom_container.
data: gt_fieldcat type lvc_t_fcat.
data gs_layout type lvc_s_layo.
data: begin of gt_itab_alv occurs 0,
lifnr type char10, "ekko-lifnr, " vendor
ebeln type ekpo-ebeln, " purchase order
aedat type ekko-aedat, " order date
ebelp like ekpo-ebelp, " item
matnr like mara-mfrpn, " material part no.
end of gt_itab_alv.
in field cat preparation
perform prepare_fieldcat changing gt_fieldcat.
form prepare_fieldcat changing pt_fieldcat type lvc_t_fcat. "M24
data ls_fcat type lvc_s_fcat.
ls_fcat-fieldname = 'LIFNR'.
* ls_fcat-ref_table = 'EKKO'.
* ls_fcat-ref_field = 'LIFNR'.
ls_fcat-inttype = 'C'.
ls_fcat-outputlen = '12'.
ls_fcat-coltext = 'Vendor'.
ls_fcat-seltext = 'Vendor'.
append ls_fcat to pt_fieldcat.
clear ls_fcat.
endform.
CALL METHOD gr_alvgrid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_outtab = gt_itab_alv[]
it_fieldcatalog = gt_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
ENDIF.
i am trying to change it to list output - it is giving the getwa_not_assigned dump error.
when i try to do it for one field also, it is giving the same error.
kindly help me.
thanks and regards,
Sakthi Sri.The Problem is with the layout and not with the field cat preparation.
I gave colours to the layout and now i have changed it to the zebra and the problem solved by me. -
Display ALV list output in PDF format
Hi All,
My requirement is :
I am displaying output using Function module 'REUSE_ALV_LIST_DISPLAY'. then i will click one button which placed in application tool bar say 'Download to PDF' when i click this button it will display the output in PDF format. I tried with exsting threads but i unable to get suitable solution.Anybody can send me the sample code please.
Thanks in advance.
Maheedharplease go throuh the below procedure and sample Code, this might help you.
Procedure
When we activate the Smartform the system generates a Function Module. The function module name we can get from Smartfrom screen from menubar
Environment => Function Module_Name . In a report we can get this Function module name by calling a Function Module standard SSF_FUNCTION_MODULE_NAME. This function module at runtime calls the FM generated by smartform, which in turn is then used to pass data from the report to Smartform. In the report given below the FM generated is /1BCDWB/SF00000152 . In this FM we can see CONTROL_PARAMETERS in import tab. This is of type SSFCTRLOP. We need to set the GETOTF of this to be X. Setting this field will activate the OTF field in smartform.
In export tab of the FM generated by smartform we can see a parameter JOB_OUTPUT_INFO which is of type SSFCRESCL. The SSFCRESCL is a structure of having one of fields as OTFDATA. OTFDATA in turn is a table of type ITCOO. ITCOO has two fields TDPRINTCOM and TDPRINTPAR. TDPRINTCOM represents command line of OTF format data and TDPRINTPAR contains command parameters of OTF format data.
In every Smartform output in OTF format, TDPRINTCOM begins and ends with //. EP represents the end-of-page value for TDPRINTCOM field.
In addition we need to set few fields at the place where we call this FM(generated by smartform) in our program. While calling this FM we should set control_parameters, output_options, user_settings and job_putput_info fields as shown in program.
Once these settings are done we can call Function Module CONVERT_OTF to convert the OTF data of smartfrom output to PDF data format. Once these are done we can call method cl_gui_fronted_services=>file_save_dialog to specify the directory path where we want to save the output PDF file. After this we can call Function Module GUI_DOWNLOAD to download the PDF file on our local system.
Here is a sample code of program to perform the function.
SAMPLE CODE
*& Report ZAMIT_SMART_FORM_PDF *
REPORT ZAMIT_SMART_FORM_PDF .
data: carr_id type sbook-carrid,
cparam type ssfctrlop,
outop type ssfcompop,
fm_name type rs38l_fnam.
DATA: tab_otf_data TYPE ssfcrescl,
pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE,
tab_otf_final TYPE itcoo OCCURS 0 WITH HEADER LINE,
file_size TYPE i,
bin_filesize TYPE i,
FILE_NAME type string,
File_path type string,
FULL_PATH type string.
parameter: p_custid type scustom-id default 1.
select-options: s_carrid for carr_id default 'LH' to 'LH'.
parameter: p_form type tdsfname default 'ZAMIT_SMART_FORM'.
data: customer type scustom,
bookings type ty_bookings,
connections type ty_connections.
start-of-selection.
suppressing the dialog box for print preview****************************
outop-tddest = 'LP01'.
cparam-no_dialog = 'X'.
cparam-preview = SPACE.
cparam-getotf = 'X'.
select single * from scustom into customer where id = p_custid.
check sy-subrc = 0.
select * from sbook into table bookings
where customid = p_custid
and carrid in s_carrid
order by primary key.
select * from spfli into table connections
for all entries in bookings
where carrid = bookings-carrid
and connid = bookings-connid
order by primary key.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting formname = p_form
variant = ' '
direct_call = ' '
importing fm_name = fm_name
exceptions no_form = 1
no_function_module = 2
others = 3.
if sy-subrc 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
exit.
endif.
calling the generated function module
call function fm_name
exporting
archive_index =
archive_parameters =
control_parameters = cparam
mail_appl_obj =
mail_recipient =
mail_sender =
output_options = outop
user_settings = SPACE
bookings = bookings
customer = customer
connections = connections
importing
document_output_info =
job_output_info = tab_otf_data
job_output_options =
exceptions formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
if sy-subrc 0.
error handling
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
tab_otf_final] = tab_otf_data-otfdata[.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
IMPORTING
bin_filesize = bin_filesize
BIN_FILE =
TABLES
otf = tab_otf_final
lines = pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILE_NAME =
FILE_FILTER =
INITIAL_DIRECTORY =
WITH_ENCODING =
PROMPT_ON_OVERWRITE = 'X'
CHANGING
filename = FILE_NAME
path = FILE_PATH
fullpath = FULL_PATH
USER_ACTION =
FILE_ENCODING =
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
************downloading the converted PDF data to your local PC*******
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = bin_filesize
filename = FULL_PATH
filetype = 'BIN'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
IMPORTING
filelength = file_size
TABLES
data_tab = pdf_tab
FIELDNAMES =
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22
IF sy-subrc 0.
ENDIF.
Check this link it will help you.
https://forums.sdn.sap.com/click.jspa?searchID=5950895&messageID=2375150
Reward points if useful. -
Using a devices camera and adding the image to the display list
Hi,
My students and I have not been able to make an AIR app that can take a picture using the devices camera and then add the image to the display list. We are able to open the devices camera and of course take a picture, but that's it.
We've been using these two tutorials/examples:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/CameraUI.ht ml
and
http://tv.adobe.com/watch/adc-presents/input-for-mobile-devices-camera/
I've uploaded our project: http://www.dayvid.com/professor/camera.zip
Can someone help us out?
Thanks!
Below is the main document class:
package {
import flash.desktop.NativeApplication;
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.ErrorEvent;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.MediaEvent;
import flash.media.CameraUI;
import flash.media.MediaPromise;
import flash.media.MediaType;
import flash.events.MouseEvent;
public class Main extends MovieClip{
private var deviceCameraApp:CameraUI = new CameraUI();
private var imageLoader:Loader;
public function Main()
this.stage.align = StageAlign.TOP_LEFT;
this.stage.scaleMode = StageScaleMode.NO_SCALE;
camera_btn.addEventListener(MouseEvent.CLICK, cameraBtnClicked);
private function cameraBtnClicked(event:MouseEvent):void
if( CameraUI.isSupported )
result_txt.text = "Initializing camera...";
deviceCameraApp.addEventListener( MediaEvent.COMPLETE, imageCaptured );
deviceCameraApp.addEventListener( Event.CANCEL, captureCanceled );
deviceCameraApp.addEventListener( ErrorEvent.ERROR, cameraError );
deviceCameraApp.launch( MediaType.IMAGE );
else
result_txt.text = "Camera interface is not supported.";
private function imageCaptured( event:MediaEvent ):void
result_txt.text = "Media captured...";
var imagePromise:MediaPromise = event.data;
if( imagePromise.isAsync )
result_txt.text = "Asynchronous media promise.";
imageLoader = new Loader();
imageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, asyncImageLoaded );
imageLoader.addEventListener( IOErrorEvent.IO_ERROR, cameraError );
imageLoader.loadFilePromise( imagePromise );
else
result_txt.text = "Synchronous media promise.";
imageLoader.loadFilePromise( imagePromise );
showMedia( imageLoader );
private function captureCanceled( event:Event ):void
result_txt.text = "Media capture canceled.";
NativeApplication.nativeApplication.exit();
private function asyncImageLoaded( event:Event ):void
result_txt.text = "Media loaded in memory.";
showMedia( imageLoader );
private function showMedia( loader:Loader ):void
this.addChild( loader );
private function cameraError( error:ErrorEvent ):void
result_txt.text = "Error:" + error.text;
NativeApplication.nativeApplication.exit();Hi,
Do I have to add the picture to the cameraroll in order to add it to the AIR apps display list?
Both examples from Adobe claim that their examples work. Do they not?
In the example, the event handler asyncImageLoaded is never called. The output text field shows - result_txt.text = "Asynchronous media promise."; So the Event.COMPLETE is being added. But I don't think it's being dispatched.
Any ideas? -
How to get the value entered in input enabled field of a list output?
Hi all,
I am developing a program to display list with two input enabled fields . After users enetered the values into these fields I need to do some calculations based on these values and modify the value of another field in the list.
But i couldn't have an idea how to read the values after users enter into these fields.
Please help me on solving this problem? If possible please provide the sample code.
Thanks,
Aravind.You can enable disable screen fields in at selection screen output event.
And by using loop at screen.
And for changing the values you can do in initialization event.
I Hope you are doing these in Reports. -
Need help in modifing the following code to display required output
Hi this is the code which i am going to displayoutput here i used FM VRM_SET_VALUES for getting dropdown box when i used it my output race field is not getting any values and blank space is getting displayed
what i want is just i need to display the output according to the selection screen
and the other fields in the selection screen except 'p_gender' are also giving problem when i am keeping where condition to link selection screen
can any one please help me in getting the required output according to selection by modifing the following code
TABLES: pernr,t5u13,cskt , t001p,t500p, t501t,t503t,t513s,t527x,t529t,t530t, t5uaa.
TYPE-POOLS: slis, vrm.
INFOTYPES: 0000, "Actions
0001, "Org Assignment
0002, "Personal Data
0006, "Address
0008, "Basic Pay
0041, "Date Specifications
0077. "Additional Personal Data
CONSTANTS: gc_x TYPE c VALUE 'X',
g_w(1) TYPE c VALUE 'W',
g_h(1) TYPE c VALUE 'H',
g_af(2) TYPE c VALUE 'AF',
g_ai(2) TYPE c VALUE 'AI',
g_01(2) TYPE c VALUE 'R1',
g_02(2) TYPE c VALUE 'R2',
g_03(2) TYPE c VALUE 'R3',
g_05(2) TYPE c VALUE 'R5'.
TYPES : BEGIN OF t_roster,
pernr TYPE p0001-pernr,
ssn TYPE p0002-perid,
first_name TYPE p0002-vorna,
last_name TYPE p0002-nachn,
city TYPE t500p-ort01,
state TYPE t500p-regio,
zipcode TYPE t500p-pstlz,
hire_date(10) TYPE c,
lhire_date(10) TYPE c,
serv_date(10) TYPE c,
eg TYPE p0001-persg,
eg_desc TYPE t501t-ptext,
esg TYPE p0001-persk,
esg_desc TYPE t503t-ptext,
race TYPE p0077-rac01,
*** TYPE p0002-gesch,
job_grade TYPE p0008-trfgr,
job_level TYPE p0008-trfst,
grade_entry_date(10) TYPE c,
job_title TYPE p0001-plans,
title(30) TYPE c,
job_code TYPE p0001-stell,
job_code_desc TYPE t513s-stltx,
job_entry_date(10) TYPE c,
annual_sal TYPE p0008-ansal,
hrly_rate TYPE p0008-bet01,
org_unit TYPE p0001-orgeh,
orgtx(40) TYPE c,
cost_cntr TYPE p0001-kostl,
ltext(40) TYPE c,
personal_area TYPE p0001-werks,
personal_area_desc TYPE t500p-name1,
supervisor(30) TYPE c,
flsa TYPE t5u13-exmpt,
ee01 TYPE t5u13-eeoct,
job_grp TYPE p0001-stell,
aap_code TYPE t5u13-aapct,
aap_code_desc TYPE t5uaa-ltext,
dob TYPE p0002-gbdat,
psa TYPE p0001-btrtl,
psa_desc TYPE t001p-btext,
unionl TYPE p0001-btrtl,
unionc TYPE p0001-btrtl,
END OF t_roster.
DATA : gi_roster TYPE STANDARD TABLE OF t_roster, gi_objec TYPE STANDARD TABLE OF objec,
gi_hrp1000 TYPE STANDARD TABLE OF hrp1000,
gi_cskt TYPE STANDARD TABLE OF cskt,
gi_t001p TYPE STANDARD TABLE OF t001p,
gi_t500p TYPE STANDARD TABLE OF t500p,
gi_t501t TYPE STANDARD TABLE OF t501t,
gi_t503t TYPE STANDARD TABLE OF t503t,
gi_t513s TYPE STANDARD TABLE OF t513s,
gi_t527x TYPE STANDARD TABLE OF t527x,
gi_t529t TYPE STANDARD TABLE OF t529t,
gi_t530t TYPE STANDARD TABLE OF t530t,
gi_t5u13 TYPE STANDARD TABLE OF t5u13,
gi_t5uaa TYPE STANDARD TABLE OF t5uaa.
DATA : gs_roster TYPE t_roster,
gs_objec TYPE objec,
gs_hrp1000 TYPE hrp1000,
gs_cskt TYPE cskt,
gs_t001p TYPE t001p,
gs_t500p TYPE t500p,
gs_t501t TYPE t501t,
gs_t503t TYPE t503t,
gs_t513s TYPE t513s,
gs_t527x TYPE t527x,
gs_t529t TYPE t529t,
gs_t530t TYPE t530t,
gs_t5u13 TYPE t5u13,
gs_t5uaa TYPE t5uaa.
DATA : gv_ltext(40) TYPE c,
gv_ltext1(40) TYPE c,
gv_age(3) TYPE c,
gv_butxt(40) TYPE c,
gv_eeoc(10) TYPE c,
gv_prevdate TYPE datum.
DATA: gi_fieldcat TYPE slis_t_fieldcat_alv,
gs_fieldcat TYPE slis_fieldcat_alv,
i_top_of_page TYPE slis_t_listheader,
g_repid TYPE sy-repid,
g_save,
gs_layout TYPE slis_layout_alv,
gt_events TYPE slis_t_event,
gs_variant LIKE disvariant,
gi_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
SELECTION-SCREEN BEGIN OF BLOCK b1
WITH FRAME TITLE text-x02.
PARAMETERS : p_race(10) AS LISTBOX VISIBLE LENGTH 30,
p_gender TYPE p0002-gesch,
p_eeoc TYPE t5u13-eeoct,
p_aap TYPE t5u13-aapct.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN OUTPUT.
REFRESH list.
name = 'P_RACE'.
value-key = 'R1'.
value-text = 'American Indian or Alaskan Native'.
APPEND value TO list.
CLEAR value.
value-key = 'R2'.
value-text = 'Asian'.
APPEND value TO list.
CLEAR value.
value-key = 'R3'.
value-text = 'Black or African American'.
APPEND value TO list.
CLEAR value.
value-key = 'R5'.
value-text = 'White'.
APPEND value TO list.
CLEAR value.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
INITIALIZATION.
g_repid = sy-repid.
PERFORM layout_init USING gs_layout.
PERFORM eventtab_build USING gt_events[].
gs_variant-report = g_repid.
g_save = 'A'.
START-OF-SELECTION.
GET pernr.
PERFORM roster_aap.
END-OF-SELECTION.
PERFORM fetch_roster_text.
PERFORM output_roster_display.
*& Form ROSTER_AAP
text
--> p1 text
<-- p2 text
FORM roster_aap .
PERFORM infty_rost_0001.
PERFORM infty_rost_0002.
PERFORM infty_rost_0008.
PERFORM infty_rost_0041.
PERFORM infty_rost_0077.
PERFORM supervisor_rost.
PERFORM append_rost_recs.
ENDFORM. " ROSTER_AAP
*& Form INFTY_ROST_0001
text
FORM infty_rost_0001 .
rp_provide_from_last p0001 space
pn-begda pn-endda.
IF pnp-sw-found = 1.
gs_roster-pernr = p0001-pernr.
gs_roster-eg = p0001-persg.
READ TABLE gi_t501t INTO gs_t501t WITH KEY persg = p0001-persg.
IF sy-subrc <> 0.
APPEND gs_t501t TO gi_t501t.
CLEAR gs_t501t.
ENDIF.
gs_roster-esg = p0001-persk.
READ TABLE gi_t503t INTO gs_t503t WITH KEY persk = p0001-persk.
IF sy-subrc <> 0.
APPEND gs_t503t TO gi_t503t.
CLEAR gs_t503t.
ENDIF.
gs_roster-job_title = p0001-plans.
READ TABLE gi_hrp1000 INTO gs_hrp1000 WITH KEY objid = p0001-plans.
IF sy-subrc <> 0.
APPEND gs_hrp1000 TO gi_hrp1000.
CLEAR gs_hrp1000.
ENDIF.
gs_roster-job_code = p0001-stell.
READ TABLE gi_t513s INTO gs_t513s WITH KEY stell = p0001-stell.
IF sy-subrc <> 0.
APPEND gs_t513s TO gi_t513s.
CLEAR gs_t513s.
ENDIF.
gs_roster-org_unit = p0001-orgeh.
READ TABLE gi_t527x INTO gs_t527x WITH KEY orgeh = p0001-orgeh.
IF sy-subrc <> 0.
APPEND gs_t527x TO gi_t527x.
CLEAR gs_t527x.
ENDIF.
gs_roster-cost_cntr = p0001-kostl.
READ TABLE gi_cskt INTO gs_cskt WITH KEY kostl = p0001-kostl.
IF sy-subrc <> 0.
APPEND gs_cskt TO gi_cskt.
CLEAR gs_cskt.
ENDIF.
gs_roster-personal_area = p0001-werks.
READ TABLE gi_t500p INTO gs_t500p WITH KEY persa = p0001-werks.
IF sy-subrc <> 0.
APPEND gs_t500p TO gi_t500p.
CLEAR gs_t500p.
ENDIF.
gs_roster-job_grp = p0001-stell.
READ TABLE gi_t5u13 INTO gs_t5u13 WITH KEY stell = p0001-stell.
IF sy-subrc <> 0.
APPEND gs_t5u13 TO gi_t5u13.
CLEAR gs_t5u13.
ENDIF.
READ TABLE gi_t5uaa INTO gs_t5uaa WITH KEY aapct = gs_roster-aap_code.
IF sy-subrc <> 0.
APPEND gs_t5uaa TO gi_t5uaa.
CLEAR gs_t5uaa.
ENDIF.
gs_roster-psa = p0001-btrtl.
READ TABLE gi_t001p INTO gs_t001p WITH KEY btrtl = p0001-btrtl.
IF sy-subrc <> 0.
APPEND gs_t001p TO gi_t001p.
CLEAR gs_t001p.
ENDIF.
gs_roster-unionl = p0001-btrtl.
gs_roster-unionc = p0001-btrtl.
ENDIF.
ENDFORM. " INFTY_ROST_0001
*& Form INFTY_ROST_0002
text
FORM infty_rost_0002 .
rp_provide_from_last p0002 space
pn-begda pn-endda.
IF pnp-sw-found = 1.
IF p_gender IS NOT INITIAL AND p_gender NE p0002-gesch.
REJECT.
ENDIF.
gs_roster-ssn = p0002-perid.
gs_roster-first_name = p0002-vorna.
gs_roster-last_name = p0002-nachn.
gs_roster-*** = p0002-gesch.
gs_roster-dob = p0002-gbdat.
ENDIF.
ENDFORM. " INFTY_ROST_0002
*& Form INFTY_ROST_0008
text
FORM infty_rost_0008 .
DATA: lv_wage TYPE lgart,
lv_amount TYPE pad_amt7s.
rp_provide_from_last p0008 space
pn-begda pn-endda.
IF pnp-sw-found = 1.
gs_roster-annual_sal = p0008-ansal.
DO 40 TIMES VARYING lv_wage FROM p0008-lga01
NEXT p0008-lga02
VARYING lv_amount FROM p0008-bet01
NEXT p0008-bet02.
IF lv_wage = '0101'.
gs_roster-hrly_rate = lv_amount.
EXIT.
ENDIF.
ENDDO.
gs_roster-job_grade = p0008-trfgr.
gs_roster-job_level = p0008-trfst.
ENDIF.
ENDFORM. " INFTY_ROST_0008
*& Form INFTY_ROST_0041
text
FORM infty_rost_0041 .
DATA : l_date TYPE datum,
l_hdate TYPE datum,
l_sdate TYPE datum.
rp_provide_from_last p0041 space
pn-begda pn-endda.
IF pnp-sw-found = 1.
CLEAR : l_date,
l_hdate,
l_sdate.
*--Last Hire Date--
CALL FUNCTION 'HR_DATESPECIFICATION_DATE_GET'
EXPORTING
p0041 = p0041
p_datar = 'U1'
P_DATKN =
IMPORTING
p_date = l_date
EXCEPTIONS
illegal_arguments = 1
more_than_one_date = 2
OTHERS = 3
IF sy-subrc <> 0.
ENDIF.
IF NOT l_date IS INITIAL.
CONCATENATE
l_date4(2) l_date6(2) l_date+0(4)
INTO gs_roster-hire_date
SEPARATED BY '/'.
ENDIF.
ENDIF.
*--Last Hire Date--
CALL FUNCTION 'HR_DATESPECIFICATION_DATE_GET'
EXPORTING
p0041 = p0041
p_datar = 'U2'
P_DATKN =
IMPORTING
p_date = l_hdate
EXCEPTIONS
illegal_arguments = 1
more_than_one_date = 2
OTHERS = 3
IF sy-subrc <> 0.
ENDIF.
IF NOT l_hdate IS INITIAL.
CONCATENATE
l_hdate4(2) l_hdate6(2) l_hdate+0(4)
INTO gs_roster-lhire_date
SEPARATED BY '/'.
ENDIF.
*--Service Date--
CALL FUNCTION 'HR_DATESPECIFICATION_DATE_GET'
EXPORTING
p0041 = p0041
p_datar = 'U4'
P_DATKN =
IMPORTING
p_date = l_sdate
EXCEPTIONS
illegal_arguments = 1
more_than_one_date = 2
OTHERS = 3
IF sy-subrc <> 0.
ENDIF.
IF NOT l_sdate IS INITIAL.
CONCATENATE
l_sdate4(2) l_sdate6(2) l_sdate+0(4)
INTO gs_roster-serv_date
SEPARATED BY '/'.
ENDIF.
ENDFORM. " INFTY_ROST_0041
*& Form INFTY_ROST_0077
text
FORM infty_rost_0077 .
DATA: lv_race TYPE races.
rp_provide_from_last p0077 space
pn-begda pn-endda.
IF pnp-sw-found = 1.
IF NOT p_race IS INITIAL AND p_race NE lv_race.
REJECT.
ENDIF.
DO 10 TIMES VARYING lv_race FROM p0077-rac01
NEXT p0077-rac02.
IF lv_race NE space.
IF lv_race EQ g_01.
gs_roster-race = g_ai.
ELSEIF lv_race EQ g_02.
gs_roster-race = g_h.
ELSEIF lv_race EQ g_03.
gs_roster-race = g_af.
ELSEIF lv_race EQ g_05.
gs_roster-race = g_w.
ENDIF.
ENDIF.
ENDDO.
ENDIF.
ENDFORM. " INFTY_ROST_0077
*& Form SUPERVISOR_ROST
text
FORM supervisor_rost .
REFRESH gi_objec.
IF NOT p0001-orgeh IS INITIAL.
CALL FUNCTION 'HRCM_ORGUNIT_MANAGER_GET'
EXPORTING
plvar = '01'
otype = 'O'
objid = p0001-orgeh
begda = pn-begda
endda = pn-endda
PATH_ID = ' '
TABLES
manager_info_table = gi_objec
EXCEPTIONS
path_error = 1
root_error = 2
nothing_found = 3
OTHERS = 4
IF sy-subrc <> 0.
ENDIF.
SORT gi_objec DESCENDING BY endda.
READ TABLE gi_objec INTO gs_objec INDEX 1.
IF sy-subrc = 0.
gs_roster-supervisor = gs_objec-stext.
CLEAR gs_objec.
ENDIF.
ENDIF.
ENDFORM. " SUPERVISOR_ROST
*& Form APPEND_ROST_RECS
text
FORM append_rost_recs .
IF NOT gs_roster-pernr IS INITIAL.
APPEND gs_roster TO gi_roster.
CLEAR gs_roster.
ENDIF.
ENDFORM. " APPEND_ROST_RECS
*& Form FETCH_ROSTER_TEXT
text
FORM fetch_roster_text .
IF p_eeoc IS NOT INITIAL AND p_eeoc NE t5u13-eeoct.
REJECT.
ENDIF.
IF NOT gi_roster IS INITIAL.
SELECT orgeh orgtx FROM t527x
INTO CORRESPONDING FIELDS OF TABLE gi_t527x
WHERE sprsl = sy-langu AND
endda = '99991231'.
SELECT persa ort01 regio pstlz name1
FROM t500p
INTO CORRESPONDING FIELDS OF TABLE gi_t500p.
SELECT persg ptext
FROM t501t
INTO CORRESPONDING FIELDS OF TABLE gi_t501t
WHERE sprsl = sy-langu.
SELECT persk ptext
FROM t503t
INTO CORRESPONDING FIELDS OF TABLE gi_t503t
WHERE sprsl = sy-langu.
SELECT stell stltx FROM t513s
INTO CORRESPONDING FIELDS OF TABLE gi_t513s
WHERE sprsl = sy-langu AND
endda = '99991231'.
SELECT otype plvar objid stext
FROM hrp1000 INTO
CORRESPONDING FIELDS OF TABLE gi_hrp1000
for all entries in gi_roster
WHERE plvar = '01'
AND otype = 'S'.
and objid = gi_roster-job_title.
SELECT stell eeoct exmpt aapct
FROM t5u13
INTO CORRESPONDING FIELDS OF TABLE gi_t5u13.
for all entries in gi_t5u13
WHERE stell = gi_t5u13-stell
AND eeoct = p_eeoc
AND aapct = p_aap.
SELECT aapct eeoct ltext
FROM t5uaa
INTO CORRESPONDING FIELDS OF TABLE gi_t5uaa.
FOR ALL ENTRIES IN gi_roster
WHERE aapct = gi_roster-aap_code
and eeoct = gi_roster-ee01.
SELECT kostl ltext
FROM cskt
INTO CORRESPONDING FIELDS OF TABLE gi_cskt
FOR ALL ENTRIES IN gi_roster
WHERE kostl = gi_roster-cost_cntr
WHERE spras = sy-langu.
SELECT btrtl btext
FROM t001p
INTO CORRESPONDING FIELDS OF TABLE gi_t001p.
FOR ALL ENTRIES IN gi_roster
WHERE btrtl = gi_roster-psa.
ENDIF.
LOOP AT gi_roster INTO gs_roster.
CLEAR :gs_hrp1000,gs_t5u13,gs_t500p,gs_t501t,gs_t503t,gs_t5uaa,gs_cskt,gs_t001p,gs_t513s, gs_t527x,gs_t529t,gs_t530t.
READ TABLE gi_t501t INTO gs_t501t WITH KEY persg = gs_roster-eg.
IF sy-subrc = 0.
gs_roster-eg_desc = gs_t501t-ptext.
ENDIF.
READ TABLE gi_t503t INTO gs_t503t WITH KEY persk = gs_roster-esg.
IF sy-subrc = 0.
gs_roster-esg_desc = gs_t503t-ptext.
ENDIF.
READ TABLE gi_t513s INTO gs_t513s
WITH KEY stell = gs_roster-job_code.
IF sy-subrc = 0.
gs_roster-job_code_desc = gs_t513s-stltx.
ENDIF.
READ TABLE gi_t527x INTO gs_t527x
WITH KEY orgeh = gs_roster-org_unit.
IF sy-subrc = 0.
gs_roster-orgtx = gs_t527x-orgtx.
ENDIF.
READ TABLE gi_hrp1000 INTO gs_hrp1000 WITH KEY objid = gs_roster-job_title.
IF sy-subrc = 0.
gs_roster-title = gs_hrp1000-stext.
ENDIF.
READ TABLE gi_cskt INTO gs_cskt
WITH KEY kostl = gs_roster-cost_cntr.
IF sy-subrc = 0.
gs_roster-ltext = gs_cskt-ltext.
ENDIF.
READ TABLE gi_t5u13 INTO gs_t5u13 WITH KEY stell = gs_roster-job_code.
IF sy-subrc = 0.
gs_roster-ee01 = gs_t5u13-eeoct.
gs_roster-flsa = gs_t5u13-exmpt.
gs_roster-aap_code = gs_t5u13-aapct.
ENDIF.
READ TABLE gi_t500p INTO gs_t500p WITH KEY persa = gs_roster-personal_area.
IF sy-subrc = 0.
gs_roster-city = gs_t500p-ort01.
gs_roster-state = gs_t500p-regio.
gs_roster-zipcode = gs_t500p-pstlz.
gs_roster-personal_area_desc = gs_t500p-name1.
ENDIF.
READ TABLE gi_t001p INTO gs_t001p WITH KEY btrtl = gs_roster-psa.
IF sy-subrc = 0.
gs_roster-psa_desc = gs_t001p-btext.
ENDIF.
READ TABLE gi_t5uaa INTO gs_t5uaa WITH KEY aapct = gs_roster-aap_code eeoct = gs_roster-ee01.
IF sy-subrc = 0.
gs_roster-aap_code_desc = gs_t5uaa-ltext.
ENDIF.
MODIFY gi_roster FROM gs_roster .
ENDLOOP.
ENDFORM. " FETCH_ROSTER_TEXT
*& Form OUTPUT_ROSTER_DISPLAY
text
FORM output_roster_display .
PERFORM build_roster_fieldcatalog.
PERFORM comment_roster_build CHANGING i_top_of_page[].
PERFORM display_roster_alv_report.
ENDFORM. " OUTPUT_ROSTER_DISPLAY
*& Form LAYOUT_INIT
text
FORM layout_init USING rs_layout TYPE slis_layout_alv.
rs_layout-detail_popup = 'X'.
rs_layout-zebra = 'X'.
rs_layout-colwidth_optimize = 'X'.
ENDFORM. " LAYOUT_INIT
*& Form EVENTTAB_BUILD
text
FORM eventtab_build USING rt_events TYPE slis_t_event.
*"Registration of events to happen during list display
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = rt_events.
READ TABLE rt_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE gi_top_of_page TO ls_event-form.
APPEND ls_event TO rt_events.
ENDIF.
ENDFORM. " EVENTTAB_BUILD
*& Form top_of_page
text
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_top_of_page.
ENDFORM. "TOP_OF_PAGE
*& Form BUILD_ROSTER_FIELDCATALOG
text
FORM build_roster_fieldcatalog .
gs_fieldcat-fieldname = 'PERNR'.
gs_fieldcat-seltext_m = 'Employee Number'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'SSN'.
gs_fieldcat-seltext_m = 'SSN Number'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'FIRST_NAME'.
gs_fieldcat-seltext_m = 'First Name'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'LAST_NAME'.
gs_fieldcat-seltext_m = 'Last Name'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'CITY'.
gs_fieldcat-seltext_m = 'City'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'STATE'.
gs_fieldcat-seltext_m = 'State'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'ZIPCODE'.
gs_fieldcat-seltext_m = 'Zip Code'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'HIRE_DATE'.
gs_fieldcat-seltext_m = 'Hire Date'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'LHIRE_DATE'.
gs_fieldcat-seltext_m = 'Last Hire Date'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'SERV_DATE'.
gs_fieldcat-seltext_m = 'Service Date'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'EG'.
gs_fieldcat-seltext_m = 'Eg'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'EG_DESC'.
gs_fieldcat-seltext_m = 'Eg Description'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'ESG'.
gs_fieldcat-seltext_m = 'Esg'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'ESG_DESC'.
gs_fieldcat-seltext_m = 'Eg Description'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'RACE'.
gs_fieldcat-seltext_m = 'Race'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = '***'.
gs_fieldcat-seltext_m = '***'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'JOB_GRADE'.
gs_fieldcat-seltext_m = 'Job Grade'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'JOB_LEVEL'.
gs_fieldcat-seltext_m = 'Job Level'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'GRADE_ENTRY_DATE'.
gs_fieldcat-seltext_l = 'Grade Entry Date'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'JOB_TITLE'.
gs_fieldcat-seltext_l = 'Job Title'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat..
gs_fieldcat-fieldname = 'TITLE'.
gs_fieldcat-seltext_l = 'Job Title Description'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'JOB_CODE'.
gs_fieldcat-seltext_l = 'Job Code'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'JOB_CODE_DESC'.
gs_fieldcat-seltext_l = 'Job Code Description'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'JOB_ENTRY_DATE'.
gs_fieldcat-seltext_l = 'Job Entry Date'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'ANNUAL_SAL'.
gs_fieldcat-seltext_l = 'Annual Salary'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'HRLY_RATE'.
gs_fieldcat-seltext_l = 'Hourly Rate'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'ORG_UNIT'.
gs_fieldcat-seltext_l = 'Org Unit'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'ORGTX'.
gs_fieldcat-seltext_l = 'Org Text'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'COST_CNTR'.
gs_fieldcat-seltext_l = 'Cost Center'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'LTEXT'.
gs_fieldcat-seltext_l = 'Cost Center Description'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'PERSONAL_AREA'.
gs_fieldcat-seltext_l = 'Personal Area'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'PERSONAL_AREA_DESC'.
gs_fieldcat-seltext_l = 'Personal Area Description'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'SUPERVISOR'.
gs_fieldcat-seltext_l = 'Supervisor'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'FLSA'.
gs_fieldcat-seltext_l = 'FLSA'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'EE01'.
gs_fieldcat-seltext_l = 'EE01'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'JOB_GRP'.
gs_fieldcat-seltext_l = 'Job Group'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'AAP_CODE'.
gs_fieldcat-seltext_l = 'AAP Code'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'AAP_CODE_DESC'.
gs_fieldcat-seltext_l = 'AAP Code Description'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'DOB'.
gs_fieldcat-seltext_l = 'Date of Birth'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'PSA'.
gs_fieldcat-seltext_l = 'Personal Sub Area'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'PSA_DESC'.
gs_fieldcat-seltext_l = 'Personal Sub Area Description'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'UNIONL'.
gs_fieldcat-seltext_l = 'Union Local'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'UNIONC'.
gs_fieldcat-seltext_l = 'Union Classfication'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
ENDFORM. " BUILD_ROSTER_FIELDCATALOG
*& Form COMMENT_ROSTER_BUILD
text
FORM comment_roster_build CHANGING top_of_page TYPE
slis_t_listheader.
DATA: ls_line TYPE slis_listheader,
l_startdate(10) TYPE c,
l_enddate(10) TYPE c,
l_final_start(22) TYPE c,
l_final_end(22) TYPE c.
CONCATENATE pn-begda4(2)'/'pn-begda6(2)'/'pn-begda+0(4)
INTO l_startdate.
CONCATENATE pn-endda4(2)'/'pn-endda6(2)'/'pn-endda+0(4)
INTO l_enddate.
CONCATENATE 'Start Date:' l_startdate INTO l_final_start.
CONCATENATE 'End Date :' l_enddate INTO l_final_end.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = 'AAP-EEOC Roster Report Data '. "Max len = 60
APPEND ls_line TO i_top_of_page.
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-info = l_final_start.
APPEND ls_line TO i_top_of_page.
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-info = l_final_end.
APPEND ls_line TO i_top_of_page.
CLEAR ls_line.
ENDFORM. " COMMENT_ROSTER_BUILD
*& Form DISPLAY_ROSTER_ALV_REPORT
text
FORM display_roster_alv_report .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
is_layout = gs_layout
it_fieldcat = gi_fieldcat
i_save = g_save
is_variant = gs_variant
it_events = gt_events[]
TABLES
t_outtab = gi_roster
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
ENDIF.
ENDFORM. " DISPLAY_ROSTER_ALV_REPORT
Regards
sachinhi there,
i want to fetch data from all the fields i ahve given here .It will be a join statement.
the important thing is I need all the values of vbeln in leftside
as output. -
ABAP List Output Printing Error
Hi All,
I am facing a problem while printing the ABAP List Output. First Page is printing fine and from the second page its not printing. Where as in Standard reports everything is printing OK.
Thanks in Advance.
Best regards,
Shahid MalayilHello Shahid,
For list printing: Add to affected reports with NEW-PAGE PRINT ON LAYOUT/ SUBMIT... TO SAP-SPOOL LAYOUT (print at list generation). For printing from list display, adjust REPORT width specification to force selection of the format and move format to SAP namespace (name "X....").
May be this can help you.
Cheers
Mudassir. -
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 -
How to append ALV grid output to LIST output
Hi,
I am working with Basis AUDIT MANUAL report for which i have to integrate around 50 standard transactions (SM37,SM35...etc) output and make it into one single report.
On execution of my report i have to get all the 50 transaction outputs sequentially.
Some standard transactions have ALV list display output and some have GRID display.I can able to append only list outputs by submit program and exporting list to memory.
Please suggest me how to get Alv grid output in midst of list output.
Regards
Kalpana.You should post your question to the ABAP forum:
ABAP Development -
Clarifications in pick list output type EK00
Hello ,
Have any one of you used the pick list output EK00 . I have
tried this and I do have some issues with
We are using SAP R/3 4.7 x 200 version .
Output type EK00 is not available in the application V2 (
Shipping ) . Its available in application V4 (Shipping special
case).
1. I have assigned the shipping points through T code VOK2 as I
am not able to find the output EK00 through customization menu.
2. I have maintained the printers details through VP01SHP ( correct me if I am wrong) . I am using the standard program RVADEK01 and form
SD_PICK_SINGLE in the output EK00.
After doing the above setting when I am creating delivery in
VL01N , the output type EK00 is not assigned automatically and
when I try to assign it manually , it gives an error message
"Processing program missing for output EK00 (medium 1)in
application V2" . I dont know why the system is looking for
application V2 when it is not available in V2 and only available
in V4 .
Am I missing anything in my process . Can some one help me in this .
With regards,
Joseph Anand.BDear Joseph,
Have you done the following setting in transaction v/38:
1.On the Display View "Output Types": Overview screen, in the Output type group box, select EK00. (Application V4)
2.In the left frame, under Dialog Structure, double-click on the Processing routines folder.
3.On the Change View "Processing Routines": Overview screen, choose .
4.In the first medium, for Print output, enter the Smart Form print program /SMB40/RVADEK01 under Program and Smart Form /SMB40/SDPIK_L under SmartForm.
Document Types Picking List
Output Types EK00
Transaction Code v/38
Smart Form Program /SMB40/RVADEK01
Smart Form /SMB40/SDPIK_L
/SMB40/SDPIK_A
5. Save the changes.
Regards,
Naveen. -
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
Maybe you are looking for
-
I have an iMac, where all my library is in.
I have an iMac, an Mac Book Pro, an iPod classic, and iPhone 4S. It supposed that all the dispositives, should share my library, but this is not happening now, some of my music, is download, but I cant heard it, because there's a message on the scree
-
Website not updating when published to Business Catalyst
I have just updated a website in Muse and it works fine using the preview options in Muse. Here is the site: http://www.nemesisbio.com 'The Team' section should not be a scrolling slider as I've updated it to show all 3 team members together. When I
-
I am trying to look at the graph patterns of average joint motion angles (X, Y, Z) from many trials of 13 subjects during a certain phase recored at sampling rate of 100 Hz. This phase of each trial has different data points (For example, trial 1 ha
-
Sub picture highlight - missing the big picture
Windows 7 64-bit, Photoshop and Encore CS5, everything patched I have been banging around on this for days, off and on, and I'm sure I must be missing something obvious. I created a menu in Photoshop but even if I use a built-in Encore menu (like Sun
-
Copy Selected Fimnder Items weirdness
Hi, I have a simple automator script. It's pupose is to shift some stuff of my local machine, to a network share. But I can't get it to work reliably. It has the following actions: 1. Get Specified URLs - Specifies the URL to the server share 2. Conn