Call function maximum print.
Hi all.
I have print proble. if sombody know that , please let me know.
if the number of itab is '400', when 300 times print is not printing. logic like below.
loop at itab.
call function 'OPEN_FORM'
exporting
device = 'PRINTER'
dialog = ' '
form = 'Z_CPS_OUTBOX'
options = option
exceptions
others = 9.
if sy-subrc <> 0.
exit.
endif.
call function 'WRITE_FORM'
exporting
element = l_element
function = 'SET'
type = 'BODY'
window = 'MAIN'
exceptions
others = 8.
call function 'WRITE_FORM'
exporting
element = l_element
function = 'SET'
type = 'BODY'
window = 'BARCODE'
exceptions
others = 8.
call function 'CLOSE_FORM'
exceptions
others = 4.
if sy-subrc <> 0.
exit.
endif.
endloop.
can u jot down ur exact requirement..
why r u opening and closing the form inside the loop?
u could have done this:
openform...
loop at itab.
writeform...
endloop.
closeform...
Similar Messages
-
Hi,
Is there anyway to make a button call IE's print function with web dynpro?
ThxThe thread Christophe pointed to, does it a little different:
1. they create an HTML page @ runtime (based on the context, but that doesn't matter in your case) that contains javascript to print the page
2. they open the page in an external window
The problem with my approach is that it uses an IFrame, which is deprecated as of NW04s. An external window is different, that'll most likely be supported in the future too. But the main drawback of the external window is that you need to create it('s content)...
So yes, I'm afraid the conclusion is there's no perfect way of doing it. In case your iViews are running in the portal, maybe, just maybe, a Web Dynpro action might trigger a portal event that in turn automatically executes the print action of the print button, i.e. the portal event "presses" the (invisible) print button on behalf of the user. I seriously doubt this is possible, but I'm no expert when it comes to portal eventing and what exactly is possible with portal eventing.
Kind regards,
Sigiswald -
How to fill data when call function of sap standard script form?
Hi every experts,
<Priority Normalized>
In our system, when we log in 'FR', we can print purchase order in language Franch,in t_code:ME22N. And when logging in 'EN', we can print it in language English, in ME22N. The English form is just only translated from Franch, with all same structure and frame. The form is done by script form.
And when logging in 'ZH', we create a new program, calling function smartform, instead of translating from EN language. Because of different structure and frame, I don't know the way to write script, so I print puchase order by smartform, when logging in 'ZH'.
But I have a new issue. Our MM module consultant needs me to print Chinese form if one condition, print English form in other condition.
So I have no idea to solve it. Because in my program, I get data to fill smartform and call function of smartform. And I don't know how to get data to fill script form. I only know the function name, 'OPEN_FORM' 'WRITE_FORM' 'CLOSE_FORM'.....
If I only call the several functions, I will get only frame without no data. So who can tell me how to do????
<Urgency downgraded>
Edited by: Suhas Saha on Jul 26, 2011 3:34 PM
Edited by: Vinod Kumar on Jul 26, 2011 4:09 PMHi,
Normally if we look in NACE transaction, you can see that upto five different FORMS can be assigned to a single output type . i.e. for each form there will be a seperate routine through which it gets called. But it all start from the first form only.
so you need to write your code in the ENTRY of the first form and if it does not satisfy do not go for processing of it but just exit of that form ENTRY. so that it will take you to next form.
hope this helps.
Thanks,
Venkatesh -
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 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 -
Simulation model which call functions in an other dll...
I have a C simulation model that I implement like NI Model Framework template (NI_VStand_Model_Framework_Guide.pdf ). If I use this simple model I can deploy on my PXI. But I must call functions which are in an other dll. When I call functions in other DLL I can't deploy because Veristand specify that the model is not compatible.
NI VeriStand: The specified compiled model is not compatible with NI VeriStand.
=========================
NI VeriStand: NI VeriStand Engine.lvlib:VeriStand Engine Wrapper (RT).vi >> NI VeriStand Engine.lvlib:VeriStand Engine.vi >> NI VeriStand Engine.lvlib:VeriStand Engine State Machine.vi >> Model Execution.lvlib:Initialize Model Loop Data.vi >> SIT Model API.lvlib:Initialize Model.vi >> SIT Model API.lvlib:Load Model DLL.vi
<append>=========================
NI VeriStand: Failed to load c:\ni-rt\NIVeriStand\Models\LD1_T1.dll
If I use DLL Checker there is no bad import. How to add a simulation model in veristand which call function in an other DLL?Thank you for your answer.
I know how to import a dll in veristand. My Dll is LD1_T1. I can import it in Veristand without error. But this DLL depends of an other dll (addition.dll) as you can see in the print screen.
When I try to deploy to my PXI I have an error message of compatibility.
NI VeriStand: The specified compiled model is not compatible with NI VeriStand.
=========================
NI VeriStand: NI VeriStand Engine.lvlib:VeriStand Engine Wrapper (RT).vi >> NI VeriStand Engine.lvlib:VeriStand Engine.vi >> NI VeriStand Engine.lvlib:VeriStand Engine State Machine.vi >> Model Execution.lvlib:Initialize Model Loop Data.vi >> SIT Model API.lvlib:Initialize Model.vi >> SIT Model API.lvlib:Load Model DLL.vi
<append>=========================
NI VeriStand: Failed to load c:\ni-rt\NIVeriStand\Models\LD1_T1.dll
For LD1_T1.dll I have use NI Model Framework template (NI_VStand_Model_Framework_Guide.pdf ).
If I check my Dll with dll checker it's ok but I can't deploy.
Please somebody have an idee to deploy my model ? -
CALL FUNCTION SEND ERROR when displaying attendance report in PDF format.
We implemented SSO/webgui. The users did not have any issues with printing reports from SAPGUI. In webgui, however, we had to define a Local PDF1 printer, per SAP Note 771683. When users prints this report, it is generating 1-5 CALL_FUNCTION_SEND_ERROR. We have Central Instance and 5 additional instances on 3 app servers. Sometimes it generates 1 dumps, sometimes 2, etc. The dump do not occurred on the instances you are logged into. The dump contains the following:
ShrtText
" " (I/O error)
What happened?
"CPIC-CALL: 'ThCMSEND'#connection closed#"
An error occurred when executing a Remote Function Call.
Error analysis
An error occurred when executing a Remote Function Call.
"CPIC-CALL: 'ThCMSEND'#connection closed#"
Status of connection.... "CODE=CM_DEALLOCATED_NORMAL CM_SEND_RECEIVED
CM_COMPLETE_DATA_RECEIVED SAPCODE=0 CONV=04892091"
Internal error code.... "RFC_IO5"
There is an error in the communication system. To clarify
and resolve the error, contact your system administrator.
Transaktion......... " "
Programm............ "SAPLSICM"
Dynpro.............. "SAPMSSY1 3004"
Dynprozeile......... 2
Informationen zum Aufrufer des Remote Function Calls (RFC):
System.............. "HRP"
Datenbank-Release... 640
Kernel-Release...... 640
Verbindungstyp...... 3 (2 = R/2, 3 = R/3, E = Extern, R = Reg. Extern)
Aufrufsart.......... "asynchron with reply (imode 0)" (S = Synchron, a/A =
Asynchron, T = Transakt. )
Mandant............. 600
Benutzer............ "CG1981"
Transaktion......... " (Program: SAPLSICM)"
Funktionsbaustein... "ICM_CACHE_UPLOAD"
Information on where terminated
The termination occurred in the ABAP program "SAPLSICM" in "ICM_CACHE_UPLOAD".
The main program was "SAPMSSY1 ".
The termination occurred in line 18 of the source code of the (Include)
program "LSICMV11"
of the source code of program "LSICMV11" (when calling the editor 180).
Source Code Extract
Line SourceCde
1 *******************************************************************
2 * THIS FILE IS GENERATED BY THE FUNCTION LIBRARY **
3 * NEVER CHANGE IT MANUALLY, PLEASE! **
4 *******************************************************************
5 FORM ICM_CACHE_UPLOAD %_RFC.
6 * Parameter declaration
7 DATA URL TYPE
8 ICMURL
9 .
10 DATA DATA TYPE
11 ICMDATA
12 .
13 DATA GLOBAL LIKE
14 SY-INDEX
15 .
16 * Assign default values
17 * Call remote function
>>>>> CALL FUNCTION 'ICM_CACHE_UPLOAD' %_RFC
19 EXPORTING
20 URL = URL
21 DATA = DATA
22 GLOBAL = GLOBAL
23 .
24 ENDFORM.
We are on ERP 2004, kernel level 156, and Basis SP18. I have Adobe Reader 8.
Our CI Service Port is 8009.
I have not seen any posting if there is a PDF limitation, e.g., width limitation, report contains rows highlighted in various colors.Dear Elaine,
check notes
<a href="https://service.sap.com/sap/support/notes/764734">764734</a>
<a href="https://service.sap.com/sap/support/notes/688372">688372</a>
or you might want to try to comment out line 118 of the function module
ICM_CACHE_UPLOAD which reads like this
PERFORMING RECEIVE_DATA_UPLOAD ON END OF TASK
If this does not solve the problem, give a detailed description on how to reproduce the dump and put that into an error message with SAP. It should go to BC-CST-IC.
Best Regards,
Tim -
Problem in Call function .. starting new task
Hi,
I want to execute a dialog program in background. I am trying to use call function starting new task.
I am facing some syntax issue. Can any one guide me how to use call function starting new task. The function module is RFC FM. Do we need to define task some where before use please guide.
Thanks in advance. A sample program will be gr8.Hi,
Incase you want to call a RFC FM in background you can call ity like this.
call function 'Y_L_TO_CREATE_HUPAST' in background task
exporting
venum = y_v_venum
backg = 'X'
buser = y_lv_uname
langu = sy-langu
objky = y_lv_objky
printer = y_lv_printer.
Here Y_L_TO_CREATE_HUPAST is a RFC FM.
Regards,
Ankur Parab -
Hi,
i have creted a function module which read stock quantity using BAPI_MATERIAL_AVAILABILITY.
Import - MFRPN
Export - QNTY
If i execute function module from SAP the result it's OK but when i call function from PHP it does not output nothing.
$sap = new saprfc(array(
"logindata"=>array(
"ASHOST"=>"192.168.3.1" // application server
,"SYSNR"=>"00" // system number
,"CLIENT"=>"200" // client
,"USER"=>"rfc" // user
,"PASSWD"=>"123456789" // password
,"show_errors"=>true // let class printout errors
,"debug"=>false)) ; // detailed debugging information
// Call-Function
// Call-Function
$result=$sap->callFunction("Z_READ_QNTY",
array(
array("IMPORT","MFRPN",$_POST['cod']),
array("EXPORT","QNTY",$quantity),
// Call successfull?
if ($sap->getStatus() == SAPRFC_OK)
echo $quantity;
else
// No, print long Version of last Error
$sap->printStatus();
// or print your own error-message with the strings received from
// $sap->getStatusText() or $sap->getStatusTextLong()
Please someone help me.
Thank you.hi Dan,
i will send you an working code sample. The Fuba ZGET_MAKTX is easy MATNR as import parameter and MAKTX as export parameter.
you will receive the material short description.
hope this will help you a little bit.
in your code i thing you forgot to fill the $quantity like this $quantity = saprfc_export($fce,"QNTY"); before echo $quantity;
regards
Tony
<?php
//Login to SAP R/3
$login = array ("ASHOST"=>"vsap3", "SYSNR"=>"2", "CLIENT"=>"200","USER"=>"vsrfc", "PASSWD"=>"********", "CODEPAGE"=>"1100");
$rfc = saprfc_open($login);
if (!$rfc) {
echo "RFC connection failed";
exit;
$fce = saprfc_function_discover($rfc,"ZGET_MAKTX");
if (!$fce) {
echo "Discovering interface of function module failed";
exit;
saprfc_import($fce,"MATNR","200200");
$rc = saprfc_call_and_receive ($fce);
if ($rfc_rc != SAPRFC_OK) { if ($rfc == SAPRFC_EXCEPTION ) echo ("Exception raised: ".saprfc_exception($fce)); else echo (saprfc_error($fce)); exit; }
$maktx = saprfc_export($fce,"MAKTX");
echo $maktx;
saprfc_function_free($fce);
saprfc_close($rfc);
?>
Edited by: Tony Wienhold on Oct 7, 2008 11:19 AM
Edited by: Tony Wienhold on Oct 7, 2008 11:22 AM -
How to use this function call function 'REUSE_ALV_COMMENTARY_WRITE' in alv
hi all
thanks in advance
how to use this function in alv programming
call function 'REUSE_ALV_COMMENTARY_WRITE'
why use and what purpose use this function plz tell me details
plz guide me
thanksHi
see this exmaple code where i had inserted a LOGO by useing this FM
*& Report ZTEST_ALV_LOGO
REPORT ztest_alv_logo.
TYPE-POOLS : slis.
*ALV Formatting tables /structures
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: gt_events TYPE slis_t_event.
DATA: gs_layout TYPE slis_layout_alv.
DATA: gt_page TYPE slis_t_listheader.
DATA: gs_page TYPE slis_listheader.
DATA: v_repid LIKE sy-repid.
*ALV Formatting work area
DATA: w_fieldcat TYPE slis_fieldcat_alv.
DATA: w_events TYPE slis_alv_event.
DATA: gt_bsid TYPE TABLE OF bsid WITH HEADER LINE.
INITIALIZATION.
PERFORM build_events.
PERFORM build_page_header.
START-OF-SELECTION.
*perform build_comment. "top_of_page - in initialization at present
SELECT * FROM bsid INTO TABLE gt_bsid UP TO 10 ROWS.
*perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.
*USING = Row, Column, Field name, display length, table name, heading
*OR
PERFORM build_fieldcat.
gs_layout-zebra = 'X'.
*top of page event does not work without I_callback_program
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_structure_name = 'BSID'
i_background_id = 'ALV_BACKGROUND'
i_grid_title = 'This is the grid title'
I_GRID_SETTINGS =
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
it_events = gt_events[]
TABLES
t_outtab = gt_bsid.
Form..............: populate_for_fm
Description.......: Populates fields for function module used in ALV
FORM populate_for_fm USING p_row
p_col
p_fieldname
p_len
p_table
p_desc.
w_fieldcat-row_pos = p_row. "Row Position
w_fieldcat-col_pos = p_col. "Column Position
w_fieldcat-fieldname = p_fieldname. "Field name
w_fieldcat-outputlen = p_len. "Column Lenth
w_fieldcat-tabname = p_table. "Table name
w_fieldcat-reptext_ddic = p_desc. "Field Description
w_fieldcat-input = '1'.
APPEND w_fieldcat TO gt_fieldcat.
CLEAR w_fieldcat.
ENDFORM. " populate_for_fm
*& Form build_events
FORM build_events.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = gt_events.
READ TABLE gt_events
WITH KEY name = slis_ev_user_command
INTO ls_event.
IF sy-subrc = 0.
MOVE slis_ev_user_command TO ls_event-form.
APPEND ls_event TO gt_events.
ENDIF.
READ TABLE gt_events
WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE slis_ev_top_of_page TO ls_event-form.
APPEND ls_event TO gt_events.
ENDIF.
ENDFORM. " build_events
*& Form USER_COMMAND
When user command is called it uses 2 parameters. The itab
passed to the ALV is in whatever order it currently is on screen.
Therefore, you can read table itab index rs_selfield-tabindex to get
all data from the table. You can also check r_ucomm and code
accordingly.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
READ TABLE gt_bsid INDEX rs_selfield-tabindex.
error checking etc.
SET PARAMETER ID 'KUN' FIELD gt_bsid-kunnr.
CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
ENDFORM. "user_command
*& Form top_of_page
Your own company logo can go here if it has been saved (OAOR)
If the logo is larger than the size of the headings in gt_page,
the window will not show full logo and will have a scroll bar. Thus,
it is a good idea to have a standard ALV header if you are going to
use logos in your top of page.
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_page
i_logo = 'ENJOYSAP_LOGO'.
ENDFORM. "top_of_page
*& Form build_fieldcat
*Many and varied fields are available here. Have a look at documentation
*for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE
FORM build_fieldcat.
w_fieldcat-fieldname = 'BUDAT'.
w_fieldcat-seltext_m = 'Dte pst'.
w_fieldcat-ddictxt(1) = 'M'.
w_fieldcat-edit = 'x'.
Can change the position of fields if you do not want them in order
of the DDIC or itab
w_fieldcat-row_pos = '1'.
w_fieldcat-col_pos = '10'.
APPEND w_fieldcat TO gt_fieldcat.
CLEAR w_fieldcat.
ENDFORM. " build_fieldcat
*& Form build_page_header
gt_page is used in top of page (ALV subroutine - NOT event)
*H = Header, S = Selection, A = Action
FORM build_page_header.
For Headers, Key is not printed and is irrelevant. Will not cause
a syntax error, but is not used.
gs_page-typ = 'H'.
gs_page-info = 'Header 1'.
APPEND gs_page TO gt_page.
gs_page-typ = 'H'.
gs_page-info = 'Header 2'.
APPEND gs_page TO gt_page.
For Selections, the Key is printed (bold). It can be anything up to 20
bytes. It gets printed in order of code here, not by key value.
gs_page-typ = 'S'.
gs_page-key = 'And the winner is:'.
gs_page-info = 'Selection 1'.
APPEND gs_page TO gt_page.
gs_page-typ = 'S'.
gs_page-key = 'Runner up:'.
gs_page-info = 'Selection 2'.
APPEND gs_page TO gt_page.
For Action, Key is also irrelevant.
gs_page-typ = 'A'.
gs_page-info = 'Action goes here'.
APPEND gs_page TO gt_page.
ENDFORM. " build_page_header -
How to Call Function from SAPSCRIPT
I want to Call a function from my SAPSCRIPT to get some data and print the same in the form , Can I get an example for this
Hi Nandan,
U cannot directly call function from SAPScript... For that u have to create one include in which u need to write the code. Using Perform... EndPerform u can call the same from SAPScript. See the below example
u need to write this code in SAPScript
PERFORM formname IN PROGRAM includename
USING &field1&
USING &field2&
CHANGING &field3&
ENDPERFORM
Here includename is your include type program.
u need to write this code in your include type program..
FORM formname TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
data : var1 like field1,
var2 like field2,
var3 like field3.
READ TABLE in_par WITH KEY 'field1'.
CHECK sy-subrc = 0.
var1 = in_par-value.
READ TABLE in_par WITH KEY 'field2'.
CHECK sy-subrc = 0.
var2 = in_par-value.
now u can call corresponding function using local VAR1 and VAR2. Here u can pass N no of USING parameters.
After processing on VAR3...
READ TABLE out_par WITH KEY 'field3'.
out_par-value = VAR3.
MODIFY out_par INDEX sy-tabix.
EndForm.
Here in_par and out_par are the structures which will be used to communicate with SAPScript. And this is the only way as per my view.
I m sure this code will work fine. Here i have used dummy variables that u need to change as per your requirement. If u have more queries write me back.
And yes if this works than dont forget to give the points.
Regards,
Sagar -
Behaviour of CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE'
As per ABAP help documentation, the statement CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE' should create a new main session in same user session.The behaviour is wrong as per documentation.
But current behaviour:
The statement CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE' is creating a new user session.
Any reason?Hi Prakash,
I'd agree with Suhas, that you're reading the documentation wrong. Here's your quote:
As per ABAP help documentation, the statement CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE' should create a new main session in current user session.
If you look at the help, you can see that it says:
When the destination NONE is used, a new main session is opened for the current user session.
Do you see the difference? Also, note that in this context main session basically means that we're talking about a new external session:
Each task ID defines a separate RFC connection with its own context, meaning that, in the case of repeated function module calls of the same task ID, the global data of the relevant function group can be accessed, if the connection still exists.
In dialog processing, note that the maximum number of six main sessions cannot be exceeded, else an error message is displayed.
If you're still in doubt, check out the online ABAP documentation for [CALL FUNCTION - STARTING NEW TASK|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_STARTING.htm]. So I'd say the documentation is in line with the actual behavior.
Cheers, harald -
To get import value of table spoolids in CALL function 'smartfomr' ?
I am calling smartform as like under:
DATA:l_doc_output_info TYPE ssfcrespd,
tab_otf_data TYPE ssfcrescl,
l_job_output_options TYPE ssfcresop.
CALL FUNCTION FNAME
IMPORTING
DOCUMENT_OUTPUT_INFO = l_doc_output_info
JOB_OUTPUT_INFO = tab_otf_data
JOB_OUTPUT_OPTIONS = l_job_output_options
exporting..
changing..
i am run the smartform than i get display than i print it form that smartform output but i am getting null value in : tab_otf_data-spoolids and tab_otf_data-otfdata,
So, how to get that table values?
if u know,
regards,
I am gettin null value inHi Scruz !
The parameter "GETOTF" of the structure CONTROL_PARAMETERS should be set.
Regards,
Vincent. -
Call function from "CP210xManufacturing.dll"- Silicon Labs
I am developing a production line test system that includes retrieving and setting the VID, PID, product string, serial number maximum power consumption of a Silicon Labs CP2102 USB - UART bridge using Labview 8.2.
Unfortunately I could only call one function { CP210x_GetNumbDevices() }. Wondering any one can help me to call others.
The Document : http://www.silabs.com/public/documents/tpub_doc/anote/Microcontrollers/Interface/en/an144.pdf
CP210xManufacturing.dll :http://www.silabs.com/public/documents/software_doc/othersoftware/Microcontrollers/Interface/en/an14...
TuongG'day Tuong,
I'm having issues finding the device i want (VID / PID) on my machine using the "CP210xManufacturing.dl"and calling function "CP210x_GetNumDevices()"...
Just wondering if you have any details on this....
Hahaha, I just saw the date you wrote this thread... Hmmm, I might just ask you at work tomoz...
Cheers
Tim -
COMMUNICATION_FAILURE in CALL FUNCTION STARTING NEW TASK/Background task
Hi friends,
I am trying to use a FM in a Print Program (when user prints a document), using
CALL FUNCTION STARTING NEW TASK 'TASK' DESTINATION 'NONE'.
The program is triggered from VL02N tcode.
But it's giving an exception - COMMUNICATION_FAILURE. Message is Error when opening an RFC connection
I also tried
CALL FUNCTION IN BACKGROUND TASK as Separate Unit
then error message pops up - Database error when recording transactional RFC
We are attaching a PDF file of the print to content server within this function module and because the "attaching" takes a while, this part needs to be detached from the print program so that we can avoid performance issue.
I can't figure out the issue. i gues this is happening because print program is already running in Update task. I also tried with RFC enabled FM. Please help me resolve/understand the issue.
Appreciate your help.
Regards,
Ronjan.Hi Ronjan,
COMMUNICATION_FAILURE. Message is Error when opening an RFC connection
I guess the reason for the above is that every RFC call synchronous/Asynchronous issues a DB COMMIT and we cannot have DB COMMITs in the V1/V2 updates, please go through the link below.
http://help.sap.com/saphelp_nw70ehp2/helpdata/en/23/e9aa61638e404d81575e939b5cd847/frameset.htm
Now, the possible solutions i can think of are,
1) Call the FM in update task delayed start and try.
2) Or create a report program and use SUBMIT (look at the job options as well).
@Mainak
3. Write a statement COMMIT WORK AND WAIT. This will actually invoke the FM
Mainak, this will lead to a Update termination, as the program is running in an update task.
Regards,
Chen
Maybe you are looking for
-
I have an include that links to the social networking icons. For some reason, my two icons on the far right are sort of masked off so as not to allow the cursor to hover over them as a pointer finger - only in Firefox though. Issue does not occur in
-
I have tried downloading the update for Firefox 3 times, but had to go to bed before it was finiahed....seemed to be more than 45 minutes is this normal? How long should it take?
-
Convert Date Format from DDMMYY to DD/MMM/YYYY
Hi, Thanks in Advance. Is there any function Module to Conver the Given Date in the given Below Format. DD / MMM / YYYY For Example if the given date is 16072009 then it should print as 16 / JUL / 2009 Regards: Sridhar.J
-
Can we have a choice list (lookup) while editing a report.
I have created a report and it has one editable field. BAM shows an input field which user can update but to avoid typing mistakes we want to make it choice list. Can I do it? Source data for choice list is fixed for time being but I would like to kn
-
BlackBerry Z10 BBM picture not displaying
I have a BlackBerry Z10 and once I change my BBM picture my contacts do not see the updated picture, but only my status updates. What should i do?