Error calling transaction from a transaction
Hi,
I have created a transaction to batch Measurement Point readings for the PM Module. The batch uses a query to determine the tags required to update and it calls the "MeasurementPointWrite" transaction that I downloaded from SAP. My problem is when I run the batch transaction it reports "TransactionLoadException: Unable to find transaction file specified"
Has anyone seen this issue?
The following shows the relevant log dump:
[DEBUG] [MPWriteCall]: Started action execution
[DEBUG] [MPWriteCall]: Type: TransactionCall, Description: MeasurementPointWrite Transaction Call
[DEBUG] [MPWriteCall]: [Initializing Action][Initializing Parameters: [MPWriteCall.StoreTransactionOutput = MPWriteCall.StoreTransactionOutput=[boolean:false]][MPWriteCall.ResetState = MPWriteCall.ResetState=[boolean:true]][MPWriteCall.Persist = MPWriteCall.Persist=[string:INHERIT]][MPWriteCall.Async = MPWriteCall.Async=[boolean:false]][MPWriteCall.Expiration = MPWriteCall.Expiration=[long:21600000]]]
[DEBUG] [MPWriteCall]: Resolving Input Links
[DEBUG] [MPWriteCall]: Link Stats: MPWriteCall.Reader, Type [Assign], Time [ <1 ms], Expression: "PCS7 Automatic"
[DEBUG] [MPWriteCall]: Link Stats: MPWriteCall.DebugFlag, Type [Assign], Time [ <1 ms], Expression: Transaction.DebugFlag
[DEBUG] [MPWriteCall]: Link Stats: MPWriteCall.MeasurementPoint, Type [Assign], Time [ <1 ms], Expression: PCSTagRepeater.Item{/Row/POINT}
[DEBUG] [MPWriteCall]: Link Stats: MPWriteCall.Reading, Type [Assign], Time [ <1 ms], Expression: PCSTagRepeater.Item{/Row/Value}
[DEBUG] [MPWriteCall]: Link Stats: MPWriteCall.Text, Type [Assign], Time [ <1 ms], Expression: "PCS TimeStamp: "&PCSTagRepeater.Item{/Row/TimeStamp}
[DEBUG] [MPWriteCall]: Link Stats: MPWriteCall.CreateOutputXML, Type [Assign], Time [ <1 ms], Expression: Transaction.CreateOutputXML
[DEBUG] [MPWriteCall]: Link Stats: MPWriteCall.CreateNotif, Type [Assign], Time [ <1 ms], Expression: Local.Blank
[DEBUG] [MPWriteCall]: Link Stats: MPWriteCall.NotificaitonType, Type [Assign], Time [ <1 ms], Expression: Local.Blank
[DEBUG] [MPWriteCall]: Link Stats: MPWriteCall.DifferenceFlag, Type [Assign], Time [ <1 ms], Expression: Local.Blank
[DEBUG] Action parameter creating time [ <1 ms]
[DEBUG] Entering action 'MPWriteCall' implementation.
[DEBUG] [] Loading transaction from file.
[FATAL] [] Unable to find transaction in file system: .trx
[DEBUG] Exiting action 'MPWriteCall' implementation
[ERROR] Error found trying to execute action 'MPWriteCall' Exception: [Unable to find transaction file specified]
[WARN] [MPWriteCall] Skipping execution of output links due to action failure.
[ERROR] [MPWriteCall] Action: Runtime threw an exception. Exception: [com.sap.xmii.bls.exceptions.TransactionLoadException: Unable to find transaction file specified]
[DEBUG] [MPWriteCall]: Finished[ <1 ms] Succeeded: false
For what it's worth, it appears to be a problem at the source. I have the same problem with the same downloaded file. Looking at the xml, there is an error in the self-reference of location. I was unable to figure out how to modify the xml of the export such that a reimport would fix it. (Export it and look at the xml - do a find on MeasurementPointWrite and you will see what I mean).
However, try the following:
Create a new transaction.
Copy the top sequence and include children of the MeasurementPointWrite transaction (basically you are copying the entire transaction contents).
Paste it to the empty sequence in your new transaction.
Save it under some name.
Create another new transaction.
Drag and drop your first new transaction into the empty sequence of your second new transaction.
Now it works...
Go figure.
Regards,
Mike
Edited by: Michael Appleby on Oct 18, 2010 7:44 PM
Similar Messages
-
Error calling BLS from oracle database
Hi Experts,
We have a scenario in which we are calling BLS from oracle database using trigger. The call is made using the following URL:
http://<Host name>:50000/XMII/Runner?Transaction=<TRX_Path>&Material=MATNR&Pallet_id=PALLET&Plant=PLANT&Proc_order=PROC&Prodline=PROD&Quantity=QTY&Start_Date=DAT&Start_Time=TIM&Status=STAT&UOM=UOM1&User_name=USER&OutputParameter=*
This used to work fine in 11.5 but when we upgraded to 14.0 it is not working. We have maintained server details in \etc\host file.
We were getting error in file 'Error 1 Text.txt'. "A possible Cross-Frame Scripting attack has been prevented. Please contact your system administrator or refer to" this was the last error message. We checked this on SCN and based on the search results we have implemented SAP note 1651004 wherein setting in netweaver is required to be changed. After note was implemented we are getting another error text ('Error 2 Text.txt') "This will happen if the browser running the page tha". We tried a few ways but could not capture the full message coming.
Has anybody of faced similar problem? I would highly appreciate any hint which could help in solving this problem.
System Information:
NW 7.31 SP 10
Oracle 11.2.0.4
MII 14.0 SP5 patch 7
Regards,
DarshanHi Christian/Anushree,
I have now modified the URL by adding Illum login name and password:
http://<Host name>:50000/XMII/Runner?Transaction=<TRX_Path>&Material=MATNR&Pallet_id=PALLET&Plant=PLANT&Proc_order=PROC&…
When i run the url in browser it gives me the expected results but when i try to trigger it from Oracle i am still getting the error as below:
"<script>
var inPortalScript = false
var webpath = "/logon_ui_resources/"
</script>
<html>
<head>
<BASE target="_self">
<link rel=stylesheet href="/logon_ui_resources/css/ur/ur_ie5.css">
<title>User Management, SAP AG</title>
<script language="javascript">
var originWindowName=window.name;
window.name="logonAppPage";
function restoreWindow() {
try{
window.name=originWindowName;
} catch(ex){}
</script>
<script language="JavaScript">
function putFocus(formInst, elementInst) {
if (document.forms.length > 0) {
document.forms[formInst].elements[elementInst].focus();
function setValuesAutoCreation() {
var form = document.getElementById('logonForm');
form.j_username.value="";
form.j_password.value="";
form.automaticAccountCreation.value="true";
function submitForm() {
var form = document.getElementById('logonForm');
form.submit();
function clearEntries() {
document.logonForm.longUid.value="";
document.logonForm.password.value="";
function setFocusToFirstField() {
myform = document.logonForm;
try{
for (i=0; i<myform.length; i++) {
elem = myform.elements[i];
if (!elem.disabled) {
elemType = elem.type;
if (elemType=="text" || elemType=="password") {
if (!elem.readOnly) {
elem.focus();
break;
if (elemType=="select-one" || elemType=="select-multiple" || elemType=="checkbox" || elemType=="radio") {
elem.focus();
break;
} catch(ex){
function addTenantPrefix() {
return true;
</script>
</head>
<body class="urBdyStd" bgcolor="#F7F9FB" onLoad="setFocusToFirstField()" onUnload="restoreWindow()">
Thanks,
Darshan
<script language="JavaScript">
var blockPage = false;
</script>
<script language="JavaScript">
try {
if (top.document.domain != self.document.domain) {
blockPage = true;
} catch (error) {
// This will happen if the browser running the page tha" -
I am using the SOA Suite and have a very simple ESB project which picks up files from a directory and calls a BPEL process following a simple XSL translation. I am getting the following error:
An unhandled exception has been thrown in the ESB system. The exception reported is: "java.lang.Exception: Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: Not authorized; nested exception is: javax.naming.AuthenticationException: Not authorized [Root exception is javax.naming.AuthenticationException: Not authorized] at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:64) at javax.naming.InitialContext.lookup(InitialContext.java:351) at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:279) at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250) at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:174) at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:158) at oracle.tip.esb.server.service.impl.bpel.BPELService.processBusinessEvent(Unknown Source) at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatchNonRoutingService(Unknown Source) at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(Unknown Source) at oracle.tip.esb.server.dispatch.BusinessEvent.raise(Unknown Source) at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(Unknown Source) at oracle.tip.esb.server.service.EsbRouterSubscription.onBusinessEvent(Unknown Source) at oracle.tip.esb.server.dispatch.EventDispatcher.executeSubscription(Unknown Source) at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscription(Unknown Source) at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscriptions(Unknown Source) at oracle.tip.esb.server.dispatch.EventDispatcher.dispatchRoutingService(Unknown Source) at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(Unknown Source) at oracle.tip.esb.server.dispatch.BusinessEvent.raise(Unknown Source) at oracle.tip.esb.utils.EventUtils.raiseBusiness
The esb has been deployed to our server (OAS 10.1.3) using jdeveloper. Please can anybody point me in the right direction.Not really. There are 2 ways to invoke BPEL.
1) Over SOAP using an ESB SOAP service that parses a BPLE WSDL. This works like any standard HTTP/SOAP invocation and would be used when BPEL and ESB are not in the same container.
2) Over Java by add a routing rule to an ESB Routing Servie and select a BPEL process in the BPELSystem as the target. This is the preferred binding when ESB and BPEL are colocate din the same container. This takes advantage of the fact that ESB kistens on the BPEL internal Control jms queue when a BPEL process is deployed into the container. That is how the BPEL processes show up in the BPELSystem ESB service tree. -
Error calling Report from Form
Hi,
I'd like to call a report using a Form.
I have Oracle Form 10.1.2 in Oracle Database 10g.
I create a button and specify a PL/SQL in the when-button-pressed
declare
rep_id REPORT_OBJECT;
v_rep VARCHAR2(100);
begin
rep_id := FIND_REPORT_OBJECT('report9');
if not id_null(rep_id) then
v_rep := RUN_REPORT_OBJECT(rep_id);
else
message('report not available');
end if;
end;
but after I click the button in the form, it gives an error message in the status bar
(in the bottom of the form)
error : FRM-41211: Integration Error: SSL failure running another product
Any help would be grateful.
Thanks,
BuntoroI have tried your suggestion.
I create my own report server using rwserver server=repsrv.
Another java-based windows showed up. It shows that repsrv is ready.
I do the following:
1. Navigate to http://localhost:8889/reports/rwservlet using web browser.
It showed OracleAS Report Services - Servlet Command Help page.
But there is no other window popup.
2. Navigate to http://localhost:8889/reports/rwservlet?userid=PRACTICE/PRTC@MYDB&report=C:\PRACTICE\FORM\MODULE1.JSP&destype=cache&desformat=html¶mform=no&p_1=P1&p_1=P2
my schema is PRACTICE, password PRACTICE, and database instance MYDB
the report path = C:\FORM\MODULE1.JSP
The following error occured
REP-51002: Bind to Reports Server rep_<computer_name> failed
3. Finally,
http://localhost:8889/reports/rwservlet?server=REPSRV&userid=PRACTICE/PRTC@MYDB&report=C:\PRACTICE\FORM\MODULE1.JSP&destype=cache&desformat=html¶mform=no&p_1=P1&p_1=P2
The following error occured
REP-51002: Bind to Reports Server repsrv failed
I don't understand.
It seems that the Report Service is not recognized although the java-based window state that the Report Server (repsrv) is ready.
My questions:
1. Does it means that my report server is not running?
Or it is running but the browser didn't recognize it?
I use Internet Explorer 6 and Netscape 7, both of them showed the same error message.
2. I have read the PDF you've pointed out.
The paper said there is supposed to be 2 type of server, 'In process' and custom server.
Both of them will create a configuration file in /reports/conf in DevSuiteHomeDirectory.
I can see the custom report server's configuration file which I create using rwserver (repsrv.conf)
but I can't see the 'in process' server's configuration file (rep_<computer_name>.conf).
What am I supposed to do?
Many thanks,
Buntoro -
Error calling BPEL from ESB Multi-part simple type
I am trying to define a soap service in ESB which is refering a BPEL service. I get the error
The selected porttype is using a message that is invalid for ESB because it is multi-part or has a simple type.The message RuntimeFaultMessage in operation process of port type exportCaCustomers is invalid. Please select another portype.
Here is the wsdl for the BPEL service. exportCaCustomers.wsdl
<definitions
name="exportCaCustomers"
targetNamespace="http://xmlns.oracle.com/exportCaCustomers"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://www.globalcompany.com/ns/order"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:ns3="http://usconcrete.com/v1/interfaces/common/InputMessage.xsd"
xmlns:ns2="http://schemas.oracle.com/bpel/extension"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:client="http://xmlns.oracle.com/exportCaCustomers"
xmlns:ns10="http://usconcrete.com/v1/interfaces/common/InputMessage.xsd"
>
<import namespace="http://schemas.oracle.com/bpel/extension" location="RuntimeFault.wsdl"/>
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://www.globalcompany.com/ns/order"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:client="http://xmlns.oracle.com/exportCaCustomers">
<import namespace="http://xmlns.oracle.com/exportCaCustomers" schemaLocation="exportCaCustomers.xsd"/>
</schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://www.globalcompany.com/ns/order"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:client="http://xmlns.oracle.com/exportCaCustomers">
<xsd:import namespace="http://www.globalcompany.com/ns/order" schemaLocation="sampleTax.xsd"/>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://usconcrete.com/v1/interfaces/common/InputMessage.xsd" schemaLocation="InputMessage.xsd"/>
</xsd:schema>
</types>
<message name="exportCaCustomersRequestMessage">
<part name="payload" element="ns10:CVInputMessage"/>
</message>
<message name="exportCaCustomersResponseMessage">
<part name="payload" element="client:exportCaCustomersProcessResponse"/>
</message>
<portType name="exportCaCustomers">
<operation name="process">
<input message="client:exportCaCustomersRequestMessage"/>
<output message="client:exportCaCustomersResponseMessage"/>
<fault name="bindingFault" message="ns2:RuntimeFaultMessage"/>
</operation>
</portType>
<plnk:partnerLinkType name="exportCaCustomers">
<plnk:role name="exportCaCustomersProvider">
<plnk:portType name="client:exportCaCustomers"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
These are the contents of RuntimeFault.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="RuntimeFault"
targetNamespace="http://schemas.oracle.com/bpel/extension"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<message name="RuntimeFaultMessage">
<part name="code" type="xsd:string"/>
<part name="summary" type="xsd:string"/>
<part name="detail" type="xsd:string"/>
</message>
</definitions>
This looks like a very basic thing to do. My BPEL process is working fine. I just want to access it from ESB. Any ESB gurus there. Please respond.<fault name="bindingFault" message="ns2:RuntimeFaultMessage"/>Don't think this is the way to define the RuntimeFaults.
the fault-element you use to 'throw' you own business faults.
RunTimeFaults are handled by the bpel framework itself and aren't throwable like this.
See :
http://www.oracle.com/technology/products/ias/bpel/htdocs/orabpel_technotes.tn007.html
""Business faults are application specific faults and occur when an explicit <throw> activity is executed or an <invoke> activity gets a fault as response. The fault name of a business fault is specified by the BPEL process and the messageType, if one exists, is defined in the WSDL.
Runtime faults are not user defined and will not appear in the WSDL for a process or service."" -
ESS throwing error while calling transaction from R/3
Whenever u try to pull certain I-view like under ESS > Income tax provisional statement then the portal throws below mentioned error. Portal is not able to call transactions from R/3.
Error:
The requested URL could not be retrieved
While trying to retrieve the URL: http://dev.mglep.com:26000/sap(ZT0yZElaRG5xNDlZdFF4aGcyTDhzMWxRLS1hVUR5bDBMbjBDZ2hWUUcyMlZmcmlBLS0=)/bc/gui/sap/its/webgui?
The following error was encountered:
Connection to 69.43.161.156 Failed
The system returned:
(111) Connection refusedThe remote host or network may be down. Please try the request again.
Your cache administrator is root.
Please helpHi,
Please check the parameters that has been defined in SICF for the transaction you are using.
With Regards,
Kaustuv Goswami. -
Error 00-341 RAISE_EXCEPTION when using Call Transaction for VA01 in backgr
Hi,
I am getting this message when I use call transaction to create a sales order using VA01. Following is the statement I have used. Note that when i execute the program online, I am not getting any errors. I could create sales order without any problem. I am getting this exception only when I run in background.
CALL TRANSACTION 'VA01'
USING BDC_TAB
MODE 'N'
UPDATE 'S'
MESSAGES INTO W_MESS_TAB.
When I captured message tab, I got following messages.
DC006 - Control Framework: Fatal error - GUI cannot be reached
00341 Runtime error RAISE_EXCEPTION has occurred.
Please help me in this regard.
Regards
KasiSome times execution of BDC program in back ground is different from the foreground. Some screens may appear in background and raise error while same will not when executed in foreground.
Double click the message in Session log to know more details.
One way is to suppress the screen while executing BDC.
Alternatively I suggest to use BAPI instead.
- Sanjay -
Error while updating data using session and call transaction method
Hi all,
i have to update data using MM01 transaction from flat file to database.i have used both session method and call transaction method to do that.in both the methods data has been transferred from internal tables to screens but while updating the data that is by clicking the ok-code at the end of the transaction iam getting a dialogue box stating
SAP EXPRESS DOCUMENT "UPDATE WAS TERMINATED" RECEIVED FROM AUTHOR "SAP".
please tell whether the problem lies and solution for that.
thanks and regards.hi,
check your recording.check whether u saved your material no in recording or not.
once again record the transacton mm01.
MATNR LIKE RMMG1-MATNR,
MBRSH LIKE RMMG1-MBRSH,
MTART LIKE RMMG1-MTART,
MAKTX LIKE MAKT-MAKTX,
MEINS LIKE MARA-MEINS,
MATKL LIKE MARA-MATKL,
BISMT LIKE MARA-BISMT,
EXTWG LIKE MARA-EXTWG,
these are the fields which u have to take in internal table.
this is the record which i took in my flatfile.use filetype as asc and hasfieldseperator as 'X'.
SUDHU-6 R ROH MATSUDHU " 001 7890 AA
i did the same.but i didn't get any error. -
Error committing transaction in Stored Proc call - prev solns not working
Hi All,
Our process invokes a DB adapter to fetch the response from the table for our request via Stored Procedure call but facing the below issue. Its a synchronous process. Stored Procedure is present inside the Package and we are calling the Stored procedure using that Package.
What we did is created a DB datasource of XA type and tried to call the Stored Proc but it was giving a problem “ORA-24777: use of non-migratable database link not allowed” and hence according to this thread Using DB links in Stored proc call in DB adapter 11G SOA we have modified the datasource as non-XA type.
While we do that, we could see that Stored Proc is called and the response is present in the reply payload inside the flow trace. But the instance is getting faulted and the error is “Error committing transaction:; nested exception is: javax.transaction.xa.XAException: JDBC driver does not support XA, hence cannot be a participant in two-phase commit. To force this participation, set the GlobalTransactionsProtocol attribute to LoggingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source.”
We have tried the properties of global transaction support as one phase commit, emulate two phase commit and logging last resource but error remains the same.
Database from which we are getting the response is of version "Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production". Will the database link error arises even if we connect to Oracle Database?
Please could you advise me solutions to resolve this issue.
Thanks in advance.You are using Non-XA because it means (among all others) that the commit issue can be handle by the DB as well.
The Emulate Two Phase property imitating the XA transaction in that way, that it allows you to manage a local db transaction.
You can stay with XA connection, but then you will have to use "AUTONOMOUS_TRANSACTION pragma" in your procedure.
Enter the following link to find good explanation about all of your questions:
http://docs.oracle.com/cd/E15523_01/integration.1111/e10231/adptr_db.htm#BGBIHCIJ
Arik -
Initial Load Error - No generation performed. Call transaction GN_START
Hi Folks,
We are doing middleware configuration for data migration between R3->CRM.Have followed "Best Practies" configuration Guide.
System Using; CRM 2007 and ECC6.0
Issue
While performing initial load, system is throwing the error as
001- No generation performed. Call transaction GN_START
002-Due to system errors the Load is prohibited (check transaction MW_CHECK)!
After calling the transaction GN_START system asks for job scheduling,whereas I have already scheduled it.
A job is already scheduled periodically.
Clicking on 'Continue' will create another job
that starts immediately.
After checking(MW_CHECK),message is displayed as
No generation performed. Call transaction GN_START.
If anybody has encountered the similar issue and has resolved it,their guidence will be greatly appriciated.
Thanks in Advance
VEERA BVeera,
We also faced the same problem when we have done the upgrade from CRM 4.0 to CRM 2007.
For that you go to SMWP where you can see all the errors related to Middleware with the error message so try to remove the error,
Also pls check in RZ20 and activate the middleware trace tree.
Regards
Vinod -
Timeout Error in Call Transaction on Asynchronous Abap Proxy
Hi Gurus!!
We have a problem with a Call Transaction on Asynchronous Abap Proxy. When the process of Call Transaction (transaction CO02) takes more than 10 minutes, the process is cancelled with sy-subrc 1001 and the Abap Proxy continues with the execution. Strangely, there is a short dump in ST22 on transaction CO02, although on the ABAP Proxy we don't get any dump.
When this process is called from a Background Job no dumps are get.
Somebody knows if there is a problem with the Asynchronous ABAP Proxy executing CALL TRANSACTION statementent?
Thanks and regards,
Manuel.and the message after recording is
Number 1
Transaction F-22
SY-SUBRC 0
Messages
FB01 SAPMF05A 0301WEZ001 066
FB01 SAPMF05A 0300WEZ001 066
FB01 SAPMF05A 0300EEZ001 073
I F5 573 Correct the error reported before on the next screen
FB01 SAPMF05A 0300WEZ001 066
FB01 SAPMF05A 0300EEZ001 073
I F5 573 Correct the error reported before on the next screen
FB01 SAPMF05A 0330WEZ001 066
FB01 SAPMF05A 0301WEZ001 066
FB01 SAPMF05A 0301WEZ001 066
FB01 SAPMF05A 0301WEZ001 066
S F5 312 Document 100001677 was posted in company code 3100 -
Error when Calling Transaction in ABAP Proxy
Hi All,
I'm trying to call a transaction in synchronous ABAP Proxy, but there's a CNTL_ERROR in the details of SXMB_MONI.
I've checked some threads related to this problem, but they're not solved yet.
Please advise, can I use "call transaction" in synchronous ABAP Proxy ? Is there any additional setting / code to prevent the error ?
Thanks in advance,
Andy SHi Stefan,
I'm trying to assign marketing attributes in our CRM Business Partner Transaction, which is triggered by messages sent from some 3rd party application.
Recently, I find out that this transaction (TCode BP) raise the same error (CNTL_ERROR) if run background from SM35. So the problem is not about calling transaction in ABAP Proxy, but due to the TCode BP itself.......
My ABAPER friend is trying to find the BAPI to replace this call transaction .........
Thanks a lot for your response........
Regards,
Andy S -
Call transaction from RFC?
Hi Experts,
I need to call Different transactions from a RFC.
I am looking for different approaches to achieve this.
One Idea is RFC will take input parameters as
-Transaction name
-Field names to be updated with its values (as a table)
Now in RFC, it should be able to update this transactionu2019s fields with the values provided in table parameter.
RFC will fill up the BDC table with the needed data, and will call the needed transaction to update the data.
Once the execution is complete, RFC will send back the different messages (error, info, and warning) through Table parameter.
Now, I do not have much of ABAP experience so I need your help in following
1) Should I use BDC recording in RFC?
2) Can BDC send back all the messages encountered while calling the transaction?
3) Is there any other way to approach this requirement?
Thank you in advance.
Regards,
Ashish ShahHi Amitava,
This RFC might be called from any WebBased application , like Portal , Visual Composer or WebDynpro for Java.
One more idea , may be an extension to my current idea is:
To add one more input parameter to RFC, a table with single field of type string.
Populate this table with entire BDC recording for one particular transaction, and pass it as an input parameter of RFC.
Once in RFC , this BDC recording can be used to populate BDC table and then pass this table to call transaction statement.
Do you see any sense in this logic?
Regards,
Ashish Shah -
Pls tell me how to check the errors in BDC CALL TRANSACTION
lemme know
HI ,
check for the bold part..
REPORT ZCONCUR_UPLOAD_TO_SAP NO STANDARD PAGE HEADING
LINE-SIZE 170
LINE-COUNT 58
MESSAGE-ID ZM.
Internal Table *
*-Internal table for the Header input data from the Comma Delimited file
DATA: BEGIN OF IT_DATA_HEADER OCCURS 0,
ID TYPE C, "Identifier
BUKRS(6), "Company Code
WAERS(7), "Currency
NEWKO(12), "Vendor
XBLNR(16), "First Name
XBLNR1(16), "Last Name
BLDAT(12), "Document/Posting date
PK(15), "Reference
WRBTR(15), "Amount
BKTXT(27), "Doc.header text
BKTXT1(27), "Item text
SELNO(8), "Serial No
END OF IT_DATA_HEADER.
*-Internal table for the item input data from the Comma Delimited file
DATA: BEGIN OF IT_DATA_ITEM OCCURS 0,
ID TYPE C, "Identifier
NEWKO(19), "Vendor
BUKRS(6), "Company Code
KOSTL(12), "Cost center
WRBTR(15), "Amount
SGTXT(50), "Text
SELNO(8), "Serial No Header
SELNO1(8), "Serial No item
END OF IT_DATA_ITEM .
*-Internal table for the Header input data from the Comma Delimited file
*-Removing " " From Comma Delimited file
DATA: BEGIN OF IT_FINAL_HEADER OCCURS 0,
ID TYPE C, "Identifier
BUKRS LIKE BKPF-BUKRS, "Company Code
WAERS LIKE BKPF-WAERS, "Currency
NEWKO TYPE RF05A-NEWKO, "Vendor
XBLNR LIKE BKPF-XBLNR,
XBLNR1 LIKE BKPF-XBLNR,
BLDAT(10), " LIKE BKPF-BLDAT, "Date
PK(15), "Reference
WRBTR(15), "Amount
BKTXT LIKE BKPF-BKTXT, "Doc.header text
BKTXT1 LIKE BKPF-BKTXT, "Item text
SELNO TYPE I, "Serial No
FLAG TYPE C,
END OF IT_FINAL_HEADER.
*-Internal table for the Item input data from the Comma Delimited file
*-Removing " " From Comma Delimited file
DATA: BEGIN OF IT_FINAL_ITEM OCCURS 0,
ID TYPE C, "Identifier
NEWKO TYPE RF05A-NEWKO, "Account
BUKRS LIKE BKPF-BUKRS, "Company Code
KOSTL LIKE BSEG-KOSTL, "Cost Center
WRBTR(15), "Amount
SGTXT LIKE BSEG-SGTXT, "Text
SELNO TYPE I, "Serial No
SELNO1 TYPE I, "Serial No
END OF IT_FINAL_ITEM.
**-Internal table for the input data from the file
DATA : BEGIN OF P_DOWNLOAD OCCURS 0,
V_FILEREC(1000) TYPE C,
END OF P_DOWNLOAD.
*--- Internal Table for Success messages
DATA : BEGIN OF I_SUCC OCCURS 0,
HEADER(50),
MSG(100), "SUCCESS message
END OF I_SUCC.
*--- Internal Table for error messages
DATA : BEGIN OF I_ERROR_LOG OCCURS 0,
HEADER(50),
MSG(100), "Error message
END OF I_ERROR_LOG.
*--- Internal table for getting the BDC data
DATA : BEGIN OF IT_BDCDATA OCCURS 0.
INCLUDE STRUCTURE BDCDATA. " Table to hold BDC data
DATA : END OF IT_BDCDATA.
*--- Internal table for reading the messages of call transaction
DATA : BEGIN OF IT_MESSAGE_TAB OCCURS 0.
INCLUDE STRUCTURE BDCMSGCOLL. "Table to hold messages
DATA : END OF IT_MESSAGE_TAB.
DATA DECLARATIONS *
DATA:
V_ERROR_COUNTER TYPE I, " error records counter
V_MSG(100), " used for Error message
V_LINES TYPE I, " used for format message
V_HEAD LIKE SY-CPROG, " Heading for report
XMODE VALUE 'N', " EXECUTION MODE
V_SUCCESS_COUNTER TYPE I, " Success records counter
V_UNAME LIKE APQI-USERID, " User Name
V_TOTAL TYPE I. " Total records uploaded
DATA : V_SELNO TYPE I.
DATA : V_CHECK TYPE I.
DATA : V_HEADER(50) TYPE C. "Header Information
DATA : V_SUCC_MSG LIKE BDCMSGCOLL-MSGV1."Success Message
DATA : V_ZERO(4) VALUE '0.00'. "Checking Zero
DATA : V_CHECK_ZERO LIKE BSEG-WRBTR. "Checking Zero
DATA : V_CHECK_ZERO1 LIKE BSEG-WRBTR. "Checking Zero
DATA : V_SYSTEMDATE LIKE BKPF-BUDAT.
DATA : V_VALUE TYPE I.
DATA : V_VALUE1 TYPE I.
DATA : V_VALUE2 TYPE I.
Flags
DATA:
F_BDC_OPEN, " BDC session open check.
F_CONTINUE_PROCESSING. " To continue further processing
CONSTANTS *
CONSTANTS:
C_SESSION_NAME LIKE APQI-GROUPID VALUE 'F-43', "Session
C_X VALUE 'X'. " Used for falgs
SELECTION SCREEN *
*--- Selection Screen with Block and title
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-038.
PARAMETER: P_FNAME LIKE RLGRAP-FILENAME DEFAULT
'C:\Concur.txt'.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION SCREEN ON VALUE-REQUEST
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = P_FNAME
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC <> 0.
MESSAGE E999 WITH 'Error in opening a file'(009).
ENDIF.
Top-of-page *
TOP-OF-PAGE .
*---perform to display the standard header
PERFORM STANDARD_HEADER.
--START OF SELECTION--
START-OF-SELECTION.
Upload data
PERFORM UPLOAD_DATA.
move data to bdcdata internal table
PERFORM MOVE_DATA_F43.
*--- Posting the valid data to F-43
IF F_BDC_OPEN = C_X.
*---perform to close bdc group
PERFORM CLOSE_GROUP.
ENDIF.
END OF SELECTION *
END-OF-SELECTION.
CHECK F_CONTINUE_PROCESSING IS INITIAL.
PERFORM DISPLAY_REPORT.
*& Form MESSAGE_FORMAT
MESSAGE FORMAT
FORM MESSAGE_FORMAT.
CLEAR V_MSG.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = IT_MESSAGE_TAB-MSGID
LANG = 'EN'
NO = IT_MESSAGE_TAB-MSGNR
V1 = IT_MESSAGE_TAB-MSGV1
V2 = IT_MESSAGE_TAB-MSGV2
V3 = IT_MESSAGE_TAB-MSGV3
V4 = IT_MESSAGE_TAB-MSGV4
IMPORTING
MSG = V_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
V_MSG = SPACE.
ENDIF.
ENDFORM. " MESSAGE_FORMAT
*& Form F4_HELP
FORM F4_HELP.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = 'C:\'
MODE = 'O'
TITLE = TEXT-025 "'Upload File'
IMPORTING
FILENAME = P_FNAME
EXCEPTIONS
SELECTION_CANCEL = 3
SELECTION_ERROR = 4.
CASE SY-SUBRC.
WHEN 3.
MESSAGE I000 WITH TEXT-007. " Selection Cancel.
WHEN 4.
MESSAGE I000 WITH TEXT-008. " Selection Error.
ENDCASE.
ENDFORM. " F4_HELP
*& Form STANDARD_HEADER
STANDARD_HEADER
FORM STANDARD_HEADER.
FORMAT COLOR COL_HEADING INTENSIFIED OFF.
CASE V_HEAD.
WHEN 'Summary Report'(001).
WHEN 'SUCC_REPORT'.
**---To display the field headings for Success report.
ULINE (154).
WRITE : /001 SY-VLINE,
002 'Header Details '(011),
052 SY-VLINE,
053 'Document Number'(036),
154 SY-VLINE.
ULINE (154).
WHEN 'Error Report'.
**---To display the field headings for error report.
ULINE (154).
WRITE : /001 SY-VLINE,
002 'Header Details '(011),
052 SY-VLINE,
053 'Error Message/Text'(035),
154 SY-VLINE.
ULINE (154).
ENDCASE.
ENDFORM. " STANDARD_HEADER
*& Form DISPLAY_REPORT
Display Report Details
FORM DISPLAY_REPORT.
PERFORM SUMMARY_REPORT.
PERFORM SUCC_REPORT.
PERFORM ERROR_REPORT.
ENDFORM. " DISPLAY_REPORT
*& Form SUMMARY_REPORT
Success & Error Count Number
FORM SUMMARY_REPORT.
WRITE : /030 SY-TITLE.
SKIP 1.
WRITE : /005 'Program Name : '(032),
024 SY-REPID,
080 'Date :'(033),
088 SY-DATUM.
SKIP 1.
V_HEAD = 'Summary Report'(001).
ULINE (132).
WRITE : /1 SY-VLINE,
5 'No. of Records read from the Data file'(014),
45 ':', V_TOTAL LEFT-JUSTIFIED,
132 SY-VLINE,
/1 SY-VLINE,
5 'No. of Records successfully posted'(015),
45 ':', V_SUCCESS_COUNTER LEFT-JUSTIFIED,
132 SY-VLINE,
/1 SY-VLINE,
5 'No. of Records Failed'(023),
45 ':'(031), V_ERROR_COUNTER LEFT-JUSTIFIED,
132 SY-VLINE.
IF NOT F_BDC_OPEN IS INITIAL.
WRITE: /1 SY-VLINE,
5 'Session Name'(022),
45 ':'(031), C_SESSION_NAME LEFT-JUSTIFIED,
132 SY-VLINE.
ENDIF.
ULINE (132).
IF NOT F_BDC_OPEN IS INITIAL.
WRITE: /1 SY-VLINE,
5 'Session Name'(022),
45 ':'(031), C_SESSION_NAME LEFT-JUSTIFIED,
132 SY-VLINE.
ENDIF.
ULINE (132).
ENDFORM. " SUMMARY_REPORT
*& Form ERROR_REPORT
Error Report
FORM ERROR_REPORT.
IF NOT I_ERROR_LOG[] IS INITIAL.
SORT I_ERROR_LOG. " by tcode.
V_HEAD = 'Error Report'(013).
NEW-PAGE.
LOOP AT I_ERROR_LOG.
WRITE: /001 SY-VLINE,
002 I_ERROR_LOG-HEADER,
052 SY-VLINE,
053 I_ERROR_LOG-MSG,
154 SY-VLINE.
ULINE (154).
ENDLOOP.
ENDIF.
ENDFORM. " ERROR_REPORT
*& Form ERROR_REPORT
Success Report
FORM SUCC_REPORT.
IF NOT I_SUCC[] IS INITIAL.
SORT I_SUCC. " by tcode.
V_HEAD = 'SUCC_REPORT'(034).
NEW-PAGE.
LOOP AT I_SUCC.
WRITE: /001 SY-VLINE,
002 I_SUCC-HEADER,
052 SY-VLINE,
053 I_SUCC-MSG,
154 SY-VLINE.
ULINE (154).
ENDLOOP.
ENDIF.
ENDFORM. " SUCC_REPORT
*& Form OPEN_SESSION
FORM OPEN_SESSION.
DATA : V_DATE LIKE SY-DATUM. " For Hold Date.
V_DATE = SY-DATUM - 1. " Hold date
V_UNAME = SY-UNAME. " User name
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = C_SESSION_NAME
HOLDDATE = V_DATE
KEEP = 'X'
USER = V_UNAME
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'Session can not be opened'(019).
STOP.
ENDIF.
F_BDC_OPEN = 'X'.
ENDFORM. " OPEN_SESSION
*& Form BDC_INSERT
FORM BDC_INSERT USING P_TCODE TYPE ANY.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = P_TCODE
TABLES
DYNPROTAB = IT_BDCDATA
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'Unable to insert, Error record'(037).
STOP.
ENDIF.
ENDFORM. " BDC_INSERT
*& Form CLOSE_GROUP
FORM CLOSE_GROUP.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'Session can not be closed'(021).
STOP.
ENDIF.
ENDFORM. " CLOSE_GROUP
*& Form UPLOAD_DATA
Upload Data From the text file
FORM UPLOAD_DATA.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_FNAME
FILETYPE = 'DAT'
TABLES
DATA_TAB = P_DOWNLOAD
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
OTHERS = 10.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH 'File does not Exist'(003).
ELSEIF P_DOWNLOAD[] IS INITIAL.
MESSAGE E000 WITH 'Input file is empty'(004).
ENDIF.
DATA: V_INDEX LIKE SY-TABIX.
IF NOT P_DOWNLOAD[] IS INITIAL.
LOOP AT P_DOWNLOAD.
V_INDEX = SY-TABIX.
*Removing double quotes
DO.
REPLACE '"' WITH '' INTO P_DOWNLOAD.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
ENDDO.
MODIFY P_DOWNLOAD INDEX V_INDEX.
CONDENSE P_DOWNLOAD.
IF P_DOWNLOAD(1) = '1'.
*Finding the header information, creating key field
V_SELNO = SY-TABIX.
ENDIF.
WE ARE NOT HAVING KEY FIELD IN HEADER/ITEM IN THE FILE.
SO WE ARE CREATING MANUAL KEY FIELD IN INTERNAL TABLE (SELNO).
IF P_DOWNLOAD(1) = '1'.
Moving header information into IT_DATA_HEADER Internal Table
SPLIT P_DOWNLOAD AT ',' INTO
IT_DATA_HEADER-ID
IT_DATA_HEADER-BUKRS
IT_DATA_HEADER-WAERS
IT_DATA_HEADER-NEWKO
IT_DATA_HEADER-XBLNR
IT_DATA_HEADER-XBLNR1
IT_DATA_HEADER-BLDAT
IT_DATA_HEADER-PK
IT_DATA_HEADER-WRBTR
IT_DATA_HEADER-BKTXT
IT_DATA_HEADER-BKTXT1.
IT_DATA_HEADER-SELNO = V_SELNO.
CONDENSE : IT_DATA_HEADER-ID, IT_DATA_HEADER-BUKRS,
IT_DATA_HEADER-WAERS, IT_DATA_HEADER-NEWKO,
IT_DATA_HEADER-XBLNR, IT_DATA_HEADER-XBLNR1,
IT_DATA_HEADER-BLDAT, IT_DATA_HEADER-PK,
IT_DATA_HEADER-WRBTR, IT_DATA_HEADER-BKTXT,
IT_DATA_HEADER-BKTXT1, IT_DATA_HEADER-SELNO.
APPEND IT_DATA_HEADER.
CLEAR IT_DATA_HEADER.
ELSEIF P_DOWNLOAD(1) = '2'.
Moving header information into IT_DATA_ITEM Internal Table
SPLIT P_DOWNLOAD AT ',' INTO
IT_DATA_ITEM-ID
IT_DATA_ITEM-NEWKO
IT_DATA_ITEM-BUKRS
IT_DATA_ITEM-KOSTL
IT_DATA_ITEM-WRBTR
IT_DATA_ITEM-SGTXT.
IT_DATA_ITEM-SELNO = V_SELNO.
IT_DATA_ITEM-SELNO1 = SY-TABIX.
CONDENSE: IT_DATA_ITEM-ID,IT_DATA_ITEM-NEWKO,IT_DATA_ITEM-BUKRS,
IT_DATA_ITEM-KOSTL,IT_DATA_ITEM-WRBTR,
IT_DATA_ITEM-SGTXT,IT_DATA_ITEM-SELNO,
IT_DATA_ITEM-SELNO1.
APPEND IT_DATA_ITEM.
CLEAR IT_DATA_ITEM.
ENDIF.
ENDLOOP.
*SORT HEADER & ITEM INTERNAL Table
SORT IT_DATA_HEADER BY SELNO.
SORT IT_DATA_ITEM BY SELNO SELNO1.
*Header Information
LOOP AT IT_DATA_HEADER.
IT_FINAL_HEADER-ID = IT_DATA_HEADER-ID.
IT_FINAL_HEADER-BUKRS = IT_DATA_HEADER-BUKRS.
IT_FINAL_HEADER-WAERS = IT_DATA_HEADER-WAERS.
IT_FINAL_HEADER-NEWKO = IT_DATA_HEADER-NEWKO.
CONCATENATE IT_DATA_HEADER-XBLNR IT_DATA_HEADER-XBLNR1
INTO IT_FINAL_HEADER-XBLNR.
IT_FINAL_HEADER-BLDAT = IT_DATA_HEADER-BLDAT.
IT_FINAL_HEADER-PK = IT_DATA_HEADER-PK.
IT_FINAL_HEADER-WRBTR = IT_DATA_HEADER-WRBTR.
IT_FINAL_HEADER-BKTXT = IT_DATA_HEADER-BKTXT.
IT_FINAL_HEADER-BKTXT1 = IT_DATA_HEADER-BKTXT1.
IT_FINAL_HEADER-SELNO = IT_DATA_HEADER-SELNO.
APPEND IT_FINAL_HEADER.
CLEAR IT_FINAL_HEADER.
ENDLOOP.
*Item Information
LOOP AT IT_DATA_ITEM.
CHECKING ZERO IN THE IT_DATA_ITEM-WRBTR FIELD
It will not append the IT_FINAL_ITEM
V_CHECK_ZERO = IT_DATA_ITEM-WRBTR.
IF V_CHECK_ZERO NE V_CHECK_ZERO1. "V_ZERO.
IT_FINAL_ITEM-ID = IT_DATA_ITEM-ID.
IT_FINAL_ITEM-NEWKO = IT_DATA_ITEM-NEWKO.
IT_FINAL_ITEM-BUKRS = IT_DATA_ITEM-BUKRS.
IT_FINAL_ITEM-KOSTL = IT_DATA_ITEM-KOSTL.
IT_FINAL_ITEM-WRBTR = IT_DATA_ITEM-WRBTR.
IT_FINAL_ITEM-SGTXT = IT_DATA_ITEM-SGTXT.
IT_FINAL_ITEM-SELNO = IT_DATA_ITEM-SELNO.
IT_FINAL_ITEM-SELNO1 = IT_DATA_ITEM-SELNO1.
APPEND IT_FINAL_ITEM.
CLEAR IT_FINAL_ITEM.
CLEAR : V_CHECK_ZERO,V_CHECK_ZERO1.
ENDIF.
ENDLOOP.
SORT IT_FINAL_HEADER BY SELNO.
SORT IT_FINAL_ITEM BY SELNO.
ENDIF.
ENDFORM. " UPLOAD_DATA
*& Form MOVE_DATA_F43
Call Transaction F-43
FORM MOVE_DATA_F43.
*MOVE THE SYSTEM DATE TO
CLEAR V_SYSTEMDATE.
V_SYSTEMDATE = SY-DATUM.
LOOP AT IT_FINAL_HEADER.
CLEAR V_CHECK.
V_CHECK = IT_FINAL_HEADER-SELNO.
MOVE HEADER DATA TO BDCDATA INTERNAL TABLE
PERFORM BDC_BUILD_HEADER.
MOVE ITEM DATA TO BDCDATA INTERNAL TABLE
PERFORM BDC_BUILD_ITEM.
<b>* Call Transcation (F-43)
CALL TRANSACTION 'F-43' USING IT_BDCDATA
MODE XMODE
UPDATE 'S'
MESSAGES INTO IT_MESSAGE_TAB.</b>
IF error record found, it will move to batch Input session
IF SY-SUBRC <> 0.
V_ERROR_COUNTER = V_ERROR_COUNTER + 1. " Inc the counter
CLEAR V_LINES.
DESCRIBE TABLE IT_MESSAGE_TAB LINES V_LINES.
READ TABLE IT_MESSAGE_TAB INDEX V_LINES.
*--- <b>Perform to read the messages
PERFORM MESSAGE_FORMAT.</b>*--- Appending the error records into error table
CONDENSE IT_FINAL_HEADER-BUKRS.
CONDENSE IT_FINAL_HEADER-NEWKO.
CONDENSE IT_FINAL_HEADER-XBLNR.
CONDENSE IT_FINAL_HEADER-BLDAT.
CONCATENATE IT_FINAL_HEADER-BUKRS ','
IT_FINAL_HEADER-NEWKO ','
IT_FINAL_HEADER-XBLNR ','
IT_FINAL_HEADER-BLDAT
INTO V_HEADER.
I_ERROR_LOG-HEADER = V_HEADER.
I_ERROR_LOG-MSG = V_MSG.
APPEND I_ERROR_LOG.
CLEAR I_ERROR_LOG.
*-- Posting the error record to Session
IF F_BDC_OPEN IS INITIAL.
PERFORM OPEN_SESSION.
ENDIF.
PERFORM BDC_INSERT USING 'F-43'.
ELSE.
V_SUCCESS_COUNTER = V_SUCCESS_COUNTER + 1.
*-- READING ONLY SUCCESS MESSAGE(MSGNR 312)
LOOP AT IT_MESSAGE_TAB WHERE MSGNR = '312'.
V_SUCC_MSG = IT_MESSAGE_TAB-MSGV1.
ENDLOOP.
*--- Perform to read the messages
PERFORM MESSAGE_FORMAT.
*--- Appending the Success records into Success table
CONDENSE IT_FINAL_HEADER-BUKRS.
CONDENSE IT_FINAL_HEADER-NEWKO.
CONDENSE IT_FINAL_HEADER-PK.
CONDENSE IT_FINAL_HEADER-XBLNR.
CONDENSE IT_FINAL_HEADER-BLDAT.
CONCATENATE IT_FINAL_HEADER-BUKRS ','
IT_FINAL_HEADER-NEWKO ','
IT_FINAL_HEADER-PK ','
IT_FINAL_HEADER-XBLNR ','
IT_FINAL_HEADER-BLDAT
INTO V_HEADER.
I_SUCC-HEADER = V_HEADER.
I_SUCC-MSG = V_SUCC_MSG.
APPEND I_SUCC.
CLEAR I_SUCC.
ENDIF.
V_TOTAL = V_TOTAL + 1.
REFRESH: IT_BDCDATA,
IT_MESSAGE_TAB.
CLEAR: IT_BDCDATA,
IT_MESSAGE_TAB.
ENDLOOP.
ENDFORM. " MOVE_DATA_F43
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR IT_BDCDATA.
IT_BDCDATA-PROGRAM = PROGRAM.
IT_BDCDATA-DYNPRO = DYNPRO.
IT_BDCDATA-DYNBEGIN = 'X'.
APPEND IT_BDCDATA.
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
CLEAR IT_BDCDATA.
IT_BDCDATA-FNAM = FNAM.
IT_BDCDATA-FVAL = FVAL.
APPEND IT_BDCDATA.
ENDFORM.
*& Form BDC_BUILD_HEADER
Header Information
FORM BDC_BUILD_HEADER.
Header Details
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/00'.
PERFORM BDC_FIELD USING 'BKPF-BLDAT'
IT_FINAL_HEADER-BLDAT.
PERFORM BDC_FIELD USING 'BKPF-BLART'
'KR'.
PERFORM BDC_FIELD USING 'BKPF-BUKRS'
IT_FINAL_HEADER-BUKRS.
Moveing System date to Posting date in the document
CLEAR IT_FINAL_HEADER-BLDAT.
CONCATENATE V_SYSTEMDATE4(4) V_SYSTEMDATE0(4)
INTO IT_FINAL_HEADER-BLDAT.
PERFORM BDC_FIELD USING 'BKPF-BUDAT'
IT_FINAL_HEADER-BLDAT.
PERFORM BDC_FIELD USING 'BKPF-WAERS'
IT_FINAL_HEADER-WAERS.
PERFORM BDC_FIELD USING 'BKPF-XBLNR'
IT_FINAL_HEADER-PK.
PERFORM BDC_FIELD USING 'BKPF-BKTXT'
IT_FINAL_HEADER-BKTXT.
PERFORM BDC_FIELD USING 'FS006-DOCID' '*'.
IF IT_FINAL_HEADER-WRBTR CA '-'.
REPLACE '-' WITH SPACE INTO IT_FINAL_HEADER-WRBTR.
CONDENSE IT_FINAL_HEADER-WRBTR.
PERFORM BDC_FIELD USING 'RF05A-NEWBS' '25'.
ELSE.
PERFORM BDC_FIELD USING 'RF05A-NEWBS' '31'.
ENDIF.
PERFORM BDC_FIELD USING 'RF05A-NEWKO'
IT_FINAL_HEADER-NEWKO.
*-- Item Vendor Details
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0302'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'BSEG-WRBTR'
IT_FINAL_HEADER-WRBTR.
PERFORM BDC_FIELD USING 'BSEG-SGTXT'
IT_FINAL_HEADER-BKTXT1.
ENDFORM. " BDC_BUILD_HEADER
*& Form BDC_BUILD_ITEM
Item Information
FORM BDC_BUILD_ITEM.
DATA L_FIRST TYPE C.
LOOP AT IT_FINAL_ITEM WHERE SELNO = V_CHECK.
IF L_FIRST IS INITIAL.
L_FIRST = C_X.
Line Item ( PstKy,Account & New Company Code)
CONDENSE IT_FINAL_HEADER-BLDAT.
IF IT_FINAL_ITEM-WRBTR CA '-'.
REPLACE '-' WITH SPACE INTO IT_FINAL_ITEM-WRBTR.
CONDENSE IT_FINAL_ITEM-WRBTR.
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0302'.
PERFORM BDC_FIELD USING: 'BDC_OKCODE' '/00',
'RF05A-NEWBS' '50',
'RF05A-NEWKO' IT_FINAL_ITEM-NEWKO,
'RF05A-NEWBK' IT_FINAL_ITEM-BUKRS.
ELSE.
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0302'.
PERFORM BDC_FIELD USING: 'BDC_OKCODE' '/00',
'RF05A-NEWBS' '40',
'RF05A-NEWKO' IT_FINAL_ITEM-NEWKO,
'RF05A-NEWBK' IT_FINAL_ITEM-BUKRS.
ENDIF.
Amount & Text
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0300'.
PERFORM BDC_FIELD USING: 'BDC_OKCODE' '/00',
'BSEG-WRBTR' IT_FINAL_ITEM-WRBTR,
'BSEG-SGTXT' IT_FINAL_ITEM-SGTXT,
'DKACB-FMORE' 'X'.
Cost Center
PERFORM BDC_DYNPRO USING 'SAPLKACB' '0002'.
PERFORM BDC_FIELD USING: 'BDC_OKCODE' 'ENTE',
'COBL-KOSTL' IT_FINAL_ITEM-KOSTL.
ELSE.
Line Item ( PstKy,Account & New Company Code)
IF IT_FINAL_ITEM-WRBTR CA '-'.
REPLACE '-' WITH SPACE INTO IT_FINAL_ITEM-WRBTR.
CONDENSE IT_FINAL_ITEM-WRBTR.
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0300'.
PERFORM BDC_FIELD USING: 'BDC_OKCODE' '/00',
'RF05A-NEWBS' '50',
'RF05A-NEWKO' IT_FINAL_ITEM-NEWKO,
'RF05A-NEWBK' IT_FINAL_ITEM-BUKRS.
ELSE.
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0300'.
PERFORM BDC_FIELD USING: 'BDC_OKCODE' '/00',
'RF05A-NEWBS' '40',
'RF05A-NEWKO' IT_FINAL_ITEM-NEWKO,
'RF05A-NEWBK' IT_FINAL_ITEM-BUKRS.
ENDIF.
PERFORM BDC_DYNPRO USING 'SAPLKACB' '0002'.
PERFORM BDC_FIELD USING: 'BDC_OKCODE' 'ENTE'.
Amount & Text
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0300'.
PERFORM BDC_FIELD USING: 'BDC_OKCODE' '/00',
'BSEG-WRBTR' IT_FINAL_ITEM-WRBTR,
'BSEG-SGTXT' IT_FINAL_ITEM-SGTXT,
'DKACB-FMORE' 'X'.
Cost Center
PERFORM BDC_DYNPRO USING 'SAPLKACB' '0002'.
PERFORM BDC_FIELD USING: 'BDC_OKCODE' 'ENTE',
'COBL-KOSTL' IT_FINAL_ITEM-KOSTL.
ENDIF.
ENDLOOP.
*Save Details
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0300'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BU'.
PERFORM BDC_DYNPRO USING 'SAPLKACB' '0002'.
PERFORM BDC_FIELD USING: 'BDC_OKCODE' 'ENTE'.
ENDFORM. " BDC_BUILD_ITEM
Thanks
Mahesh -
In call transaction how can we handle error records.
hai..tellme how can we handle error records in call transaction..we can get error records into one flatfile ok...then we have to execute the same bdc program with dat flat file (error records) once again...is it wright ..
Hi,
check this program u will get idea
seee this prog. its will help u .
copy and run this prog.
TYPES : BEGIN OF t_disp ,
vendorno(9),
compcc(13),
purchorg(14),
accgroup(15),
title(7),
name(5),
country(8),
ordcurr(14),
END OF t_disp.
TYPES : BEGIN OF t_err,
msgtyp LIKE bdcmsgcoll-msgtyp,
l_mstring(250),
END OF t_err.
DATA: i_disp TYPE STANDARD TABLE OF t_disp,
wa_disp TYPE t_disp,
i_err TYPE STANDARD TABLE OF t_err,
wa_err TYPE t_err.
data definition
Batchinputdata of single transaction
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
messages of call transaction
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
error session opened (' ' or 'X')
DATA: e_group_opened.
message texts
TABLES: t100.
PARAMETER : p_file1 LIKE ibipparms-path,
p_cmode LIKE ctu_params-dismode DEFAULT 'N'.
"A: show all dynpros
"E: show dynpro on error only
"N: do not display dynpro
*selction screen.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file1.
AT SELECTION-SCREEN ON p_file1.
IF p_file1 IS INITIAL.
MESSAGE 'FILE IS NOT FOUND' TYPE 'E'.
ENDIF.
START-OF-SELECTION.
PERFORM f_disp_file1.
END-OF-SELECTION.
PERFORM f_disp_errs.
*& Form F_DISP_FILE1
text
--> p1 text
<-- p2 text
FORM f_disp_file1 .
DATA: l_filename1 TYPE string.
MOVE p_file1 TO l_filename1.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_filename1
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 = i_disp
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.
*? prepare BDC data
DELETE i_disp INDEX 1.
LOOP AT i_disp INTO wa_disp .
PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-KTOKK'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02K-LIFNR'
wa_disp-vendorno.
'ztest_1'.
PERFORM bdc_field USING 'RF02K-BUKRS'
wa_disp-compcc.
'0001'.
PERFORM bdc_field USING 'RF02K-EKORG'
wa_disp-purchorg.
'0001'.
PERFORM bdc_field USING 'RF02K-KTOKK'
wa_disp-accgroup.
'0001'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-SPRAS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_field USING 'LFA1-ANRED'
wa_disp-title.
'Mr.'.
PERFORM bdc_field USING 'LFA1-NAME1'
wa_disp-name.
'test name'.
PERFORM bdc_field USING 'LFA1-SORTL'
'TEST NAME'.
PERFORM bdc_field USING 'LFA1-LAND1'
wa_disp-country.
'in'.
PERFORM bdc_field USING 'LFA1-SPRAS'
'en'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-KUNNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-AKONT'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-ZTERM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB5-MAHNA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VW'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFM1-WAERS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
PERFORM bdc_field USING 'LFM1-WAERS'
wa_disp-ordcurr.
'inr'.
PERFORM bdc_transaction USING 'XK01'.
WRITE:/ WA_DISP-VendorNo,
WA_DISP-COMPCC,
WA_DISP-PURCHORG,
WA_DISP-ACCGROUP,
WA_DISP-title,
WA_DISP-name,
WA_DISP-country,
WA_DISP-ORDCURR.
CLEAR: wa_disp.
REFRESH bdcdata.
ENDLOOP.
ENDFORM. " F_DISP_FILE1
Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM bdc_field USING fnam fval.
IF FVAL NODATA.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDIF.
ENDFORM. "BDC_FIELD
*& Form bdc_transaction
text
-->P_0322 text
FORM bdc_transaction USING tcode.
DATA: l_mstring(480),
l_subrc LIKE sy-subrc.
REFRESH messtab.
CALL TRANSACTION tcode USING bdcdata
MODE p_cmode
UPDATE 'L'
MESSAGES INTO messtab.
l_subrc = sy-subrc.
IF SMALLLOG 'X'.
WRITE: / 'CALL_TRANSACTION',
TCODE,
'returncode:'(I05),
L_SUBRC,
'RECORD:',
SY-INDEX.
LOOP AT messtab.
SELECT SINGLE * FROM t100 WHERE sprsl = messtab-msgspra
AND arbgb = messtab-msgid
AND msgnr = messtab-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH messtab-msgv1 INTO l_mstring.
REPLACE '&2' WITH messtab-msgv2 INTO l_mstring.
REPLACE '&3' WITH messtab-msgv3 INTO l_mstring.
REPLACE '&4' WITH messtab-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH messtab-msgv1 INTO l_mstring.
REPLACE '&' WITH messtab-msgv2 INTO l_mstring.
REPLACE '&' WITH messtab-msgv3 INTO l_mstring.
REPLACE '&' WITH messtab-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
WRITE: / messtab-msgtyp, l_mstring(250).
*? Send this errors to err internal table
wa_err-msgtyp = messtab-msgtyp.
wa_err-l_mstring = l_mstring.
APPEND wa_err TO i_err.
ELSE.
WRITE: / messtab.
ENDIF.
CLEAR: messtab, wa_err.
ENDLOOP.
SKIP.
ENDIF.
ENDFORM. " bdc_transaction
*& Form f_disp_errs
text
--> p1 text
<-- p2 text
FORM f_disp_errs .
SORT i_err BY msgtyp.
LOOP AT i_err INTO wa_err.
AT FIRST.
WRITE : / text-002.
ULINE.
ENDAT.
AT NEW msgtyp.
IF wa_err-msgtyp = 'S'.
WRITE : / text-003.
ULINE.
ELSEIF wa_err-msgtyp = 'E'.
WRITE : / text-001.
ULINE.
ENDIF.
ENDAT.
WRITE : / wa_err-msgtyp, wa_err-l_mstring.
CLEAR wa_err.
ENDLOOP.
ENDFORM. " f_disp_errs
Regards
Maybe you are looking for
-
How to reset without losing data?
LS, Is there a way to reset my iPhone (through itunes or other) that will prevent me from losing data? Situation: I have an iPhone 3G with ios4. Saturday night my phone acted weird, it would lock the screen every few seconds without me promting it (
-
Is it possible to upgrade the IE 5 browser in OS 9.1?
How we doin Gang? Got a lot of help here recently Ya know I'm sure other folks have asked about upgrading their IE 5 browser that comes with OS 9 - well I don't think Microsoft offers any more upgrades for MAC IE 5.0 (just like they're through with a
-
Adobe photoshop CC - text module error - caanot initialize...
Hi! I have this problem with photosop. I cannot write a sible character. Vedry frustating. Cleared cache fonts. Nothing! Any solution, patch, crack. I'm paying for something that doesn't wortk!!!
-
EEIND IS IN WHICH TABLE?
EEIND IS IN wHICH TABLE?
-
My email password won't link me with my comcast mail account
My mail keeps prompting me to verify password of my second comcast account. When I type it in the appropriate box, it rejects it.