Sample code to process stylesheet on serverside
Hi,
Can u please give me a sample code to process style sheet on server side. The xml document is obtained from database.
Thanks
RAJ
I solved it, Here is the code for begineers.
try {
DOMParser parser = new DOMParser();
parser.parse((new File("C://Rajesh/Equipment/Pops.xsl")).toURL().toString());
XMLDocument xsldoc = parser.getDocument();
java.net.URL ref = null;
XSLStylesheet xsl = new XSLStylesheet(xsldoc, ref);
OutputStream os = response.getOutputStream();
processor.processXSL(xsl, Populardevices, response.getOutputStream());
// Here Populardevices is XMLDocument obtained from database.
} catch (org.xml.sax.SAXException ex){
String ll = ex.getMessage();
System.out.println ("Error processing XSL" + ll);
}catch (XSLException ex){
ex.printStackTrace();
System.out.println ("Error display XSL" + ex);
}catch (Exception ex) {
System.out.println("Error" + ex);
//ex.printStackTrace();
}
Similar Messages
-
Sample code in Update Rule to restrict data selection?
We used to restrict data selection in InfoPackage data selection, e.g., for company code range when loading data from a source system (e.g. EBP which is similar to R3), but somehow the company code range we set in InfoPackage data selection not working and we found actually it occurs on the source system side when running RSA3 on EBP side and input the company code range in RSA3 selection section, but still it extracts data beyond the company code range. We don't understand why EBP data selection doesn't work, then we consider in update rule on BW to set the company code range. We know in update rule, we can select Start Routine, formula, or routine to set the company code range. But we would be appreciated if experts here can recommend which one is the most efficient to load data fast for data load performance reason and would be appreicated if you can let us know the sample code!
Thanks in advance!hi Hari,
I copy the whole code of the start routine below:
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line -
TABLES: ...
Includes to update generic objects
INCLUDE rsbctgn_top .
INCLUDE rsbctgn_update_rules .
INCLUDE rsbctbbp_generic_objects.
The following section is prepared for you if you compound
the business partner 0BPARTNER with the
Source System 0BBP_SYS_BP or if you compound the organizational
Unit 0ORGUNIT with the source System 0BBP_SYS_BP
TYPE-POOLS: RRSV.
Data: L_HLP_CHAVL_CMP TYPE RSCHAVL.
DATA:
L_S_DEP TYPE RRSV_S_DEP,
L_T_DEP TYPE RRSV_T_DEP.
End of compound
DATA: l_s_errorlog TYPE rssm_s_errorlog_int,
l_hlp_chavl TYPE rschavl.
$$ end of global - insert your declaration only before this line -
The follow definition is new in the BW3.x
TYPES:
BEGIN OF DATA_PACKAGE_STRUCTURE.
INCLUDE STRUCTURE /BIC/CS0BBP_CONF_TD_1.
TYPES:
RECNO LIKE sy-tabix,
END OF DATA_PACKAGE_STRUCTURE.
DATA:
DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
FORM startup
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
DATA_PACKAGE STRUCTURE DATA_PACKAGE
USING RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
$$ begin of routine - insert your code only below this line -
fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
to make monitor entries
delete data_package where 0comp_code < 'X300' OR 0comp_code > 'X6ZZ'.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
$$ end of routine - insert your code only before this line -
ENDFORM. -
Hi guys please give me sample code for call transaction that handles error
hi guys, please give me sample code for call transaction that handles error,
please send me the sample code in which there should be all decleration part and everything, based on the sample code i will develop my code.
please do help me as it is urgent.
thanks and regards.
prasadnn.Hi Prasad,
Check this code.
Source Code for BDC using Call Transaction
*Code used to create BDC
*& Report ZBDC_EXAMPLE *
*& Example BDC program, which updates net price of item 00010 of a *
*& particular Purchase order(EBELN). *
REPORT ZBDC_EXAMPLE NO STANDARD PAGE HEADING
LINE-SIZE 132.
Data declaration
TABLES: ekko, ekpo.
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekko-ebeln,
waers TYPE ekko-waers,
netpr TYPE ekpo-netpr,
err_msg(73) TYPE c,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko,
it_error TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_error TYPE t_ekko,
it_success TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_success TYPE t_ekko.
DATA: w_textout LIKE t100-text.
DATA: gd_update TYPE i,
gd_lines TYPE i.
*Used to store BDC data
DATA: BEGIN OF bdc_tab OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdc_tab.
*Used to stores error information from CALL TRANSACTION Function Module
DATA: BEGIN OF messtab OCCURS 0.
INCLUDE STRUCTURE bdcmsgcoll.
DATA: END OF messtab.
*Screen declaration
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME
TITLE text-001. "Purchase order Num
SELECT-OPTIONS: so_ebeln FOR ekko-ebeln OBLIGATORY.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME
TITLE text-002. "New NETPR value
PARAMETERS: p_newpr(14) TYPE c obligatory. "LIKE ekpo-netpr.
SELECTION-SCREEN END OF BLOCK block2.
*START-OF-SELECTION
START-OF-SELECTION.
Retrieve data from Purchase order table(EKKO)
SELECT ekkoebeln ekkowaers ekpo~netpr
INTO TABLE it_ekko
FROM ekko AS ekko INNER JOIN ekpo AS ekpo
ON ekpoebeln EQ ekkoebeln
WHERE ekko~ebeln IN so_ebeln AND
ekpo~ebelp EQ '10'.
*END-OF-SELECTION
END-OF-SELECTION.
Check data has been retrieved ready for processing
DESCRIBE TABLE it_ekko LINES gd_lines.
IF gd_lines LE 0.
Display message if no data has been retrieved
MESSAGE i003(zp) WITH 'No Records Found'(001).
LEAVE TO SCREEN 0.
ELSE.
Update Customer master data (instalment text)
LOOP AT it_ekko INTO wa_ekko.
PERFORM bdc_update.
ENDLOOP.
Display message confirming number of records updated
IF gd_update GT 1.
MESSAGE i003(zp) WITH gd_update 'Records updated'(002).
ELSE.
MESSAGE i003(zp) WITH gd_update 'Record updated'(003).
ENDIF.
Display Success Report
Check Success table
DESCRIBE TABLE it_success LINES gd_lines.
IF gd_lines GT 0.
Display result report column headings
PERFORM display_column_headings.
Display result report
PERFORM display_report.
ENDIF.
Display Error Report
Check errors table
DESCRIBE TABLE it_error LINES gd_lines.
If errors exist then display errors report
IF gd_lines GT 0.
Display errors report
PERFORM display_error_headings.
PERFORM display_error_report.
ENDIF.
ENDIF.
*& Form DISPLAY_COLUMN_HEADINGS
Display column headings
FORM display_column_headings.
WRITE:2 ' Success Report '(014) COLOR COL_POSITIVE.
SKIP.
WRITE:2 'The following records updated successfully:'(013).
WRITE:/ sy-uline(42).
FORMAT COLOR COL_HEADING.
WRITE:/ sy-vline,
(10) 'Purchase Order'(004), sy-vline,
(11) 'Old Netpr'(005), sy-vline,
(11) 'New Netpr'(006), sy-vline.
WRITE:/ sy-uline(42).
ENDFORM. " DISPLAY_COLUMN_HEADINGS
*& Form BDC_UPDATE
Populate BDC table and call transaction ME22
FORM bdc_update.
PERFORM dynpro USING:
'X' 'SAPMM06E' '0105',
' ' 'BDC_CURSOR' 'RM06E-BSTNR',
' ' 'RM06E-BSTNR' wa_ekko-ebeln,
' ' 'BDC_OKCODE' '/00', "OK code
'X' 'SAPMM06E' '0120',
' ' 'BDC_CURSOR' 'EKPO-NETPR(01)',
' ' 'EKPO-NETPR(01)' p_newpr,
' ' 'BDC_OKCODE' '=BU'. "OK code
Call transaction to update customer instalment text
CALL TRANSACTION 'ME22' USING bdc_tab MODE 'N' UPDATE 'S'
MESSAGES INTO messtab.
Check if update was succesful
IF sy-subrc EQ 0.
ADD 1 TO gd_update.
APPEND wa_ekko TO it_success.
ELSE.
Retrieve error messages displayed during BDC update
LOOP AT messtab WHERE msgtyp = 'E'.
Builds actual message based on info returned from Call transaction
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
msgid = messtab-msgid
msgnr = messtab-msgnr
msgv1 = messtab-msgv1
msgv2 = messtab-msgv2
msgv3 = messtab-msgv3
msgv4 = messtab-msgv4
IMPORTING
message_text_output = w_textout.
ENDLOOP.
Build error table ready for output
wa_error = wa_ekko.
wa_error-err_msg = w_textout.
APPEND wa_error TO it_error.
CLEAR: wa_error.
ENDIF.
Clear bdc date table
CLEAR: bdc_tab.
REFRESH: bdc_tab.
ENDFORM. " BDC_UPDATE
FORM DYNPRO *
stores values to bdc table *
--> DYNBEGIN *
--> NAME *
--> VALUE *
FORM dynpro USING dynbegin name value.
IF dynbegin = 'X'.
CLEAR bdc_tab.
MOVE: name TO bdc_tab-program,
value TO bdc_tab-dynpro,
'X' TO bdc_tab-dynbegin.
APPEND bdc_tab.
ELSE.
CLEAR bdc_tab.
MOVE: name TO bdc_tab-fnam,
value TO bdc_tab-fval.
APPEND bdc_tab.
ENDIF.
ENDFORM. " DYNPRO
*& Form DISPLAY_REPORT
Display Report
FORM display_report.
FORMAT COLOR COL_NORMAL.
Loop at data table
LOOP AT it_success INTO wa_success.
WRITE:/ sy-vline,
(10) wa_success-ebeln, sy-vline,
(11) wa_success-netpr CURRENCY wa_success-waers, sy-vline,
(11) p_newpr, sy-vline.
CLEAR: wa_success.
ENDLOOP.
WRITE:/ sy-uline(42).
REFRESH: it_success.
FORMAT COLOR COL_BACKGROUND.
ENDFORM. " DISPLAY_REPORT
*& Form DISPLAY_ERROR_REPORT
Display error report data
FORM display_error_report.
LOOP AT it_error INTO wa_error.
WRITE:/ sy-vline,
(10) wa_error-ebeln, sy-vline,
(11) wa_error-netpr CURRENCY wa_error-waers, sy-vline,
(73) wa_error-err_msg, sy-vline.
ENDLOOP.
WRITE:/ sy-uline(104).
REFRESH: it_error.
ENDFORM. " DISPLAY_ERROR_REPORT
*& Form DISPLAY_ERROR_HEADINGS
Display error report headings
FORM display_error_headings.
SKIP.
WRITE:2 ' Error Report '(007) COLOR COL_NEGATIVE.
SKIP.
WRITE:2 'The following records failed during update:'(008).
WRITE:/ sy-uline(104).
FORMAT COLOR COL_HEADING.
WRITE:/ sy-vline,
(10) 'Purchase Order'(009), sy-vline,
(11) 'Netpr'(010), sy-vline,
(73) 'Error Message'(012), sy-vline.
WRITE:/ sy-uline(104).
FORMAT COLOR COL_NORMAL.
ENDFORM. " DISPLAY_ERROR_HEADINGS
Hope this resolves your query.
Reward all the helpful answers.
Regards -
Sample code for offline PDF forms submit to workflow
Hi,
I have a XDP form which needs to be submitted offline by the user. So i have saved the XDP as dynamic PDF. On submit of this PDF the code flows to the servlet. I am getting the following error:
"com.adobe.formServer.interfaces.ProcessFormSubmissionException: RequestBuffer not specified at com.adobe.formServer.client.EJBClient.processFormSubmission(EJBClient.java:454) at samples.triggerworkflow.servlet.ProcessFormServlet.doPost(ProcessFormServlet.java:54) at samples.triggerworkflow.servlet.ProcessFormServlet.doGet(ProcessFormServlet.java:28) at javax.servlet.http.HttpServlet.service(HttpServlet.java:697) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at.... "
Finally i need to trigger the workflow from the servlet.
Please help me fix this error. Pleas eprovide a sample code if you have.
My servelt code is:
package samples.triggerworkflow.servlet;
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.*;
import com.adobe.formServer.client.*;
import com.adobe.formServer.interfaces.*;
import com.adobe.idp.*;
import com.adobe.workflow.client.*;
import com.adobe.workflow.manager.*;
import samples.util.*;
* @version 1.0
* @author
public class ProcessFormServlet extends HttpServlet implements Servlet {
private static String failedHTML = "Process Invocation Failed. See Log";
* @see javax.servlet.http.HttpServlet#void (javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
doPost(req, resp);
* @see javax.servlet.http.HttpServlet#void (javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
EJBClient formServer = new EJBClient(Util.getInitContext(getServletContext()));
IOutputContext form = null;
try {
IOutputContext outputContext =formServer.processFormSubmission(req,"OutputType=0");
// Determine the content type -- make sure it is text/xml
String ct = outputContext.getContentType();
if ((ct.equals("text/xml"))||(ct.equals("application/vnd.adobe.xdp+xml")))
// Get the length of the output stream
int outLength = outputContext.getOutputContent().length;
// Create a byte array and allocate outLength bytes
byte[] formOutput = new byte[outLength];
// Populate the byte array by invoking getOutputContext
formOutput = outputContext.getOutputContent();
System.out.println("coming in post 5555***********");
} catch (ProcessFormSubmissionException e1) {
System.out.println("coming in exception 123***********");
e1.printStackTrace(resp.getWriter());
return;
String returnHtml = triggerWorkflow(form);
resp.setContentType("text/html");
resp.setContentLength(returnHtml.length());
resp.getWriter().print(returnHtml);
private String triggerWorkflow(IOutputContext form) {
System.out.println("coming in triggerWorkflow 1111***********");
QLCSession session = null;
String html = null;
try {
System.out.println("coming in try of triggerWorkflow 2222***********");
session = QLCSessionFactory.createSession("Localhost");
Context wkfContext = session.login("administrator", "password");
session.setContext(wkfContext);
System.out.println("coming in try of triggerWorkflow 3333***********");
ProcessManager manager = session.getProcessManager();
System.out.println("coming in try of triggerWorkflow 4444***********");
manager.setContextFigured out how to set an event parameter in the function:
CALL METHOD event_container->set
EXPORTING
name = 'Item'
value = wa_eban-bnfpo -
Where can I get the sample code of gantt chart?
hi, all
I want to use gantt chart component.I find this video http://download.oracle.com/otn_hosted_doc/jdeveloper/11/demos/DVT_Gantt_Chart/ADFDVTGanttChartDemo.html.
where can I get the sample code in this video?
I have got the demo <strong>dvt-faces-demo.ear</strong>.but in this demo, the code of events process is too simple.I want more detail code of date change, denpendency change and so on.
this is my mail [email protected]
Thanks
Best Regards
kenshin
Edited by: Himura Kenshin on 2010-8-20 上午4:57
Edited by: Himura Kenshin on 2010-8-20 上午9:03Hi Katia,
Essentially the same sample app which was referenced above (http://download.oracle.com/otn_hosted_doc/jdeveloper/11/demos/DVT_Gantt_Chart/ADFDVTGanttChartDemo.html). There are many features implemented in this sample which I'll be "reinventing the wheel" with. Its been a bit since I worked with the gantt component as I had to abandon for other development but will be getting back into it here shortly.
Namely as I remember, I had difficult time getting the gantt to load quickly with large amount of tasks, difficulty getting the selected item when using context menus or buttons defined within the control, and a few other minor issues which could be fixed as I was using the first release of 11g and cannot remember specifics. I'll let you know as I get back into it if I see similar problems.
For example, if you go to the ADF Demo Site (http://jdevadf.oracle.com/adf-richclient-demo/faces/feature/index.jspx) and click on "Project Gantt Custom Menu and Toolbar - add menus and buttons on the Project Gantt Menu and Toolbar". The buttons work, however if you first select a row in the left and then click the button, you have to click twice for it to work (in my findings the action listener never "fires"). So in my case I want to select a row and then have a custom event for that selected row when I click the button. There were other similar findings I had when I tried to go off of the examples.
Hope this helps.
Thank you,
Kris -
Sample code snippet needed to provision appinstance with child data in R2
Gurus,
I have developed some code to provision an application instance to a user using API but it is not working.
Can you please provide me some sample code to provision with child data this using API.
Here are the errors.
oracle.iam.provisioning.exception.GenericProvisioningException: An error occurred in oracle.iam.provisioning.spi.DOBProvisioningMechanism/provision while provisioning application instance with key 16907 to user with name TESETUSER the cause of error is oracle.iam.provisioning.exception.GenericProvisioningConfigException: Entitlement attribute not marked as key in reconciliation field mapping for UD_ADUSRC.
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:237)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
at oracle.iam.provisioning.api.ProvisioningService_p7m7x_ProvisioningServiceRemoteImpl_1036_WLStub.provisionx(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
at $Proxy2.provisionx(Unknown Source)
at oracle.iam.provisioning.api.ProvisioningServiceDelegate.provision(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at Thor.API.Base.SecurityInvocationHandler$1.run(SecurityInvocationHandler.java:68)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.security.Security.runAs(Security.java:41)
at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(weblogicLoginSession.java:52)
at Thor.API.Base.SecurityInvocationHandler.invoke(SecurityInvocationHandler.java:79)
at $Proxy3.provision(Unknown Source)
at OIM.provisioning.DirectProvisionApplicationInstance.provisionResource(DirectProvisionApplicationInstance.java:118)
at OIM.provisioning.DirectProvisionApplicationInstance.main(DirectProvisionApplicationInstance.java:179)
Caused by: oracle.iam.provisioning.exception.GenericProvisioningException: An error occurred in oracle.iam.provisioning.spi.DOBProvisioningMechanism/provision while provisioning application instance with key 16907 to user with name TESETUSER the cause of error is oracle.iam.provisioning.exception.GenericProvisioningConfigException: Entitlement attribute not marked as key in reconciliation field mapping for UD_ADUSRC.
at oracle.iam.provisioning.util.ProvisioningUtil.throwGenericProvisioningException(ProvisioningUtil.java:216)
at oracle.iam.provisioning.spi.DOBProvisioningMechanism.provision(DOBProvisioningMechanism.java:401)
at oracle.iam.provisioning.impl.ProvisioningServiceImpl$4.process(ProvisioningServiceImpl.java:488)I am new to the Windows programming environment (I'm running Windows 7).
I am looking for sample code that will do the following:
1.
12.
If you expect a useful answer here, you'll have to narrow your thread(s) to one specific
issue. Posting a (virtually) complete application specification is far too broad and
comprehensive for any one thread in these forums.
Pick *one* aspect of this project and describe what problems you're having writing the code.
Post a new thread for each specific problem.
As posted, you appear to be hoping to find code already completely written for this project.
Most sample code illustrates *one* task, not a dozen. If you aren't able or willing to do
the lion's share of the coding yourself, you may have to consider contracting a developer.
- Wayne -
New Sample Code: Querying techniques, integration events, book assignment
We have just posted a new CRM On Demand Web Services code sample to Oracle Sample Code. This sample uses a combination of WS v1.0 and WS v2.0 to demonstrate advanced samples like querying techniques, processing integration events, and book assignment.
The sample is written using .Net framework 1.1 and VS studio 2003. Users will need to have Microsoft .NET (.Net Framework 1.1) installed on their machine.
<a title="Click here" href="https://codesamples.samplecode.oracle.com/servlets/Scarab/action/ExecuteQuery?query=crm_on_demand" target="_blank">Click here</a> to go to the CRM On Demand code samples. Look for Artifact ID S517, Advanced WS Techniques (in .NET Framework 1.1)I found some examples in the Web Services Resource Library.
you can access this through the "Training and Support" link from within CRM OD.
Then click on "Web Services Library" then download the Getting Started kits
Edited by: user10730659 on 20/01/2009 16:11 -
Has Apple released Sample Code using In-App Purchase?
The title says it all...
Does anyone know if Apple has released Sample Code using In-App Purchase?
I've read through (skimming mostly) the In App Purchase section of the iPhone OS Reference Library
Thanks to K T I have:
http://developer.apple.com/iphone/program/sdk/inapppurchase.html
and
https://itunesconnect.apple.com/docs/iTunesConnect_DeveloperGuide.pdf
Check pages 52~71 in the 115 page updated iTunes Connect Developer Guide for all the ugly details...
This will be part of my weekend project
-CarlI guess I will mark this solved, for the time being.
I was just hoping that maybe Apple had released some example code in a working program, rather than just the snippets used to explain the process. I haven't had the presence of mind to read and follow the document all the way through and wanted to compare working code if possible.
Thanks Ray. If all goes well, maybe I'll figure it out by the end of the weekend.
-Carl -
Hi All!
I am getting a .txt file from legacy systems.Now i have to read that file and put the values into internal tables using datasets for further processing.
Can anybody give me sample code on this.
Regards
PavanHi pavan,
Code like this...
<b>data : begin of file occurs 0,
v_mara(255),
end of file.
call function 'GUI_UPLOAD'
exporting
filename = 'C:\legacy.TXT'
filetype = 'ASC'
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = file
loop at file.
write : file-v_mara.
endloop</b>. -
KIMYONG : API ( FND_SUBMIT, FND_REQUEST) Sample Code 소개
Purpose
Extension 개발자들이 간혹 요청하는 Standard API (FND_SUBMIT, FND_REQUEST)의 sample code입니다.
Configuring the Script
FND_SUBMIT test procedure and sample code
Creates a procedure called fnd_submit_test that can be registered and run as a concurrent program.
This procedure will use the FND_SUBMIT API to submit a request set. (Function Security Reports - This request set should be seeded, if it is not available the values in the script may need to be changed.) The procedure will then place itself in a Paused status until the request set completes.
Running the Script
1. Install this procedure in the APPS schema.
2. Register the procedure as a concurrent program
Caution
This script is provided for educational purposes only and not supported by Oracle Support Services. It has been tested internally, however, and works as documented. We do not guarantee that it will work for you, so be sure to test it in your environment before relying on it.
Proofread this script before using it! Due to the differences in the way text editors, e-mail packages and operating systems handle text formatting (spaces, tabs and carriage returns), this script may not be in an executable state when you first receive it. Check over the script to ensure that errors of this type are corrected.
Script
REM +==========================================================================
REM | Concurrent Processing Sample Code
REM |
REM | FILE:
REM | fnd_submit_test.pls
REM |
REM | REVISION:
REM | $Id$
REM |
REM | DESCRIPTION:
REM | FND_SUBMIT test procedure and sample code
REM | Creates a procedure called fnd_submit_test that can be registered
REM | and run as a concurrent program.
REM | This procedure will use the FND_SUBMIT API to submit a request set.
REM | (Function Security Reports - This request set should be seeded, if
REM | it is not available the values in the script may need to be changed.)
REM | The procedure will then place itself in a Paused status until the
REM | request set completes.
REM |
REM | INSTRUCTIONS:
REM |
REM | 1. Install this procedure in the APPS schema.
REM |
REM | 2. Register the procedure as a concurrent program
REM |
REM |
REM +==========================================================================
whenever sqlerror exit failure rollback;
create or replace procedure fnd_submit_test (errbuf out varchar2,
retcode out varchar2) as
success boolean;
req_id number;
req_data varchar2(10);
srs_failed exception;
submitprog_failed exception;
submitset_failed exception;
begin
-- Use FND_FILE to output messages at each stage
fnd_file.put_line(fnd_file.log, 'Starting test...');
-- Read fnd_conc_global.request_data, if available then we have been
-- reawakened after the request set has completed.
-- If so, exit.
req_data := fnd_conc_global.request_data;
if (req_data is not null) then
errbuf := 'Done!';
retcode := 0 ;
return;
end if;
-- Step 1 - call set_request_set
fnd_file.put_line(fnd_file.log, 'Calling set_request_set...');
success := fnd_submit.set_request_set('FND', 'FNDRSSUB43');
if ( not success ) then
raise srs_failed;
end if;
fnd_file.put_line(fnd_file.log, 'Calling submit program first time...');
-- Step 2 - call submit program for each program in the set
success := fnd_submit.submit_program('FND','FNDMNFUN', 'STAGE10', 'System Administrator', chr(0));
if ( not success ) then
raise submitprog_failed;
end if;
fnd_file.put_line(fnd_file.log, 'Calling submit program second time...');
success := fnd_submit.submit_program('FND','FNDMNMNU', 'STAGE10', 'System Administrator', chr(0));
if ( not success ) then
raise submitprog_failed;
end if;
fnd_file.put_line(fnd_file.log, 'Calling submit program third time...');
success := fnd_submit.submit_program('FND','FNDMNNAV', 'STAGE10', 'System Administrator', chr(0));
if ( not success ) then
raise submitprog_failed;
end if;
-- Step 3 - call submit_set
fnd_file.put_line(fnd_file.log, 'Calling submit_set...');
req_id := fnd_submit.submit_set(null,true);
if (req_id = 0 ) then
raise submitset_failed;
end if;
fnd_file.put_line(fnd_file.log, 'Finished.');
-- Set conc_status to PAUSED, set request_data to 1 and exit
fnd_conc_global.set_req_globals(conc_status => 'PAUSED', request_data => '1') ;
errbuf := 'Request set submitted. id = ' || req_id;
retcode := 0;
exception
when srs_failed then
errbuf := 'Call to set_request_set failed: ' || fnd_message.get;
retcode := 2;
fnd_file.put_line(fnd_file.log, errbuf);
when submitprog_failed then
errbuf := 'Call to submit_program failed: ' || fnd_message.get;
retcode := 2;
fnd_file.put_line(fnd_file.log, errbuf);
when submitset_failed then
errbuf := 'Call to submit_set failed: ' || fnd_message.get;
retcode := 2;
fnd_file.put_line(fnd_file.log, errbuf);
when others then
errbuf := 'Request set submission failed - unknown error: ' || sqlerrm;
retcode := 2;
fnd_file.put_line(fnd_file.log, errbuf);
end;
rem ===================================================================
commit;
exit;
Reference
자세한 사항은 Note 221542.1 를 참고하세요.Not sure about that particular option, but in general you pass in pairs - an example from code I didn't write but maintain (so if this is the worst possible way, I apologize)
proj_req_id6 := FND_REQUEST.SUBMIT_REQUEST('SQLGL', 'XXXX_GLGENLED_PDF',
'XXXX General Ledger',
'',dummy_default,
'P_SET_OF_BOOKS_ID='||v_rep_cmp.set_of_books_id,'P_CHART_OF_ACCOUNTS_ID=101',
'P_KIND=L','P_CURRENCY_CODE='||v_rep_cmp.currency_code,
'P_ACTUAL_FLAG=A','P_BUD_ENC_TYPE_ID=100',
'P_START_PERIOD='||'&1','P_END_PERIOD='||'&1',
'P_MIN_FLEX='||v_min_flex||'.'||v_emp_cost_center.COST_CENTER||'.00000.000.000.000.00',
'P_MAX_FLEX='||v_max_flex||'.'||v_emp_cost_center.COST_CENTER||'.99999.999.999.ZZZ.99',
'P_PAGE_SIZE=180',chr(0),'',
'','','','','','','','','','');You see where I have option pairs - for example
'P_ACTUAL_FLAG=A'Tells my program that the value for parameter P_ACTUAL_FLAG is A
This example is from a SQL*Plus script, hence the &1 for the value substitutions.
Hope that helps -
What is the Extract statement? Please give me some sample code.?
What is the Extract statement? Please give me some sample code.?
Hello ,
Once you have declared the possible record types as field groups and defined their structure, you can fill the extract dataset using the following statements: EXTRACT . When the first EXTRACT statement occurs in a program, the system creates the extract dataset and adds the first extract record to it. In each subsequent EXTRACT statement, the new extract record is added to the dataset EXTRACT HEADER. When you extract the data, the record is filled with the current values of the corresponding fields. As soon as the system has processed the first EXTRACT statement for a field group , the structure of the corresponding extract record in the extract dataset is fixed. You can no longer insert new fields into the field groups and HEADER. If you try to modify one of the field groups afterwards and use it in another EXTRACT statement, a runtime error occurs. By processing EXTRACT statements several times using different field groups, you fill the extract dataset with records of different length and structure. Since you can modify field groups dynamically up to their first usage in an EXTRACT statement, extract datasets provide the advantage that you need not determine the structure at the beginning of the program.
Sample program:
REPORT ZSPFLI LINE-SIZE 132 LINE-COUNT 65(3)
NO STANDARD PAGE HEADING.
TABLES:SPFLI,SCARR, SFLIGHT, SBOOK.
SELECT-OPTIONS: MYCARRID FOR SPFLI-CARRID.
FIELD-GROUPS: HEADER, SPFLI_FG, SFLIGHT_FG, SBOOK_FG.
INSERT:
SPFLI-CARRID
SPFLI-CONNID
SFLIGHT-FLDATE
SBOOK-BOOKID
INTO HEADER,
SPFLI-CARRID
SPFLI-CONNID
SPFLI-CITYFROM
SPFLI-AIRPFROM
SPFLI-CITYTO
SPFLI-AIRPTO
SPFLI-DEPTIME
SCARR-CARRNAME
INTO SPFLI_FG,
SFLIGHT-FLDATE
SFLIGHT-SEATSMAX
SFLIGHT-SEATSOCC
SFLIGHT-PRICE
INTO SFLIGHT_FG,
SBOOK-BOOKID
SBOOK-CUSTOMID
SBOOK-CUSTTYPE
SBOOK-SMOKER
INTO SBOOK_FG.
SELECT * FROM SPFLI WHERE CARRID IN MYCARRID.
SELECT SINGLE * FROM SCARR WHERE CARRID = SPFLI-CARRID.
EXTRACT SPFLI_FG.
SELECT * FROM SFLIGHT
WHERE CARRID = SPFLI-CARRID AND CONNID = SPFLI-CONNID.
EXTRACT SFLIGHT_FG.
SELECT * FROM SBOOK
WHERE CARRID = SFLIGHT-CARRID AND
CONNID = SFLIGHT-CONNID AND FLDATE = SFLIGHT-FLDATE.
EXTRACT SBOOK_FG.
CLEAR SBOOK.
ENDSELECT.
CLEAR SFLIGHT.
ENDSELECT.
CLEAR SPFLI.
ENDSELECT.
SORT.
LOOP.
AT SPFLI_FG.
FORMAT COLOR COL_HEADING.
WRITE: / SCARR-CARRNAME,
SPFLI-CONNID, SPFLI-CITYFROM,
SPFLI-AIRPFROM, SPFLI-CITYTO, SPFLI-AIRPTO, SPFLI-DEPTIME.
FORMAT COLOR OFF.
ENDAT.
AT SFLIGHT_FG.
WRITE: /15 SFLIGHT-FLDATE, SFLIGHT-PRICE, SFLIGHT-SEATSMAX,
SFLIGHT-SEATSOCC.
ENDAT.
AT SBOOK_FG.
WRITE: /30 SBOOK-BOOKID, SBOOK-CUSTOMID,
SBOOK-CUSTTYPE, SBOOK-SMOKER.
ENDAT.
ENDLOOP. -
How to Delete a Specific Cell in a Matrix + plz Give sample code for Lost F
hello there !!!!
i m in Great Trouble please help me out..
i have to search for a specific Column n then i have to validate that portion, similarly after validating i have to add update delete all the fuction apply... so please help me i m very upset.
Public Sub HandleEventts_Allowance(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByRef BubbleEvent As Boolean)
Try
Dim Count As Int32
If FormUID.Equals("Allowance") Then
If (pVal.BeforeAction = True) And (pVal.ItemUID = "1") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) Then
If pVal.Row = 0 Then
'BubbleEvent = False
End If
o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
Count = o_Matrix.RowCount()
SBO_Application1.MessageBox("Matrix Count is " & o_Matrix.RowCount)
Validate(pVal, EventEnum, FormUID, BubbleEvent)
End If
End If
Catch ex As Exception
SBO_Application1.MessageBox(ex.Message)
End Try
End Sub
Public Sub Validate(ByRef pval As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByVal FormUID As String, ByRef BubbleEvent As Boolean)
Dim Row, ii As Integer
o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
o_Matrix.FlushToDataSource()
Try
For Row = 2 To o_Matrix.RowCount
StrName = Convert.ToString(DBtable.GetValue("CardCode", Row - 1)).Trim()''' i got Error over there n rest of my code is also not working pls...
StrUId = Convert.ToString(DBtable.GetValue("U_AlwID", Row - 1)).Trim()
StrEnter = Convert.ToString(DBtable.GetValue("U_SupEnter", Row - 1)).Trim()
StrExist = Convert.ToString(DBtable.GetValue("U_SupExist", Row - 1)).Trim()
If Row - 1 < DBtable.Rows.Count - 1 Or (Not (StrName.Equals(String.Empty) And StrUId.Equals(String.Empty) And (StrEnter.Equals(String.Empty) Or StrExist.Equals(String.Empty))) And (Row - 1 = DBtable.Rows.Count - 1)) Then
If (Not StrName.Equals(String.Empty)) And ((StrUId.Equals(String.Empty) Or StrEnter.Equals(String.Empty)) Or StrExist.Trim.Equals(String.Empty)) Then
SBO_Application1.StatusBar.SetText("Invalid values provided!Blank values not vllowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
BubbleEvent = False
Exit Sub
End If
For ii = Row To DBtable.Rows.Count - 1
If Convert.ToString(DBtable.GetValue("ColName", ii)).Trim().Equals(StrName.Trim()) Then
SBO_Application1.StatusBar.SetText("Invalid Allowance ID: Duplication Not Allowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
BubbleEvent = False
Exit Sub
End If
Next
If CDbl(StrName) < 0 Then
SBO_Application1.StatusBar.SetText("Invalid values provided!Blank values not vllowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
BubbleEvent = False
Exit Sub
End If
End If
Next Row
Catch ex As Exception
SBO_Application1.MessageBox(ex.Message)
End Try
End SubHello there
sir i want to Add Update and delete these three basic operation onto the Matrix, Sir u game me a Sample code of Delete a specific Column...
Sir can u do me a favour pls leave every thing n just told me how to update a matrix ,like i have to fill the matrix field through the DATABASE table now i want to update the DataBase table from the matrix..
i just only know thta i have to fill back database table with the help of FLUSHTODATABASE()
here is my Sample Code...n i have to update in the validate portion...
Public Sub HandleEventts_Allowance(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByRef BubbleEvent As Boolean)
Try
Dim oCellValue As SAPbouiCOM.EditText
If FormUID.Equals("Allowance") Then
If (pVal.ItemUID = "MatAllow") Then
If pVal.Row = 0 Then Exit Sub
o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
If (pVal.Row > o_Matrix.RowCount) Then Exit Sub
oForm = SBO_Application1.Forms.Item(FormUID)
If (pVal.ItemUID = "1" Or EventEnum = SAPbouiCOM.BoEventTypes.et_CLICK) Then
o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
If pVal.ColUID = "ColName" And pVal.BeforeAction = True Then
If pVal.Row = 0 Then Exit Sub
oCellValue = CType(o_Matrix.Columns.Item(pVal.ColUID).Cells.Item(pVal.Row).Specific(), SAPbouiCOM.EditText)
If (oCellValue.Value.Trim().Equals(String.Empty) And o_Matrix.RowCount <> pVal.Row) Then
SBO_Application1.StatusBar.SetText("Invalid Allowance ID: Blank Value Not Allowed", )
oCellValue.Active = True
BubbleEvent = False
Exit Sub
End If
End If
End If
End If
End If
Validate(pVal, EventEnum, FormUID, BubbleEvent)
Catch ex As Exception
SBO_Application1.MessageBox(ex.Message)
End Try
End Sub
Public Sub Validate(ByRef pval As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByVal FormUID As String, ByRef BubbleEvent As Boolean)
Dim str, str1 As String
Dim checkbox1, Checkbox2 As SAPbouiCOM.CheckBox
Dim o_Matrix As SAPbouiCOM.Matrix
Dim Sum As Integer
Dim oRecordset As SAPbobsCOM.Recordset
Dim Container As Integer
Dim Count As Int32
o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
oRecordset = o_CompanyObj.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Try
For Count = 0 To DBtable.Rows.Count - 1
CodeFill = Convert.ToString(DBtable.GetValue("Name", Count).Trme())
NameID = Convert.ToString(DBtable.GetValue("ColUID", Count).Trim())
Price = Convert.ToString(DBtable.GetValue("ColPrice", Count).Trim())
Quantity = Convert.ToString(DBtable.GetValue("ColQuant", Count).Trim())
Total = Convert.ToString(DBtable.GetValue("ColTotal", Count).Trim())
checkbox1 = o_Matrix.Columns.Item("ColSEnter").Cells.Item(Count).Specific
Checkbox2 = o_Matrix.Columns.Item("ColSExist").Cells.Item(Count).Specific
If (checkbox1.Checked = True) And (Checkbox2.Checked = True) Then
Dim Sql As String
Sql = "Update [@Supplier] Set U_Price=' " & Price & " ',U_ID=" & NameID & "Where Name ='" & CodeFill & " '"
oRecordset.DoQuery(Sql)
End If
Next Count
SBO_Application1.MessageBox("Record was Updated")
Catch ex As Exception
SBO_Application1.MessageBox(ex.Message)
End Try
End Sub -
Error while running a sample code
Hello,
I 'm getting the following error while i'm trying to run a
sample code which I have imported into Flex 3.
===================================================================
Severity and Description Path Resource Location Creation Time
Id
unable to open 'C:\Documents and Settings\sn55179\My
Documents\Flex Builder
3\FlexForDummies_Chapter3_Code\libs'FlexForDummies_Chapter3_Code
Unknown 1237909480511 215
===================================================================
Can anyone help me in resolving this issue.
Many thanks in advance.It's very frustrating that FB stops working when the libs
folder is missing. If you are checking in project files to a source
control app like Perforce, empty folders don't get added, so if you
don't add an initial dummy file, the next time you do a clean sync,
the libs folder may not be there, and even though there is nothing
there, FB complains. :-( -
Hi all,
This is what I want to achieve. I have an attribute for an IO, but the values for that has to be decided at the transfer structure level. I want to write a routine in the transfer rules to populate the field.
I have another field that gets populated from R/3. I need to write a routine which would take this value and see if it falls in the range and have to decide the value and populate.
I have gl_account coming in, and in the routine I need to take that value of the gl_account and see if it falls in the range of 1 5000 or 6700 - 8130 if so assign a + sign and if not assign a sign to the new field.
Any sample code would be appreciated and rewarded.
Thanks,
SriGlobal code used by conversion rules
$$ begin of global - insert your declaration only below this line -
TABLES: ...
DATA: ...
$$ end of global - insert your declaration only before this line -
$$ begin of routine - insert your code only below this line -
DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
Data: temp1 TYPE RANGE OF TRAN_STRUCTURE-ZDEBITCREDIT,
Data: temp1_line LIKE LINE OF temp1.
temp1_line-sign = 'I'.
temp1_line-option = 'BT'.
temp1_line-low = '001'.
temp1_line-high = '5000'.
APPEND temp1_line TO temp1
Data: temp2 TYPE RANGE OF TRAN_STRUCTURE-ZDEBITCREDIT,
Data: temp2_line LIKE LINE OF temp2.
temp2_line-sign = 'I'.
temp2_line-option = 'BT'.
temp2_line-low = '5001'.
temp2_line-high = '8000'.
APPEND temp2_line TO temp2
Data: temp(1) char.
if TRAN_STRUCTURE-0glaccnt IN temp1.
temp3 = '+'.
elseif TRAN_STRUCTURE-0glaccnt IN temp2.
temp 3= '-'.
endif
RESULT = temp3 .
returncode <> 0 means skip this record
RETURNCODE = 0.
abort <> 0 means skip whole data package !!!
ABORT = 0.
$$ end of routine - insert your code only before this line - -
Routine sample code for reading 2 fields from existing DSO
Hi Gurus,
I am a monkey when it comes to write ABAP code. I have one DSO-A where we store accounting info of purchading (from DS 2lis_02_acc) and one DSO-B getting data from 2lis_02_scl data source.
We need to write a rountine to read DSO-A for G/L account and populate DSO-B G/L account field.
Please provide me the sample code for this.
Warm Regards,
AnilHi anil,
Create a local table this is type of you source,
Data : LV_table TYPE XXXX
use the select statement to read the table of DSO .You have to use th active table for the dso that you want to read data from.
Select xxxfieldxxx FROM /BIC/A..........50
into lv_table where
filed name of of scheule line probably order no and item no .
<soruce-fields>-IOBELN = IOBELN
and <source-fields>-IOBELP = IOBELP.
Checke the techinal name i am not sure about it. It will be something like that.
Cheers mate
Maybe you are looking for
-
Desktop Intelligence formula to convert into Web Intelligence formula
Hi Team, I have converted Desk I Report into Web I report but below formula is not working in Web Intelligence report. Desk I formula ="Selected Period: " + UserResponse(DataProvider([Order Number]) [EIH Query]"Enter Date mm/dd/yyyy (From)?") + " To
-
How do I delete audio files on GarageBand for iPad?
In GarageBand for iPad, When I click on the audio files button, there are three songs in there that I have imported to iTunes from my iPad. How do I delete these?
-
Firefox crashes daily, unrelated to any action
Firefox 13.0.1, but also happened with earlier versions. After running for several hours, Firefox will crash, often while I am in the middle of reading a page (i.e., not navigating or opening a link at the moment of the crash). I uninstalled Firefox
-
My ipad is froze with a message saying int has been two weeks since I update my icloud.
-
Change sender address for reports in waas
Hi all when schedule a report and send it by mail to us we receive a mail with sender [email protected], our customer wants to change this i have checked the config properties in CM (not CLI) and looked after button of reports but i can't find an opt