Select File name using routine
I am trying to write a routine in the info package for flat file extractionwhich will select the flat file automatically according to sy-datum ( the flat file is saved with system date). Here is my example code. Please help me in writing a correct code.
program filename_routine.
Global code
$$ begin of global - insert your declaration only below this line -
TABLES:
DATA: str1(60) TYPE c,
str2(10) TYPE c,
str3(10) TYPE c.
str4(100) type c.
str1 = 'C:\Documents and Settings\Yadavalli\Desktop'.
str2 = 'Sy-datum'.
str3 = 'csv'.
$$ end of global - insert your declaration only before this line -
form compute_flat_file_filename
changing p_filename type RSFILENM
p_subrc like sy-subrc.
$$ begin of routine - insert your code only below this line -
concatenate str1 str2 str3 into str4.
p_filename =
CONCATENATE str1 '\' str2 '.' str3 INTO str4.
p_subrc = 0.
$$ end of routine - insert your code only before this line -
endform.
Regards
Naga
I thought of using below Function Module but it is not loading the data. It is showing red. Please let me know whether i have mentioned logical_filename correctly.
$$ begin of routine - insert your code only below this line -
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
CLIENT = SY-MANDT
logical_filename = 'C:\'
OPERATING_SYSTEM = SY-OPSYS
PARAMETER_1 = ' '
PARAMETER_2 = ' '
PARAMETER_3 = ' '
USE_PRESENTATION_SERVER = ' '
WITH_FILE_EXTENSION = ' '
USE_BUFFER = ' '
ELEMINATE_BLANKS = 'X'
IMPORTING
EMERGENCY_FLAG =
FILE_FORMAT = 'csv'
FILE_NAME = sy-datum
EXCEPTIONS
FILE_NOT_FOUND = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
Naga
Similar Messages
-
Select flat file name using routine
Hi experts!
I am trying to write a routine in the infopackage for flat file extraction, which will select the flat file automatically according to the date. I need to load always the file of the previous week. Please help me correcting the code. The file name is: DatAuftragsbestandSeiten_W(number of week).fix
For example: DatAuftragsbestandSeiten_W16.fix
Thank you for your help!
program filename_routine.
Global code
$$ begin of global - insert your declaration only below this line -
Enter here global variables and type declarations
as well as additional form routines, which you may call from the
main routine COMPUTE_FLAT_FILE_FILENAME below
*TABLES: ...
DATA: ...
DATA: Str1 value '/strans/appl/anzeigen_bw/DatAuftragsbestandSeiten_W',
Str3 value '.fix'.
DATA: iweek(2).
call function 'WEEKNR_GET'
EXPORTING
DATE = sy-datum
IMPORTING
WEEK+4(2) = iweek.
iweek = iweek - 1.
$$ end of global - insert your declaration only before this line -
form compute_flat_file_filename
using p_infopackage type rslogdpid
p_datasource type rsoltpsourcer
p_logsys type rsslogsys
changing p_filename type RSFILENM
p_subrc like sy-subrc.
$$ begin of routine - insert your code only below this line -
This routine will be called by the adapter,
when the infopackage is executed.
p_filename =
*....Concatenate str1 iweek str3 into p_filename.
p_subrc = 0.
$$ end of routine - insert your code only before this line -
endform.hi Doris,
try
in global routine
data : l_week type SCAL-WEEK,
i_week(2).
in form compute_...
data : Str1 type string,
Str3 type string.
str1 = '/strans/appl/anzeigen_bw/DatAuftragsbestandSeiten_W'.
str3 = '.fix'.
call function 'DATE_GET_WEEK'
exporting
date = sy-datum
importing
week = l_week.
i_week = l_week+4(2).
i_week = i_week - 1.
if strlen( i_week ) = 1.
concatenate str1 '0' i_week str3 into p_filename.
else.
concatenate str1 i_week str3 into p_filename.
endif.
hope this helps. -
Selection of Folder/File name using the same Fun.Module
Please let me know if there is a function module which can fetch folder name/File name from the directory path when f4 option of selection screen field is selected. Currently I am able to get the file name using FM F4_DXFILENAME_4_DYNP but the requirment is like I have to select either folder name or the file name depending on user selection.
Note: Please let me know if there is a single Function module which can get folder name or the file name based on the user selection.i.e, if the user want to select a folder he can select or he can select files in the folder for processingHi sridhar
try this:
PARAMETER : TXT_FILE(100).
AT SELECTION-SCREEN ON VALUE-REQUEST FOR TXT_FILE.
PERFORM GETFILE.
start-of-selection.
PERFORM GETDATA.
FORM GETDATA.
DATA : FILENAME TYPE STRING.
FILENAME = TXT_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = IT_UPLOAD
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
FORM GETFILE.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = '.'
MASK = ' '
MODE = ' '
TITLE = ' '
IMPORTING
FILENAME = TXT_FILE
RC =
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
<b>This is a part of my BDC program its working for me u try n reply if it works for u.</b>
regards
vijay -
How to rename the SharePoint Document Library existing file name using Web service
Hi,
How to rename the SharePoint Document Library existing file name using SharePoint Web service.
Is it possible. How could i do it?
Thanks & Regards
Poomani SankaranHi,
Lists.UpdateListItems Method
would be helpful for your requirement.
Here is a blog with code demo for your reference:
http://blogs.msdn.com/b/knowledgecast/archive/2009/05/20/moss-using-the-list-web-service-to-rename-a-file.aspx
Best regards,
Patrick
Patrick Liang
TechNet Community Support -
How to find the File name using the FTP Adapter
hi all,
how to find the File name using the FTP Adapter with BPEL.
RegardsFound the solution for this.
First In the mediator's routing rule use assign property $in.property.jca.file.FileName to $out.property.jca.file.FileName
In the BPEL's receive activity go to the properties tab and get the property to a BPEL variable. That should do it.
Thanks for the posts -
How to get file name using File adapter Sync read
Hi All,
I am using SOA 10.1.3.3 and JDEV 10.1.3.3.
I have an async bpel process.
I have to read file name in this process... so i have used file adapter sync read operation.
How can we get the file name with out payload using sync read.
For normal read (Inbound Spec)we have UseHeaders="true" property.
Is there any property for sync read to read the file name.
Please help me
Regards
PavanKumar.M
Edited by: [email protected] on Oct 27, 2009 11:23 PMHi Eric,
The info in the link provided by you is for a normal read.
I need to read he file name using Sync read operation.
Regards
PavanKumar.M -
Hoe to logical file name using "FILE" transcation
I want to create a logical file name using "FILE" transaction , i have file path '/xfer/OUT/IDD0230 ' that cureently hard coded in program but i want to avoid hard code .
You need to go to FILE transction, create new entry.
You need to specify Physical name i.e value hardcoded in your program
and corresponding new Logical Path which enduser will be entering.
In code u ned to decode Logical path to physical path as its actual path.
Award points if helpful.
Shital -
Append file name using FileSelectPopup under Windows 7
Hi,
I saw the following thread for the same issue in Vista, just wanted to make sure that this issue has been fixed for Windows 7 also before I upgrade to the latest version.
http://forums.ni.com/t5/LabWindows-CVI/Append-file-name-using-FileSelectPopup-under-Windows-VISTA/m-...
Thanks,
Karthik
Solved!
Go to Solution.Hi,
I ran across that issue when I was running applications built under CVI 7.1.1 on Windows 7. I can verify that rebuilding the application under CVI 2009 SP1 and later CVI 2010 fixed the issue. So you should be ok. -
Same file name using JMS adapter on sender side.
Hi Friends,
I got a requirement to capture file name using JMS adapter on the sender side.
Can some one help me in resolving this issue.
Regards,
Jeevan.Hi ,
You can use Dynamic Configuration in mapping.
Create a UDF with input as file name and copy/paste this code
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//conf.removeAll();
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
//String filename= conf.get(key);
conf.put(key, fileName);
key= null;
return fileName;
Thanks. -
Get/put dynamic file name using FTP
Hi Friends,
I am currently using FTP_Connect, FTP_command and FTP_disconnect to get/put a file from a remote server.
But the file name was changed to add a date/time stamp.
So the filename became dynamic (example from 'test.txt' to 'test_200512160800.txt').
I tried using get test. but my FTP command failed. Do you know anyway of doing this?
Thanks.Hi Lego,
here's another sample for the fm:
REPORT ztest_epsf.
PARAMETERS: date LIKE sy-datum,
dir TYPE epsf-epsdirnam,
pattern TYPE epsf-epsfilnam,
zid LIKE vers_dest-rfcdest.
DATA dir_list LIKE epsfili OCCURS 0 WITH HEADER LINE.
DATA cnt_file TYPE epsf-epsfilsiz.
DATA err_file TYPE epsf-epsfilsiz.
START-OF-SELECTION.
IF date IS INITIAL.
date = sy-datum.
ENDIF.
*build pattern with input-pattern and date
CONCATENATE pattern date '*' INTO pattern.
*search for files in foreign system
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
DESTINATION zid
EXPORTING
dir_name = dir
file_mask = pattern
IMPORTING
file_counter = cnt_file
error_counter = err_file
TABLES
dir_list = dir_list
EXCEPTIONS
invalid_eps_subdir = 1
sapgparam_failed = 2
build_directory_failed = 3
no_authorization = 4
read_directory_failed = 5
too_many_read_errors = 6
empty_directory_list = 7
OTHERS = 8.
WRITE: / pattern.
ULINE.
LOOP AT dir_list.
WRITE: / dir_list-name.
ENDLOOP.
ULINE.
WRITE: / cnt_file.
WRITE: / err_file.
pls reward points for useful hints.
thanks and
regards Andreas -
How to get the incoming file name using JMS adapter and SOAP adapter
Hi Everybody,
In one of my interface i need to get the file name of incoming flat file using JMS adapter at sender side. and then i am using xslt to convert it to IDOC and then posting to SAP IDOC.
my incoming filname are in this form price<DateTimestamp>.txt. when i do the tranformation this incoming file name should be part of one element in the IDOC which i am posting.
EX:
<IDOC
<REF>price<DateTimestamp>.txt</REF>
</IDOC>
Hope it is clear to everybody. I need your suggestion how i can capture this incoming file name and send it as part of IDOC.
Thanks
rajIf they are passing it in message id or correlation id,
you can access it using
<xsl:variable name="dynamic-conf"
select="map:get($inputparam, 'DynamicConfiguration')" />
<xsl:variable name="dynamic-key"
select="key:create('http://sap.com/xi/XI/System/JMS', 'DCJMSMessageID/ DCJMSCorrelationID')" />
<xsl:variable name="dynamic-value"
select="dyn:get($dynamic-conf, $dynamic-key)" />
Check this:
http://help.sap.com/saphelp_nw70/helpdata/en/f4/2d6189f0e27a4894ad517961762db7/content.htm
Thanks,
Beena. -
Getting the file name using ehdr:getRequestHeader function in style sheet
Hi, I am facing an issue while using ehdr:getRequestHeader function to get the name of the file, which was placed in FTPS server and read by FTP Adapter. In style sheet I am trying to get the file name as below.
<xsl:variable name="fileName"
select="ehdr:getRequestHeader('/fhdr:InboundFTPHeaderType/fhdr:fileName','fhdr=http://xmlns.oracle.com/pcbpel/adapter/ftp/;')"/>
and based on the file name I am trying to fetch the values from Property file, map it to a schema and make a SOAP service call.
When i use the above functionality in style sheet exception occurs and in ESB instance I am not able to view the exception.
It is saying as 'Details of the message are not available, The message details would have been purged'. In logs it is showing the following error trace.
<MSG_TEXT>Failed to process deferred message</MSG_TEXT>
<SUPPL_DETAIL>oracle.tip.esb.server.common.exceptions.BusinessEventRejectionException: Error occured while handling monitor message dequeued from monitor topic. Message text is "<activityMessages><activityMessage order='10' type='6'><flowId>cRfy7g6a-8HDUKqyf4GsKw==</flowId><subFlowId>1245307693657</subFlowId><timestamp>1245307703862</timestamp><operationGUID>2F1C13905B3F11DE8F0BD923A1148BB1</operationGUID><operationQName>ESBTest.InvokeESB</operationQName><errorMessage><![CDATA[An unhandled exception has been thrown in the ESB system. The exception reported is: "org.collaxa.thirdparty.apache.wsif.WSIFException: exception on JaxRpc invoke: serialization error: java.lang.IllegalArgumentException: getSerializer requires a Java type and/or an XML type
at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.invokeOperation(WSIFOperation_JaxRpc.java:1714)
at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.invokeRequestResponseOperation(WSIFOperation_JaxRpc.java:1460)
at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.executeInputOnlyOperation(WSIFOperation_JaxRpc.java:1141)
at oracle.tip.esb.server.common.wsif.WSIFInvoker.executeOperation(WSIFInvoker.java:894)
at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:810)
at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:832)
at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.nextService(OutboundAdapterService.java:227)
at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.processBusinessEvent(OutboundAdapterService.java:136)
at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatchNonRoutingService(InitialEventDispatcher.java:407)
at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(InitialEventDispatcher.java:165)
at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1988)
at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1467)
at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:205)
at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:136)
at oracle.tip.esb.server.service.EsbRouterSubscription.onBusinessEvent(EsbRouterSubscription.java:310)
at oracle.tip.esb.server.dispatch.EventDispatcher.executeSubscription(EventDispatcher.java:138)
at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscription(InitialEventDispatcher.java:547)
at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscriptions(InitialEventDispatcher.java:529)
at oracle.tip.esb.server.dispatch.EventDispatcher.dispatchRoutingService(EventDispatcher.java:94)
at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(InitialEventDispatcher.java:161)
at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1988)
at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1467)
at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:119)
at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:65)
at oracle.tip.esb.server.service.impl.inadapter.ESBListenerImpl.processMessage(ESBListenerImpl.java:722)
at oracle.tip.esb.server.service.impl.inadapter.ESBListenerImpl.onMessage(ESBListenerImpl.java:407)
at oracle.tip.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage(MessageEndpointImpl.java:281)
at oracle.tip.adapter.file.inbound.ProcessWork.publishMessage(ProcessWork.java:1173)
at oracle.tip.adapter.file.inbound.ProcessWork.doTranslation(ProcessWork.java:882)
at oracle.tip.adapter.file.inbound.ProcessWork.processMessages(ProcessWork.java:342)
at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:224)
at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:825)
at java.lang.Thread.run(Thread.java:595)
]]></errorMessage><exception><![CDATA[oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "org.collaxa.thirdparty.apache.wsif.WSIFException: exception on JaxRpc invoke: serialization error: java.lang.IllegalArgumentException: getSerializer requires a Java type and/or an XML type
at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.invokeOperation(WSIFOperation_JaxRpc.java:1714)
at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.invokeRequestResponseOperation(WSIFOperation_JaxRpc.java:1460)
at com.collaxa.cube.ws.wsif.providers.oc4j.jaxrpc.WSIFOperation_JaxRpc.executeInputOnlyOperation(WSIFOperation_JaxRpc.java:1141)
at oracle.tip.esb.server.common.wsif.WSIFInvoker.executeOperation(WSIFInvoker.java:894)
at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:810)
at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:832)
at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.nextService(OutboundAdapterService.java:227)
at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.processBusinessEvent(OutboundAdapterService.java:136)
at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatchNonRoutingService(InitialEventDispatcher.java:407)
at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(InitialEventDispatcher.java:165)
at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1988)
at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1467)
at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:205)
at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:136)
at oracle.tip.esb.server.service.EsbRouterSubscription.onBusinessEvent(EsbRouterSubscription.java:310)
at oracle.tip.esb.server.dispatch.EventDispatcher.executeSubscription(EventDispatcher.java:138)
at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscription(InitialEventDispatcher.java:547)
at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscriptions(InitialEventDispatcher.java:529)
at oracle.tip.esb.server.dispatch.EventDispatcher.dispatchRoutingService(EventDispatcher.java:94)
at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(InitialEventDispatcher.java:161)
at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1988)
at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1467)
at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:119)
at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:65)
at oracle.tip.esb.server.service.impl.inadapter.ESBListenerImpl.processMessage(ESBListenerImpl.java:722)
at oracle.tip.esb.server.service.impl.inadapter.ESBListenerImpl.onMessage(ESBListenerImpl.java:407)
at oracle.tip.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage(MessageEndpointImpl.java:281)
at oracle.tip.adapter.file.inbound.ProcessWork.publishMessage(ProcessWork.java:1173)
at oracle.tip.adapter.file.inbound.ProcessWork.doTranslation(ProcessWork.java:882)
at oracle.tip.adapter.file.inbound.ProcessWork.processMessages(ProcessWork.java:342)
at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:224)
at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:825)
at java.lang.Thread.run(Thread.java:595)
at oracle.tip.esb.server.common.wsif.WSIFInvoker.executeOperation(WSIFInvoker.java:1020)
at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:810)
at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:832)
at oracle.tip.esb.server.service.impl.outadapte]]></exception><retryable>false</retryable></activityMessage></activityMessages>"
at oracle.tip.esb.monitor.manager.ActivityMessageReceiver.handleMessage(ActivityMessageReceiver.java:96)
at oracle.tip.esb.server.dispatch.agent.ESBWork.process(ESBWork.java:178)
at oracle.tip.esb.server.dispatch.agent.ESBWork.run(ESBWork.java:132)
at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:825)
at java.lang.Thread.run(Thread.java:595)
Caused by: oracle.tip.esb.monitor.MonitorException: Due to the error "", the activity message could not be stored.
at oracle.tip.esb.monitor.manager.database.AbstractFaultPersister.persist(AbstractFaultPersister.java:107)
at oracle.tip.esb.monitor.manager.database.DBActivityMessageStore.persistMessage(DBActivityMessageStore.java:340)
at oracle.tip.esb.monitor.manager.database.DBActivityMessageStore.store(DBActivityMessageStore.java:131)
at oracle.tip.esb.monitor.manager.ActivityMessageReceiver.handleMessage(ActivityMessageReceiver.java:83)
... 7 more
Caused by: java.lang.NullPointerException
at oracle.tip.esb.monitor.manager.database.oracle.OracleFaultPersister.persist(OracleFaultPersister.java:102)
at oracle.tip.esb.monitor.manager.database.AbstractFaultPersister.persist(AbstractFaultPersister.java:105)
... 10 more
</SUPPL_DETAIL>
When I use the same function getRequestHeader for FileAdapter, it is working fine. Do anyone know why this issue occurs? Is this an issue with environment?As far as I can see the problem is the invoke of the SOAP service. This could be because of an empty filename but maybe there are other issues. First, make sure that the filename is read correctly by looking it up in the BPEL runtime process. Maybe the content is different than you expected it so that the read action for the properties give wrong result. Are you sure that ehdr is the correct prefix for the ftpheader?
-
Target file name using Dynamic Configuration
Hi,
Currently we have requirement Idoc to File interface.In this scenario if one field exists infile then we have to check and we need to create update directory and if it is not exist then we should create one more directory and upload files over there there files should create with timestamp. Since,File system using Sql database so we have used JDBC lookup to check that particaluar field and if it exists we are passing update to UDF if it is not then we are passing constant Create to that. If we use Adapter Specific Message Attributes then in reciever side file Communication Channel addtimestap will it consider or do we have to write anything in Udf it self? Could anybody explain on this?Please provide some sample udf .
Thanks ,
Aparna.
Edited by: aparna_karnam on Dec 24, 2011 11:44 AM
Edited by: aparna_karnam on Dec 24, 2011 11:52 AMHi,
I have added little changes to the code you have written, to meet your expectations
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
conf.put(key,"/sap-dev/" +a);
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
string filename=conf1.get(key1);
final String DATE_FORMAT_NOW = "dd-MM-yyyy_HH-mm-ss";
String s;
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(DATE_FORMAT_NOW);
java.util.Calendar cal = java.util.Calendar.getInstance();
s=sdf.format(cal.getTime());
filename=a+" "+"User_"+s+".txt";
conf1.put(key1,filename);
return " ";
So if value of input variable "a" is "update" then the target directory will be "/sap-dev/update" and the file formed will have name "update User_26-12-2011_01-20-50.txt", of course the date and time values will change depending on server settings. I just showed a sample. one more point, the directory will not be created, you have to create the directories before you run the scenario, only the final directory will be decided depending on value of variable "a". In case you wanna create new directory if directory is not pre-existing then try ticking on "Create Target Directory" option under "file access parameters" in communication channel. (I have never used this option u can have a try. )
Now coming to your queries
1. But whether file type txt automatically it will take or do we have to give in udf it self ?
ans) You have to put the value in UDF as I have done in code.
2. how it will consider timestamp ?
ans) This has been generated in UDF itself.
3. how i can give file extension .txt?
ans) same as ans 1
4. And also in Receiver Communication Channel under Adapter Specific Message attributes we have option of file type how it works?
ans) File type determines is the file you are going to write is of type "text" or "binary". From "Processing Parameters" tab you can select this from drop down menu in communication channel or you can set it through ASMA properties in similar manner as you have done for file name and directory name. For more details refer to http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
http://help.sap.com/saphelp_nwpi71/helpdata/en/44/6830e67f2a6d12e10000000a1553f6/content.htm
Finally few more points I would like to add
1) you have not mentioned the operating system of the server where file is going to form. In case its UNIX/LINUX you are not allowed to use space in the filename. you can consult these links before you decide on file name and directory name in the UDF mentioned above
http://www.med.nyu.edu/rcr/rcr/nyu_vms/unixfileanddirectorynames.htm (UNIX)
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions (WINDOWS)
2) you can alter the string "DATE_FORMAT_NOW" as per your requirement so that the timestamp appears in the way you want. I have just showed a sample.
3) Plesae do not forget to tick on the options "Use Adapter-Specific Message Attributes indicator", "Fail If Adapter-Specific Message Attributes Missing", indicators "File Name" and "Directory" under "Define Adapter-Specific Message Attributes." in receiver communication channel.
Hope this solves your problem.
Wish my dear forum members and users of SDN
Merry Christmas and Happy new year (in advance)
Regards
Anupam
N.B:- I initially forgot to add the ".txt" part to the file name. I made necessary corrections in code now. -
Get File name using File Adapter
Does anyone know how to get the file name that has been picked up so it can be past to a variable so it can be used in the BPEL process.
cheers
JamesHi James,
Here the STEPS,
Create File Adapter.
Add File Adapter Service to Receive Activity.
Click Receive Activity and goto Adapters Tab.
Click "Tourch" to get variable names.
Select Variable -> Process -> Variables and Click on "Create New Variable" icon and give name.
Select "Message Type" and click "Tourch" icon.
Now you select "Partner Links" -> FileAdapter WSDL -> Imported WSDL -> Message Type -> InboundHeader_msg and select OK.
It's done.
now you can use this Global Variable to get Filename and Directory name.
Regards,
Bhavesh Thaker. -
Tabular form - field to open explorer select file name to same in field
Hi
I am using apex 4.1 and would like some help with a tabular form I have created.
It is based on a table which has two fields
description
path_of_source_file
in the form I would like to be able to open windows explored to select a file name and save the path in the path_of_source_file field
Does anyone know how to do that
Many thanks
Jayne>
Start by editing your forum profile with a real handle instead of "user1647153".
I am using apex 4.1 and would like some help with a tabular form I have created.
It is based on a table which has two fields
description
path_of_source_file
in the form I would like to be able to open windows explored to select a file name and save the path in the path_of_source_file fieldYou need to seriously rethink what you're trying do. Not only does APEX not provide support for file browse items in tabular forms (which are horrible anyway; even more so with an ugly file picker in every row), but file path information is not available in standard browser configurations (or at all in most browsers). As has been noted in many previous threads on this topic:
>
For security/privacy reasons recent versions of browsers by default do not send local file path information from File Browse items to the server, nor expose the file path in the control's JavaScript methods. Firefox, Safari and Chrome only provide the filename. IE6 & IE7 still yield the path in Windows format. IE8+ and Opera have adopted an irritating approach of replacing the path with a wholly imaginary "C:\fakepath\"—and this monstrosity has sadly had to be enshrined in the HTML5 spec...
Changing IE's security config setting "Include local directory path when uploading files" enables the path to be exposed in IE, but unless you're working in an intranet environment where: IE is the only browser used; it's possible to make remote changes to this setting on every desktop; and this won't break/expose anything else, then trying to achieve this is pointless.
>
For more information see:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-March/018980.html
http://blogs.msdn.com/ie/archive/2009/03/20/rtm-platform-changes.aspx
http://developers.whatwg.org/number-state.html#file-upload-state
{thread:id=2385659}
Go right back to the start and explain what this is all about. We need to know what the ultimate goal is in order to determine what use—if any—can be made of APEX here.
Maybe you are looking for
-
i have uninstalled three times and keeps saying same thing? help pls
-
Premiere Elements transcoding error
After dozens of hours editing I get a transcoding error when trying to burn a project to disk in Premiere Elements 12. Can anyone suggest a solution or workaround?
-
Settings...what is the secret
i have had a heck of a time generating HD clips that will play in QT on my own computer without "staggering," i can down load an HD movie trailer from apple (armored) that is bigger (1920x912 vs 1780x720), in millions and at 24 fps (mine is 30). the
-
I'm not too technical but I'm looking for some understanding. ERP2005, ECC 6.0 We want to use ESS and have employees log in to ESS to view their pay stubs. We understand they can view it as a PDF file. Can someone explain the process we need to go th
-
Customizing exchange for ticketing system
I posted this in a system center operations manager 2012 forum but maybe it belongs in a exchange 2010 forum. I set up subscriptions in SCOM to email out alerts when i get a hardware alert. I would like to send these email alerts directly to our tick