Problem in reading Data and Inserting...Urgent help..
INITIALIZATION.
AUTHORITY-CHECK OBJECT 'ZZABAP'
ID 'ZZABAP' FIELD 'ZCOU2006'
ID 'ZZAKTI' FIELD '1'.
IF sy-subrc <> 0.
MESSAGE e001(zm) WITH text-001.
ENDIF.
*... Selektionen .......................................................
PARAMETER:
bu AS CHECKBOX,
p_vtweg LIKE zknvh-vtweg OBLIGATORY. ".. Update JA/NEIN ?
START-OF-SELECTION.
*... Löschen ZKNVH .....................................................
IF NOT bu IS INITIAL.
DELETE FROM zknvh WHERE hityp = 'A'.
IF sy-subrc GT 4.
ROLLBACK WORK.
MESSAGE e001(zm) WITH text-002.
ENDIF.
ENDIF.
*Select the Vtweg and perform based on the Vtweg..
*Running two Variants in the BG processing..
IF p_vtweg EQ 'MZ'.
PERFORM form_06.
ELSEIF p_vtweg EQ 'AU'.
PERFORM form_04.
ENDIF.
FORM form_06 *
FORM form_06.
*... Fuellen LKNVH ....................................................
SELECT * INTO CORRESPONDING FIELDS OF TABLE lknvh
FROM knvh
WHERE hityp = 'A'
AND datbi GE sy-datum
AND hzuor = '06'.
MESSAGE i002(zm) WITH text-005 sy-dbcnt.
*... Fuellen Knoten KKNVH .............................................
SELECT * INTO CORRESPONDING FIELDS OF TABLE kknvh
FROM knvh
WHERE hityp = 'A'
AND datbi GE sy-datum
AND hzuor LT '06'.
*... Aufbau BU_ZKNVH ..................................................
LOOP AT lknvh.
CLEAR: bu_zknvh, flag.
MOVE-CORRESPONDING lknvh TO bu_zknvh.
zaehler = 6.
DO 4 TIMES.
zaehler = zaehler - 1.
UNPACK zaehler TO help_hzuor.
bu_zknvh-hier05 = lknvh-hkunnr.
IF sy-index = 1.
READ TABLE kknvh WITH TABLE KEY
mandt = sy-mandt
hzuor = help_hzuor
hityp = lknvh-hityp
kunnr = lknvh-hkunnr
vkorg = lknvh-hvkorg
vtweg = lknvh-hvtweg
spart = lknvh-hspart.
ELSE.
READ TABLE kknvh WITH TABLE KEY
mandt = sy-mandt
hzuor = help_hzuor
hityp = kknvh-hityp
kunnr = kknvh-hkunnr
vkorg = kknvh-hvkorg
vtweg = kknvh-hvtweg
spart = kknvh-hspart.
ENDIF.
IF sy-subrc = 0.
CASE help_hzuor.
WHEN '05'. bu_zknvh-hier04 = kknvh-hkunnr.
WHEN '04'. bu_zknvh-hier03 = kknvh-hkunnr.
WHEN '03'. bu_zknvh-hier02 = kknvh-hkunnr.
WHEN '02'. bu_zknvh-hier01 = kknvh-hkunnr.
ENDCASE.
ELSE.
WRITE: / text-004,
kknvh-hityp,
kknvh-kunnr,
kknvh-vkorg,
kknvh-vtweg,
kknvh-spart,
kknvh-hkunnr,
kknvh-hvkorg,
kknvh-hvtweg,
kknvh-hspart,
kknvh-hzuor.
flag = 'X'.
EXIT.
ENDIF.
ENDDO.
IF flag IS INITIAL.
APPEND bu_zknvh.
ENDIF.
ENDLOOP.
ENDFORM. " form_06
Form_4 looks exactly like form_6 just the table name changed and Hier05 and Hier04 fields are Blanks..
INSERT zknvh from Table bu_zknvh.
MESSAGE i002(zm) WITH text-006 sy-dbcnt.
IF sy-subrc <> 0 OR bu IS INITIAL.
ROLLBACK WORK.
MESSAGE e001(zm) WITH text-003.
ELSE.
COMMIT WORK.
ENDIF.
INSERT zknvh from Table au_zknvh.
MESSAGE i002(zm) WITH text-006 sy-dbcnt.
IF sy-subrc <> 0 OR bu IS INITIAL.
ROLLBACK WORK.
MESSAGE e001(zm) WITH text-003.
ELSE.
COMMIT WORK.
ENDIF.
1) When I select VTWEG 'MZ' everything is working without anyproblem...
2) When I select VTWEG 'AU' I can see only one RECORD.. where as their are around 41,000 records.. in this Selection..
Normally with this prog the ZKNVH table should be filled with the specified fields..
Only if the VTWEG is AU the Hier05 and Hier04 is Blank and others are filled with data.. bcoz in the Customer Hierarchy of AU has only 4 levels...
and if VTWEG is MZ all the fields should be filled with data as the Customer Hierarchy of Mz has 6 levels..
Please check the prog and suggest me how I can Fill append the table ZKNVH with data when I select AU..
Thanx in advance...
Preethu
Message was edited by: Preethu
HERE IS THE FULL CODE:: please help
REPORT zcou2006.
TABLES: zknvh.
*... Datentypen ................................
TYPES:
BEGIN OF t1_knvh, "... Knoten
mandt LIKE knvh-mandt,
hzuor LIKE knvh-hzuor,
hityp LIKE knvh-hityp,
kunnr LIKE knvh-kunnr,
vkorg LIKE knvh-vkorg,
vtweg LIKE knvh-vtweg,
spart LIKE knvh-spart,
hkunnr LIKE knvh-hkunnr,
hvkorg LIKE knvh-hvkorg,
hvtweg LIKE knvh-hvtweg,
hspart LIKE knvh-hspart,
grpno LIKE knvh-grpno,
bokre LIKE knvh-bokre,
prfre LIKE knvh-prfre,
END OF t1_knvh,
t2_knvh LIKE knvh,
t3_zknvh LIKE zknvh,
t4_zknvh LIKE zknvh,
t1_hknvh TYPE HASHED TABLE OF t1_knvh WITH UNIQUE KEY
mandt hzuor hityp kunnr vkorg vtweg spart.
DATA:
lknvh TYPE t2_knvh OCCURS 0 WITH HEADER LINE,
bu_zknvh TYPE t3_zknvh OCCURS 0 WITH HEADER LINE,
au_zknvh TYPE t4_zknvh OCCURS 0 WITH HEADER LINE,
kknvh TYPE t1_hknvh WITH HEADER LINE,
flag(1) TYPE c,
help_hzuor LIKE knvh-hzuor,
zaehler TYPE p.
INITIALIZATION.
AUTHORITY-CHECK OBJECT 'ZZABAP'
ID 'ZZABAP' FIELD 'ZCOU2006'
ID 'ZZAKTI' FIELD '1'.
IF sy-subrc <> 0.
MESSAGE e001(zm) WITH text-001.
ENDIF.
PARAMETER:
bu AS CHECKBOX,
p_vtweg LIKE zknvh-vtweg OBLIGATORY.
START-OF-SELECTION.
IF NOT bu IS INITIAL.
DELETE FROM zknvh WHERE hityp = 'A'.
IF sy-subrc GT 4.
ROLLBACK WORK.
MESSAGE e001(zm) WITH text-002.
ENDIF.
ENDIF.
IF p_vtweg EQ 'MZ'.
PERFORM form_06.
ELSEIF p_vtweg EQ 'AU'.
PERFORM form_04.
ENDIF.
FORM form_06.
SELECT * INTO CORRESPONDING FIELDS OF TABLE lknvh
FROM knvh
WHERE hityp = 'A'
AND datbi GE sy-datum
AND hzuor = '06'.
MESSAGE i002(zm) WITH text-005 sy-dbcnt.
SELECT * INTO CORRESPONDING FIELDS OF TABLE kknvh
FROM knvh
WHERE hityp = 'A'
AND datbi GE sy-datum
AND hzuor LT '06'.
LOOP AT lknvh.
CLEAR: bu_zknvh, flag.
MOVE-CORRESPONDING lknvh TO bu_zknvh.
zaehler = 6.
DO 4 TIMES.
zaehler = zaehler - 1.
UNPACK zaehler TO help_hzuor.
bu_zknvh-hier05 = lknvh-hkunnr.
IF sy-index = 1.
READ TABLE kknvh WITH TABLE KEY
mandt = sy-mandt
hzuor = help_hzuor
hityp = lknvh-hityp
kunnr = lknvh-hkunnr
vkorg = lknvh-hvkorg
vtweg = lknvh-hvtweg
spart = lknvh-hspart.
ELSE.
READ TABLE kknvh WITH TABLE KEY
mandt = sy-mandt
hzuor = help_hzuor
hityp = kknvh-hityp
kunnr = kknvh-hkunnr
vkorg = kknvh-hvkorg
vtweg = kknvh-hvtweg
spart = kknvh-hspart.
ENDIF.
IF sy-subrc = 0.
CASE help_hzuor.
WHEN '05'. bu_zknvh-hier04 = kknvh-hkunnr.
WHEN '04'. bu_zknvh-hier03 = kknvh-hkunnr.
WHEN '03'. bu_zknvh-hier02 = kknvh-hkunnr.
WHEN '02'. bu_zknvh-hier01 = kknvh-hkunnr.
ENDCASE.
ELSE.
WRITE: / text-004,
kknvh-hityp,
kknvh-kunnr,
kknvh-vkorg,
kknvh-vtweg,
kknvh-spart,
kknvh-hkunnr,
kknvh-hvkorg,
kknvh-hvtweg,
kknvh-hspart,
kknvh-hzuor.
flag = 'X'.
EXIT.
ENDIF.
ENDDO.
IF flag IS INITIAL.
APPEND bu_zknvh.
ENDIF.
ENDLOOP.
ENDFORM. " form_06
FORM form_04.
SELECT * INTO CORRESPONDING FIELDS OF TABLE lknvh
FROM knvh
WHERE hityp = 'A'
AND datbi GE sy-datum
AND hzuor LE '06'.
MESSAGE i002(zm) WITH text-005 sy-dbcnt.
SELECT * INTO CORRESPONDING FIELDS OF TABLE kknvh
FROM knvh
WHERE hityp = 'A'
AND datbi GE sy-datum
AND hzuor LT '06'.
LOOP AT lknvh.
CLEAR: au_zknvh, flag.
MOVE-CORRESPONDING lknvh TO au_zknvh.
zaehler = 6.
DO 4 TIMES.
zaehler = zaehler - 1.
UNPACK zaehler TO help_hzuor.
au_zknvh-hier05 = ' '.
IF sy-index = 1.
READ TABLE kknvh WITH TABLE KEY
mandt = sy-mandt
hzuor = help_hzuor
hityp = lknvh-hityp
kunnr = lknvh-hkunnr
vkorg = lknvh-hvkorg
vtweg = lknvh-hvtweg
spart = lknvh-hspart.
ELSE.
READ TABLE kknvh WITH TABLE KEY
mandt = sy-mandt
hzuor = help_hzuor
hityp = kknvh-hityp
kunnr = kknvh-hkunnr
vkorg = kknvh-hvkorg
vtweg = kknvh-hvtweg
spart = kknvh-hspart.
ENDIF.
IF sy-subrc = 0.
CASE help_hzuor.
WHEN '05'. au_zknvh-hier04 = ' '.
WHEN '04'. au_zknvh-hier03 = kknvh-hkunnr.
WHEN '03'. au_zknvh-hier02 = kknvh-hkunnr.
WHEN '02'. au_zknvh-hier01 = kknvh-hkunnr.
ENDCASE.
ELSE.
WRITE: / text-004,
kknvh-hityp,
kknvh-kunnr,
kknvh-vkorg,
kknvh-vtweg,
kknvh-spart,
kknvh-hkunnr,
kknvh-hvkorg,
kknvh-hvtweg,
kknvh-hspart,
kknvh-hzuor.
flag = 'X'.
EXIT.
ENDIF.
ENDDO.
IF flag IS INITIAL.
APPEND au_zknvh.
ENDIF.
ENDLOOP.
ENDFORM. " form_04
END-OF-SELECTION.
INSERT zknvh FROM TABLE bu_zknvh.
MESSAGE i002(zm) WITH text-006 sy-dbcnt.
IF sy-subrc <> 0 OR bu IS INITIAL.
ROLLBACK WORK.
MESSAGE e001(zm) WITH text-003.
ELSE.
COMMIT WORK.
ENDIF.
INSERT ZKNVH FROM TABLE AU_ZKNVH.
MESSAGE I002(ZM) WITH TEXT-006 SY-DBCNT.
IF SY-SUBRC <> 0 OR BU IS INITIAL.
ROLLBACK WORK.
MESSAGE E001(ZM) WITH TEXT-003.
ELSE.
COMMIT WORK.
ENDIF.
CALL FUNCTION 'Z_SELECT_OPTIONS_PRINT'
EXPORTING
irepid = 'ZCOU2006'
ausgabe = ' '
EXCEPTIONS
OTHERS = 1.
Message was edited by: Preethu
Similar Messages
-
Problem while reading data from Serial Port
Hi All,
I am facing some problem while reading data from Serial Port.
As per the requirement I am writing the data on Serial Port and waiting for response of that data.
Notification for data availabilty is checked with method public void serialEvent(SerialPortEvent event) of javax.comm.SerialPortEventListener.
When we are writing data on the port one thread i.e. "main" thread is generated and when data availability event occures another thread "Win32SerialPort Notification thread" is generated. This creates problem for me as we can't control thread processing.
So can anybody pls explain me how to overcome this problem?
Regards,
NehaMy Problem is:-
I am simoultaneouly wrting data on port & reading data from port.
First I write data on port using outputStream.write() method. Now when target side sends me response back for the request on serial port DATA_AVAILABLE of SerialPortEventListner event occured,we are reading data from serial port.Now till the time we didn't get the response from target next command can't be written on the serial port. When we are writing data on port main thread is executed.Now my problem starts when DATA_AVAILABLE event occured.At this point another thread is created.Due to this my program writes data of next command without reading response of previous command.To solve this prob. I have used wait() & notify() methods as follows.But again due to this my pc hangs after execution of 2 commands. (PC hang in while loop in a code provided below.)
From SOPs I could figure it out that after 2 commands we are not able to write data on serial port so DATA_AVAILABLE event doesn't occure n pro. goes in wait state.
Can anybody help me to solve this issue.
Neha.
Code:
public void serialEvent(SerialPortEvent event)
switch (event.getEventType())
case SerialPortEvent.BI:
case SerialPortEvent.OE:
case SerialPortEvent.FE:
case SerialPortEvent.PE:
case SerialPortEvent.CD:
case SerialPortEvent.CTS:
case SerialPortEvent.DSR:
case SerialPortEvent.RI:
case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
break;
case SerialPortEvent.DATA_AVAILABLE:
try
dataThread = Thread.currentThread();
dataThread.setPriority(10);
dataAvailable = true;
byte[] tempArray=new byte[availableBytes];
inputStream.read(tempArray);
catch (IOException io)
SOP(io, "Error in serialEvent callback call for event DATA_AVAILABLE");
public void writetoPort(byte[] data) throws IOException
outputStream.write(data);
while(finalTimeOut >= actualTime)
if( ! dataAvailable)
actualTime = System.currentTimeMillis();
else
synchronized (mainThread)
mainThread = Thread.currentThread();
mainThread.wait();
public void sendDatatoUser(byte[] b) throws Exception, HWCCSystemFailure
obj.returnData(b);
synchronized(mainThread)
mainThread.notify();
-
Use of READ REPORT and INSERT REPORT
Hi Guys,
i need a small help from u guys.......
i want to know the use of READ REPORT and INSERT REPORT with Example
the requirement is...
i want to declare an internal table with fields from custom table.
if any field is aded in the custum table then that field also should get populated in the program.
Ex: custom table fields are
MANDT
BUKRS
MATNR
LIFNR
field1
field2
field3
now suppose if a new field field4 is added in the Table
then the Program should automatically pick-up the fields from FIELD1...FIELD4.
i heard by using READ and INSERT report we can do it
plz help me ...
Thanks
Sunil.:-)If you're on 46C or above, you can use the following to generate tables dynamically.
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = GT_FIELDCAT
IMPORTING
EP_TABLE = GS_DATA_HEAD
EXCEPTIONS
GENERATE_SUBPOOL_DIR_FULL = 1
OTHERS = 2.
But you are restricted to 32 calls, if I remember correctly. If you are in a later release, you can use the RTTS classes to create internal tables dynamically, without the restriction on subroutine pools.
These classes are CL_ABAP_TYPEDESCR and subclasses.
There are a few blogs on SDN that give examples of their use.
Matt -
Problem trying read data from Destination
HI,
I have confiigured ADS and when im testing dest im getting the error :error while silently connecting:org.w3c.www.protocol :connection refused.
when i ckedth NWA logs i got the below trace file. please let me know how to solve this.
Problem trying read data from Destination: dest:FP_ICF_DATA_K64//sap/bc/fp/form/layout/FP_FORM_SECURITY_TEST.XDP?fp-language=DE
com.adobe.ads.destination.DestinationException: IO error detected while opening DEST connection: http://sapk64.essent.local:8062/sap/bc/fp/form/layout/FP_FORM_SECURITY_TEST.XDP?fp-language=DE
at com.adobe.ads.destination.Destination.readUrlStream(Unknown Source)
at com.adobe.ads.destination.Destination.readTemplate(Unknown Source)
at com.adobe.ads.data.DestURLData.setData(Unknown Source)
at com.adobe.ads.data.DestURLData.<init>(Unknown Source)
at com.adobe.ads.data.PDFData.createFromURL(Unknown Source)
at com.adobe.ads.data.PDFData.create(Unknown Source)
at com.adobe.ads.request.Template.setPDFData(Unknown Source)
at com.adobe.ads.request.Template.initialize(Unknown Source)
at com.adobe.ads.request.Renderer.initializeTemplates(Unknown Source)
at com.adobe.ads.request.Renderer.execute(Unknown Source)
at com.adobe.BaseADSRequest.doWork(Unknown Source)
at com.adobe.AdobeDocumentServicesWorker.processRender(Unknown Source)
at com.adobe.AdobeDocumentServicesWorker.execute(Unknown Source)
at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
at SoapServlet.doPost(SoapServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(AccessController.java:207)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: org.w3c.www.protocol.http.HttpException: java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:354)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:219)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:206)
at java.net.Socket.connect(Socket.java:483)
at java.net.Socket.connect(Socket.java:433)
at java.net.Socket.<init>(Socket.java:340)
at java.net.Socket.<init>(Socket.java:180)
at org.w3c.www.protocol.http.f.a(Unknown Source)
at org.w3c.www.protocol.http.f.markUsed(Unknown Source)
at org.w3c.www.protocol.http.HttpBasicServer.getConnection(Unknown Source)
at org.w3c.www.protocol.http.HttpBasicServer.runRequest(Unknown Source)
at org.w3c.www.protocol.http.HttpManager.runRequest(Unknown Source)
at org.w3c.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at org.w3c.www.protocol.http.HttpURLConnection.a(Unknown Source)
at org.w3c.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.adobe.ads.destination.Destination.readUrlStream(Unknown Source)
at com.adobe.ads.destination.Destination.readTemplate(Unknown Source)
at com.adobe.ads.data.DestURLData.setData(Unknown Source)
at com.adobe.ads.data.DestURLData.<init>(Unknown Source)
at com.adobe.ads.data.PDFData.createFromURL(Unknown Source)
at com.adobe.ads.data.PDFData.create(Unknown Source)
at com.adobe.ads.request.Template.setPDFData(Unknown Source)
at com.adobe.ads.request.Template.initialize(Unknown Source)
at com.adobe.ads.request.Renderer.initializeTemplates(Unknown Source)
at com.adobe.ads.request.Renderer.execute(Unknown Source)
at com.adobe.BaseADSRequest.doWork(Unknown Source)
at com.adobe.AdobeDocumentServicesWorker.processRender(Unknown Source)
at com.adobe.AdobeDocumentServicesWorker.execute(Unknown Source)
at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
at SoapServlet.doPost(SoapServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(AccessController.java:207)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Error embedding request inputs in error log.
Error embedding request inputs in error log.
java.lang.NullPointerException
at com.adobe.ads.request.Renderer.embedInputs(Unknown Source)
at com.adobe.AdobeDocumentServicesWorker.processRenderLog(Unknown Source)
at com.adobe.AdobeDocumentServicesWorker.processRender(Unknown Source)
at com.adobe.AdobeDocumentServicesWorker.execute(Unknown Source)
at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
at SoapServlet.doPost(SoapServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(AccessController.java:207)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
No output was generated while rendering
The render error log file has been written to /usr/sap/T50/SYS/global/AdobeDocumentServices/renderErrorLog/errorFiles/2008.08.05.113021ADS_AGENT.pdf.
Please validate the input files or streams attached with it and try again
Processing exception during a "Render" operation.
Request start time: Tue Aug 05 11:30:21 CEST 2008
com.adobe.ads.destination.DestinationException: IO error detected while opening DEST connection: http://sapk64.essent.local:8062/sap/bc/fp/form/layout/FP_FORM_SECURITY_TEST.XDP?fp-language=DE; [Error Log file "2008.08.05.113021ADS_AGENT.pdf" written to /usr/sap/T50/SYS/global/AdobeDocumentServices/renderErrorLog/errorFiles]
Exception Stack Trace:
com.adobe.ads.destination.DestinationException: IO error detected while opening DEST connection: http://sapk64.essent.local:8062/sap/bc/fp/form/layout/FP_FORM_SECURITY_TEST.XDP?fp-language=DE
at com.adobe.ads.destination.Destination.readUrlStream(Unknown Source)
at com.adobe.ads.destination.Destination.readTemplate(Unknown Source)
at com.adobe.ads.data.DestURLData.setData(Unknown Source)
at com.adobe.ads.data.DestURLData.<init>(Unknown Source)
at com.adobe.ads.data.PDFData.createFromURL(Unknown Source)
at com.adobe.ads.data.PDFData.create(Unknown Source)
at com.adobe.ads.request.Template.setPDFData(Unknown Source)
at com.adobe.ads.request.Template.initialize(Unknown Source)
at com.adobe.ads.request.Renderer.initializeTemplates(Unknown Source)
at com.adobe.ads.request.Renderer.execute(Unknown Source)
at com.adobe.BaseADSRequest.doWork(Unknown Source)
at com.adobe.AdobeDocumentServicesWorker.processRender(Unknown Source)
at com.adobe.AdobeDocumentServicesWorker.execute(Unknown Source)
at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
at SoapServlet.doPost(SoapServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(AccessController.java:207)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: org.w3c.www.protocol.http.HttpException: java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:354)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:219)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:206)
at java.net.Socket.connect(Socket.java:483)
at java.net.Socket.connect(Socket.java:433)
at java.net.Socket.<init>(Socket.java:340)
at java.net.Socket.<init>(Socket.java:180)
at org.w3c.www.protocol.http.f.a(Unknown Source)
at org.w3c.www.protocol.http.f.markUsed(Unknown Source)
at org.w3c.www.protocol.http.HttpBasicServer.getConnection(Unknown Source)
at org.w3c.www.protocol.http.HttpBasicServer.runRequest(Unknown Source)
at org.w3c.www.protocol.http.HttpManager.runRequest(Unknown Source)
at org.w3c.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at org.w3c.www.protocol.http.HttpURLConnection.a(Unknown Source)
at org.w3c.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.adobe.ads.destination.Destination.readUrlStream(Unknown Source)
at com.adobe.ads.destination.Destination.readTemplate(Unknown Source)
at com.adobe.ads.data.DestURLData.setData(Unknown Source)
at com.adobe.ads.data.DestURLData.<init>(Unknown Source)
at com.adobe.ads.data.PDFData.createFromURL(Unknown Source)
at com.adobe.ads.data.PDFData.create(Unknown Source)
at com.adobe.ads.request.Template.setPDFData(Unknown Source)
at com.adobe.ads.request.Template.initialize(Unknown Source)
at com.adobe.ads.request.Renderer.initializeTemplates(Unknown Source)
at com.adobe.ads.request.Renderer.execute(Unknown Source)
at com.adobe.BaseADSRequest.doWork(Unknown Source)
at com.adobe.AdobeDocumentServicesWorker.processRender(Unknown Source)
at com.adobe.AdobeDocumentServicesWorker.execute(Unknown Source)
at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
at SoapServlet.doPost(SoapServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(AccessController.java:207)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)hi,
My problem is solved now. We have opened backend system port connection from portal side.
regards,
Krishna -
Hi all ,
I am trying to create a BOM .
I have a created a file for the header and other file for item data .
after assigning the files of header and item , i am getting problem at Read Data step
It is giving an information message Generation canceled: No field with this name.
My Hierarchy at Assign Files is :
ZBGR00 Batch Input Structure for Session Data
ZBICSK Header Data
Header C:\Documents and Settings\Raj\Desktop\Input\zbom_zbom_header.txt
ZBICSP Item Data
Item C:\Documents and Settings\RajDesktop\Input\zbom_zbom_item.txt
ZBICSU Sub Item Data
Please let me Know the Solution .
Regards,
Rajin the step 5(Maintain Field Mapping and Conversion Rules)
do the syntax check (SHIFT+F2) -
Problem with reading data from screen and inserting in table
hi ther,
im new to abap-webdyn pro. can anyone suggest how to read data from screen and insert into table when press 'ADD' button.
i done screen gui , table creation but problems with action. what the content of acton add.
is ther any link that helps me or tut??
thankx in advance!
regardsHi,
Create a context node for the screen fields for which you want to enter the values with cardinality 1.1.....
Now in the layout of your view bind the screen input fields to that context node(attributes) to the value property of the input fields...
Now in the action of ADD button....
--> go the wizard and select the read node button and select the node which you have created it generates the auto code for you.....
for example if the node is contains aone attribute like MATNR
reading the node from wizard will generate the code as....
DATA lo_nd_matnr TYPE REF TO if_wd_context_node.
DATA lo_el_matnr TYPE REF TO if_wd_context_element.
DATA ls_matnr TYPE wd_this->element_matnr.
DATA lv_matnr TYPE wd_this->element_matnr-matnr.
* navigate from <CONTEXT> to <MATNR> via lead selection
lo_nd_matnr = wd_context->get_child_node( name = wd_this->wdctx_matnr ).
* @TODO handle non existant child
* IF lo_nd_matnr IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_matnr = lo_nd_matnr->get_element( ).
* @TODO handle not set lead selection
IF lo_el_matnr IS INITIAL.
ENDIF.
* get single attribute
lo_el_matnr->get_attribute(
EXPORTING
name = `MATNR`
IMPORTING
value = lv_matnr ).
here the variable lv_matnr will contain the entered value......
now you can use this value for further process.
Thanks,
Shailaja Ainala. -
File Upload problem: JSF, IBM WPS and Portlet - Please HELP Vey Very Urgent
I want to upload a file from the front end using JSF and Portlets deployed on IBM WebSphere Portal.
I have used Apache's commons file upload functionality as the file upload provided in JSF doesnot work with portlets and the action event is not invoked If I keep enctype="multipart/form-data". So I included 3 forms in my Faces JSP file.
1) h:form = For displyign error message on screen
2) html:form = Include the enctype="multipart/form-data" and the input type file for uploading. And a submit button
3) h:form: Here I have a command link which is remotely excuted on click of sumit button in my html form. This is to invoke the action event in the pagecode to get the bean value from the context.
Now in the my doView method in the portlet, isMultipartContent(httpservletrequest) always returns null as the content type is text/html and not multipart. Onclick of the submit button in the the html form I am calling a javascript function which sets the __LINK_TARGET__ to the command link in the 3rd h:form which will call the page code.
The problem here is action is invoked only when I return false from the above javascript else it will trigger for the first time and from second time onwards it will not invoke the action event in the pagecode method. Whent the javascript function returns false, the content type is always text/html. However if I return "true" from the javascript the content type is multipart/form-data, but the action is not triggered for the second time. So basically when the javascript functions returns true, for the first click everything works perfectly. When it returns false, the content type is text/html, but the action is invoked in the page code every time.
Returning always true would solve my problem with the content type, but the action with the command link will not get invoked always as its some type of problem with h:commanLink :(.
I guess I gave too much info. Heres my code stepby step.
Can somebody please tell me , how I should also invoke the action in the page code and get the content type as "multipart/form-data" at the same time.
1:
======================= Faces JSP File: BPSMacro.jsp ====================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="IBM Software Development Platform">
<meta http-equiv="Content-Style-Type" content="text/css">
<%@taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
<%@taglib uri="/WEB-INF/tld/j4j.tld" prefix="j4j"%>
<%@taglib uri="/WEB-INF/tld/core.tld" prefix="core"%>
<%@page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" session="false"%>
<portlet:defineObjects />
<link rel="stylesheet" type="text/css"
href='<%= renderResponse.encodeURL(renderRequest.getContextPath() + "/theme/stylesheet.css") %>'
title="Style">
<script type="text/javascript">
function formSubmit() {
var formName2 = document.getElementById("proxy_form_main_").title;
var formName1 = document.getElementById("BPSMacroFormId").title;
document.getElementById("__LINK_TARGET__").value = document.getElementById("proxy_HD_COMMAND_").title;
document.getElementById(formName2).submit();
return false;
</script>
<f:view>
<hx:scriptCollector id="bpsMacroScriptCollector">
<f:loadBundle var="bps" basename="bordereauprocessingsystem" />
<table bgcolor="#FFF9C3">
<tr>
<td><h:form id="BPSMacroFormMain" styleClass="form">
<table class="tablemiddle" cellspacing="0" cellpadding="0">
<tr>
<td><h:messages layout="table" styleClass="errormessage"
id="ValidationErrorMsg" /> </td>
</tr>
</table>
<j4j:idProxy id="proxy_form_main_0_" />
</h:form></td>
</tr>
<tr>
<td>
<form id="BPSMacroFormId" enctype="multipart/form-data">
<table bgcolor="#FFF9C3">
<tr>
<td height="36" width="324">Worksheet <input type="file"
name="upfile" /></td>
</tr>
<tr>
<td align="center" width="324"><input TYPE="submit"
onclick="return formSubmit();" value="Upload">
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td>
<h:form id="BPSMacroFormMain2" styleClass="form">
<table cellspacing="2" cellpadding="2" class="tablemiddle">
<tbody>
<tr>
<td colspan="2" align="center"><h:commandLink
styleClass="commandLink" id="lnkuserdelete"
action="#{pc_BPSMacro.doIdUpload1Action}">
<hx:graphicImageEx
styleClass="graphicImageEx" id="imgBtnCreateUser"
value="/theme/images/btnUpload.gif" style="border:0;cursor:pointer"></hx:graphicImageEx>
<j4j:idProxy id="proxy_HD_COMMAND_" />
</h:commandLink></td>
<h:inputHidden id="dtSize"
value="#{pc_BPSMacro.fileDetailsList.clicked}">
<j4j:idProxy id="proxy_clicked_" />
</h:inputHidden>
</tr>
</tbody>
</table>
<j4j:idProxy id="proxy_form_main_" />
</h:form>
</td>
</tr>
</table>
</hx:scriptCollector>
</f:view>
================== END: FACES JSP FILE: BPSMacro.jsp ========================
2:
=================== Action event in the Page Code: BPSMacro.java ============
public String doIdUpload1Action() {
System.out.println("PageCode");
FacesContext context = FacesContext.getCurrentInstance();
BPSMacroDetailsDataBean fileDetails = (BPSMacroDetailsDataBean)context.getApplication().createValueBinding("#{fileDetails}").getValue(context);
BPSMacroListDataBean fileDetailsList = (BPSMacroListDataBean)context.getApplication().createValueBinding("#{fileDetailsList}").getValue(context);
PortletSession sess = (PortletSession)context.getExternalContext().getSession(false);
sess.setAttribute("BPS_MACRO_CONTEXT", context, PortletSession.APPLICATION_SCOPE);
sess.setAttribute("BPS_MACRO_FILE_DETAILS", fileDetails, PortletSession.APPLICATION_SCOPE);
sess.setAttribute("BPS_MACRO_FILE_LIST", fileDetailsList, PortletSession.APPLICATION_SCOPE);
HttpServletRequest request = (HttpServletRequest)context.getExternalContext().getRequest();
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
request.getContentType();
return "gotoBPSMacro";
============== END Of Page Code Action event ==============================
3:
============== doView() Portlet method ================================
public void doView(RenderRequest arg0, RenderResponse arg1)
throws PortletException, IOException {
String METHOD_NAME = "doView(RenderRequest arg0, RenderResponse arg1)";
Logger.debug(this.getClass(), METHOD_NAME, "Entering BPSMacroPortlet");
FacesContext context = FacesContext.getCurrentInstance();
PortletSession sess1 = arg0.getPortletSession(true);
BPSMacroDetailsDataBean fileDetails = new BPSMacroDetailsDataBean();
BPSMacroListDataBean fileDetailsList = new BPSMacroListDataBean();
context = (FacesContext)sess1.getAttribute("BPS_MACRO_CONTEXT", PortletSession.APPLICATION_SCOPE);
if(context != null){
fileDetails = (BPSMacroDetailsDataBean)sess1.getAttribute("BPS_MACRO_FILE_DETAILS", PortletSession.APPLICATION_SCOPE);
fileDetailsList = (BPSMacroListDataBean)sess1.getAttribute("BPS_MACRO_FILE_LIST", PortletSession.APPLICATION_SCOPE);
sess1.removeAttribute("BPS_MACRO_CONTEXT", PortletSession.APPLICATION_SCOPE);
sess1.removeAttribute("BPS_MACRO_FILE_DETAILS", PortletSession.APPLICATION_SCOPE);
sess1.removeAttribute("BPS_MACRO_FILE_LIST", PortletSession.APPLICATION_SCOPE);
HttpServletRequest servletRequest = (HttpServletRequest)arg0;
PortletRequest pReq = (PortletRequest)arg0;
HttpServletResponse servletResponse= (HttpServletResponse)arg1;
System.out.println("\n\n Content Type" + servletRequest.getContentType());
try{
if(context != null){
boolean isFileMultipart = ServletFileUpload.isMultipartContent(servletRequest);
System.out.println("\nFILE TO BE UPLOADED IS MULTIPART ? " + isFileMultipart);
if(isFileMultipart){
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List items = upload.parseRequest(servletRequest);
Iterator iterator = items.iterator();
while (iterator.hasNext()) {
FileItem item = (FileItem) iterator.next();
InputStream iStream = item.getInputStream();
ByteArrayOutputStream ByteArrayOS = new ByteArrayOutputStream();
int sizeofFile =(int) item.getSize();
byte buffer[] = new byte[sizeofFile];
int bytesRead = 0;
while( (bytesRead = iStream.read(buffer, 0, sizeofFile)) != -1 )
ByteArrayOS.write( buffer, 0, bytesRead );
String data = new String( ByteArrayOS.toByteArray() );
int k = 0;
//Check if the file is Refund or Premium
int dynamicArraySize = 0;// = st2.countTokens() * 9;
dynamicArraySize = st2.countTokens() * 9;
if (!item.isFormField() ){
File cfile=new File(item.getName());
String fileName = "";
String separator = "\\";
int pos = item.getName().lastIndexOf(separator);
int pos2 = item.getName().lastIndexOf(".");
if(pos2>-1){
fileName =item.getName().substring(pos+1, pos2);
}else{
fileName =item.getName().substring(pos+1);
File fileToBeUploaded=new File("C:\\Sal\\BPS MACRO\\FileTransfer\\Desti", fileName);
item.write(fileToBeUploaded);
validate.displaySuccessMessage(context);
}catch(Exception e){System.out.println(e);
Logger.debug(this.getClass(), METHOD_NAME, "Leaving BPSMacroPortlet");
super.doView(arg0, arg1);
==== END: doView method in the portle class. ================================
Thanks.one more question. Is there a way where I can submit two forms ?
Thats is submit 2nd form only when the first form is submitted.
I tried this it works.
function formSubmit(){
document.form1.submit();
alert();
document.form2.submit();
But If I dont put an alert(basically it disables the parent page) in between, only the second form is submitted.
If I put a delay of say 3 seconds in between then it will throw a SOCKET CLOSED error in the code triggered due to first form submit.
Thus disabling the paresnt page for a few seconds is reolving my problem.
Any ideas ?
Well Basically when the Alert pop's up the parent page "STALLS" and thus the form2 does not submit till I click on OK, Is there a way I can stall the browser/Parent JSP page using JAVA SCRIPT ??
Edited by: hector on Oct 9, 2007 11:09 AM
Edited by: hector on Oct 9, 2007 2:12 PM -
Problem in reading data of a file
Following is the text file(dat.txt),
Sent on: 11/24/07 Time: 05:49 PM ES
Total number of pages (including this one): 3
FAX: [9,18668650173]
Date: 10/3/08
I want to print only "Sent on: 11/24/07" but not "Time" and also i want to print "Time" in a separate line, I tried with the following program but i am not getting the correct o/p,
public class Whitespace {
public final static int FAX = 0;
public final static int Sent = 1;
public final static int Time = 2;
public final static int Date = 3;
public final static int Quantity = 4;
public final static int From = 5;
public static void main(String args[]) throws FileNotFoundException, IOException{
BufferedReader br = new BufferedReader(new FileReader("D:\\Kiran\\Programs\\dat.txt"));
Document document = new Document();
String strLine;
int i=0;
try{
PdfWriter.getInstance(document,new FileOutputStream("D:\\Kiran\\HelloWorld.pdf"));
document.open();
while((strLine=br.readLine())!=null) {
if (strLine.length()>0)
//System.out.println(strLine);
switch(i){
case 0:
if(strLine.startsWith("FAX")){
System.out.println(strLine);
document.add(new Paragraph(strLine));
case 1:
if(strLine.startsWith("Sent")){
System.out.println(strLine);
document.add(new Paragraph(" "));
document.add(new Paragraph(strLine));
case 2:
if(strLine.startsWith("Time")){
System.out.println(strLine);
document.add(new Paragraph(" "));
document.add(new Paragraph(strLine));
case 3:
if(strLine.startsWith("Date")){
System.out.println(strLine);
document.add(new Paragraph(" "));
document.add(new Paragraph(strLine));
case 4:
if(strLine.startsWith("Quantity")){
System.out.println(strLine);
document.add(new Paragraph(" "));
document.add(new Paragraph(strLine));
case 5:
if(strLine.startsWith("FROM")){
System.out.println(strLine);
document.add(new Paragraph(" "));
document.add(new Paragraph(strLine));
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
// step 5: we close the document
document.close();
Please help me in this, its very urgent.
Thanks,
Kiran.here is the program with code tags,
public class Whitespace {
public final static int FAX = 0;
public final static int Sent = 1;
public final static int Time = 2;
public final static int Date = 3;
public final static int Quantity = 4;
public final static int From = 5;
public static void main(String args[]) throws FileNotFoundException, IOException{
//input file
BufferedReader br = new BufferedReader(new FileReader("D:\\Kiran\\Programs
dat.txt"));
Document document = new Document();
String strLine;
int i=0;
try{
//creating a PDF file
PdfWriter.getInstance(document,new FileOutputStream("D:\\Kiran
HelloWorld.pdf"));
document.open();
//reading the data from a file and storing in a string
while((strLine=br.readLine())!=null) {
if (strLine.length()>0)
//System.out.println(strLine);
switch(i){
case 0:
//comparing the data and printing into a file if it matches
if(strLine.startsWith("FAX")){
System.out.println(strLine);
document.add(new Paragraph(strLine));
case 1:
if(strLine.startsWith("Sent")){
System.out.println(strLine);
document.add(new Paragraph(" "));
document.add(new Paragraph(strLine));
case 2:
if(strLine.startsWith("Time")){
System.out.println(strLine);
document.add(new Paragraph(" "));
document.add(new Paragraph(strLine));
case 3:
if(strLine.startsWith("Date")){
System.out.println(strLine);
document.add(new Paragraph(" "));
document.add(new Paragraph(strLine));
case 4:
if(strLine.startsWith("Quantity")){
System.out.println(strLine);
document.add(new Paragraph(" "));
document.add(new Paragraph(strLine));
case 5:
if(strLine.startsWith("FROM")){
System.out.println(strLine);
document.add(new Paragraph(" "));
document.add(new Paragraph(strLine));
} -
IIOP and firewalls - urgent help!!!
Hello there,
we have problems connecting with a Java applet to BC4J deployed as EJBs in an OracleJVM (Oracle9i AS 1.0.2) over IIOP throu a firewall. Is anyone out there who can help us? We need urgent help!!!
Thanks in advance!
Stefan
nullAFAIK, you have only three options:
1. Configure your IIOP connection to use an existing open port on the firewall (e.g., port 80 which is usually reserved for HHTP protocol) - THIS IS A BAD IDEA
2. Configure the firewall to allow inbound traffic on the IIOP port you are using (Oracle uses 2481 by default) - this is fine if you control the firewall.
3. Wrap your EJB client code in a servlet and communicate from the applet to the servlet via HTTP. This is the normal "firewall-puncturing" approach (aka "tunneling").
John H. -
Reading Dates and Timestamps created by PL/SQL
Hello,
This is probably a FAQ (or stating the obvious) but I want to make sure I've got the right idea about things...
I recently noticed that our Java app reads dates/timestamps incorrectly from the database. Any date set using 'SYSDATE' in PL/SQL is an hour out when read by Java. This is because we are now in BST and the object read back by the JDBC driver thinks the timezone is GMT.
From reading around it seems that the DATE and TIMESTAMP types in Oracle don't persist timezone information. Fair enough, but to me this makes it dangerous to use SYSDATE at all in PL/SQL procedures.
Previously I've never relied on the database itself to generate timestamps so dates have always been stored as UTC. I'm currently using SYS_EXTRACT_UTC(SYSTIMESTAMP) when inserting data in to tables and basically wondering if this is the common way of achieving accuracy.
(using types such as "TIMESTAMP WITH LOCAL TIME ZONE" seem to have their own annoyances in JDBC so I've opted to avoid those)
Thanks.Tom,
This may be helpful...
http://www.javaworld.com/javaworld/jw-10-2003/jw-1003-time.html
Good Luck,
Avi. -
Problem in reading data from Excel sheet to 2D string array (ActiveX & LabView).
I am trying to read data from Excel sheet to 2D string array (ActiveX & LabView). Error -2147352571 is generated (type mismatch) if cell value is "#NULL!", "#N/A" etc. What should I do?
Hello �
Is the error happening when the cell value is #NULL or #NA only?
Sometimes these errors occur because of an ActiveX object mismatch. The version of the ActiveX object might have changed or been updated since the VI was created. The VI tries to use an earlier, incompatible version of the ActiveX object.
To solve the problem, you need to link automation refnum terminal to the correct ActiveX object. To do so, right-click an automation refnum terminal and choose Select ActiveX Class»Browse from the shortcut menu. From the Type Library pull-down menu, select the latest version of the library you want to use, such as Microsoft Excel Object Library. In the Objects list, select an ActiveX object, and click the OK button. Link ea
ch automation refnum terminal in the VI and its subVIs until the run arrow is not broken. Also, you might have to replace some or all of the Invoke Nodes and Property Nodes for the ActiveX objects.
Also, I came across this Knowledgebase. The error number is slightly different but it is always good to check it out and make sure it is not your case.
Hope this helps.
S Vences
Applications Engineer
National Instruments -
Problem with Java Dates and UPDATE for SQL2000
I am having problems with the date formats for Java. I am trying to put the current date time into a SQL table, here it the code I am using:
var Today = new Date()
var conn = Server.CreateObject( "ADODB.Connection" )
conn.Open( "Provider=SQLOLEDB;Server=(local);Database=BillTracking;UID=sa;PWD=;")
var sql = "UPDATE BillAssignments SET DatePosted = " + Today + " WHERE AssignmentID = '" + Request.QueryString("AssignmentID") + "'"
var rs = conn.execute(sql)
I keep getting different errors and I have been unable to find a solution yet. I know that I need to change the date format from the Java standard to the one that SQL likes.
Help....
Norm...Please tell us where the Java part of this comes in. I see that you are using JavaScript to load up data via an ADO connection (presumably on an IIS platform) - but I do not see where you are using Java
Lee -
Script for parsing xml data and inserting in DB
Thank you for reading.
I have the following example XML in an XML file. I need to write a script that can insert this data into an Oracle table. The table does not have primary keys. The data just needs to be inserted.
I do not have xsd file in this scenario. Please suggest how to modify Method 1 https://community.oracle.com/thread/1115266?tstart=0 mentioned so that I can call the XML mentioned below and insert into a table
Method 1
Create or replace procedure parse_xml is
l_bfile BFILE;
l_clob CLOB;
l_parser dbms_xmlparser.Parser;
l_doc dbms_xmldom.DOMDocument;
l_nl dbms_xmldom.DOMNodeList;
l_n dbms_xmldom.DOMNode;
l_file dbms_xmldom.DOMNodeList;
l_filen dbms_xmldom.DOMNode;
lv_value VARCHAR2(1000);
l_ch dbms_xmldom.DOMNode;
l_partname varchar2(100);
l_filename varchar2(1000);
l_temp VARCHAR2(1000);
TYPE tab_type IS TABLE OF tab_software_parts%ROWTYPE;
t_tab tab_type := tab_type();
BEGIN
l_bfile := BFileName('DIR1', 'SoftwareParts.xml');
dbms_lob.createtemporary(l_clob, cache=>FALSE);
dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
dbms_lob.loadFromFile(dest_lob => l_clob, src_lob => l_bfile, amount => dbms_lob.getLength(l_bfile));
dbms_lob.close(l_bfile);
dbms_session.set_nls('NLS_DATE_FORMAT','''DD-MON-YYYY''');
l_parser := dbms_xmlparser.newParser;
dbms_xmlparser.parseClob(l_parser, l_clob);
l_doc := dbms_xmlparser.getDocument(l_parser);
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'/PartDetails/Part');
FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP
l_n := dbms_xmldom.item(l_nl, cur_emp);
t_tab.extend;
dbms_xslprocessor.valueOf(l_n,'Name/text()',l_partname);
t_tab(t_tab.last).partname := l_partname;
l_file := dbms_xslprocessor.selectNodes(l_n,'Files/FileName');
FOR cur_ch IN 0 .. dbms_xmldom.getLength(l_file) - 1 LOOP
l_ch := dbms_xmldom.item(l_file, cur_ch);
lv_value := dbms_xmldom.getnodevalue(dbms_xmldom.getfirstchild(l_ch));
if t_tab(t_tab.last).partname is null then t_tab(t_tab.last).partname := l_partname; end if;
t_tab(t_tab.last).filename := lv_value;
t_tab.extend;
END LOOP;
END LOOP;
t_tab.delete(t_tab.last);
FOR cur_emp IN t_tab.first .. t_tab.last LOOP
if t_tab(cur_emp).partname is not null and t_tab(cur_emp).filename is not null then
INSERT INTO tab_software_parts
VALUES
(t_tab(cur_emp).partname, t_tab(cur_emp).filename);
end if;
END LOOP;
COMMIT;
dbms_xmldom.freeDocument(l_doc);
EXCEPTION
WHEN OTHERS THEN
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
dbms_xmldom.freeDocument(l_doc);
END;
<TWObject className="TWObject">
<array size="240">
<item>
<variable type="QuestionDetail">
<questionId type="String"><![CDATA[30]]></questionId>
<questionType type="questionType"><![CDATA[COUNTRY]]></questionType>
<country type="String"><![CDATA[GB]]></country>
<questionText type="String"><![CDATA[Please indicate]]></questionText>
<optionType type="String"><![CDATA[RadioButton]]></optionType>
<answerOptions type="String[]">
<item><![CDATA[Yes]]></item>
<item><![CDATA[No]]></item>
</answerOptions>
<ruleId type="String"><![CDATA[CRP_GB001]]></ruleId>
<parentQuestionId type="String"></parentQuestionId>
<parentQuestionResp type="String"></parentQuestionResp>
</variable>
</item>
<item>
<variable type="QuestionDetail">
<questionId type="String"><![CDATA[40]]></questionId>
<questionType type="questionType"><![CDATA[COUNTRY]]></questionType>
<country type="String"><![CDATA[DE]]></country>
<questionText type="String"><![CDATA[Please indicate]]></questionText>
<optionType type="String"><![CDATA[RadioButton]]></optionType>
<answerOptions type="String[]">
<item><![CDATA[Yes]]></item>
<item><![CDATA[No]]></item>
</answerOptions>
<ruleId type="String"><![CDATA[CRP_Q0001]]></ruleId>
<parentQuestionId type="String"></parentQuestionId>
<parentQuestionResp type="String"></parentQuestionResp>
</variable>
</item>
</array>
</TWObject>Reposted as
Script to parse XML data into Oracle DB -
my daughters ipod 4th gen will no longer charge past 20% and will not connect to a pc in order to back everything up. the cable is working fine, otherwise it would not even charge to the 20%. i have tried the reset to not lose any data and no luck, home+power for 10-15 seconds. I really would like to not lose everything she has, again, because I can't back it up this time. I have tried charging via a wall outlet and PC and both charge fine, just only to 20%. I am using the cable that came with it so no aftermarket issues there. Please help so I don't have to reset everything again.
Because once it has charged enough to be powered on as soon as you turn it on it says battery is at 20% and will not charge anymore after that, it just runs for about 5-10 minutes before the battery dies again. The battery cycles discharge/recharge daily and its not on the charger at full charge for more than a couple hours and is never totally dead for more than a couple of hours.
-
Problem in reading data if field in database is Unique const
Hi All,
If a field is unique constraint and if it allows nulls (i.e. nullable) then there is problem in reading the data for display and even updating that record when application is running in JBoss 3.2.3 (this works fine in Weblogic 8.1) can any one tell me what changes should be made to avoid this problem or any other solutions.
Thanks in advance
Mallikarjuan Budur.I'm confused.
If a field is unique constraint, that means the field must have a value that exists in some other table, and is unique within the current table, right? If that's the case, then how can you allow nulls?
Maybe you are looking for
-
Scanning multiple pages - pop-up for "Next Page" appears
I'm running Acrobat Profession version 7 on OS X 10.5. My scanner is an Epson Perfection 3170 with an automatic document feeder. The settings for scanning seem to have been goofed up -- any assistance in resetting them would be appreciated. Previousl
-
I have an iMac OS 10.9.5 - Every time I turn on my system I get the message that it can not access icloud and to fix it using iCloud preferences. I do not want to access or use iCloud, how do I get the message to discontinue?
-
Issue with viewing Package Body in SQL Developer 2.1 RC1
Were anybody able to see the package body of other user in 2.1 RC1. I had an issue since 2.1 EA 1 so... just curious. - Oracle 9i - Windows XP SP3 Please do let me know if there is any hint or setting that can be change to view the package body. Than
-
I have purchased a film from the istore and it had transferred to my download but I can not do it as it say I don't have enough storage. I pressed the HD version and know SD are smaller how can I change it to SD version?
-
How to transfer photo from iPhoto in iPad to Mac
Hi, Just installed and tried the iPhoto for iPad. Noticed that there is no option for me to transfer/sync my edited photo back to my iPhoto in my MacBook Pro. Any idea how this could done?