Performance After Using Call Function
Hi All,
I have a program, where it is having some performance issues.
It is taking a lot of time at a customized Z Call Function.
Please suggest some solutions.
Hi,
Firstly check if the Z Function module is remote enables or not...
if it is remote enabled then it will take some time....
then debug the function module and check which statement is hitting on performance, try to find out the other way round for that statement or if its a long loop then try to find out some optimized way for that loop...
still if you are not able to then paste the code of the z function module may be we are of some help there
Regards,
Siddarth
Similar Messages
-
How can I execute program after using F4_Filename function?
Hi all,
I'm a new user on the forum. I've been working with ABAP and SAP for a few weeks. I wrote a program for importing data from excel file to SAP using BDC. During searching this forum I found information about F4_Filename function which allows users to browse the disc for a file. I'd like to add this function to my program. I have a parameter for a file name but this is an ordinary static string field. When I added the code which I found in the message on this forum the rest of program doesn't execute.
This is simple program for example:
REPORT Z_TEST8_AB.
DATA f_name TYPE STRING.
PARAMETERS p_file like rlgrap-filename DEFAULT 'c:\test.xls'.
f_name = p_file.
write:/ f_name.
This program works correctly. There is a field for parameter. I can change the default name for a file.
After all, I can run the program (F8) and rest of the code is executed. The field for parameter dissapears from the screen and the file name is displayed. ( command write)
Now I added a function F4_Filename
REPORT Z_TEST8_AB.
DATA f_name TYPE STRING.
PARAMETERS p_file like rlgrap-filename DEFAULT 'c:\test.xls'.
at selection-screen on value-request for p_file.
call function 'F4_FILENAME'
exporting
program_name = syst-repid
dynpro_number = syst-dynnr
field_name = 'p_file'
importing
file_name = p_file.
f_name = p_file.
write:/ f_name.
I can browse a computer for a file now but after selecting the file I can't run the rest of the code. When I click on the icon or press key F8 the field for parameter doesn't dissapier and the command write is not executed.
What do I do wrong?
Could anyone suggest me a solution? How can I executed the code after using this function?
Thanks in advance.
Regards,
Arek.Hi arkadiusz,
1. simple
2.
<b>start-of-selection.</b>
f_name = p_file.
write:/ f_name.
regards,
amit m. -
Modify toolbar for alv using CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
Hi Experts,
I am using CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC' inside an exit.
I need to modify the tolbar with just three options :-
a- add new row
b- delete rows
c- save data
Please guide me step by step as how to proceed as I am very new to ALV.
and after applying your solution to show the toolbar what should I do to Make these buttons working.
Thanks a lot for your replies in advance.
regards,
UditI'm not really sure why you would use an ALV grid display in a user exit. I'm not sure how that works. Another point is that the ALV object is really easier to use once you get used to it.
However:
Usually you would create a GUI status, and just add your buttons to it. Then when the function module is called specify the gui status, and user command.
For example
v_repid = sy-repid.
w_user_command = 'USER_COMMAND'
w_set_status = "Status you define below.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_bypassing_buffer = 'X'
i_callback_program = w_repid
i_callback_pf_status_set = w_set_status
i_callback_user_command = w_user_command
is_layout = w_layout
i_structure_name = 'ZGOODSMOVE'
tables
t_outtab = gt_outtab
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message e000 with 'Error in Displaying the Output Report'(025).
endif.
Put your code for the different functions into one user function module
form user_command using r_comm like sy-ucomm
rs_selfield type slis_selfield.
read table it_final1 index rs_selfield-tabindex. " This will give you back the row you selected
if sy-subrc = 0.
endif.
endform.
To define the GUI Status:
Copy the status from
Then change it to add your fields -
Is It Possible to use Call Function in update task in perform on commit
Hi Friends,
I have to send an email once the commit work is done. so i am writing code like this,
Perform send_email on commit.
form send_email.
call function 'SO_NEW_DOCUMENT_SEND_API1' in update task
endform.
endform.
.... ( Some other code)
commit work.
But, I am getting error saying Update task is not possible. Please suggest me how to solve this.
Thanks in Advance,
Phani.Hi Phani,
Check whether <b>COMMIT Work</b> has be performed. I think this might be the problem.
Regards,
Prashanth -
How to use CALL FUNCTION '/1BCDWB/SF00000014' in smartform urgent
hiiiiiiiii
Iam doing classical report n i want my output to be printed in smartform.
So my output is in IT_FINAL table.In smartform in Form Interface Table column i had declare :::
Parameter Name: IT_FINAL
Type Assignment:LIKE
Associated Type:ZSD_FINAL ( Its a structure of IT_FINAL)
And in SE38..iam using...............
data: FM_NAME1 type RS38L_FNAM.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZCSF_SDPRSR03_PR'
importing
FM_NAME = FM_NAME1.
CALL FUNCTION FM_NAME1
EXPORTING
IT_FINAL = IT_FINAL.
So while running its giving dump..
I DONT KNOW HOW TO USE THE ABOVE FUNCTION MODULE.
CALL FUNCTION '/1BCDWB/SF00000014'
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 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.
Please suggest me with example if possible......URGENT.
(Rewards if solved)
Regards.Hi
see the below doc and do accordingly
How to create a New smartfrom, it is having step by step procedure
http://sap.niraj.tripod.com/id67.html
step by step good ex link is....
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
Here is the procedure
1. Create a new smartforms
Transaction code SMARTFORMS
Create new smartforms call ZSMART
2. Define looping process for internal table
Pages and windows
First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
Here, you can specify your title and page numbering
&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
Main windows -> TABLE -> DATA
In the Loop section, tick Internal table and fill in
ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
3. Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
4. To display the data in the form
Make used of the Table Painter and declare the Line Type in Tabstrips Table
e.g. HD_GEN for printing header details,
IT_GEN for printing data details.
You have to specify the Line Type in your Text elements in the Tabstrips Output options.
Tick the New Line and specify the Line Type for outputting the data.
Declare your output fields in Text elements
Tabstrips - Output Options
For different fonts use this Style : IDWTCERTSTYLE
For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
5. Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
http://sapr3.tripod.com
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
<b>call function 'SSF_FUNCTION_MODULE_NAME'</b>
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
<b>call function FM_NAME</b>
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 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.
Smartform
you can check this link here you can see the steps and you can do it the same by looking at it..
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
SMARTFORMS STEPS.
1. In Tcode se11 Create a structure(struct) same like the Internal table that you are going to use in your report.
2. Create Table type(t_struct) of stracture in se11.
3. In your program declare Internal table(Itab) type table of structure(struct).
4. Define work area(wa) like line of internal table.
5. Open Tcode Smartforms
6. In form Global setting , forminterface Import parameter define Internal table(Itab) like table type of stracture(t_struct).
7. In form Global setting , Global definitions , in Global data define Work area(wa) like type stracture(struct).
8. In form pages and window, create Page node by default Page1 is available.
9. In page node you can create numbers of secondary window. But in form there is only one Main window.
10. By right click on page you can create windows or Go to Edit, Node, Create.
11. After creating the window right click on window create table for displaying the data that you are passing through internal table.
12. In the table Data parameter, loop internal internal table (Itab) into work area(wa).
13. In table there are three areas Header, Main Area, Footer.
14. Right click on the Main area create table line by default line type1 is there select it.
15. Divide line into cells according to your need then for each cell create Text node.
16. In text node general attribute. Write down fields of your work area(wa) or write any thing you want to display.
17. Save form and activate it.
18. Then go to Environment, function module name, there you get the name of function module copy it.
19. In your program call the function module that you have copied from your form.
20. In your program in exporting parameter of function pass the internal table(itab).
SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.
SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can
configure forms with data from an SAP System for the relevant business processes.
To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
SAP Smart Forms also support postage optimizing.
Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
What Transaction to start SAP Smart Forms?
Execute transaction SMARTFORMS to start SAP Smart Forms.
Key Benefits of SAP Smart Forms:
SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time.
You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
These actions do not include writing of coding lines or using a Script language.
Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one.
For Web publishing, the system provides a generated XML output of the processed form.
Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
SmartForms System Fields
Within a form you can use the field string SFSY with its system fields. During form processing the system replaces these fields with the corresponding values. The field values come from the SAP System or are results of the processing.
System fields of Smart Forms
&SFSY-DATE&
Displays the date. You determine the display format in the user master record.
&SFSY-TIME&
Displays the time of day in the form HH:MM:SS.
&SFSY-PAGE&
Inserts the number of the current print page into the text. You determine the format of the page number (for example, Arabic, numeric) in the page node.
&SFSY-FORMPAGES&
Displays the total number of pages for the currently processed form. This allows you to include texts such as'Page x of y' into your output.
&SFSY-JOBPAGES&
Contains the total page number of all forms in the currently processed print request.
&SFSY-WINDOWNAME&
Contains the name of the current window (string in the Window field)
&SFSY-PAGENAME&
Contains the name of the current page (string in the Page field)
&SFSY-PAGEBREAK&
Is set to 'X' after a page break (either automatic [Page 7] or command-controlled [Page 46])
&SFSY-MAINEND&
Is set as soon as processing of the main window on the current page ends
&SFSY-EXCEPTION&
Contains the name of the raised exception. You must trigger your own exceptions, which you defined in the form interface, using the user_exception macro (syntax: user_exception <exception name >).
Example Forms Available in Standard SAP R/3
SF_EXAMPLE_01
Simple example; invoice with table output of flight booking for one customer
SF_EXAMPLE_02
Similar to SF_EXAMPLE_01 but with subtotals
SF_EXAMPLE_03
Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the form is called for each customer and all form outputs are included in an output request
Advantages of SAP Smart Forms
SAP Smart Forms have the following advantages:
1. The adaption of forms is supported to a large extent by graphic tools for layout and logic, so that no programming knowledge is necessary (at least 90% of all adjustments). Therefore, power user forms can also make configurations for your business processes with data from an SAP system. Consultants are only required in special cases.
2. Displaying table structures (dynamic framing of texts)
3. Output of background graphics, for form design in particular the use of templates which were scanned.
4. Colored output of texts
5. User-friendly and integrated Form Painter for the graphical design of forms
6. Graphical Table Painter for drawing tables
7. Reusing Font and paragraph formats in forms (Smart Styles)
8. Data interface in XML format (XML for Smart Forms, in short XSF)
9. Form translation is supported by standard translation tools
10. Flexible reuse of text modules
11. HTML output of forms (Basis release 6.10)
12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-Release 6.10)
Regards
Anji -
Displaying table using call function 'REUSE_ALV_GRID_DISPLAY'
I have created a table which has product code, product description, and product level. I am trying to display it using REUSE_ALV_GRID_DISPLAY. When I Check it, I get the following error message: "PVS2" is not an internal table - the "Occurs n" specification is missing.
Is it possible to copy PVS2 into another table, and then display that table using REUSE_ALV_GRID_DISPLAY?
I have patched together code from sdn, a client program, and my own code and I am starting to get confused. So, please help me.
Regards,
Al Lal
REPORT YABHINAV16.
* program to display products at chosen level *
Tables: T179, T179t.
types: begin of hierarchy,
prodh type t179-prodh,
vtext type t179t-vtext,
stufe type t179-stufe,
end of hierarchy.
types: begin of text,
prodh type t179t-prodh,
vtext type t179t-vtext,
end of text.
data: pvs type standard table of hierarchy initial size 0.
data: pvs2 type hierarchy.
data: it_text type standard table of text,
wa_text type text.
TYPE-POOLS:SLIS.
*For ALV
DATA: GT_FLD TYPE SLIS_T_FIELDCAT_ALV,
GT_EV TYPE SLIS_T_EVENT,
GT_HDR TYPE SLIS_T_LISTHEADER,
GT_SORT TYPE SLIS_T_SORTINFO_ALV.
DATA: WA_FLD TYPE SLIS_FIELDCAT_ALV,
WA_EV TYPE SLIS_ALV_EVENT,
WA_HDR TYPE SLIS_LISTHEADER,
WA_SORT TYPE SLIS_SORTINFO_ALV,
WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
DEFINE FLD.
WA_FLD-FIELDNAME = &1.
WA_FLD-TABNAME = &2.
WA_FLD-OUTPUTLEN = &3.
WA_FLD-SELTEXT_L = &4.
WA_FLD-SELTEXT_M = &5.
WA_FLD-SELTEXT_S = &6.
WA_FLD-COL_POS = &7.
WA_FLD-FIX_COLUMN = &8.
WA_FLD-DO_SUM = &9.
APPEND WA_FLD TO GT_FLD.
CLEAR WA_FLD.
END-OF-DEFINITION.
CONSTANTS: C_TOP TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
C_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
DATA: MTRL LIKE SY-REPID,
TITLE LIKE SY-TITLE.
select-options level for t179-stufe no intervals.
start-of-selection.
Select prodh stufe from T179 into corresponding fields of table pvs where stufe in level.
select prodh vtext from t179t into corresponding fields of table it_text for all entries in pvs where prodh = pvs-prodh.
end-of-selection.
sort pvs by prodh.
sort it_text by prodh.
loop at pvs into pvs2.
read table it_text into wa_text with key prodh = pvs2-prodh.
if sy-subrc eq 0.
pvs2-vtext = wa_text-vtext.
write: / pvs2-prodh, pvs2-vtext, pvs2-stufe.
endif.
* modify pvs2.
endloop.
perform BUILD_FIELDCAT.
perform GRID_DISPLAY.
form BUILD_FIELDCAT .
FLD 'PRODH' 'PVS2' '20' 'Product Hierarchy' ' ' ' ' '1' '' '' .
FLD 'VTEXT' 'PVS2' '40' 'Description ' ' ' ' ' '3' '' '' .
FLD 'STUFE' 'PVS2' '5' 'Level' ' ' ' ' '2' '' '' .
endform. " BUILD_FIELDCAT
form GRID_DISPLAY .
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = MTRL
I_CALLBACK_USER_COMMAND = 'C_USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = C_TOP
I_STRUCTURE_NAME = 'PVS2'
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = GT_FLD
IT_SORT = GT_SORT
I_DEFAULT = 'X'
I_SAVE = 'U'
IT_EVENTS = GT_EV
TABLES
T_OUTTAB = PVS2[]
EXCEPTIONS
PROGRAM_ERROR = 1
others = 2.
if SY-SUBRC <> 0.
message id SY-MSGID type SY-MSGTY number SY-MSGNO
with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " GRID_DISPLAYTYPE-POOLS : SLIS.
DATA : BEGIN OF WA_T001,
BUKRS LIKE T001-BUKRS,
BUTXT LIKE T001-BUTXT,
ORT01 LIKE T001-ORT01,
END OF WA_T001,
IT_T001 LIKE TABLE OF WA_T001.
DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT LIKE LINE OF IT_FCAT.
DATA : V_NAME LIKE SY-REPID.
SELECT BUKRS BUTXT ORT01 FROM T001 INTO TABLE IT_T001 UP TO 15 ROWS. V_NAME = SY-REPID.
CALL FUCTION MODULE 'REUSE_ALV_FIELDCATLOG_MERGE. EXPORTING I_CALBACK_PROGRAM =
V_NAME I_INTERAL_TABNAME = 'WA_T001' I_INCLNAME = V_NAME CHANGING CT_FIELDCAT =
IT_FCAT.
CALL FUNCTION MODULE "REUSE_ALV_GRID_DISPLAY"
EXPORTING
I_CALLBACK_PROGRAM = V_NAME
IT_FCAT = IT_FCAT.
TABLES
T_OUTTAB = IT_T001
SY-REPID IS THE SYSTEM VARIABLE WHICH IS HAVING THE ABAP PROGRAM
OR CURRENT MAIN PROGRAM.
----- Sample Progam -
***INCLUDE YRVR058_DEST_WISE_SUMMARY_DF01 .
*& Form DISPLAY_DATA
text *-- Rajesh Vasudeva
--> p1 text
<-- p2 text
FORM DISPLAY_DATA .
IF ITAB[] IS NOT INITIAL.
PERFORM F_APPEND_BLOCK.
ELSE.
MESSAGE 'Data not found for the selection
criteria' TYPE 'S'.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " display_data
*& Form f_append_block
text
--> p1 text
<-- p2 text
FORM F_APPEND_BLOCK .
DATA : L_WA_SORT TYPE SLIS_SORTINFO_ALV, "For
sort
L_WA_EVENTS TYPE SLIS_ALV_EVENT. "For
events
Event (Top of List)
CLEAR L_WA_EVENTS.
L_WA_EVENTS-NAME = SLIS_EV_TOP_OF_LIST.
L_WA_EVENTS-FORM = C_TOPOFPAGE.
APPEND L_WA_EVENTS TO I_EVENTS_PART.
Event (Top of Page)
CLEAR L_WA_EVENTS.
L_WA_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
L_WA_EVENTS-FORM = 'F_DISPLAY_HEADER_PARTA'(031).
"f_display_header_part
APPEND L_WA_EVENTS TO I_EVENTS_PART.
Event (End of List)
CLEAR L_WA_EVENTS.
L_WA_EVENTS-NAME = SLIS_EV_END_OF_LIST.
L_WA_EVENTS-FORM = C_END_OF_LIST.
APPEND L_WA_EVENTS TO I_EVENTS_PART.
Set Layout Zebra
STRUCT_LAYOUT-ZEBRA = 'X'.
STRUCT_LAYOUT-NUMC_SUM = 'X'.
STRUCT_LAYOUT-TOTALS_TEXT = 'TOTAL:'(032).
set field catalog
PERFORM F_FIELD_CATALOG_PART.
ASSIGN ITAB[] TO <F_OUTTAB>.
V_PART = 'A'. "initiating list is A
PERFORM F_DISPLAY_BLOCK USING STRUCT_LAYOUT
I_FIELD_CAT_PART[]
C_TAB
I_EVENTS_PART[]
I_SORT_PART[].
ENDFORM. " f_append_block
*& Form f_field_catalog_part
text
--> p1 text
<-- p2 text
FORM F_FIELD_CATALOG_PART .
REFRESH I_FIELD_CAT_PART.
CLEAR I_FIELD_CAT_PART.
PERFORM F_CREATE_CATALOG USING :
*Month
C_TAB 'MONTH' 'MONTH' SPACE 'L' 7
I_FIELD_CAT_PART[],
*OBD
*C_TAB 'VBELN' 'Delivery' SPACE 'L' 12
I_FIELD_CAT_PART[],
*DATE
C_TAB 'WADAT_IST' 'Date' SPACE 'L' 10
I_FIELD_CAT_PART[],
*Destination
C_TAB 'CITY1' 'Destination' SPACE 'L' 25
I_FIELD_CAT_PART[],
*Qty By Road
C_TAB 'NTGEW_ROAD' 'Road Quantity' SPACE 'R' 16
I_FIELD_CAT_PART[],
*Rail Qty
C_TAB 'NTGEW_RAIL' 'Rail Quantity' SPACE 'R' 16 I_FIELD_CAT_PART[],
*Total Qty C_TAB 'TOT' 'Total Quantity' SPACE 'R' 16 I_FIELD_CAT_PART[], *RR/Trk No.
C_TAB 'EXTI2' 'Truck/RR No.' SPACE 'L' 17 I_FIELD_CAT_PART[].
ENDFORM. " f_field_catalog_part
*& Form f_DISPLAY_block
text
-->P_STRUCT_LAYOUT text
-->P_I_FIELD_CAT_PART[] text
-->P_C_TAB text
-->P_I_EVENTS_PART[] text
-->P_I_SORT_PART[] text
FORM F_DISPLAY_BLOCK USING FP_LAYOUT TYPE
SLIS_LAYOUT_ALV
FP_I_FCAT TYPE
SLIS_T_FIELDCAT_ALV
VALUE(FP_TABNAME) TYPE
ANY
FP_I_EVENTS TYPE
SLIS_T_EVENT
FP_I_SORT TYPE
SLIS_T_SORTINFO_ALV.
DATA: V_REPID TYPE SYREPID,
"current Program id
C_SAVE TYPE CHAR1 VALUE 'A'.
"variant save
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
*CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
IS_LAYOUT = FP_LAYOUT
IT_FIELDCAT = FP_I_FCAT[]
IT_SORT = FP_I_SORT[]
I_SAVE = C_SAVE "variant
save
IT_EVENTS = FP_I_EVENTS[]
TABLES
T_OUTTAB = <F_OUTTAB>
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " f_DISPLAY_block
*& Form f_create_catalog
text
-->P_C_TAB text
-->P_0085 text
-->P_0086 text
-->P_SPACE text
-->P_0088 text
-->P_5 text
-->P_I_FIELD_CAT_PART[] text
FORM F_CREATE_CATALOG USING FP_I_TABNAME TYPE
SLIS_TABNAME
FP_I_FIELDNAME TYPE SLIS_FIELDNAME
FP_I_SELTEXT TYPE
SCRTEXT_L
FP_I_DOSUM TYPE
CHAR1
FP_I_JUST TYPE C
FP_I_OUTPUTLEN TYPE
OUTPUTLEN
FP_I_FCAT TYPE
SLIS_T_FIELDCAT_ALV.
Record for field catalog
DATA: L_REC_FCAT TYPE SLIS_FIELDCAT_ALV.
L_REC_FCAT-TABNAME = FP_I_TABNAME.
L_REC_FCAT-FIELDNAME = FP_I_FIELDNAME.
L_REC_FCAT-SELTEXT_L = FP_I_SELTEXT.
L_REC_FCAT-DO_SUM = 'X'.
*l_rec_fcat-do_sum = ' '.
L_REC_FCAT-JUST = FP_I_JUST.
L_REC_FCAT-OUTPUTLEN = FP_I_OUTPUTLEN.
L_REC_FCAT-DECIMALS_OUT = '2'.
L_REC_FCAT-KEY = '1'.
APPEND L_REC_FCAT TO FP_I_FCAT.
ENDFORM. " f_create_catalog
Subroutines for Headings
*& Form f_display_header_partA
Display header for report for Part A
*& Form top_of_page
text
--> p1 text
<-- p2 text
FORM TOP_OF_PAGE .
SKIP 1.
WRITE:/25 ' Name of Company ',80 'RUN DATE' ,
SY-DATUM.
SKIP 1.
WRITE:/60 'RUN DATE' , SY-DATUM.
SKIP 1.
DATA: YR(4) TYPE N,
FIN_PRD(10) TYPE C.
IF S_DTABF-LOW+4(2) LT '04'.
YR = S_DTABF-LOW+0(4) - 1.
CONCATENATE YR '-' S_DTABF-LOW+2(2) INTO FIN_PRD.
ELSE.
YR = S_DTABF-LOW+0(4) + 1.
CONCATENATE S_DTABF-LOW0(4) '-' YR2(2) INTO
FIN_PRD.
ENDIF.
WRITE:/5 'DETAILS OF THE MONTH/DATE WISE DESPATCHES
MADE BY ROAD/RAIL DURING THE YEAR ' , FIN_PRD .
SKIP 1.
WRITE :/ 'SALES OFFICE : ' , P_SALES,' ' , RNAME.
SKIP 1.
ENDFORM. " DISPLAY_DATA
Award Points If Useful... -
Populate SELECT-OPTIONS default value using CALL FUNCTION
Hi Experts,
I would like to populate SELECT-OPTIONS s_currm default with value in w_currm, however, it doesn't seem to work. Can you please advise what the correct syntax is.
Note that CALL FUNCTION 'GET_CURRENT_YEAR' is working correctly and populating w_currm (as I can use it in a SQL SELECT statement), however, it does not seem to work for SELECT-OPTIONS s_currm.
Thank you for your time.
Code snippet is as a follows:
REPORT Z_DOWNLOAD_BSIS_TEST.
*Data Declaration
DATA: w_currm TYPE BSIS-MONAT.
*Define current fiscal month
CALL FUNCTION 'GET_CURRENT_YEAR'
EXPORTING
BUKRS = 'X999' " Company Code
DATE = SY-DATUM " Date to find fiscal year for
IMPORTING
CURRM = w_currm. " Current Fiscal Month
SELECT-OPTIONS s_currm FOR w_currm
DEFAULT w_currm. " The default value is NOT being populated (appears blank)Hi Venkat.O,
Thank you for your clear response. I have implemented your suggestion and it works, however, I now have a new problem.
Each time the report is executed or the "multiple selection" button is clicked the selection fields are populated once again with the default (low) values.
For example, when report is first opened the s_curry field displays '2010'. Clicking "multiple selection" results in another '2010' being populated. After executing the report the selection screen is populated again with '2010' (so we now have '2010' listed 3 times in the s_curry field).
How do I prevent the default values from repeating?
REPORT Z_DOWNLOAD_BSIS_TEST
*Data Declaration
DATA: w_currm TYPE BSIS-MONAT,
w_curry TYPE BSIS-GJAHR,
w_prevm TYPE BSIS-MONAT,
w_prevy TYPE BSIS-GJAHR.
SELECTION-SCREEN BEGIN OF BLOCK b11 WITH FRAME TITLE text-001 .
*Parameters to enter the path
PARAMETERS: FILENAME(128) OBLIGATORY DEFAULT '/usr/sap/tmp/TEST.txt'
LOWER CASE.
SELECT-OPTIONS: s_curry FOR w_curry,
s_currm FOR w_currm.
SELECTION-SCREEN END OF BLOCK b11.
AT SELECTION-SCREEN OUTPUT.
*Define current/previous financial periods
CALL FUNCTION 'GET_CURRENT_YEAR'
EXPORTING
BUKRS = 'X999' " Company Code
DATE = SY-DATUM " Date to find fiscal year for
IMPORTING
CURRM = w_currm " Current Fiscal Month
CURRY = w_curry " Current Fiscal Year
PREVM = w_prevm " Previous Fiscal Month
PREVY = w_prevy. " Previous Fiscal Year
s_curry-low = w_curry.
s_curry-option = 'EQ'.
s_curry-sign = 'I'.
APPEND s_curry.
CLEAR s_curry.
s_currm-low = w_currm.
s_currm-option = 'EQ'.
s_currm-sign = 'I'.
APPEND s_currm.
CLEAR s_currm. -
How to use CALL FUNCTION '/1BCDWB/SF00000014' in smartform
hiiiiiiiii
Iam doing classical report n i want my output to be printed in smartform.
So my output is in IT_FINAL table.In smartform in Form Interface Table column i had declare :::
Parameter Name: IT_FINAL
Type Assignment:LIKE
Associated Type:ZSD_FINAL ( Its a structure of IT_FINAL)
And in SE38..iam using...............
data: FM_NAME1 type RS38L_FNAM.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZCSF_SDPRSR03_PR'
importing
FM_NAME = FM_NAME1.
CALL FUNCTION FM_NAME1
EXPORTING
IT_FINAL = IT_FINAL.
So while running its giving dump..
I DONT KNOW HOW TO USE THE ABOVE FUNCTION MODULE.
CALL FUNCTION '/1BCDWB/SF00000014'
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 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.
Please suggest me with example if possible......URGENT.
(Rewards if solved)
Regards.Hi Hemant
Before running u r program agai run ur smartfor the it will release fm take that one and place ur program and change that name to FM_NAME1 and check once -
How can use CALL FUNCTION READ_TEXT
Dear SAP Expert,
I am working in Journal Voucher of smart form. I want to show Long Text in SF.
So i am using the READ_TEXT function module to read SAP long text. and use Range of Clear Doc. in driver program.
i have one ITAB which have 20 rows.
problem is that CALL FUNCTION READ_TEXT is not working properly ...........
i WANT store Long text clear Doc. no. wise in my ITAB .
DATA: FORMNAME TYPE TDSFNAME VALUE 'ZFI_S_JOUR_VOUCHER'.
DATA: FM_NAME TYPE RS38L_FNAM.
lv_name = ITAB-BELNR.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = c_id
language = 'E'
name = lv_name
object = c_object
TABLES
lines = lt_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5.
IF sy-subrc = 0.
ELSE.
LOOP AT lt_lines INTO wa_lines.
CONCATENATE ld_text wa_lines-tdline INTO ld_text.
ENDLOOP.
ENDIF.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = FORMNAME
IMPORTING
FM_NAME = FM_NAME.
DATA: V_PRCTR LIKE BSIS-PRCTR.
CALL FUNCTION FM_NAME
EXPORTING
V_TYPE_DES = V_TYPE_DES
P_BUKRS = P_BUKRS
TABLES
IT_BKPF = IT_BKPF
ITAB = Itab
TY_BSIS = TY_BSIS.
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. " call_smhI [See this |http://wiki.sdn.sap.com/wiki/display/BOBJ/FunctionExampleREAD_TEXTABAPwrapper+function]
Check out the wiki session .
FUNCTION Z_AW_READ_TEXT_ALL.
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(ID) TYPE THEAD-TDID
*" REFERENCE(LANGUAGE) TYPE THEAD-TDSPRAS
*" REFERENCE(NAME) TYPE THEAD-TDNAME
*" REFERENCE(OBJECT) TYPE THEAD-TDOBJECT
*" EXPORTING
*" REFERENCE(TEXT) TYPE CHAR2000
DATA BEGIN OF TEXTHEADER.
INCLUDE STRUCTURE THEAD.
DATA END OF TEXTHEADER.
DATA BEGIN OF TEXTLINES OCCURS 10.
INCLUDE STRUCTURE TLINE.
DATA END OF TEXTLINES.
CLEAR TEXTHEADER.
data: l_name type TDOBNAME."TR
l_name = name."TR
CALL FUNCTION 'READ_TEXT'
EXPORTING
OBJECT = OBJECT
ID = ID
LANGUAGE = LANGUAGE
NAME = l_NAME "TR
IMPORTING
HEADER = TEXTHEADER
TABLES
LINES = TEXTLINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
LOOP AT TEXTLINES.
CONCATENATE TEXT TEXTLINES into TEXT SEPARATED BY space.
ENDLOOP.
ENDFUNCTION.
Regards,
koolspy. -
CS2 Bridge crashes after using Find function
I have been using the same set-up at work for 2.5 years - CS2 on OS10.3.9. No new software/hardware has been added (that I know of). In the last few weeks, whenever I use the Find function in Bridge, it usually manages to complete the search, then crashes. It seems to be getting worse, as the crash now happens almost immediately the search is completed, whereas previously it usually waited until I could at least see the results. Any suggestions of why this is happening or what I can do to fix it?
Hi,
you made a mistake. Instead of
jbyte * pMin=(jbyte *)(*jEnv)->GetByteArrayElements(jEnv,testByteArray,0);should be
jbyte * pMin=(jbyte *)jEnv->GetByteArrayElements(testByteArray,0);this is C++ style.
Or C style
jbyte * pMin=(jbyte *)GetByteArrayElements(jEnv, testByteArray,0);If you get a pointer to some java array you should release it after using:
jbyte * pMin=(jbyte *)(*jEnv)->GetByteArrayElements(testByteArray,0);
(*jEnv)->ReleaseByteArrayElements(testByteArray,pMin,0); -
Create generic component to handle errors after using the function modules
Hi,
Please provide steps to create a generic component to handle the BAPI Return structure meesages after the function calls..
Please let me know how to pass the structure or internal table from one component to other.
Thanks in Advance,
SV
Moderator Message: No Step-by-steps will be provided here. Either take a classroom course or search for SAP Documentation
Edited by: kishan P on Dec 10, 2010 3:14 PMHi Hari,
Plz give me ur mail id.. i will forward some documents regarding Generic Extraction using FM and query...
For function module means.. you have to create function module. in RSAX..in R/3 side
and you want to extract data using Query means...you have to create Infoset query in (SQ01,SQ02,SQO3) IN r/3 Side
you can refer this blog also..
to Function module "RSAX_BIW_GET_DATA_SIMPLE" and there is very good weblog . Search "generic extraction" for weblog. /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
thanks
@jay -
Awful performance when using planning function of type EXIT
Hi.
I created planning function base on my own class with interface IF_RSPLFA_SRVTYPE_IMP_EXEC_REF.
In this class I read active buffer and do some validations.If validation not successful I give error message, otherwise I do nothing.
After my method ends to run (very fast and without any problem and only on active filter rstricted values) it seem that application goes forward, come to method EXECUTE_SERVICE in CL_RSPLFR_CONTROLLER==========CM002 (see code below) and at line 387 when calling read_data_from_buffer it hangs for 10 minutes.
I seems that system try to read all data in cube (not only restricted with active filter) and hangs. This method returns me all records of cube into L_R_REF_DATA.
IF n_use_node_selection = rs_c_false.
read_data_from_buffer( EXPORTING i_t_charsel = l_t_charsel_ref
i_t_charsel_orig = l_t_charsel_orig
i_tsx_seldr_orig = p_tsx_seldr
i_th_block_chars = l_th_ref_block_chars
i_enqmode = 'S'
i_th_attr = l_th_attr
CHANGING c_r_data = l_r_ref_data
c_r_sid = l_r_th_sid
c_ok = l_ok ).
ELSE.
Does anybody has an idea WHY ???
Regards.Solved.
I just need to fill E_T_REF_CHARSEL at end of my class run. -
Hot Corners not working after using Call of Duty 4
So I have noticed that Hot Corners are not working after i use COD4.
I know that the game uses different resolution and somehow interupts the hot corner software. Buty why and how I dont know.
I very often close COD4 by using Cmd+Q (or something like that)... But it doesnt matter if I quit it the "real" way. Hot corners still stops working after I use it.
Hot corners works again if I reboot my iMac and also if I have used COD4 then go to System Preferences and Hot Corneres and make one change there.. then it magically works again.
Does anyone have any definate solution for this.
PS: I have an iMac 3.06 GHz Intel Core 2 Duo. 4GB 1067 MHz RAM and Lion 10.7.3.
I also have a Macbook Pro with the same problem.... and both computers running Lion OSX and are always updated....
Peace
/BoboDoes your 8600M GT have 128 or 256MB VRAM? Both versions shipped with that model MBP. The game sysreqs says that, while 128 is minimum, 256 is preferred. We all know what "minimum" means in software advertising.
Have you downloaded the SL Graphics updater?
http://support.apple.com/kb/DL1083
It's supposed to fix certain games but it's worth a shot.
I'm surprised that the temp doesn't change. Even running the COD2 demo on my Late 2007 2.2G with 2G RAM and the 128MB version of the 8600, temps go up to 160-170F. That was under 10.5. Just upgraded to 10.6 Sunday, so I guess I should check COD2 again, because SL seems to run cooler on my MBP. -
I use FM READ_TEXT with KOPF (ord header) = ID, and AUFK (ord text) = Object, to successfully retrieve the long text for an order.
I have another requirement to read the Inspection text from the material, that I can see if I do MM03.
Can I replace the ID and Object names to do this in the same order?
where can I see all of the available ID and object names to use?
Is there a better, or another way to get the inspection text?
Thank-You.double click on the text.....it will take u text editor there in menu bar
goto------>header...
here u can find all information. -
Commit changes after CALL FUNCTION ... IN UPDATE TASK
Hi ABAPers,
I'm a bit confused about the behaviour of Update Function Modules.
Following scenario:
In our transaction (Modulpool with dynpros) the user clicks a butto to change some data:
1. PAI-Modul performs FORM_A
2. FORM_A calls FM_A several times in a LOOP
3. FM_A does some business logic and calls FM_B IN UPDATE TASK
4. FM_B modifies database tables
5. After the LOOP FORM_A does COMMIT WORK AND WAIT
Then the changes are not in the db immediately, the user will see the old data for a short time.
Why does the COMMIT-statement not start the Update-process?
Thanks,
MarkusHi,
This executes all high-priority update function modules registered using CALL FUNCTION ... IN UPDATE TASK in the order of their registration and in a common database LUW. If you do not specify the addition AND WAIT, the program does not wait until the update work process has executed it (asynchronous updating). If you specify the addition AND WAIT, however, program processing after COMMIT WORK will not continue until the update work process has executed the high-priority update function modules (synchronous updating).
If all high-priority update function modules are completed successfully, the statement executes the low-priority update function modules together in a common database LUW.
here high priority function moudles are function module with V1 task.
Regards,
Siva chalasani.
Maybe you are looking for
-
[GAVE UP] New Wifi card problem - no orange "Wifi on" light
For some silly reason the Intel Wifi 4965 agn mini-PCI card in my wife's laptop will not work with anything newer than Ubuntu 8.04 Hardy Heron. Linux will not even "post". (I think that's the right word) So, I ordered an Intel Wifi 5100 agn mini-PCI
-
ServerSocket(TCP/IP) listening in the web container part
So, if I implement the ServerSocket(TCP/IP) listening in the web container part (Websphere), what is the best way to do this? I need to monitor socket state and statistics from browser. When I receive message from socket, I must read something from d
-
Attaching a mouse event to the SeekBar component's SeekBarHandle
Hi, I'm trying to attach a MouseEvent to the SeekBarHandle inside the SeekBar component. I've tried this and it doesn't work: flvPlayer_mc.seekBar = seekBar_mc; flvPlayer_mc.seekBar.seekBarHandle.addEventListener(MouseEvent.MOUSE_OVER, doSomeThing);
-
Statement AUDIT SELECT TABLE also audits update, delete and inserts
Hi, Database Oracle 11g. After turning on AUDIT with these 2 statements: SQL> ALTER SYSTEM SET audit_trail = "DB_EXTENDED" SCOPE=SPFILE; SQL> AUDIT SELECT TABLE BY ACCESS; then insert, update and delete statements are recorded in sys.aud$ as well as
-
Another Sainsburys gift card post
Hey all, i applied for my Sainsburys gift card on 30/1/14, the Email says please allow 45 days for it to arrive. Well as you can tell i havent recieved it and was wondering if anyone can help or give me a pointer as to where i might ask about it? F.Y