URGENT!!!!!!!!! rollback in BADI
Hi,
I wanted to know how can we perform ROLLBACK in BAdi's.
I am using the BAdi defination - MB_DOCUMENT_BADI and I want to roll back after i click on POST button in MIGO.
The functionality is like -
- First I m checking for the tcode eq MIGO.
- Second for the document category(likp-vbtyp) and delivery type(likp-lfart).
- Third check is on the movement type, my requirment is tht if while posting a GR for outbound delivery the movement type should be 861.
IF the movemnt type is not eq to 861 then we throw a popup message using -
CALL FUNCTION 'POPUP_TO_CONFIRM' ,
Now there are 2 buttons -
1. Change - the program shloud retain the screen and allow the user to change the movement type there and then post again.
2. Exit - the program will terminate the current action and will
LEAVE TO TRANSACTION MIGO.
I want to rollback the work after the user clicks on CHANGE and then to leave to the current screen where the user can change the movement type.
I hope i have made myself clr. If not plz come back to me for any further details.
Hi Friend,
When user press change button, try to fire an error message with some information...
It is a odd way..but if you fire an error message SAP stop processing further and it will remain in the screen
and press enter it will open for change...
Hope it will help to get the solution
Regards
Krishnendu
Similar Messages
-
!!URGENT!! BADI Implementation for creation of G/L accounts
Please can you urgently help. I am trying to implement a user exit or badi to check the uniqueness of the description while creating a G/L account.
I tried to create a BADI implementation to the definition FI_LIMIT_ACCOUNT but it gives error messages that this is for SAP internal use.
The user exit ZXF03U01 used in enhancement SAPMF02H cannot be used as this exit passes only SKA1 and SKB1.I would like to check on SKAT. The fields affected in SKAT-TXT20 and SKAT-TXT50.
Do you see a solution to this?
I have the same to be implemented for KS01/KS02 - Create/Change Costcenter.
A prompt response would be appreciated.Also try :
CL_IM_QISR1_GL_ACCOUNT_CRE Class
Or FM`s
GL_ACCOUNT_INSERT
GL_ACCOUNT_IN_COA_INSERT
GL_ACCOUNT_IN_COMPANY_INSERT
GL_ACCOUNT_SAMPLE_INSERT
GL_ACCT_CH_REQ_CREATE_ACCOUNT
Thanks -
Hi Experts,
My requrement is on BADI's but i have not much idea on this requrement,requirement is as follows:
· A user exit is needed on the delivery that rebrands sub items into the header item and the header item will then be Post Goods Issued.
· This needs only to be done for materials with Item Category equal ZTNB.
· The SAP sales BOM functionality needs to generate movement types 309/310 rebrands for the component materials and 601 on the header or additized material.
· We want 309 Credit entries on the base product instead of additized product.
· This is needed to create the correct financial posting as well as stock movements
· It can now check the header MOT of the delivery for PK as well as the item category of the sales BOM header ZTAQ
This is the screen flow for transaction MB11 which can be called via the Call Transaction statement. It shows all data needed to process this transaction.
It is not necessarily wanted that the user exit BADI - LE_SHP_GOODSMOVEMENT calls this transaction.
plz help me out from this problem.
ThanksPlease only open one post per question. Thanks.
Regards,
Rich Heilman -
Hi Abappers,
Kindly help me out as i am in trouble. I have got a requirement to add customized fields onto O4_TIGER screen using BADI. I have got the name of the BADI definition ie., OII_DIP_ADD_COLUMNS . This screen is related to MM -> Inventory mangement -> Is-OIL.
Can anyone pl help me out of how to add fields . Coz i have absolutely nil knowledge in BADIs and Userexits. I would be very much pleased if some one suggest me a step by step process.
Regards.<b>first u define BADI in " SE18", and implement in "SE19".
for predefined GLOBAL CLASS : CL_EXITHANDLER which can enable BADI service.
method-->GET_INSTANCE (which can create instance of a class)
gowith SE18 --> NAME..... Z***** --> CREATE,
click check box MULTIPLE USE.
select INTERFACE tab
INTERFACE ..... ZIF_EX_**** <-----click on this -
> enter.
save details.
METHODS LEVEL DESCRIPTION
SELECT-DATA INSTANCE SELECTING DATA
select PARAMETERS
PARAMETER TYPE TYPING
CUST_LOW IMPORTING TYPE KNA1-KUNNR
CUST_HIGH IMPORTING TYPE KNA1-KUNNR
SAVE DETAILS.
implementing BADI -
> SE19
implementation name ...... Z**********-----> CREATE
DESCRIPTION--...DEMO FOR BADI
select--> INTERFACE
for method> SELECT_DATA <--- click on this ---> enter
save details.
METHOD
DATA : ITAB TYPE TABLE OF KNA1,
WA TYPE KNA1.
SELECT KUNNR LAND1 NAME1 ORT01 FROM KNA1 INTO TABLE ITAB WHERE KUNNR BETWEEN CUST_LOW AND CUST_HIGH.
LOOP AT ITAB INTO WA.
WRITE:/ WA-KUNNR,WA-LAND1,WA-NAME1,WA-ORT01.
ENDLOOP.
ENDMETHOD.
F3 , SAVE and ACTIVATE.
LETUS CREATE EXECUTABLE PROGRAM (SE38).
PROVIDE TABLE WA.
REPORT Z*******
TABLES: KNA1.
SELECT-OPTIONS: S_KUNNR FOR KNA1-KUNNR.
declaration.
CLASS CL_EXITHANDLER DEFINITION LOAD.
interface reference
DATA: OBJ_EXIT TYPE REF TO ZIF_EX_*****.
START-OF-SELECTION.
gowith PATTERN ---> AABAP object pattern --> ENTER.
CALL METHOD
CLASS---- CL_EXITHANDLER
METHOD--- GET_INSTANCE
ENTER.
CALL METHOD.............
CHANGING
INSTANCE = OBJ_EXIT.
gowith PATTERN> AABAP OBJECT--> ENTER
CALL METHOD
OBJ---> OBJ_EXIT,
CLASS---> ZIF_EX_*******,
METHOD----> SELECT_DATA.
CALL METHOD.................
EXPORTING
CUST_LOW = S_KUNNR-LOW
CUST_HIGH = S_KUNNR-HIGH.
SAVE and ACTIVATE.
EXECUTE.</b> -
URGENT - Error 400--Bad Request
When I run weblogic 6.0 default console I get "Error 400--Bad Request> From RFC
2068 Hypertext Transfer Protocol -- HTTP/1.1:"What does this mean ? Can u help
me to fix it !! Other than reinstall the whole WebLogic!!!
Another things is do you have and recommendation web site, eBook that teach "Using
Weblogic EJB with JBuider 6". Thank YouThe solution was to switch to Apache's HttpClient. no more problems with SUN's HttpUrlConnection!
-
Hi ,
There are 8 gl accounts in set.a set is created.In badi i am trying to compare with those gl accounts with some value.I have hard coded those values.
Is there any other method for comparing these set valuses.
regI think you want to read the set of account defined in SAP,
If yes look at <a href="http://www.geocities.com/victorav15/sapr3/abapfun.html#sets">FI-SL Sets</a>
Regards -
Enhancement help in ME51n : Extereme urgent ! Exit + BADI-EX
Hi Experts !
I have added one tab and a field into it in ME51n through screen exit mentioned below :
Calling screen No. Area Called screen No. Short Text
SAPLMEGUI 0014 SUB0 SAPLXM02 0111
I need to save the user input value of this field + the PR number generated into my ztable which has only these two fields.
<b>The issue here is that PR no gets generated only when we save and i cud not fetch it in these exits ( If some has a point that we can fetch it in one of the exits-plz let me know)</b>
Now I've used the exit : EXIT_SAPLMEREQ_003 of enhancement : MEREQ001
to put data from screen field( added ) into a structure 'IM_ITEM' of nature mereq_item by using methods of interface IF_PURCHASE_REQUISITION_ITEM.
Below is the code i used in the include of above exit:
*& Include ZXM02U03
tables ZTMMP0_PMASTER.
data im_item type mereq_item.
CALL METHOD im_req_item->get_data
receiving
re_data = im_item.
im_item-zpurpose = ZTMMP0_PMASTER-PURPOSE.
CALL METHOD im_req_item->set_data
EXPORTING
im_data = im_item .
Now i found a BADI ->ME_REQ_POSTED which gets triggered at the time of posting the PR.if u r clear about my above code thru methods<i><b> i am tryin to throw data of screen input from my function exit and catch the same in BADI - where PR no is visible and i wud push both from BADI-method into my ztable.</b></i>
Issue is that the data of my new field which i passed thru my exit as shown above is not visible in BADI method and i cant use the get_data method
eagerly waiting for help,
Sachin Soni
Message was edited by:
Sachin SoniHello Sachin,
You are trying to bring data from an Exit to a BADI , but the BADI cannot recieve the DATA as far as i understood since the parameters are restricted,
An option coming to me right now is to :
<b> Use import <--> EXPOT memory</b>
Export from the Exit and Import from the BADI using ABAP export/import statements
EXPORT (OBJ_TAB) to memory ID 'ABCD''.
IMPORT (OBJ_TAB) FROM MEMORY ID 'ABCD'.
OR
IMPORT A = A B = B_PROG C = C_PROG FROM MEMORY ID 'ABCD'.
and
FREE MEMORY ID 'ABCD'
Please check for correct syntaxes
Reward if helpful and pls update if problem is solved
Regards
Byju -
Urgent Help needed - BADI's in Infospoke
Hi,
My Scenario:
I am pulling data from master data using infospoke into Application server. I need some kind of easy transformations during this stage.
I got ZSTATE field in my data and I need to restrict my output to only certain states(Ex: NJ,CA, TX , MNetc). Since I can't give those selection conditions in infospoke I need to try BADI. I created a BADI and have target and source structure. Can anyone write me small code for this to eliminate other states and allow NJ , CA, MN, TX etc.
Source structure: /BIC/CYZZTEST
target Structure: /BIC/CZZZTEST
infospoke: ZZTEST
Field: Zstate
Class:ZCL_IM_ZZTEST
Method:IF_EX_OPENHUB_TRANSFORM~TRANSFORM
Full points to helpful answer!!
Anil.The problem is cross user too - I have two user files on the machine and the same thing happens regardless of which user file I'm working in.
That points to s 'system-wide' issue.
Try resetting your SMC.
Resetting the System Management Controller >>
Also, you could try booting from your install DVD and see if it does it there. If it does not, it's more than likely a software issue and an Archive and Install should fix it.
Mac OS X: About the Archive and Install feature >>
-Bmer
Mac Owners Support Group - Join us @ MacOSG.com
Mac611 Mobile Mac Support - about.Mac611.com
iTunes:MacOSG Podcast | YouTube.MacOSG.com
An Apple User Group
Have an iPhone or iPod touch? Enter Mac611.com in Safari on it for 'mobile Mac support.' -
I ported a database over to a new server.
It seems there may be transactions pending...which I don't care about.
I can log as SYS and run queries, but I cannot run DML or DDL statements.
I have narrowed down the problem to the SYSTEM rollback segment.
I am running in Automatic Undo mode.
How do I clear transactions from a rollback segment?
I don't think I can alter or create a new SYSTEM rollback segment.There is no error message.
When I issue any DML/DDL statement Oracle just hangs forever...and never issues an error message.
Here is the latest printout from the alert.log file:
Tue Jul 11 14:33:03 2006
LGWR: Primary database is in CLUSTER CONSISTENT mode
Tue Jul 11 14:33:03 2006
ARCH: Evaluating archive log 3 thread 1 sequence 14697
ARCH: Beginning to archive log 3 thread 1 sequence 14697
Creating archive destination LOG_ARCHIVE_DEST_1: 'D:\ORA92\RDBMS\ARC14697.001'
ARCH: Completed archiving log 3 thread 1 sequence 14697
Tue Jul 11 14:33:05 2006
LGWR: Primary database is in CLUSTER CONSISTENT mode
Thread 1 advanced to log sequence 14700
Thread 1 opened at log sequence 14700
Current log# 3 seq# 14700 mem# 0: D:\ORADATA\9.2\ICDB\LOG\LOG3A.ORA
Successful open of redo thread 1
Tue Jul 11 14:33:06 2006
SMON: enabling cache recovery
Tue Jul 11 14:33:06 2006
Successfully onlined Undo Tablespace 1.
Tue Jul 11 14:33:06 2006
SMON: enabling tx recovery
Tue Jul 11 14:33:06 2006
Database Characterset is WE8MSWIN1252
replication_dependency_tracking turned off (no async multimaster replication found)
Completed: alter database open
Tue Jul 11 14:33:53 2006
SMON: Parallel transaction recovery tried
Tue Jul 11 14:34:45 2006
create rollback segment system
tablespace system
storage (
initial 112K
minextents 1
maxextents 1
Tue Jul 11 14:34:45 2006
ORA-1535 signalled during: create rollback segment system
tablespace system
s...
Tue Jul 11 14:35:02 2006
Thread 1 cannot allocate new log, sequence 14701
All online logs needed archiving
Current log# 3 seq# 14700 mem# 0: D:\ORADATA\9.2\ICDB\LOG\LOG3A.ORA
Tue Jul 11 14:35:12 2006
drop rollback segment system
Tue Jul 11 14:35:12 2006
ORA-1544 signalled during: drop rollback segment system...
Tue Jul 11 14:41:33 2006
alter rollback segment system offline
Tue Jul 11 14:41:33 2006
ORA-30019 signalled during: alter rollback segment system offline... -
hello,
i've created an adobe interactive form with a table in it an after deploy and run i receive these great errors:
com.sap.tc.webdynpro.pdfobject.core.PDFObjectRuntimeException: Processing exception during a "UsageRights" operation. Request start time: Thu Aug 09 14:39:24 EEST 2007 com.adobe.ProcessingError: Credential login error while applying usage rights to PDF: C:\WINDOWS\Temp\adobewa_NW4_11095250\DM3102101586918930277.dir\DM-3702683108961299978.tmp Specific error information: $$$/PDF/PDFCredentialLoginFailure3=alias ^0 was not found ReaderRights General error information: IDL:com/adobe/document/pdf/CredentialLoginFailure:1.0 Exception Stack Trace: com.adobe.ProcessingError: Credential login error while applying usage rights to PDF: C:\WINDOWS\Temp\adobewa_NW4_11095250\DM3102101586918930277.dir\DM-3702683108961299978.tmp Specific error information: $$$/PDF/PDFCredentialLoginFailure3=alias ^0 was not found ReaderRights General error information: IDL:com/adobe/document/pdf/CredentialLoginFailure:1.0 at com.adobe.ads.request.UsageRights.execute(Unknown Source) at com.adobe.BaseADSRequest.doWork(Unknown Source) at com.adobe.AdobeDocumentServicesWorker.execute(Unknown Source) at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source) at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source) at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126) at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157) at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79) at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92) at SoapServlet.doPost(SoapServlet.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365) at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944) at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266) at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95) at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Caused by: com.adobe.document.pdf.CredentialLoginFailure: IDL:com/adobe/document/pdf/CredentialLoginFailure:1.0 at com.adobe.document.pdf.CredentialLoginFailureHelper.read(CredentialLoginFailureHelper.java:67) at com.adobe.document.pdf._PDFDocumentStub.setUsageRights(_PDFDocumentStub.java:284) at com.adobe.EJB_PDFAgent.setUsageRights(Unknown Source) ... 31 more
so what is to be done ?
pls help
thx
irinahi,
i guess you have correctly installed the credential file as seems form your last thread.
<b>the credential file you have procured has expired around June end.</b>
(we were using the same before it expired, then we got everything licensed)
if its urgent ROLLBACK the system date of client system and the J2EE server, to around 22 june. it should work.
<b>But remember this if for development only.
if you are using it for production use, get a licensced copy.</b>
regards,
-ag. -
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 -
Rollback BAPI in BADI ME_PROCESS_PO_CUST
hi guys,
I used BADI ME_PROCESS_PO_CUST to implement a code before saving the purchase order (Method POST).
This code contains a BAPI to create a delivery BAPI_OUTB_DELIVERY_CREATENOREF. If this BAPI fails (this is when Return parameter contains 'E' message), I execute function BAPI_TRANSACTION_ROLLBACK.
Guess what is happening?
There is no purchase order created even when screen shows message "Standard PO created under the number 45#######".
What do I want to do?
- Rollback the bapi executed and let the system continue saving the purchase order.
- If possible show a message to the user that there is an error, but command MESSAGE doesn't seem to work in this BADI
Could you share your insights with this wannabe-abapper?
PD: it says in documentation that it is required ABAP OO to implement this BADI and I think I used it correctly for gathering all data I needed. But I just don't understand why MESSAGE statement and FM POPUP_TO_CONFIRM don't work.Hello
You may try an approach like this:
IF ( 1 = 1 ).
MESSAGE 'Creation of outbound delivery failed' type 'I'.
data: ld_dummy type string,
ls_msg type SMESG,
lt_msg type tsmesg.
message id '00' type 'E' number '398' with 'Creation of outbound delivery failed'
space space space into gl_dummy.
move-CORRESPONDING syst to ls_msg.
APPEND ls_msg to lt_msg.
CALL FUNCTION 'FB_MESSAGES_DISPLAY_POPUP'
EXPORTING
IT_SMESG = lt_msg
* ID_SMESG_ZEILE =
* IT_RETURN =
* ID_SEND_IF_ONE =
EXCEPTIONS
NO_MESSAGES = 1
POPUP_CANCELLED = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif.
Regards
Uwe -
Hi I am using BADI BUPA_FURTHER_CHECKS...when creating a business partner (sold-to-party) in SAP CRM?
I need to check the industry code with the attribute...and give an error message...
But the problem is that this BADI is not getting triggered?
Do u knw any other badi that gets trigerred...?
PLease help its urgent...Hi,
Try this BADI. <b>BUPA_INDSEC_CHECK</b>
Reward if it works.
Cheers,
Narasingam -
Urgent (userexit/badi)
hi all ,
in t-code 'VT01N' i have to make f4 help on field 'Container ID' of third screen of this t-code..can i do it by using Userexit or badi? if yes then how?
can anybody send me step by step procedure?
its urgent .
thanx in advance .
saurabh srivastava .Hi,
it may helps u..
It is user exit for vt01n i. e .V56AFCCH
check it..
Regards, -
Appraisals - BAdi calcuation display (urgent)
Hello Experts,
I have created a new BAdi for final result for Value determination. I have assigned it at Criteria group level but even after the completion, the value is not displayed. However, it is calculating properly at the backend and pushing to the relevant column. I have put a breakpoint and it is triggering..so I am able to view the calculation.
Please let me know if there is any linkage/I have to do change any configuration in the front end so that it is displayed.
Its very urgent..Please help on this.
Thanks in advance!
SwethaDear Swetha,
I suppose you have assigned standard BAdI name for your BAdI. Try to change the name of the implentation of the BAdI. That should do the job.
Do reward points if the answer is helpful.
Regards,
AXE
Maybe you are looking for
-
my imad 'lol' mini say i set up an icloud account when i first got it and its been disabled everytime i try to reset it it prompts me to a different email how can i reset the origanal
-
Print pdf/wdf files from DMS background
Hi, need some guidelines for this topic. i have a requirement to print the pdf or dwf files from DMS server. i have write a program to download the files from DMS to local PC, and call method to print the files. However, this is only applicable to fo
-
I am having some issues with the erratic nature of menu functions (on your controller- and not a button) when i am in a menu, and use the menu function on either a DVD remote, or the controller in my software, the DVD jumps back to the last place i v
-
Dear Friends, What is the best way to help a Mac user who has downloaded images into iPhoto but wants to adjust them in Elements (or CS5)? He has asked if he can move an event over to work in Photoshop, or can he only open one image at a time? Is the
-
Lost iphone 4s at home battery dead. Is there a way to locate
lost iphone 4s at home battery dead. Is there a way to locate?