Reg. Smartform function calling in script
Dear Experts
I create one smartform and I would like to call it in my script. how to implement this. Pls help.
my smartform name : ZDEMO_LOOP
Function module name : /1BCDWB/SF00000091
My scrip is :
Report ZPR.
TABLES:mara,makt.
DATA:BEGIN OF pr OCCURS 0,
matnr LIKE mara-matnr,
ersda LIKE mara-ersda,
ernam LIKE mara-ernam,
laeda LIKE mara-laeda,
aenam LIKE mara-aenam,
lvorm LIKE mara-lvorm,
END OF pr.
DATA:pr1 LIKE pr OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
SELECT-OPTIONS:mat FOR mara-matnr.
SELECTION-SCREEN END OF BLOCK b1.
SELECT maramatnr maraersda maraernam maralaeda mara~aenam
mara~lvorm INTO TABLE pr1 FROM mara
WHERE mara~matnr IN mat.
write :/'Material',
'Material Desc'.
LOOP AT pr1.
WRITE:/ pr1-matnr,
pr1-ersda,
pr1-ernam,
pr1-laeda,
pr1-aenam,
pr1-lvorm.
ENDLOOP.
That is I want the output in smart form that required data from table.
Thanks
Rajakumar.K
You need to call the smartform like in the example attached.
The function is generate dinamycally in SMARTFORM transaction. You need to call the SMARTFORM FORM
http://www.sap-img.com/smartforms/a-sample-program-calling-smartform.htm
Similar Messages
-
Call ABAP function module from script?
Hi,
I have an ABAP function module, which works fine when I call it in a transformation.
Since I don't need to execute this function for each record but rather for each file I process, I would like to move the call from the DataFlow to a script in the WorkFlow. When I click on the 'functions' button the ABAP FM is available in my SAP Datastore, so I drag and drop it into my script. I also make sure to populate all required variables.
There are no error messages or warning when I check my job definition.
When I execute it, I get the following RFC error:
Function call <xxx ( abcd ) > failed, due to error <150413>: <RFC CallReceive exception <FUNCTION_NOT_FOUND>.>.
Is it just not possible to call an RFC enabled function module in SAP from a script or am I doing something wrong here?
Thanks,
Jan.Could you please let me know how I can call an abap function module from a transformation? (from abap xslt program). I know how we can call methods of a class from the transformations, but no idea how we can call function modules. Any suggestions or a sample code snippet towards this will be very useful for me.
Thanks,
Shashi. -
Calling oracle function in OMB script
Hi
Can anyone please tell me how can i get the returned value of an oracle function in OMB script. or how can i get the value into OMB variable and use it.
Basically i want to set the properties of OWB mapping via OMB script.
Following OMB code sets the max error limit of a mapping.
OMBALTER MAPPING 'MAP_DATA' SET PROPERTIES (MAXIMUM_NUMBER_OF_ERRORS) VALUES ('100')
i dont want to hard code the value 100 rather i want this value to be returned from a function.
If it is not possible then plz tell me how can i set MAXIMUM_NUMBER_OF_ERRORS property of OWB mapping via sql or pl/sql.
Any type of clue will be highly appreciated.
Best RegardsHere is my bare-bones OMB SQL Library to allow you to do pure SQL calls from within OMB+. All I have ever used it for is to run queries, so I don't have a library procedure for calling a function, however if your function is SQL-callable (e.g. select my_func() from dual) then it would work. Either that or you'll want to augment this library to build a procedure that will call and return the results from a java preparedStatement. It's something I've been meaning to do, but haven't got around to it yet.
All you should need to do is save this as it's own tcl file and then source it at the top of your own script, or embed it into your script.
EDIT: Here is a page with some sample code on using java.sql.CallableStatement to call a Pl/SQL procedure from Java which should certainly do the trick for you in conjunction with the basic session control in my library.
http://www.exampledepot.com/egs/java.sql/CallProcedure.html
Cheers,
Mike
package require java
#file omb_sql_library.tcl
proc oracleConnect { serverName databaseName portNumber username password } {
# import required classes
java::import java.sql.Connection
java::import java.sql.DriverManager
java::import java.sql.ResultSet
java::import java.sql.SQLWarning
java::import java.sql.Statement
java::import java.sql.CallableStatement
java::import java.sql.ResultSetMetaData
java::import java.sql.DatabaseMetaData
java::import java.sql.Types
java::import oracle.jdbc.OracleDatabaseMetaData
# load database driver .
java::call Class forName oracle.jdbc.OracleDriver
# set the connection url.
append url jdbc:oracle:thin
append url :
append url $username
append url /
append url $password
append url "@"
append url $serverName
append url :
append url $portNumber
append url :
append url $databaseName
set oraConnection [ java::call DriverManager getConnection $url ]
set oraDatabaseMetaData [ $oraConnection getMetaData ]
set oraDatabaseVersion [ $oraDatabaseMetaData getDatabaseProductVersion ]
puts "Connected to: $url"
puts "$oraDatabaseVersion"
return $oraConnection
proc oracleDisconnect { oraConnect } {
$oraConnect close
proc oraJDBCType { oraType } {
#translation of JDBC types as defined in XOPEN interface
set rv "NUMBER"
switch $oraType {
"0" {set rv "NULL"}
"1" {set rv "CHAR"}
"2" {set rv "NUMBER"}
"3" {set rv "DECIMAL"}
"4" {set rv "INTEGER"}
"5" {set rv "SMALLINT"}
"6" {set rv "FLOAT"}
"7" {set rv "REAL"}
"8" {set rv "DOUBLE"}
"12" {set rv "VARCHAR"}
"16" {set rv "BOOLEAN"}
"91" {set rv "DATE"}
"92" {set rv "TIME"}
"93" {set rv "TIMESTAMP"}
default {set rv "OBJECT"}
return $rv
proc oracleQuery { oraConnect oraQuery } {
set oraStatement [ $oraConnect createStatement ]
set oraResults [ $oraStatement executeQuery $oraQuery ]
# The following metadata dump is not required, but will be a helpfull sort of thing
# if ever want to really build an abstraction layer
set oraResultsMetaData [ $oraResults getMetaData ]
set columnCount [ $oraResultsMetaData getColumnCount ]
set i 1
#puts "ResultSet Metadata:"
while { $i <= $columnCount} {
set fname [ $oraResultsMetaData getColumnName $i]
set ftype [oraJDBCType [ $oraResultsMetaData getColumnType $i]]
#puts "Output Field $i Name: $fname Type: $ftype"
incr i
# end of metadata dump
return $oraResults
# SAMPLE CODE to run a quick query and dump the results. #
#set oraConn [ oracleConnect myserver orcl 1555 scott tiger ]
#set oraRs [ oracleQuery $oraConn "select name, count(*) numlines from user_source group by name" ]
#for each row in the result set
#while {[$oraRs next]} {
#grab the field values
# set procName [$oraRs getString name]
# set procCount [$oraRs getInt numlines]
# puts "Program unit $procName comprises $procCount lines"
#$oraRs close
#oracleDisconnect $oraConnEdited by: zeppo on Nov 25, 2008 7:19 AM -
Can we call java function in java script????
hello
please tell me can i call a java function through java script function in jsp???of course not. JavaScript is interpreted by the client (web browser) while the Java code in a JSP resides on the server. don't confuse the web application's architecture.
robert -
How to call a function in "matlab script"
Hellow!
I am using Matlab scrip to make some matlab program in Labview,but i find when i try to call a matlab function like"myfun.m",it will ouput error message"undefined command myfun. So what should i do to call function in matlab script? thanks!Happybird,
Do you have MATLAB installed on the computer? LabVIEW makes calls
to MATLAB to run the script node. If so, make sure that you have
launched MATLAB and then launch LabVIEW. Once you have tried
that, <a
href="http://digital.ni.com/public.nsf/websearch/4475BC3CEB062C9586256D750058F14B?OpenDocument">KB
300A6NDT</a> might be helpful. Hope this information helps!
Andy F.
National Instruments -
How to call java script function from JSP ?
how to call java script function from JSP ?
i have function created by java script lets say x and i want to call this function from jsp scriplet tag which is at the same page ..thanks
-
Getting error in calling Java Script function in HTMLB page
Hi
I am having a button in HTMLB page which calls the Java Script function for click event.I have included the Java Script in the script folder of the application.
I am calling the function present in JS like this,
<SCRIPT src="portalsdc.js"></SCRIPT>
function buttonClick() {
someFunc()
<hbj:button
onClientClick="JavaScript:buttonClick();"
disabled="false"
design="STANDARD"
/>
The Error i am getting in calling someFunc()is "Object Expected " ..
Any suggestion how to make it work.
Thanks in advance
SaravananHi,
My code in page is
<%@ taglib uri="tagLib" prefix="hbj" %>
<hbj:content id="myContext" >
<hbj:page title="Epcf iView" >
<SCRIPT src="portalsdc.js"></SCRIPT>
<script language="JavaScript">
function buttonClick() {
someFunc()
</script>
<hbj:form>
<hbj:button
id="sendEvent"
text="Send event"
width="125px"
tooltip="This button raises an event ..."
onClientClick="JavaScript:buttonClick();"
disabled="false"
design="STANDARD"
/>
</hbj:form>
</hbj:page>
</hbj:content>
The code in Java script portalsdc.js is :
function someFunc()
alert ("HI");
Even i have set and tried jsObjectNeeded = TRUE for button.
Thanks and Regards,
Saravanan -
'Control parameters' when call the smartform function module
Hi all,
I want to know what we have to export as value to control papameter while calling the fm of smartform.
Plz also let me know the various parameters in CONVERT_OTF.
Thanks in advance.WA_CONTROL_PARAMETERS-GETOTF = 'X'.
the above is needed if you want OTF data, to convert it to PDF
WA_CONTROL_PARAMETERS-LANGU = 'E'.
Language of smartform
WA_CONTROL_PARAMETERS-DEVICE = 'PRINTER'.
*default o/p device
WA_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
if you dont want the pop up screen , that asks you for printing make the value as 'X' .
other wise make it as space or clear it.
WA_CONTROL_PARAMETERS-PREVIEW = SPACE.
if u want the print preview , make it as 'X' , otherwise SPACE
Below code shows how you can convert the OTF data to PDF data.
calling the smartform.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'Z_SMARTFORM'
IMPORTING
FM_NAME = WF_FUNCMODULENAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
CALL FUNCTION WF_FUNCMODULENAME
EXPORTING
CONTROL_PARAMETERS = WA_CONTROL_PARAMETERS "Control Params
OUTPUT_OPTIONS = WA_OUTPUT_OPT "Output Options
WF_CARRID = WF_CARRID
WF_CONNID = WF_CONNID
WF_FLDATE = WF_FLDATE
IMPORTING
DOCUMENT_OUTPUT_INFO = WA_DOCUMENT_OUTPUT_INFO
JOB_OUTPUT_INFO = WA_JOB_OUTPUT_INFO
JOB_OUTPUT_OPTIONS = WA_JOB_OUTPUT_OPTIONS
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
EXPORTING
ARCHIVE_INDEX = WA_ARC_IDX
IMPORTING
BIN_FILESIZE = WF_NUMBYTES
TABLES
OTF = WA_JOB_OUTPUT_INFO-OTFDATA[]
DOCTAB_ARCHIVE = TB_DOCTAB_ARCHIVE[]
LINES = TB_LINES[]
EXCEPTIONS
ERR_CONV_NOT_POSSIBLE = 1
ERR_OTF_MC_NOENDMARKER = 2
OTHERS = 3. -
Calling Java Script Function from Applet
How can I call the Java Script method from Applet. This should work both on IE and NN running on both Windows NT and solaris. I know it is possible to call the function in Java script using JSObject. But I don't have JSObject at run time. Please let me know how to call Java Script function from applet without using JSObject.
For Java <-> JavaScript communication in Netscape / Mozilla see:
http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/lc.html#1014290
http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/lc.html#1008480 -
How to pass a JSP var to a Script function called in a netui:checkbox
How to pass a JSP variable to a Java Script function called in a netui:checkbox onSelect?
I have a requirement where based on the checkBox selected or deselected in a repeater tag I would have to select or deselect other checkboxes in a netui:form. I am trying to pass the index or unique name of the checkbox to the JavaScript function. When I try this code I am getting a Syntax Error!! and getting a " item undefined" in the javascript. This works when I use just the html form tag but when I use the <netui:form> tag I am facing this issue. Any help would be highly appreciated.
function selectACheckBoxOnClick(name) {
alert ("called selectACheckBoxOnClick ");
alert ("called name "+name);
<netui-data:repeater dataSource="{pageFlow.unregisteredContractAssetsDTOArr}">
<netui-data:repeaterItem>
<% String checkboxName = "selectACheckBox_"+i;
String serialNum = "serialNum_"+i;
String hidenboxName = "hiddenACheckBox_"+i;
String loopNo = new Integer(i).toString();
System.out.println("Loop String :"+ loopNo);
System.out.println("CheckBox Name:"+ checkboxName);
System.out.println("serialNum :"+serialNum); %>
<tr bgcolor="#ffffff">
<td align="center">
<netui:checkBox dataSource="{container.item.selectedAssetFlag}" onSelect="selectACheckBoxOnClick(<%=checkboxName%>);" tagId="<%=checkboxName%>"/>
</td>
<td class="small"><netui:label value="{container.item.model}"/></td>
<td class="small">
<netui:hidden dataSource="{container.item.splitAssetNo}" tagId="<%=serialNum%>"/>
<netui:label value="{container.item.serial}"></netui:label></td>
<td class="small"><netui:label value="{container.item.equpimentId}"/></td>
<td class="small">
<netui-data:getData resultId="siteId" value="{container.item.siteNo}" />
<%String siteId = (String) pageContext.getAttribute("siteId");%>
<netui:anchor action="getSiteLevelAssets" formSubmit="true">
<netui:parameter value="{container.item.siteNo}" name="siteNo" />
<netui:label value="{container.item.siteNo}" />
</netui:anchor>
</td> </tr>
<%i++;%>
</netui-data:repeaterItem>
</netui-data:repeater>
This code works within a form:
<td align=center>
<input type=image name="unassign" onclick="javascript:unassignReplacement(<%=replacementSupply.getPMSupplyId()%>)" src="<%=request.getContextPath()%>/images/bt_sm_x.gif" border=0 alt="Unassign">
</td>
Thanks,
Salomehi
i did not go thru your code completly
but u can use the following for your problem
the checkbox in the repeater must have unique TagID
counter = 0; (initialize)
<netui-data:repeaterItem>
<netui:checkBox dataSource="" tagId='<%="count"+String.valueOf(counter)%>' onClick="some function()" />
<%counter++;%>
</netui-data:repeaterItem>
here if u have 3 checkbox
They will have Tagid's as count1 , count2 and count3
now in the javascript somefunction()
use the following line
for(j=0;j<<%=counter%>;j++)
document.forms(0)[getNetuiTagName"count"+j)].checked=false;
} -
RFC function call from VB Script
I have an RFC enabled function that I need to call from VBScript. I was working through this issue as a BAPI call but after research and RFC not initialized error messages over and over I am coming to think that the issue is not how I was doing it but what I was trying to do with different objects.
I think the issue is that I was trying to call a RFC function with BAPI methods, I didnt understand that there was I difference but now I do. I don't know how to initialize the RFC on the host system and unsure if I even have all of the components on the host system to make these function calls.
The goal here is to call a function that passes 3 paramters and modifies a user object in SAP.Hello John,
are you using DCOM Connector? I have a VBScript working correctly, using DCOM Connector, and consuming a Z function module defined as RFC.
What's the error message you're getting?
Regards
Michael -
Column link - call java script & assign current report column value to item
Hi,
How to call java script and assing current report column value to item?
I have a button column in the report to 'delete' the selected row.
I want to first show dialog box with message 'Are you sure?'. If yes, process to delete
will be executed, else no action.
In order to fire JS, I used Column Link ->Target=URL.
Problem: The alert is showing but I don't know how to pass selected row's primary
key value to process (to delete selected row).
I have a item which can be used to store selected primary key value but don't know how to assign the value
when button pressed.
Thanks in advance
DipOk. The issue has been resolved by following way.
PAGE PROCESS: delete_request
begin
delete xyz
where id = :P8_id;
commit;
end;BUTTON URL:
javascript: DelRec(null,'CREATE', 'f?p=&APP_ID.:8:&SESSION.:delete_request:NO::P8_id:#id#');Java Script:
<script language="JavaScript1.1" type="text/javascript">
function DelRec(msg, req, url){
var confDel = msg;
if(confDel ==null){
confDel= confirm("Are you sure?");
}else{
confDel= confirm(msg);}
if (confDel== true){
redirect(url); }
</script> -
Calling SAP script program in BAPI and want to display in html format
Dear All,
I am writing bapi and calling sap script program in it.
I want output in html format pl suggest me
same coding is working for report giving error in sapscript only.
types: begin of tt_html,
html type w3html,
end of tt_html.
data: list_tab type standard table of abaplist.
SELTAB-SELNAME = 'S_INVNO'.
SELTAB-KIND = 'S'.
SELTAB-SIGN = 'I'.
SELTAB-OPTION = 'EQ'.
SELTAB-LOW = INVOICE_NUM1.
SELTAB-HIGH = INVOICE_NUM2.
APPEND SELTAB.
submit ZSDRDINVPNBRPT with selection-table seltab
exporting list to memory and return.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = MTAB_REPORT_LIST
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'WRITE_LIST'
EXPORTING
WRITE_ONLY = 'X'
TABLES
listobject = MTAB_REPORT_LIST
EXCEPTIONS
EMPTY_LIST = 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.
CALL FUNCTION 'WWW_LIST_TO_HTML'
TABLES
HTML = MTAB_REPORT_HTML
EXCEPTIONS
OTHERS = 1.
LOOP AT MTAB_REPORT_HTML.
ENDLOOP.For displaying output in html format,
u can either use BSP ( Business Server Pages)
or Webdynpro.
Reward if helpful. -
SEND_ERROR in the SMARTFORM function module
Hi All,
I want to send the PO via e-mai as attached PDF file. It is working fine in DEV. But in PRD i am getting SEND_ERROR in the SMARTFORM function module.
can any one hep me to fix this????
CALL FUNCTION fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ssfctrlop
output_options = ls_composer_param
user_settings = 'X'
nast = nast
zxekko = zxekko
zxpekko = zxpekko
IMPORTING
job_output_info = job_output_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
Rgds,
Rajesh.Hi,
Go to se37,enter ur generated function module name .
Put a brkpoint at first executable statement of that FM.
If u run ur program,then it will stop.
Then put brk point on SSRFT_READ_ERROR(From menu).
after press f8,u will know what is the reason of ur error.
and check thjis also
http://wiki.sdn.sap.com/wiki/display/Snippets/Unique+Driver+Program+for+any+smartform+of+a+transaction
Try like this.
Thanks
Gourav. -
Function call from button works then vanishes if I click anywhere
I have the following code and it works great some times but others nothing happens, the button seems to work then for no apparent reason (at least nothing that comes up in the javascript console) I click and it says "FundName.FundTitle.getFundTitle is not a function" but it worked several times before that and nothing changed. Feel like I'm losing my mind, please give me some insight if you have any, everything is set to export for acrobat 9 and I have reader nine installed.
DeedEstablishmentForm.Page1.Button2::click - (JavaScript, client)
var str = FundName.FundTitle.getFundTitle();
I have a fragment that has the following:
form1.FundName.FundTitle::initialize - (JavaScript, client)
function getFundTitle(){
this.str = new String(this.rawValue);
this.start = str.length - 20;
this.idx = str.toLowerCase().lastIndexOf('superannuation fund');
xfa.host.messageBox(this.str.valueOf());
xfa.host.messageBox(this.start.toString());
xfa.host.messageBox(this.idx.toString());
if(this.start >= 1 && this.idx >= this.start && this.idx >= 1){
return this.str.slice(0,idx);
}else{
return this.str;I talked to the developers about this one and I think we figured out what is happening. It has to do with the scope of the function. Here is what we believe is happening. You have defined your function on the Initialize event of an object. The function gets created and at the end of the Initialize event script it is no longer needed so it is marked for deletion. The function is still around until the next garbage collection cycle. Now the form finishes loading and you hit the button to call the function. Because th efunction still exists it is called. You continue to do this and all is OK. At some point garbage collection will run and the function will be deleted. It is at that point that you call it again and get the error. To resolve this problem you need to ensure that the funstion is always available. If you move your function to a script object then when the form loads the script object will run and your function will be created. Now it is callable at all times and shoudl alleviate th eissue you are having.
On another note I noticed the use of the "this" key word in your script. In our world the "this" object is the obejct that has focus (or who is making the call). The ability to extend the "this" object as you do with str, start and idx is going to disappear. The "this" object will become immutable in a future release. To ensure that you do not have issues in a future release I suggest you change the way you do that code.
Lastly by moving the code to a script object you will not be able to use "this". You can pass an object to the script and use that instead.
Hope that helps. Let me know if you need further explanation.
Paul
Maybe you are looking for
-
Well I have bought my iPad two weeks ago and my iTunes used to open on my pc and iPad, but in the last four days it never opens except at morning when I wake up, what's wrong, please help.
-
Copy AP Configuration Templates-WCS 7.0.172.0
I am wondering if anyone has seen a way to copy an AP configuration template. We have several distribution centers and the templates are essentially identical other than the Template name and the AP Group VLAN (different for each DC). We set up a new
-
Paid Invoices - Status showing as 'Open'
Hi Experts, Have you had a situation in SBO 05 where the an invoice has been paid but the status shows Open? This is a very weird problem I am having. The BP's recon does not pick up these 'Open' Invoices at all, and the BP's balance is correct! Thes
-
PrinterJob.lookupPrintServices() returns no PrintServices on Solaris 10
I am using a third-party PDF Java print API that uses the Java Print API. The API is used in a WebLogic 10.2 server runtime environment. My problem is that after the server has been running for a day or so, the API is no longer able to see the printe
-
PO workflow - escalator at plant level
Hi SAP people, do you know if it is possible to set the time for workflow escalator at plant level? I have implemented the PO approval flow but i want to define 2 different escalator... Thanks in advance Michela