Useful utility function modules
April 30, 2013
Posted by on J_4I_NOTES_TICKLER_MAIN
K_ABC_LIST_POPUP
POPUP_TO_CONFIRM_WITH_MESSAGE
Simple ALV Grid
November 27, 2012
Posted by on Simple ALV Grid display using CL_SALV_TABLE, is shown below. GT_OUTPUT_TABLE is an internal table whose structure is from data dictionary.
data: lo_alv type ref to cl_salv_table,
lo_cols_tab type ref to cl_salv_columns_table,
lo_selections type ref to cl_salv_selections,
lo_layout type ref to cl_salv_layout,
ls_key type salv_s_layout_key,
lx_msg type ref to cx_salv_msg.
try.
cl_salv_table=>factory(
importing
r_salv_table = lo_alv
changing
t_table = gt_su_head ).
catch cx_salv_msg into lx_msg.
endtry.
lo_alv->set_screen_status(
pfstatus = ‘STANDARD_FULLSCREEN’
report = ‘SAPLSLVC_FULLSCREEN’
set_functions = lo_alv->c_functions_all ).
lo_cols_tab = lo_alv->get_columns( ).
lo_cols_tab->set_optimize(‘X’).
lo_selections = lo_alv->get_selections( ).
lo_selections->set_selection_mode( if_salv_c_selection_mode=>row_column ).
lo_layout = lo_alv->get_layout( ).
ls_key-report = sy-repid.
lo_layout->set_key( ls_key ).
lo_layout->set_save_restriction( if_salv_c_layout=>restrict_none ).
lo_alv->display( ).
Useful Transaction Codes
July 10, 2012
Posted by on SAP1 – Menu transaction for all SAP standard reports
Convert time from one time-zone to another
June 12, 2012
Posted by on data: l_timestamp type tzonref-tstamps.
call function ‘IB_CONVERT_INTO_TIMESTAMP’
exporting
i_datlo = lv_date
i_timlo = lv_time
i_tzone = ‘EST’
importing
e_timestamp = l_timestamp.
if sy-subrc = 0 and l_timestamp is not initial.
call function ‘IB_CONVERT_FROM_TIMESTAMP’
exporting
i_timestamp = l_timestamp
i_tzone = ‘PST’
importing
e_datlo = lv_date
e_timlo = lv_time.
endif.
SAP Printing , Spool
April 15, 2012
Posted by on Spool requests are stored in temporary sequential files called Temse. When the file size reaches its maximum limit, spool overflow occurs and nothing can be printed from SAP.
Transactions: SM21 and ST22 show spool overflow errors like spool_internal_error, spool overflow
To troubleshoot, go to Transaction SPAD, on the menu Administration->Clean-up spool. We can delete requests that are already printed and or based on minimum spool request age in days.
Alternatively:
1. The standard report RSPO0041 can be executed through SE38 to clean up the spool
2. The standard report RSPO0043 can be executed through SE38 to check the consistency of spool/temse and re-organizes the spool.
Reference: Basis Blog
Program to Copy/Delete file on Unix Server
March 28, 2012
Posted by on data : unixcom like rlgrap-filename.
data: begin of itab occurs 0,
line(400),
end of itab.
data: lines type i.
*———————————————————————-
start-of-selection.
refresh itab.
“cp /dir/file1 /dir2/file2
“the above command will copy the file1 of dir1 to file2 of dir2.
“rm /dir/fiel1
“the above command will remove the file1 from directory dir.
unixcom = ‘cp /dir/file1 /dir/file2’.
"if you want to use the rm
unixcom = 'rm /dir/file1 '.
call 'SYSTEM' id 'COMMAND' field unixcom
id 'TAB' field itab[].
"if any error or any thing you get in the itab
"just check the itab once after the finishing
AL11 File utilities
March 27, 2012
Posted by on Program:
CACS_FILE_COPY – Copying a File from Application to Presentation Server and Vice Versa
Function modules:
ARCHIVFILE_CLIENT_TO_SERVER – Copy file from presentation to app server
ARCHIVFILE_SERVER_TO_CLIENT – Copy file from app server to presentation
Also following SAP standard programs are available.
RPCIFU01
Display File
RPCIFU03
Download Unix File to PC
RPCIFU04
Upload PC File to Unix File
Function module to get fixed values from domain
March 21, 2012
Posted by on DATA: lv_dname TYPE dcobjdef-name,
lt_dd07v TYPE TABLE OF dd07v,
ls_dd07v TYPE dd07v.
lv_dname = ‘RBSTAT’.
CALL FUNCTION ‘DDIF_DOMA_GET’
EXPORTING
name = lv_dname
langu = sy-langu
TABLES
dd07v_tab = lt_dd07v
EXCEPTIONS
illegal_input = 1
OTHERS = 2.