Publish a business event through PL/SQL to SOA composite
Hi,
My use case is this:
I want to create/publish a business event from a PL/SQL procedure. I have a mediator component in a composite application to subscribe to that event.
Has anyone tried this? Is it possible? I tried with edn_publish_event in soa infra schema but it doesn't seem that the composite can pick up that event.
Any ideas?
Thanks!
Johan
Hi,
I had the same issues, It turns out to be the XML structure that I was passing is wrong.
The XML should be wrapped in <business-event> tag. Sample XML is given below
<business-event xmlns:ns="http://schemas.oracle.com/events/edl/PatientEvents" xmlns="http://oracle.com/fabric/businessEvent">
<name>ns:PatientDetailsChangeEvent</name>
<id>c7941f05-c982-47fa-8f6a-d12843af39df</id>
<content>
<PatientDetailsChangeEvent xmlns="http://stmatthews.hospital.com/events">
<eventTimestamp>2010-11-03T08:46:02:796</eventTimestamp>
<patientDetails>
<patientId>4</patientId>
<firstName>FNU</firstName>
</patientDetails>
</PatientDetailsChangeEvent>
</content>
</business-event>
Thanks
Jagadeesh
Similar Messages
-
Hi, I subscribe to a business event with PL/SQL. Got this from the workflow manual:
exception when others then
wf_core.context(<package name>, <function name>, p_event.geteventname(), p_subscription_guid);
wf_event.seterrorinfo(p_event, ’error’);
return 'error';
So I added that to the procedure. Where would I see if an error like this would be raised?Hi,
The error that you are getting is related to the "Event type" and not the "Event".
Goto the Tcode OOEV and see the first column value for the attendee(Person/Applicant/User). See the F1 help there. That should be self explanatory.
Hope this helps you.
Regards,
Subbu -
Can SOA consume business events using non-apps datasource ?
Hi Gurus & Experts,
We have a scenario where EBS raises custom business event to be consumed by SOA.
Everything works fine using APPS login, however we need to non-apps datasource in some environements (custom schema user)
Can SOA consume business events using non-apps datasource ?
Please let me know.
Thanks,
RevHi Srini,
Even i have a similar requirement . Could you please send me the link for OracleEBSAdapterUserGuide(b_28351). ?
Did you come to know how to check whether WF_Listener is running ?
Thanks in advance
Nutan -
Submitting XML Publisher Concurrent Program through PL/SQL
Hi,
I am trying to submit a XML Publisher concurrent program through PL/SQL API fnd_request.submit_request.
The request gets fired and completes successfully but it doesn't pick up the default template attached to it. Its output is plain XML but expected output is PDF report.
However when I submit this report from SRS, it picks up the default template and gives output in PDF.
Please let me know what could be going wrong?
Regards,
NitinCheck out the FND_REQUEST.ADD_LAYOUT API. You need to call it before you submit your report.
Cheers,
Dave -
Hi,
I am invoking an oracle seeded business event oracle.apps.po.rcv.rcvtxn through Receiving Transaction.
This event should call a PL/SQL function. But I receive a notification in saying:
Event Error Name: WFE_DISPATCH_RULE_ERR
Event Error Message: 3825: Error '-4061 - ORA-04061: existing state of has been invalidated
ORA-04061: existing state of package "APPS.XX_PO_RCV_TXN_LABEL" has been invalidated
ORA-04065: not executed, altered or dropped package "APPS.XX_PO_RCV_TXN_LABEL"
ORA-06508: PL/SQL: could not find program unit being called: "APPS.XX_PO_RCV_TXN_LABEL"' encountered during execution of Rule function 'xx_po_rcv_txn_label.receive_business_event' for event 'oracle.apps.po.rcv.rcvtxn' with key '196017-13587'.
Event Error Stack:
Wf_Event.dispatch_internal()
I am sure that this message is incorrect as I changed the package name to XXRCVTXN and business event is still calling old package XX_PO_RCV_TXN_LABEL.
Secondly, when I resubmit this event through notification worklist in sysadmin responsibility, it completes successfully and does the intended processing.
Can someone please point out why this discrepency is there?
Thanks in advanceThe message is correct: the original package XX_PO_RCV_TXN_LABEL has indeed been invalidated when you have recompiled it. The business event turns to an old version pf the package, ... but it has been flagged as invalid in the share pool. Even if you recompile, or even drop the package, the workflow system will still turn to the old package version.
What to do: restarting the application services will definitely solve the issue (providing, of course, that the new package version is in valid state). For a production system this will cause downtime, so you could try to restart the Workflow Deferred Notification Agent Listener and perhaps the Workflow Notification Mailer. -
Business Event Appraisal in Training and event management
Hi
I am facing issue releated to Business Event Appraisal Functionality in ESS. I have maintained value as blank in field HAP00 REPLA switch.
We have created I View of transacion PV7I in ESS. When i am selecting "APPRAISAL" button for attended event , i can select appraisal form from appraisal form list. On next screen i don't get Appraisal Form where i have to give feedback on different criteria's. I get Rating column and four buttons: Save, Check data, back, Complete.
When i am executing PV7i through R3 then it's working properly. Why it is not working properly in ESS. Kindly help me ?
Other issue..... :
My client needs INSTRCUCTOR feedback functionality means feedback for instructors by participants for particular event. How we can configure in the system for TEM module not for LSO.
KINDLY help me ...
Thanks and Best Regards
PuneetGood Day !
Unfortunately the appraisal services (my_appraisals, my_app_create, my_appraisalsm) have not been migrated for the use with integrated ITS.
Please review SAP notes 870126 and 771196
Note:
Since the appraisal services (My_appraisals, My_app_create) have not
been migrated, you can no longer use the appraisal function from the
services PV7I and PV8I with the integrated ITS.
At the same time I am afraid the succession product is not an option
for you as the TEM functionality is not integrated with the new
appraisal functionality of 'Performance Management'. Performance
Management only offers an integration with the succession product of
TEM, i.e. LSO (Learning Solution).
Hope this information helps you.
Best Regards
Chetan -
Unable to configure Oracle Applications Adapter to capture Business Event
Hi All,
I am new to SOA and BPEL so please bare that in mind when reading and responding to this post.
I am attempting to trigger BPEL from an EBS business event as per the SOA gateway developers guide.
I am working on EBIZ R12.1.2, 11g weblogic, Jdev 11g release 1
Step 1. I have enabled the business event oracle.apps.per.api.employee.create_employee and created a subscription from the integration repository which I can see from the business events subscription window.
Step 2. I have created a new SOA project in JDev with an empty composite and added a BPEL process and called it createOrsResource.
Step 3. Following this I opened the BPEL process and added in an applications adapter and set this up to interact with the WSDL that I got from going through the adapter configuration wizard (i.e. selected the business event detailed above).
I then tried to compile and got the following error:
Error: Load of wsdl "createEmployeeEvent.wsdl with Message part element undefined in wsdl [file:/D:/jdev_home/mywork/IntegrationApplication/integrationExample/createEmployeeEvent.wsdl] part name = WF_EVENT_T type = {http://xmlns.oracle.com/xdb/APPS/createEmployeeEvent}WF_EVENT_T" failed
This is obviously something to do with the business event message type that materialized when I selected the business event in the Adapter Config Wizard.
I went back into the Apps Adapter and checked the config, when I clicked next .. next .. next etc... through the wizard just before hit the schema definition page I got the following error:
null file is either missing or is corrupt.
This schema defines the stricture of wf event. Wizard would not be able
to edit the service
Also when I tried to add an assign activity using the WF_EVENT_T as an input to another variable I got the following WF_EVENT_T node in the left mapping window:
Exception: Unable to parse schema APPS_WF_EVENT_T_createEmployeeEvent.xsd
Can anyone point me in the right direction???
KeithTapas123 wrote:
Hi Osama,
Database is working perfectly fine in my machine. Please let me know the procedure to fix the client issue , if you know.
Thanks.It is not - else you would not have posted this thread. Home version architecture differs significantly from Professional version and higher, especially in the area of User Access Control. It is tough enough to try and solve issues on certified/supported OS versions/hardware, let alone on uncertified/unsupported ones ;-)
http://en.wikipedia.org/wiki/Windows_7_editions
http://docs.oracle.com/cd/E11882_01/install.112/e24187/pre_install.htm#CIHIAGFG
Pl use a supported OS version
HTH
Srini -
Business Event not triggering the PLSQL procedure.. What to do?
We need to call a plsql procedure when the GL Approval workflow has ended with approval. I thought i could do this by customizing the relevant business event.
We are on EBS 12.1.3 with RDBMS : 11.2.0.3.0.
I saw that the business event oracle.apps.gl.Journals.journal.approve was disabled currently. I enabled it and created a subscription for it. Subscription was a PLSQL procedure. Currently, for test purpose only thing it is doing is to insert a row into a table.
Business Event Subscription settings:
System: ORDEBS.SYSTEM.COM
Triggering Event
Source Type:Local
Event Filter: oracle.apps.gl.Journals.journal.approve
Execution Condition
Phase: 100
Status: Enabled
Rule Data: Message
Action Type:Custom
On Error: Stop and Rollback
Action
PL/SQL Rule Function: XX_GL_APPROVE_BE_PKG.Get_Attributes
Priority: Normal
Documentation (Not sure what value to be given for these. I went with the below values.)
Owner: Company Name
Owner Tag: Custom Schema
Using the below query i can see that the business event is getting called when the approval happens (One row added each time approval happened). But I cant see any rows in the table where it should insert a row. What could be going wrong? How can i verify that the procedure has been called?
select * from WF_DEFERRED where corrid ='APPS:oracle.apps.gl.Journals.journal.approve'
Procedure:
CREATE OR REPLACE PACKAGE BODY APPS.XX_GL_APPROVE_BE_PKG
AS
PROCEDURE Get_Attributes
IS
BEGIN
INSERT INTO xx.xx_test_table VALUES ('From BE');
COMMIT;
END Get_Attributes;
END XX_GL_APPROVE_BE_PKG;Thanks Alejandro. Now this is working.
Changes i made:
1. Added the WFERROR workflow as a subscription to this event. So i could see that the function i am calling from the event did not have proper signature.
2. Changed the function signature to have standard parameters like:
CREATE OR REPLACE PACKAGE BODY XX_GL_APPROVE_BE_PKG
AS
function subscription(p_subscription_guid in raw,
p_event in out nocopy wf_event_t) return varchar2 is
l_result varchar2(20);
begin
insert into xxvtv.xxvtv_test_table values ('From BE');
commit;
exception
when others then
wf_core.context('XX_GL_APPROVE_BE_PKG','function subscription', p_event.getEventName(), p_event.getEventKey());
wf_event.setErrorInfo(p_event, 'ERROR');
return 'ERROR';
end subscription;
END XX_GL_APPROVE_BE_PKG;
3. Changed the owner name and owner tag both to the custom schema name (XX) -
Is it possible to start planning manager programatically from backend through PL/SQL?
I need to activate and run Planning manager concurrent program from back end through PL/SQL.Actually i am working on MRP Open Forecast Interface and I want to run this program after inserting data in the interface table mrp_forecast_interface.Please guide me.
Oracle EBS forum is the best place for your question. This place is more towards general SQL, PL/SQL questions.
https://community.oracle.com/community/oracle-applications/e-business_suite/e-business-suite-technology/general_ebs_discussion -
TEM-Attendee & Business Event Appraisal
Hi All,
We are using SAP 5.0 and implementing TEM, when we try to create appraisal using T-code PV34(Attendee Appraisal), PV33(Business Appraisal) we are not routed to Generate To-Do List screen, instead it is going to a screen where we need to select the Appraiser and Appraiser mannually, which is quite un usual. It will remain same even if I go through Business Event Menu or Attendance Menu.
Any help in this regard is hightly appreciated.
Thanks
Ramakrishna RamadurgamHi.
I have now the some problem. When I run tcode PV33/PV34 the list of the appraisal templates contain not only the temlates for business events and attendees but also for employees.
Did you solve the problem?
If yes, please give me some hints.
Thanks a lot. -
Registering business event definitions in soa infrastructure
Hi,
What do I need to do to register events into the soa infrastructure so components can publish and subscribe to them?
Everything I found was to create an empty composite, use the wizard to create new business event, add the event and save. But that does not register it in the soa infrastructure... when I go to Enterprise Manager | Business events --> there are not definitions....
What else needs to happen?
Any help greatly appreciated!Events are only shown when there are subscribers to that particular event. What you also may consider is placing the event definition in the MDS. In this case you can reuse the event by just pointing to the shared metadata and event definitions aren't fragemented over several composites.
Regards,
Melvin -
Business Event System in Workflow
Hi,
I am having difficulties with the Business Event System (BES).
Actually, I've read the Oracle documentation about BES. Still I don't understand much.
There are little documentation about the BES, and I still get blank point.
Here are my questions :
1. What the Business Event System is?
2. Some of documentations show that using the BES, the workflow can interact with
different system.
What does 'different system' mean?
Does it mean to another computer (perhaps Client Server type)?
Or to another system (like headquarter which has several branches) located in
different location?
Or to another database service in the same computer (perhaps ORCL and ORCL2)?
Or with another database applications (i.e Microsoft SQL Server, MySQL)?
3. How do we use the BES?
How do we define BES?
Where do we use the BES?
Is it using PL/SQL?
Or the BES itself is a PL/SQL which is inside a procedure or function or trigger (used
to manipulate the database)?
What does the BES look like? Is it a PL/SQL code, an e-mail, or ...?
4. Some documentations said that using the Event (with Receive type) as a start node
(in Workflow Builder), the process will wait and respon <u>until</u> a Business
Event is detected?
How do we interact with BES?
How do we know what kind of BES to start the process?
Do we use the Oracle Advanced Queuing?
Is it using an e-mail to start the Event?
5. There is a statement from the "Feature Overview Oracel9i Application Server : Oracle Workflow" (from Oracle site)
"Business event messages from Oracle Workflow can be placed on or received from Oracle9i Advanced Queues, providing support for Oracle Net as well as HTTP and HTTPS communication protocols."
and
"The Business Event System uses Oracle Advanced Queuing to propagate messages between communication points on systems, called agents, using a specified protocol. Events received from external systems are processed by an agent listener that runs on the agent's queue."
Actually what the Advanced Queuing is?
Is it the mechanism of scheduling activites such as sending a message?
Is it use to start the Workflow Background Engine periodically?
What does the Events received from external system is? Is it an e-mail?
If it is True, so the workflow process could be start using an e-mail?
6. There is also a documentation stated that the Event can be raised using the PL/SQL WF_EVENT.Raise() API.
The Event also could be launch using the Workflow Home Page (Workflow monitor) in Event link?
So what does the BES is used for, if the Event could be launch using a PL/SQL?
Is the process of raising the Event called BES?
Such as a procedure to manipulate database tables that consist the WF_EVENT.Raise().
What is Generate Function is?
7. What Agent is?
What Subscription is?
What Event group is?
8. Perhaps there is a guide book of using the Business Event System?
Any light would be grateful.
Many many thanks,
BuntoroHi
I am in exactly the same position...
Have queued up my events using wf_event and the subscription is putting them in WF_OUT ok.
So, I guess that WF_OUT is a multisubscriber queue, so when we register with it in BPEL it asks for us to identify ourselves using the consumer and/or correlation ID.
However, I'm with you in that I have no idea how to specify the consumer.
There is a CORRID column in WF_OUT and I'm banking on that being the correlation ID at the moment....
I'll let you know if I crack it!
Chris -
Training and Event Management -- Business Event Follow Up
Hi Experts,
I have firmly booked the event in PV12 transaction.
When I am doing follow up through transaction PV15, I am getting error message event not started yet.
Please advise.
Regards,
IFFHi ,
You can only do follow-up of Business event on or after the date that the Business event has been scheduled to take place, and has been firmly booked.
Such as if the Buseiness event is for 30 th Dec 2011, you can do follow-up on 30th Dec 2011 or after this date.
Regards,
Soomra -
Badi and Business event( Urgent)
Hi experts,
I am new to badi and business event 1120P. Please post how this business event exactly comes in to picture in this badi. also how to find this business event?
And also Post the logic or code. The requirement is given below . Pls Post the solution. Its very urgent.
Enhancement Summary
Two user exits are needed to determine the correct G/L Account and Cost Center on Shipment Cost documents and post the Material Group on the Accounting document. BADI_SCD_ACCTG and Business Event 1120P can be used to accommodate the new functionality.
Business Process
Specific G/L Accounts and Cost Centers have to be determined to post on the Shipment Cost document. This is needed to provide accurate management reporting capabilities on shipments for Sales Order or Stock Transfer Order. A new custom table must be created which contains the following information: Distribution, Mode of Transport, Account, Cost Center Material group. Distribution is an identifier here if this shipment originated from an SO or STO.
There are no screens involved in this enhancement.
Components
Table: ZTABLE1
Field Data Element Type Length Description
MANDT MANDT CLNT (key) 3 Client
DISTRIBUTION Z_DISTRIBUTION CHAR (key) 1 Distribution
MOT ZZDEF_MOT CHAR (key) 2 Mode of Transportation
MATKL MATKL CHAR (key) 9 Material group
SAKNR SAKNR CHAR 10 G/L Account Number
KOSTL KOSTL CHAR 10 Cost Center
This table gets updated manually by the FI team.
Values for Distribution are:
1 = Primary Distribution to Refinery
2 = Primary and Secondary Excluding refinery
All entries must be checked against SAP config and master tables
User exit BADI BADI_SCD_ACCTG will be used to determine the correct G/L Account, Cost Center and Product Group based on Distribution and Mode of Transport. This BADI gets called only when a new Shipment Cost document get created.
Once the BADI determined the new values it populates field c_vfkn-sakto with the G/L account, field c_vfkn-kostl with the Cost Center and exports the Product group to memory.
There is no field on the Shipment Cost Document to store the Product group. Therefore another mechanism must be used to get the Product Group on the accounting document.
Business Event 1120P can be used to import the Product group out of memory and put it on BSEG-MATNR. Structure BSEG_SUBST must be enhanced with field MATNR for this purpose.
Function, Rules, Exits Description of Functionality, Rules, Exits
BADI_SCD_ACCTG Business Add-In for Shipment Cost Account Assignment
Business Framework Business Event 1120P can be used to import the Product Group from memory and to populate field BSEG_SUBST-MATNR.
This event gets called from different places. It needs to be ensured that it only populates the value when it was called from BADI_SCD_ACCTG.
Custom Table A look-up Table needs to be maintained for Distribution, Mode of Transport, G/L Account, Cost Center and Material Group
Transaction code To maintain the new table
Append Structure To enhance structure BSEG_SUBST with MATNR
Business Add-In BADI_SCD_ACCTG can be used to determine the account assignments for a shipment cost item to set the G/L Account and Cost Center. All data needed to determine the new information gets provided in this BADI.
Logic:
Determine if STO or SO based on Document Category from internal table I_REFOBJ-VTRLP field VGTYP If is C then Distribution type is Sales Order (Primary and Secondary Excluding Refinery 2 ) else we need to check the receiving plant. If the receiving plant (I_REFOBJ-VTRLK field WERKS) is a refinery the Distribution type is Primary (1) else its a (Primary and Secondary Excluding Refinery 2 ). Refineries can be identified via Function Module ZPLANTCLASSIFICATION. The plant must be passed into Import Parameter IP_SAPPLANT and field INT_PLANTCHAR-ATNAM must be looked up with value SAPTYPE. If it exists and field ATWRT contains RFY, the plant is a refinery.
Product Group can be determined from the Material master through Material group field MARA-MATKL.
Mode of Transport will be passed in the BADI in VTRLK-OIC_MOT.
Select single entry from table ZTABLE1based on Distribution, Mode of Transport and Material Group. If nothing gets selected, error message No entry exists in table ZTABLE1for Distribution (distribution), MOT (MOT) & Mat. Group (material group) should be triggered.
Move ZTABLE1-SAKNR to c_vfkn-sakto and ZTABLE1-KOSTL to c_vfkn-kostl
The Material group must be exported to memory in BADI_SCD_ACCTG
The Material group must be imported from memory in Business Event BP1120P
Free Memory in Business Event BP1120P
This is VI01 Creation of Freight Cost Item screen
and also code for function module ZPLANTCLASSIFICATION below
FUNCTION zplantclassification .
""Local interface:
*" IMPORTING
*" REFERENCE(IP_SAPPLANT) LIKE AUSP-OBJEK OPTIONAL
*" REFERENCE(IP_CPSPLANT) LIKE AUSP-ATWRT OPTIONAL
*" REFERENCE(IP_SISLOC) LIKE AUSP-ATWRT OPTIONAL
*" EXPORTING
*" VALUE(EP_SAPPLANT) LIKE AUSP-OBJEK
*" VALUE(EP_CPSPLANT) LIKE AUSP-ATWRT
*" VALUE(EP_SISLOC) LIKE AUSP-ATWRT
*" VALUE(EP_OWNERSHIP) LIKE AUSP-ATWRT
*" VALUE(EP_SMISTYPE) LIKE AUSP-ATWRT
*" VALUE(EP_SPOTREF) LIKE AUSP-ATWRT
*" VALUE(EP_SUBTYPE) LIKE AUSP-ATWRT
*" VALUE(EP_SUPPLYREGION) LIKE AUSP-ATWRT
*" VALUE(EP_TYPE) LIKE AUSP-ATWRT
*" VALUE(EP_DISTAREA) LIKE AUSP-ATWRT
*" VALUE(EP_GEOGAREA) LIKE AUSP-ATWRT
*" VALUE(EP_HMF) LIKE AUSP-ATWRT
*" VALUE(EP_IATACODE) LIKE AUSP-ATWRT
*" VALUE(EP_IRSTCN) LIKE AUSP-ATWRT
*" VALUE(EP_OPSAREA) LIKE AUSP-ATWRT
*" VALUE(EP_PLANTSTAT) LIKE AUSP-ATWRT
*" VALUE(EP_PORTCODE) LIKE AUSP-ATWRT
*" VALUE(EP_REFAREA) LIKE AUSP-ATWRT
*" VALUE(EP_SAPTYPE) LIKE AUSP-ATWRT
*" VALUE(EP_MFGWARRANTY) LIKE AUSP-ATWRT
*" VALUE(EP_USERTYPE) LIKE AUSP-ATWRT
*" VALUE(EP_TRMCENTER) LIKE AUSP-ATWRT
*" VALUE(EP_TRANSCENTER) LIKE AUSP-ATWRT
*" VALUE(EP_FEIN) LIKE AUSP-ATWRT
*" TABLES
*" INT_PLANTCHAR STRUCTURE ZPLANTCLASSIFICATION OPTIONAL
*" EXCEPTIONS
*" NO_OBJEK_FOUND
*" NO_CPSPLANT_FOUND
*" NO_SISLOC_FOUND
*" NO_INPUT_FOUND
*" VALID_PLANT_NO_CHARACTERISTIC
*" ONE_TO_MANY_ISSUE
*" PLANT_NOT_FOUND_ZDEF_DELPLANT
*" UNKNOWN_ERRORS
FM Name: ZPLANTCLASSIFICATION
Created By : SYUB *
Description : Function Module to retrieve plant characteristics *
The function module has two capabilities:
1. Retrieve only the necessary characteristics
2. Retrieve the whole characteristics into an internal table.
Parameter Description *
In the future, if there is a new characteristic added to the
plant classification tables, the characteristic has to be added
to the list of the export parameters and the loop statement.
TABLES: ausp, cabn, ksml, zdef_delplant.
DATA: ws_objek LIKE ausp-objek,
ws_countchar TYPE i,
ws_countplant TYPE i.
*Internal table for SAP plant
DATA: BEGIN OF int_plant OCCURS 0,
plant LIKE ausp-objek,
END OF int_plant.
*sap plant code is the input parameter.Move objek, atnam, and atwrt to
*internal table PLANTCHAR using inner join of AUSP, CABN, and KSML to
*synch up the internal characteristic numbers throughout the 3 tables.
IF NOT ip_sapplant IS INITIAL.
SELECT auspobjek cabnatnam ausp~atwrt
INTO CORRESPONDING FIELDS OF TABLE int_plantchar
FROM ksml AS ksml
INNER JOIN cabn AS cabn
ON cabnatinn = ksmlimerk
INNER JOIN ausp AS ausp
ON ausp~objek = ip_sapplant
AND auspatinn = cabnatinn
AND ausp~mafid = 'O'
AND ausp~klart = 'Z01'.
*Checking the existence of ip_sapplant in the table, if it doesn't
*exist, raise the exception else if it exists, check if it has
*characteristic values.
IF sy-subrc NE 0.
RAISE no_objek_found.
ELSE.
DESCRIBE TABLE int_plantchar LINES ws_countchar.
IF ws_countchar LT 2.
RAISE valid_plant_no_characteristic.
ENDIF.
ENDIF.
*cps plant code is the input parameter. Move objek from table AUSP to
*ws_objek using inner join of CABN and AUSP to match up the internal
*characteristic numbers from the 2 tables.
ELSEIF NOT ip_cpsplant IS INITIAL.
SELECT ausp~objek
INTO TABLE int_plant
FROM ausp AS ausp
INNER JOIN cabn AS cabn
ON cabn~atnam = 'OLDCODE'
WHERE auspatinn = cabnatinn
AND ausp~mafid = 'O'
AND ausp~klart = 'Z01'
AND ausp~atwrt = ip_cpsplant.
*Checking the existence of ip_cpsplant in the table
IF sy-subrc EQ 0.
*Counting the number of SAP plants in the internal table int_plant
DESCRIBE TABLE int_plant LINES ws_countplant.
*Moving the values of objek, atnam, and atwrt to PLANTCHAR using objek
*from ws_objek.
IF ws_countplant EQ 1.
LOOP AT int_plant.
SELECT auspobjek cabnatnam ausp~atwrt
INTO CORRESPONDING FIELDS OF TABLE int_plantchar
FROM ksml AS ksml
INNER JOIN cabn AS cabn
ON cabnatinn = ksmlimerk
INNER JOIN ausp AS ausp
ON ausp~objek = int_plant-plant
AND auspatinn = cabnatinn
AND ausp~mafid = 'O'
AND ausp~klart = 'Z01'.
ENDLOOP.
*If there more than one SAP Plants, then raise an exception.
ELSEIF ws_countplant GT 1.
RAISE one_to_many_issue.
ENDIF.
ELSE.
SELECT SINGLE werks FROM zdef_delplant
INTO ws_objek
WHERE cpsloc = ip_cpsplant.
SELECT auspobjek cabnatnam ausp~atwrt
INTO CORRESPONDING FIELDS OF TABLE int_plantchar
FROM ksml AS ksml
INNER JOIN cabn AS cabn
ON cabnatinn = ksmlimerk
INNER JOIN ausp AS ausp
ON ausp~objek = ws_objek
AND auspatinn = cabnatinn
AND ausp~mafid = 'O'
AND ausp~klart = 'Z01'.
if sy-subrc ne 0.
raise plant_not_found_zdef_delplant.
endif.
ENDIF.
*cps plant code is the input parameter. Move objek from table AUSP to
*ws_objek using inner join of CABN and AUSP to match up the internal
*characteristic numbers from the 2 tables.
ELSEIF NOT ip_sisloc IS INITIAL.
SELECT ausp~objek
INTO TABLE int_plant
FROM ausp AS ausp
INNER JOIN cabn AS cabn
ON cabn~atnam = 'SISLOC'
WHERE auspatinn = cabnatinn
AND ausp~mafid = 'O'
AND ausp~klart = 'Z01'
AND ausp~atwrt = ip_sisloc.
*Checking the existence of ip_sapplant in the table
IF sy-subrc EQ 0.
DESCRIBE TABLE int_plant LINES ws_countplant.
*Moving the values of objek, atnam, and atwrt to PLANTCHAR using objek
*from ws_objek.
IF ws_countplant EQ 1.
LOOP AT int_plant.
SELECT auspobjek cabnatnam ausp~atwrt
INTO CORRESPONDING FIELDS OF TABLE int_plantchar
FROM ksml AS ksml
INNER JOIN cabn AS cabn
ON cabnatinn = ksmlimerk
INNER JOIN ausp AS ausp
ON ausp~objek = int_plant-plant
AND auspatinn = cabnatinn
AND ausp~mafid = 'O'
AND ausp~klart = 'Z01'.
ENDLOOP.
*If there more than one SAP Plants, then raise an exception.
ELSEIF ws_countplant GT 1.
RAISE one_to_many_issue.
ENDIF.
ELSE.
SELECT SINGLE werks FROM zdef_delplant
INTO ws_objek
WHERE sisloc = ip_sisloc.
SELECT auspobjek cabnatnam ausp~atwrt
INTO CORRESPONDING FIELDS OF TABLE int_plantchar
FROM ksml AS ksml
INNER JOIN cabn AS cabn
ON cabnatinn = ksmlimerk
INNER JOIN ausp AS ausp
ON ausp~objek = ws_objek
AND auspatinn = cabnatinn
AND ausp~mafid = 'O'
AND ausp~klart = 'Z01'.
if sy-subrc ne 0.
raise plant_not_found_zdef_delplant.
endif.
ENDIF.
ELSE.
*Checking if there is an input parameter entered.
RAISE no_input_found.
ENDIF.
Modified 7/30 by RFOR to validate SAP plant is in plant master
data: wa_t001w like t001w.
read table int_plantchar.
SELECT SINGLE * from t001w into wa_t001w where
werks = int_plantchar-objek.
if sy-subrc ne 0.
raise NO_OBJEK_FOUND.
endif.
*Moving all the characteristic values to the export parameters
LOOP AT int_plantchar.
MOVE int_plantchar-objek TO ep_sapplant.
CASE int_plantchar-atnam.
WHEN 'OLDCODE'.
MOVE int_plantchar-atwrt TO ep_cpsplant.
WHEN 'SISLOC'.
MOVE int_plantchar-atwrt TO ep_sisloc.
WHEN 'OWNERSHIP'.
MOVE int_plantchar-atwrt TO ep_ownership.
WHEN 'SMISTYPE'.
MOVE int_plantchar-atwrt TO ep_smistype.
WHEN 'SPOTREF'.
MOVE int_plantchar-atwrt TO ep_spotref.
WHEN 'SUBTYPE'.
MOVE int_plantchar-atwrt TO ep_subtype.
WHEN 'SUPPLYREGION'.
MOVE int_plantchar-atwrt TO ep_supplyregion.
WHEN 'TYPE'.
MOVE int_plantchar-atwrt TO ep_type.
WHEN 'DISTAREA'.
MOVE int_plantchar-atwrt TO ep_distarea.
WHEN 'GEOGAREA'.
MOVE int_plantchar-atwrt TO ep_geogarea.
WHEN 'HMF'.
MOVE int_plantchar-atwrt TO ep_hmf.
WHEN 'IATACODE'.
MOVE int_plantchar-atwrt TO ep_iatacode.
WHEN 'IRSTCN'.
MOVE int_plantchar-atwrt TO ep_irstcn.
WHEN 'OPSAREA'.
MOVE int_plantchar-atwrt TO ep_opsarea.
WHEN 'PLANTSTAT'.
MOVE int_plantchar-atwrt TO ep_plantstat.
WHEN 'PORTCODE'.
MOVE int_plantchar-atwrt TO ep_portcode.
WHEN 'REFAREA'.
MOVE int_plantchar-atwrt TO ep_refarea.
WHEN 'SAPTYPE'.
MOVE int_plantchar-atwrt TO ep_saptype.
WHEN 'MFG_WARRANTY'.
MOVE int_plantchar-atwrt TO ep_mfgwarranty.
WHEN 'USER_TYPE'.
MOVE int_plantchar-atwrt TO ep_usertype.
WHEN 'TERMINALCENTER'.
MOVE int_plantchar-atwrt TO ep_trmcenter.
WHEN 'TRANSPORTATIONCENTER'.
MOVE int_plantchar-atwrt TO ep_transcenter.
when 'FEIN'.
move int_plantchar-atwrt to ep_fein.
ENDCASE.
ENDLOOP.
ENDFUNCTION.
Pls help me out from this problem its very urgent.
Thankshi SK ,
process like this .
in BADI
method.
1.Here u have to put ur logic based on the Requirement.
2.then u have to call BTE like this
<b>call function 'OPEN_FI_PERFORM_00001020_E'
tables
t_bseg = xbseg
t_bkpf = xbkpf.</b>
3.Update Ztables.
endmethod.
this is sample logic only.First get logic of TS then u will come to know how to do?
regards
prabhu -
Training & Event Management - ERROR while creating a Business Event
Dear All,
My issue is - i have created my Business event groups n event types. when i right click on BET (or PV10) and create With/WIthout resources i am unable to save. i.e. i am unable to create a Business Event. when i click on save the screen doesnt get saved and the business event is not created under BET.
But the icon pops at the Location. i have created few Locations via OOLC too
Is there any setting iam missing?? Request your help to get this resolved.
Thanks
Priya RHello Experts,
Can you help me in creating a job in HR.
I am trying to create job through Expert Mode, but I am
getting an error as “object type C info type 1000 cannot maintained via basic transactions”
Waiting for your valuable reply…
Maybe you are looking for
-
Funds Consumption Open commitments
Dear Experts, I am facing a very strange issue. We have a PO with 10 line items all items are alike except line item 9/10 where unit of measure is EA (each) and for others it is D (days). (account assignment catagory as Project, in the account assign
-
Can I see my macbook air desktop on apple tv?
Can I see my macbook air desktop on apple tv? Thank you,
-
My HP LaserJet 100 color MFP M175nw is getting a 52 error message
My HP LaserJet 100 color MFP M175nw is getting a 52 error message, how i can fix it ?
-
Named Pipes Provider, error: 40 - Could not open a connection to SQL Server
This was originally posted in the SSIS Forum, but a member of the IS team suggested it be moved here. "Most recently I got this error (Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) so does this mean that SQL Server is
-
Display word file from web repository
Hi, I have an application that stores word files in the sap web repository. Now I need to display a word file in webdynpro. There are examples where a word file is displayed by the ui element officecontrol from mime repository. How I can get access t