Program structure for a report
hi,
could any one clarify whether
initialization event is to be written first or
selection-screen begin of block is to be written.plz tell whether this affects performance.
I have written a report with the following structure.plz correct me if i'm wrong
1)DB table declaration
2) internal tables declaration and ranges decltn
3)ALV variables & internal tables
4)constants & variables
5)initialization
6)selection-screen(begin of block-end of block)
7)at selection-screen on value req
8) at selection-screen
9)start-of-selection
10)end-of-selection
Hi Mamatha
There is absolutely no need of worrying about which should come first and which next...
Anything is fine...whether INITIALIZATION coming first or vice-versa. and further, there is no connection of this with performance. Infact, let me tell you that PERFORMANCE comes into picture only when u r accessing the database or when u r processing large internal tables.
<b>and regarding the order of ur report:</b>
Its fine! How ever, for more readability, u can swap the 5th and 6th steps, so that all the events are grouped at one place and all the data declarations above them.
And let me tell u one important thing: Don't allow the data declaration to happen in SELECTION-SCREEN events, it will not be global.....
Hope u understand me completely
Reward points if helpful
Regards
Similar Messages
-
Program Structure for PID temperature Controller
Hi everybody,
I built a PID temperature controller VI for a third party DAQ board, based on a very basic knowledge in programming.
Now the VI works fine in both ends "i/ps & o/ps", the problem is that i cant get the response that I'm looking for from the PID controller. Since the system is time critical, I wounder if the structure of the VI is cosing this problem. please if you have any idea, hint or suggestion.
Marwan
http://www.geocities.com/marwan_m13/weemee8080.jpg
Attachments:
PIC Temperature Control(PID).vi 364 KBMarwan,
You say that time is critical. The timeout is set to 1 second in the main loop. You will only get one update per second with this setting.
Several comments:
1. I have never seen the event structure used soley to control loop timing like this. No reason it should not work, but that is not its primary purpose. If you were to use the event structure to also handle user events (as it is designed to do), then things could get complicated. The Wait (ms) functions and Elapsed Time Express VIs can perform the timing for you without the risk of unintended consequences.
2. Generally it is recommended to use only one event structure in a program, unless you have very specific reasons for using more than one. Since you are using them only as timers, the interaction potential is minimal.
3. Right to left wiring and avoidance of wires hidden behind other objects make code much easier to read and to debug.
4. Putting the user controls and displays and the write to file functions in independent loops allows the PID function to run at different rates from the user interface and file save functions. Look at examples of Producer/consumer architecture.
5. Precalculating things which do not change from iteration to iteration can save time. For example multiply by 2.55 rather than multiply by 255 and divide by 100. Also make the datatypes consistent to avoid type coercion (indicated by little dots at the input connections such as the 255 input to the mutliply. Changing the datatype of the 255 constant to Double eliminates the coercion.
Lynn -
What's the best program structure for multi-channel Averaged FFTs?
I have been successfully using a 8-channel FFT analyzer using a separate Averaged FFT Spectrum (Mag-Phase) VI for each channel, but I now need to expand my channel count from 8 to 16. All channels are simultaneoulsy read in to a buffer to maintain phase relatioships. Do I need to have 16 copies of the Averaged FFT Spectrum VI in my diagram to maintain the averages of each channel or can I utilize one FFT VI somehow within a For Loop? If a For Loop can be used, how can the averaged spectrums be maintained for each of the 16 channels?
You should be able to use a single FFT vi in a for loop. If your data is in a 2D array representation with each row representing a channel and you leave the indexing enabled you can pass your data array into the loop and it will strip off each row automatically. You could then pass each row of data to the FFT and pass the results out to the boundary of the for loop. This will then build an array containing the FFT results for each row (channel).
Marc
Marc -
How to create PLD_Items table for Crystal Reports
Hi experts,
Im trying to use the variable 130 for a report but in crystal reports, in some SAP Standard Reports the table PLD_Items appears, my question is how to create this structure for my report, i know that is an ADO.NET connection based on an XML file, but i dont know from where i can take this value can any one help me please?
Best Regards
DaveIf this is CR for B1, please post to SAP Business One Application
Alternatively see the SCN Site Index for the correct SCN Space for your product / component.
- Ludek
SCN Moderator -
How to Link Organizational Structure to a report program
Hi All,
Can anyone pls help me out with my requirement. How can we link a organizational structure created in transaction PPOMW to a report program. Basically i want to send the report output as an XLS attachment to an external email id. For that i need to link Organizational Structure to the report program.
There are many ways of doing it but i want it to be done by linking Organization structure to the report program. Pls help me as soon as possible as its a bit urgent for me.Hi,
Please follow the below function modules and the paramters for reading archived data:
CALL FUNCTION 'ARCHIVE_OPEN_FOR_READ'
EXPORTING
OBJECT = archiving object name
IMPORTING
ARCHIVE_HANDLE = archive read handle
Then in the loop(DO-ENDDO), use this FM:
DO.
CALL FUNCTION 'ARCHIVE_GET_NEXT_OBJECT'
EXPORTING
archive_handle = archive read handle
Then records from the data objects using this FM:
CALL FUNCTION 'ARCHIVE_GET_TABLE'
EXPORTING
archive_handle = archive read handle
record_structure = 'TABLENAME'
all_records_of_object = 'X'
automatic_conversion = 'X'
TABLES
table = internal table for which you want to retrieve records.
ENDDO.
Then close the archive file using this FM:
CALL FUNCTION 'ARCHIVE_CLOSE_FILE'
EXPORTING
archive_handle = archive read handle
This will help u in reading archived data from archive file.
may give some idea also on how to code the read prgram.
Thanks,
Shamim -
Send some sample program for ALV reports
Hi all ,
send some sample program for ALV reports for learing purpose
tahnks.Hi ,
Resource Master
Program YPPCRR *
Program type Report Program *
Title Resource Master Dara for Updation *
Author Naga Raju *
Requested By Balaji *
Date Written 24.05.2007 *
Specification Id F2-DP-FS-2-0002 *
Transport Request *
On-line Documentation
Description
This Program updates the Location Mater through the Transaction
/SAPAPO/LOC3 Based on the User Selection
Update
Reset
No Action
Output
ALV List output of the main Program
ALV List output of the Error Log
REPORT YPPCRR NO STANDARD PAGE HEADING
LINE-SIZE 120
LINE-COUNT 62(4)
MESSAGE-ID yap..
Global data
Include where all the data declarations are coded.
INCLUDE YPPCRR_data.
*Initialization
INITIALIZATION.
perform init_variant.
Constants
CONSTANTS: c_formname_top_of_page TYPE slis_formname
VALUE 'F_TOP_OF_PAGE'.
Selection-Screen
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-040.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS:p_prs RADIOBUTTON GROUP ztyp USER-COMMAND ucom DEFAULT 'X'.
SELECTION-SCREEN COMMENT 3(28) text-003.
position 40.
parameters: p_file1 TYPE rlgrap-filename.
SELECTION-SCREEN END OF LINE.
skip 5.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_aps RADIOBUTTON GROUP ztyp.
SELECTION-SCREEN COMMENT 3(28) text-004.
position 40.
parameters: p_file2 type rlgrap-filename.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = syst-repid
DYNPRO_NUMBER = SYST-DYNNR
field_name = p_file1
STATIC = ' '
MASK = ' '
CHANGING
file_name = p_file1
EXCEPTIONS
MASK_TOO_LONG = 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.
START-OF-SELECTION.
if p_prs = 'X'.
PERFORM f_read_datum1 TABLES t_res_head
USING p_file1
CHANGING w_subrc.
elseif p_aps = 'X'.
PERFORM f_read_datum2 TABLES t_res_head
USING p_file2
CHANGING w_subrc.
endif.
IF w_subrc = 0.
Validations
PERFORM VALIDATION.
PERFORM display_alv.
IF SY-UCOMM = '&F03'
or SY-UCOMM = '&F12'
or SY-UCOMM = '&F15'.
LEAVE LIST-PROCESSING.
ELSE.
ENDIF.
ELSE.
Message s100 with text-002.
ENDIF.
END-OF-SELECTION.
Forms part*
INCLUDE YPPCRR_forms.
*& Include YPPCRR_DATA
Type-Pools
TYPE-POOLS: slis.
*TYPES
DATA: BEGIN OF tl_res_head.
INCLUDE STRUCTURE ypp_res_head.
DATA: END OF tl_res_head.
DATA: BEGIN OF tl_res_head_val.
INCLUDE STRUCTURE ypp_resv.
DATA: END OF tl_res_head_val.
DATA : BEGIN OF ty_errlog ,
counter type i,
type(2) ,
name(10) TYPE c,
vrsioid(22) TYPE c,
restype TYPE c,
message(80) TYPE c,
END OF ty_errlog.
Global Variables
DATA : gc_flag(1) TYPE c,
w_val_err_flag(1) type c.
DATA: w_filename TYPE rlgrap-filename,
w_subrc TYPE sy-subrc,
w_t_res_head TYPE slis_t_fieldcat_alv,
wa_t_res_head TYPE slis_fieldcat_alv.
DATA : wa_date(10) TYPE c,
wa_time(10) TYPE c,
wa_title(40) TYPE c,
wa_type(4) TYPE c .
DATA: BAPI_RUN_YES_NO TYPE C.
*Structure
*INTERNAL TABLES USED BY ALV
DATA:
it_fieldcat_alv TYPE slis_t_fieldcat_alv,
IT_FIELDCAT_ALV_ERR TYPE SLIS_T_FIELDCAT_ALV,
it_status TYPE slis_formname VALUE 'F_MAIN',
it_user_command TYPE slis_formname VALUE 'F_USER_COMMAND',
it_events TYPE slis_t_event,
it_event_exit TYPE slis_t_event_exit,
it_list_comments TYPE slis_t_listheader,
it_excluding TYPE slis_t_extab,
it_sort TYPE slis_t_sortinfo_alv.
*Internal Table Declarations
DATA : BEGIN OF t_imex OCCURS 0 ,
string(256) TYPE c,
END OF t_imex.
DATA : fcode TYPE TABLE OF sy-ucomm.
DATA : fcode_bdc TYPE TABLE OF sy-ucomm.
DATA : fcode_error TYPE TABLE OF sy-ucomm.
DATA : fcode_final TYPE TABLE OF sy-ucomm.
STRUCTURE and WORKARES
*Internal Table Declarations
DATA : t_res_head like tl_res_head occurs 0 WITH HEADER LINE.
DATA : t_res_head_val like tl_res_head_val occurs 0 with header line.
data :l_res_head LIKE LINE OF t_res_head.
DATA : w_file TYPE string.
*DATA : wa_vrsioid(22) type c,
wa_locno(20) type c,
wa_calendar(2) type c,
wa_planner(3) type c.
DATA: T_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
DATA: RESOURCE_HEAD LIKE BAPI10004RESHEAD OCCURS 0 WITH HEADER LINE,
RESOURCE_HEAD_X LIKE BAPI10004RESHEADX OCCURS 0 WITH HEADER LINE,
RESOURCE_TEXT LIKE BAPI10004RESTEXT OCCURS 0 WITH HEADER LINE,
RESOURCE_TEXT_X LIKE BAPI10004RESTEXTX OCCURS 0 WITH HEADER LINE.
data : t_errlog like ty_errlog occurs 0 with header line.
DATA : wk_lines TYPE i,
wk_errlines TYPE i,
wk_count TYPE i.
DATA: g_tabname TYPE slis_tabname VALUE 'T_RES_HEAD'.
Variables to be used by ALV
DATA:
wk_variant LIKE disvariant,
wx_variant LIKE disvariant,
wk_variant_save(1) TYPE c,
wk_exit(1) TYPE c,
wk_repid LIKE sy-repid,
wk_user_specific(1) TYPE c,
wk_callback_ucomm TYPE slis_formname,
wk_callback_status TYPE slis_formname,
wk_callback_status1 TYPE slis_formname,
wk_print TYPE slis_print_alv,
wk_layout TYPE slis_layout_alv,
wk_html_top_of_page TYPE slis_formname,
wk_fieldcat_alv LIKE LINE OF it_fieldcat_alv,
wk_excluding LIKE LINE OF it_excluding,
wk_events LIKE LINE OF it_events,
wk_event_exit LIKE LINE OF it_event_exit,
wk_list_comments LIKE LINE OF it_list_comments,
wk_list1_comments LIKE LINE OF it_list_comments,
wk_list2_comments LIKE LINE OF it_list_comments,
wk_sort LIKE LINE OF it_sort.
*DATA :gc_delete_flag(1).
*& Include YAPOLOC_FORMS
FORM display_alv .
PERFORM f_fieldcat_build.
PERFORM f_event_build.
PERFORM f_exclude_build.
PERFORM f_print_build.
PERFORM f_layout_build.
PERFORM f_display_data.
ENDFORM. " display_alv
*& Form f_fieldcat_build
text
FORM f_fieldcat_build .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = wk_repid
i_structure_name = 'YPP_RESV'
i_inclname = wk_repid
CHANGING
ct_fieldcat = it_fieldcat_alv.
ENDFORM. " F_FIELDCAT_BUILD
*& Form F_EVENT_BUILD
text
> p1 text* < p2 text
FORM f_event_build .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events.
READ TABLE it_events WITH KEY
name = slis_ev_top_of_page INTO wk_events.
IF sy-subrc = 0.
MOVE c_formname_top_of_page TO wk_events-form.
MODIFY it_events FROM wk_events INDEX sy-tabix.
ENDIF.
ENDFORM. " F_EVENT_BUILD
*& Form F_EXCLUDE_BUILD
text
--> p1 text
<-- p2 text
FORM f_exclude_build .
wk_excluding = '&GRAPH'. "Graphic
APPEND wk_excluding TO it_excluding.
ENDFORM. " F_EXCLUDE_BUILD
*& Form F_PRINT_BUILD
text
--> p1 text
<-- p2 text
FORM f_print_build .
wk_print-no_print_listinfos = 'X'.
ENDFORM. " F_PRINT_BUILD
*& Form F_LAYOUT_BUILD
text
--> p1 text
<-- p2 text
FORM f_layout_build .
wk_layout-zebra = 'X'.
WK_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
wk_layout-detail_popup = 'X'.
wk_layout-detail_initial_lines = 'X'.
wk_layout-detail_titlebar = 'Details '.
ENDFORM. " F_LAYOUT_BUILD
*& Form F_DISPLAY_DATA
text
--> p1 text
<-- p2 text
FORM f_display_data .
wk_callback_ucomm = 'CALLBACK_UCOMM'.
IF sy-ucomm = 'UPD' OR sy-ucomm = space .
wk_callback_status = 'CALLBACK_STATUS'.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_background_id = 'SIWB_WALLPAPER'
i_callback_program = wk_repid
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
i_callback_pf_status_set = wk_callback_status
i_callback_user_command = wk_callback_ucomm
it_sort = it_sort
i_default = 'X'
i_save = 'A'
is_variant = wk_variant
is_layout = wk_layout
it_fieldcat = it_fieldcat_alv
it_events = it_events
it_event_exit = it_event_exit
it_excluding = it_excluding
is_print = wk_print
TABLES
t_outtab = t_res_head_val.
ENDFORM. " F_DISPLAY_DATA
ALV for Error Log
*& Form display_alv_ERR
text
--> p1 text
<-- p2 text
FORM display_alv_err .
PERFORM f_fieldcat_build_err.
PERFORM f_event_build_err.
PERFORM f_exclude_build_err.
PERFORM f_print_build_err.
PERFORM f_layout_build_err.
PERFORM f_display_data_err.
ENDFORM. " display_alv_ERR
*& Form F_FIELDCAT_BUILD_err
text
--> p1 text
<-- p2 text
FORM f_fieldcat_build_err .
BREAK-POINT.
REFRESH it_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = wk_repid
i_internal_tabname = 'TY_ERRLOG'
i_structure_name = 'YPP_ERR_LOG'
i_inclname = wk_repid
CHANGING
ct_fieldcat = it_fieldcat_alv_err.
LOOP AT it_fieldcat_alv INTO wk_fieldcat_alv.
CASE wk_fieldcat_alv-fieldname.
WHEN 'COUNTER'.
wk_fieldcat_alv-seltext_s = text-023.
wk_fieldcat_alv-seltext_m = text-023.
wk_fieldcat_alv-seltext_l = text-023.
wk_fieldcat_alv-reptext_ddic = text-023.
wk_fieldcat_alv-edit = 'X'.
WHEN 'TYPE'.
wk_fieldcat_alv-seltext_s = text-009.
wk_fieldcat_alv-seltext_m = text-009.
wk_fieldcat_alv-seltext_l = text-009.
wk_fieldcat_alv-reptext_ddic = text-009.
wk_fieldcat_alv-edit = 'X'.
WHEN 'NAME'.
wk_fieldcat_alv-seltext_s = text-010.
wk_fieldcat_alv-seltext_m = text-010.
wk_fieldcat_alv-seltext_l = text-010.
wk_fieldcat_alv-reptext_ddic = text-010.
wk_fieldcat_alv-edit = 'X'.
WHEN 'VRSIOID'.
wk_fieldcat_alv-seltext_s = text-011.
wk_fieldcat_alv-seltext_m = text-011.
wk_fieldcat_alv-seltext_l = text-011.
wk_fieldcat_alv-reptext_ddic = text-011.
wk_fieldcat_alv-edit = 'X'.
WHEN 'RESTYPE'.
wk_fieldcat_alv-seltext_s = text-012.
wk_fieldcat_alv-seltext_m = text-012.
wk_fieldcat_alv-seltext_l = text-012.
wk_fieldcat_alv-reptext_ddic = text-012.
wk_fieldcat_alv-edit = 'X'.
WHEN 'MESSAGE'.
wk_fieldcat_alv-seltext_s = text-013.
wk_fieldcat_alv-seltext_m = text-013.
wk_fieldcat_alv-seltext_l = text-013.
wk_fieldcat_alv-reptext_ddic = text-013.
wk_fieldcat_alv-edit = 'X'.
WHEN OTHERS.
ENDCASE.
MODIFY it_fieldcat_alv FROM wk_fieldcat_alv.
ENDLOOP.
ENDFORM. " F_FIELDCAT_BUILD_err
*& Form F_EVENT_BUILD_err
text
--> p1 text
<-- p2 text
FORM f_event_build_err .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events.
READ TABLE it_events WITH KEY name = slis_ev_top_of_page
INTO wk_events.
IF sy-subrc = 0.
MOVE c_formname_top_of_page TO wk_events-form.
MODIFY it_events FROM wk_events INDEX sy-tabix.
ENDIF.
ENDFORM. " F_EVENT_BUILD_err
*& Form F_EXCLUDE_BUILD_err
text
--> p1 text
<-- p2 text
FORM f_exclude_build_err .
wk_excluding = '&GRAPH'. "Graphic
APPEND wk_excluding TO it_excluding.
ENDFORM. " F_EXCLUDE_BUILD_err
*& Form F_PRINT_BUILD_err
text
--> p1 text
<-- p2 text
FORM f_print_build_err .
wk_print-no_print_listinfos = 'X'.
ENDFORM. " F_PRINT_BUILD_err
*& Form F_LAYOUT_BUILD_err
text
--> p1 text
<-- p2 text
FORM f_layout_build_err .
wk_layout-zebra = 'X'.
WK_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
wk_layout-detail_popup = 'X'.
wk_layout-detail_initial_lines = 'X'.
wk_layout-detail_titlebar = 'Details '.
ENDFORM. " F_LAYOUT_BUILD_err
*& Form F_DISPLAY_DATA_err
text
--> p1 text
<-- p2 text
FORM f_display_data_err .
wk_callback_ucomm = 'CALLBACK_UCOMM'.
IF SY-UCOMM ne '&F03'.
wk_callback_status = 'CALLBACK_STATUS'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_background_id = 'SIWB_WALLPAPER'
i_callback_program = wk_repid
i_callback_pf_status_set = wk_callback_status
i_callback_user_command = wk_callback_ucomm
it_sort = it_sort
i_default = 'X'
i_save = 'A'
is_variant = wk_variant
is_layout = wk_layout
it_fieldcat = it_fieldcat_alv_err
it_events = it_events
it_event_exit = it_event_exit
it_excluding = it_excluding
is_print = wk_print
TABLES
t_outtab = t_errlog.
KEEP EERRLOG BUTTON
SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD' IMMEDIATELY.
ENDFORM. "f_display_data_err
**& Form F_TOP_OF_PAGE
text
FORM f_top_of_page.
CLEAR: it_list_comments[],
wk_list_comments,
wk_list1_comments,
wk_list2_comments.
wk_list_comments-typ = 'H'. "H=Header,S=Selection, A=Action
wk_list_comments-key = ''.
CASE sy-ucomm.
WHEN ''.
wk_list_comments-info = text-030.
WHEN 'UPD'.
IF t_errlog[] IS INITIAL.
wk_list_comments-info = text-031.
ELSE.
wk_list_comments-info = text-032.
ENDIF.
WHEN 'ERRLOG'.
wk_list_comments-info = text-032.
WHEN '&F03'.
wk_list_comments-info = text-031.
WHEN '&F15'.
wk_list_comments-info = text-031.
WHEN '&F12'.
wk_list_comments-info = text-031.
ENDCASE.
APPEND wk_list_comments TO it_list_comments.
WRITE sy-datum TO wa_date.
WRITE sy-uzeit TO wa_time.
wk_list_comments-typ = 'S'. "H=Header, S=Selection, A=Action
wk_list_comments-key = ''.
wk_list_comments-info = 'User:'.
wk_list1_comments-info = sy-uname.
CONCATENATE wk_list_comments wk_list1_comments
INTO wk_list2_comments.
APPEND wk_list2_comments TO it_list_comments.
wk_list_comments-typ = 'S'. "H=Header, S=Selection, A=Action
wk_list_comments-key = ''.
wk_list_comments-info = ' Run Date : '.
wk_list1_comments-info = wa_date.
CONCATENATE wk_list_comments wk_list1_comments
INTO wk_list2_comments .
APPEND wk_list2_comments TO it_list_comments.
wk_list_comments-typ = 'S'. "H=Header, S=Selection, A=Action
wk_list_comments-key = ''.
wk_list_comments-info = 'Run Time : '.
wk_list1_comments-info = wa_time.
CONCATENATE wk_list_comments wk_list1_comments
INTO wk_list2_comments .
APPEND wk_list2_comments TO it_list_comments.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
I_LOGO = 'ENJOYSAP_LOGO'
it_list_commentary = it_list_comments.
ENDFORM. "F_TOP_OF_PAGE
FORM USER_COMMAND_SAMPLE *
--> UCOMM *
--> SELFIELD *
FORM callback_ucomm USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
DATA: v_langu(2) ,
v_loctype TYPE /sapapo/c_loctype.
data err_flg(1).
IF bapi_run_yes_no IS INITIAL.
CASE sy-ucomm.
WHEN 'UPD'.
bapi_run_yes_no = 'X'.
LOOP AT t_res_head_val WHERE val_err_msg EQ space.
v_langu = 'EN'.
refresh tables
REFRESH : resource_head ,
resource_head_x ,
resource_text ,
resource_text_x,
t_return.
CLEAR : resource_head ,
resource_head_x ,
resource_text ,
resource_text_x,
t_return .
resource_head-resource = t_res_head-name .
resource_head-restype = t_res_head-restype.
resource_head-location = t_res_head-locno.
CLEAR : v_loctype .
SELECT SINGLE loctype FROM /sapapo/loc CLIENT SPECIFIED
INTO v_loctype
WHERE mandt = sy-mandt
AND locno = t_res_head-locno.
resource_head-loctype = v_loctype.
resource_head-calendar = t_res_head-calendar.
resource_head-type = t_res_head-type.
IF t_res_head-type = '03'.
resource_head-dimension_bucket = t_res_head-dimension_bucket.
ELSE.
resource_head-dimension_bucket = space.
ENDIF.
APPEND resource_head.
CLEAR resource_head.
resource_head_x-resource = t_res_head-name.
resource_head_x-restype = 'X'.
resource_head_x-location = 'X'.
resource_head_x-loctype = 'X'.
resource_head_x-calendar = 'X'.
resource_head_x-type = 'X'.
IF t_res_head-type = '03'.
resource_head_x-dimension_bucket = 'X'.
ELSE.
resource_head_x-dimension_bucket = space.
ENDIF.
APPEND resource_head_x.
CLEAR resource_head_x.
resource_text-resource = t_res_head-name.
resource_text-langu = v_langu.
resource_text-res_short_text = t_res_head-text.
APPEND resource_text.
CLEAR resource_text.
resource_text_x-resource = t_res_head-name.
resource_text_x-langu = v_langu.
resource_text_x-res_short_text = 'X'.
APPEND resource_text_x.
CLEAR resource_text_x.
call bapi
CALL FUNCTION 'BAPI_RSSRVAPS_SAVEMULTI_30A'
EXPORTING
logical_system = 'AD2CLNT200'
business_system_group = 'BSG001'
commit_control = 'E'
NO_CREATE = ' '
TABLES
resource_head = resource_head
resource_head_x = resource_head_x
resource_text = resource_text
resource_text_x = resource_text_x
return = t_return.
IF sy-subrc = 0.
LOOP AT t_return WHERE type = 'E'
OR type = 'A'.
MOVE t_res_head_val-counter TO t_errlog-counter.
MOVE t_res_head_val-type TO t_errlog-type.
MOVE t_res_head_val-name TO t_errlog-name.
MOVE t_res_head_val-vrsioid TO t_errlog-vrsioid.
MOVE t_res_head_val-restype TO t_errlog-restype.
MOVE t_return-message TO t_errlog-message.
APPEND t_errlog.
CLEAR t_errlog..
ENDLOOP.
IF not t_errlog[] is initial..
IF sy-subrc = 0.
ERROR POP UP
MESSAGE text-007 type 'I'.
ELSE.
err_flg = 'X'.
SUCC POP UP
MESSAGE text-008 type 'I'.
ENDIF.
ELSE. "NE 0
LOOP AT t_return WHERE type = 'E'
OR type = 'A'.
MOVE t_res_head_val-counter TO t_errlog-counter.
MOVE t_res_head_val-type TO t_errlog-type.
MOVE t_res_head_val-name TO t_errlog-name.
MOVE t_res_head_val-vrsioid TO t_errlog-vrsioid.
MOVE t_res_head_val-restype TO t_errlog-restype.
MOVE t_return-message TO t_errlog-message.
APPEND t_errlog.
CLEAR t_errlog..
ENDLOOP.
IF sy-subrc = 0.
ELSE.
MOVE t_res_head_val-counter TO t_errlog-counter.
MOVE t_res_head_val-type TO t_errlog-type.
MOVE t_res_head_val-name TO t_errlog-name.
MOVE t_res_head_val-vrsioid TO t_errlog-vrsioid.
MOVE t_res_head_val-restype TO t_errlog-restype.
MOVE 'Error in Creation' TO t_errlog-message.
APPEND t_errlog.
CLEAR t_errlog..
ENDIF.
ENDIF.
ENDLOOP.
gc_flag = 'X'.
REFRESH fcode.
if err_flg = 'X'.
MESSAGE text-008 type 'I'.
endif.
ENDCASE.
ENDIF.
IF NOT t_errlog[] IS INITIAL.
wk_list_comments-info = text-032.
APPEND wk_list_comments TO it_list_comments.
APPEND 'UPD' TO fcode_error.
APPEND 'ERRLOG' TO fcode_error.
SET PF-STATUS 'ZSTANDARD' EXCLUDING fcode_error.
PERFORM display_alv_err.
ELSE.
ENDIF.
ENDFORM. "CALLBACK_UCOMM=
*& Form CALLBACK_STATUS
text
-->RT_EXTAB text
FORM callback_status USING rt_extab TYPE slis_t_extab.
IF bapi_run_yes_no IS NOT INITIAL .
IF t_errlog[] IS INITIAL.
REFRESH fcode.
APPEND 'UPD' TO fcode.
APPEND 'ERRLOG' TO fcode.
SET PF-STATUS 'ZSTANDARD' EXCLUDING 'ERRLOG'.
SET PF-STATUS 'ZSTANDARD' EXCLUDING fcode IMMEDIATELY .
ENDIF.
ELSE.
SET PF-STATUS 'ZSTANDARD' EXCLUDING 'ERRLOG' IMMEDIATELY .
ENDIF.
ENDFORM. "CALLBACK_STATUS
*& Form CALLBACK_STATUS1
text
-->RT_EXTAB text
FORM callback_status1 USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD'.
ENDFORM. " CALLBACK_STATUS
*& Form CALLBACK_STATUS2
text
-->RT_EXTAB text
FORM callback_status2 USING rt_extab TYPE slis_t_extab.
REFRESH fcode_final.
IF sy-ucomm NE '&F03'.
APPEND 'UPD' TO fcode_final.
APPEND 'ERRLOG' TO fcode_final.
SET PF-STATUS 'ZSTANDARD' EXCLUDING fcode_final.
ELSE.
SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD'.
ENDIF.
ENDFORM. "CALLBACK_STATUS2
*& Form callback_ucomm_E
text
-->UCOMM text
-->SELFIELD text
FORM callback_ucomm_e USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
CASE sy-ucomm.
WHEN 'ERRLOG' .
PERFORM display_alv_err.
WHEN '&F03'.
SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD' IMMEDIATELY .
PERFORM display_alv .
ENDCASE.
ENDFORM. "CALLBACK_UCOMM=
*& Form init_variant
text
--> p1 text
<-- p2 text
FORM init_variant .
CLEAR: wk_variant.
wk_repid = sy-repid.
wk_variant-report = wk_repid.
wk_variant-username = sy-uname.
wk_variant_save = 'A'. "All types
ENDFORM. " init_variant
*& Form f_read_datum1
text
-->P_T_RES_HEAD text
-->P_P_FILE1 text
<--P_W_SUBRC text
FORM f_read_datum1 TABLES p_t_res_head STRUCTURE ypp_res_head
USING p_p_file1
CHANGING p_w_subrc.
DATA : iexcel LIKE zexcel_read OCCURS 0 WITH HEADER LINE.
CLEAR p_w_subrc.
CALL FUNCTION 'ZALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_p_file1
i_begin_col = 1
i_begin_row = 1
i_end_col = 62
i_end_row = 50000
TABLES
intern = iexcel
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
p_w_subrc = 0 .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT iexcel WHERE row > 2.
IF iexcel-col = '0001'.
p_t_res_head-type = iexcel-value.
ENDIF.
IF iexcel-col = '0002'.
p_t_res_head-name = iexcel-value.
ENDIF.
IF iexcel-col = '0003'.
p_t_res_head-vrsioid = iexcel-value.
ENDIF.
IF iexcel-col = '0004'.
p_t_res_head-restype = iexcel-value.
ENDIF.
IF iexcel-col = '0005'.
p_t_res_head-locno = iexcel-value.
ENDIF.
IF iexcel-col = '0006'.
p_t_res_head-tzone = iexcel-value.
ENDIF.
IF iexcel-col = '0007'.
p_t_res_head-calendar = iexcel-value.
ENDIF.
IF iexcel-col = '0008'.
p_t_res_head-planner = iexcel-value.
ENDIF.
IF iexcel-col = '0009'.
p_t_res_h -
XL reporter error-requried COM add-in program for XL reporter has not ben l
Dear All,
I am getting this error could anyone please let me know the solution:
"A requried COM add-in program for XL reporter has not been Loded and prohibuit Microsoft Excel from running.Hi,
try to use the solution from the SAP note 893307:
XLR - Activation of Other Microsoft Excel Add-Ins
Symptom
When Microsoft Excel is launched from within the XL Reporter application, other add-ins selected in Microsoft Excel's Add-Ins window are not automatically loaded into Microsoft Excel upon start.
Other terms
XLR, Business One, Addins, deactivated
Reason and Prerequisites
When Microsoft Excel is started through Automation (COM), Add-ins are not loaded by default. This is by design and XL Reporter follows this behaviour.
The following is a workaround solution that is avalible in SAP Add-On XL Reporter 2004 SP02 patch 2 and SAP Add-On XL Reporter 2005 SP00 patch 1 and subsequent releases.
Solution
If you need to have other add-ins automatically loaded upon start, a workaround solution is now possible:
In the Microsoft Registry Editor on your client machine, change the following settings in your system registry: in the registry tree underHKEY_CURRENT_USER/Software/iLytix/XLReporter/Settings/SBOOEM, add a key with the following name: StartExcelAddins. The key can have two values: the value, 1, which activates other add-ins upon start, and the default value, 0, which leaves the other add-ins inactivated.
Incorrectly editing the registry may damage your system. System registry changes should therefore only be performed by an advanced user who is prepared to both edit and restore the registry. For details about the system registry, please refer to Microsoft Registry Editors help system
if not solve yet, just let me know
JimM -
How to create 2 transaction codes for same report program with diff title
Hi All -
I have created report program and create 2 transaction codes with different short description. I want to display the Tcodes decriptions instead of program attributes title.
Can anyone pls tell me how to do this?
Thanks,
KannanHi Kannan,
define 2 titlebars t1 and t2 for the report. In report initialization,
IF sy-tcode = 't1'
SET TITLE t1.
ELSE.
SET TITLE t2.
ENDIF.
Regards,
Clemens -
Creating structure for FIAR_C03 cube reports.
Hi,
I want to create structure for report in 0FIAR_C03 cube. of which requirement is as follows.
- Analysis of how old AR items are in days (key date for reporting minus the net due date),
- what the balance of the open items are (USD and local currency),
- Reporting by the country of the end customer,
- GL restriction. We only want AR trade items, not intercompany.
- Drilldown to FI document number and line number.hi,
did u chk the standard bi content queries..chk the below link..
http://help.sap.com/saphelp_nw2004s/helpdata/en/d6/dbec8914ec6c4686cd9d078093c930/frameset.htm
hope it helps... -
Standard driver programs,output type ,scripts,smartforms for SD reports
hi experts,
Can any one list all the standard driver programs,output types ,scripts,smartforms for SD reports.
maniHi,
Check this out
NACE
You can track the form and the print program used for that form
The Tcode NACE is used to link the Standard SAP forms (SCRIPTFORM or SMARTFORM) or the customized form or the new form to its respective print programs. Also the output types, Form entry are linked with their forms and print programs. In short term, i can tell u that configuration or customization of forms to print programs, assigning output types, form entry to the forms are done using this Tcode.
NACE is used to create output type while creating the output type you will mention forms, and driver program.
that will be maintained in the table TNAPR.if you create the output type using NACE then it will be automatically visible in table NAST and TNAPR.
so check in NAST, TNAPR table
http://help.sap.com/saphelp_erp2005/helpdata/en/c8/1989fe43b111d1896f0000e8322d00/frameset.htm
Condition records in NACE?
and
NACE is used for message control customizing.
Take a look at the following link
http://help.sap.com/saphelp_nw04/helpdata/en/c8/198a1843b111d1896f0000e8322d00/frameset.htm
and also
NACE is used for message control customizing.
Take a look at the following link
http://help.sap.com/saphelp_nw04/helpdata/en/c8/198a1843b111d1896f0000e8322d00/frameset.htm
If it helps reward with points.. -
How to find abap program name for web ui reports
Hi,
I need to know the abap program name which is developed and configured for
web ui.In our project web ui application crm version 7.0.there reports links are available
with label of business names.
I assume that there will be SPRO configuration for these reports.
Can anyone provide assistant on this to me.
Regards
VirenHi,
Which reports you are referring to? Are you referring to BI reports? If so then i suppose they are triggerred in BI and transferred to CRM.
Regards,
BJ -
Fetch Report Program names for a given Package
Hi,
I need to fetch all the report program names for a given pakage. I tired TADIR table but couldnt fetch report details alone..
thanks,
sri
Moderator message: very basic, please do more own research before asking, e.g. look at a few TADIR entries of different object types, also discover the repository information system.
Edited by: Thomas Zloch on Feb 23, 2011 2:56 PMDan is right to be cautious, i've seen this cause problems.
It's not very difficult to make the chnages in BCS, and if you have a lot of them/frequent changes, you can always use create an upload method
and then make all future changes by .txt file -
"Snapshot too old" for a report program
We get "ORA-1555 error: snapshot too old" for a report job, NOT an update job.
We can add rollback segments to the DB.
Why we cannot increase the commit frequency to fix this issue?
Thanks!> 1. create a big rollback segment. search the web for keyword PSAPROLLBIG.
> 2. convert to PSAPUNDO, as started by others, check SAP note 600141.
> 3. analyze the program and if it is a Z program, ask your program to add more commits in his program.
HI all,
of course Stefan and Eric have already given the right hints here.
But the main point here is not the configuration of the UNDO management.
I know that this kind of problems bears a big mental hurdle in it, which is also difficult to jump over for many supporters.
The notion of Undo/Rollback data beeing used mainly for ROLLBACK actions is unfortunately totally wrong.
The primary and main usage of this data is to deliver the consistent view (as already explained in this thread).
So the single big question here is: why does a single statement of your report needs to visit so many pages from a certain point in time?
In the wast majority of cases this is because the statement is badly tuned.
Maybe there is no appropriate index available.
Or it's just written badly, so that unnecessary data must be read by Oracle.
Maybe the CBO does something wrong which must be checked.
Maybe the data is scattered over too many blocks and clustering them together somehow could help
The core point here is: figure out what causes the statement to touch so many pages and fix that.
Then you are most likely to come over this problem.
All other recommendations, especially the move to automatic undo management: full ack.
But the solution to your problem is to fix your statement.
regards,
Lars -
Required COM add-in program for XL Reporter
Hi everyone,
Is SBO 2007A XL Reporter compatible with MS-EXCEL 2007? How can I configure the settings if the system would prompt a message "A required COM add-in program for XL Reporter has not been loaded and prohibits MS -Excel from running"
Thanks in advance...
MaluHi,
SOLUTION FOR THE PROBLEM:
Reason and Prerequisites
You need to be an administrator on the local machine to add COM add-ins.
Solution
The user should be added as a member of the administrator role on the
local computer the first time you start Excel from XL Reporter the first
time so that the COM addin are registered, then you can remove the user
from the administrator group again.
Manually Loading the XL Reporter Excel COM Add-In
Symptom
If you install Microsoft Office after installing the XL Reporter
application or use another Windows user than the one you used when
installing XL Reporter, you can get an error message.
Reason and Prerequisites
The reason for this is that the report writer COM Add-in has not been
loaded, which prohibits Microsoft Excel from running.
Solution
1. Start Microsoft Excel. If you already have the COM Add-ins command on
the Tools menu, go to step 7.
2. In the Tools menu, choose Customize.
This opens the Customize window.
3. Choose the Commands tab and select Tools from the Categories pane on
the left.
4. In the Command pane on the right, scroll down to the COM Add-ins
command.
5. Select the COM Add-ins command, hold down the mouse button, and drag
COM Add-ins from the Commands pane over to the Tools menu on the Microsoft
Excel men bar. When the Tools menu commands appear, point to where you
want the COM Add-ins command to appear on the menu and release the mouse
button.
6. To close the Customize window, choose Close.
7. On the Tools menu, choose the new COM Add-ins option.
This opens the COM Add-ins window.
8. In the window, choose Add to open the Add Add-in window.
9.Select the IXXLReporter.dll file located in the Client directory in the
XL Reporter program installation area and choose OK.
10. In the COM Add-ins window, select the XL Reporter checkbox and choose
OK.
Note: This is only a link from SAP Business One Reporting and Printing Forum. Cant paste the forum no.
Regards,
Clint -
A Required COM Add-in program for XL Reporter has not been loaded and prohibits Microsoft Excel from running. For more information, click help.
XL 2007, with the Trust level for macros set to minimum. SBO 2007 PL 42.
Thanks
CharlesRead the following solution from SAP for your problem:
When we open XL Reporter we get an error
message "A required COM add-in program for XL Reporter has not been loaded
and prohibits Microsoft Excel from running." when trying to open a report
definition.
SOLUTION FOR THE PROBLEM:
Reason and Prerequisites
You need to be an administrator on the local machine to add COM add-ins.
Solution
The user should be added as a member of the administrator role on the
local computer the first time you start Excel from XL Reporter the first
time so that the COM addin are registered, then you can remove the user
from the administrator group again.
Manually Loading the XL Reporter Excel COM Add-In
Symptom
If you install Microsoft Office after installing the XL Reporter
application or use another Windows user than the one you used when
installing XL Reporter, you can get an error message.
Reason and Prerequisites
The reason for this is that the report writer COM Add-in has not been
loaded, which prohibits Microsoft Excel from running.
Solution
1. Start Microsoft Excel. If you already have the COM Add-ins command on
the Tools menu, go to step 7.
2. In the Tools menu, choose Customize.
This opens the Customize window.
3. Choose the Commands tab and select Tools from the Categories pane on
the left.
4. In the Command pane on the right, scroll down to the COM Add-ins
command.
5. Select the COM Add-ins command, hold down the mouse button, and drag
COM Add-ins from the Commands pane over to the Tools menu on the Microsoft
Excel men bar. When the Tools menu commands appear, point to where you
want the COM Add-ins command to appear on the menu and release the mouse
button.
6. To close the Customize window, choose Close.
7. On the Tools menu, choose the new COM Add-ins option.
This opens the COM Add-ins window.
8. In the window, choose Add to open the Add Add-in window.
9.Select the IXXLReporter.dll file located in the Client directory in the
XL Reporter program installation area and choose OK.
10. In the COM Add-ins window, select the XL Reporter checkbox and choose
OK.
Maybe you are looking for
-
Problem in web cache cluster in 10.1.2.3
Hi, I'm using webcache clustering in Oracle AS 10.1.2. and there are 3 cluster members. But all the requests are getting routed through cluster member 1. When i'm bringing down services(HTTP, webcache,webcache admin) of member1 i'm unable yto access
-
Retreiving Customer Payment Information in the AR
When posting a customer's payment to our open invoice , we enter the customer's check number in the Reference Line of F-28. How can I later pull up that Invoice and see that Reference Field so I can see the check number? Thanks - Points will be awar
-
Soundbooth CS3 do not support all formats the other applications does (AfterFX/Prem)
I'm kinda stuck because when I use the function "Edit in Adobe Soundbooth" the sound file will open with right time codes I need in soundbooth. But I get the error message: Open File Failure, file format not supported. AfterFX & Premiere have no prob
-
Java Virtual Machine error?
Hi to all! I made one application in which i can choose stuffs for printing, and maximum number of that stuffs is 15. Problem is that when I click on the button for adding stuffs all Forms have just closed and I got only log file with error. But some
-
Hi, how can set a background image in an uix page ? thank for help Andrea