How do I SUBMIT from a user exit which is called in an update task?
I want to send an idoc each time there is a goods movement. So, in the user exit of MB_POST_DOCUMENT I am calling IDOC_OUTBOUND_WRITE_TO_DB. This creates an idoc of status 30. However, in order to send the idoc I want to SUBMIT RSEOUT00. I get an ABAP dump on the SUBMIT because MB_POST_DOCUMENT is called in the update task, where SUBMIT is not allowed. Do you know any other way I can execute RSEOUT00 at this moment without having to call it later in batch?
Thanks!!
Joy
Hi Naren,
Your reply is VERY helpful!! Thank you so much.
I added CALL FUNCTION 'RSAP_IDOC_EINBUCHEN_VOM_BIW_4' IN BACKGROUND TASK. I am no longer getting the dump, but my idoc is still a status 03 and not a status 30. Should I expect to see it turn to a status 30? I ran this function directly in SE37 -> Test with the same parameters and it ran perfectly and turned the idoc to a status 03. Is there anything else I need to do in the code?
Thanks again,
Joy
Similar Messages
-
How does the PRODUCTION SYSTEM take the benifit from the USER EXITS?
how does the PRODUCTION SYSTEM take the benifit from the USER EXITS?
please explainand it is not the production system that benefits. its the company and the people working with SAP that benefits from the user exits which allow SAP to be altered for the company specific situations.
-
Hi sap expert,
Please guide me for the abap coding. my requirement is when i create outbound delivery note, then press SAVE button, serial number will be automatic proposed.
Now , i process as below sequent.
1. using user exit MV50AFZ1 -> FORM USEREXIT_SAVE_DOCUMENT
in this user exit i submit background job to change oubound delivery
2. in the background job, i call BAPI BAPI_OUTB_DELIVERY_CHANGE to change serial number
Question.
1. This step right or wrong, if wrong, please suggest
2. How to coding --> submit job from the user exit
Thank you in advance
JeanHi,
Most of the guys around are with functional experience.
I think you should post this query in SAP-ABAP. U will get
an immediate reply.
Kind Regards
Chakradhar -
Send email from PA30 user exit
When I try to send an email from user exit in ZXPADU02 it never makes it to SOST. WIll always go to SBWP outbox if I set the flag but never gets sent to receiver address.
If I paste the following code into a report it works fine. Is there some other parameter for this FM or some additional process needed to send email from a user exit?
DATA: maildata TYPE sodocchgi1.
DATA: mailtxt TYPE TABLE OF solisti1 WITH HEADER LINE.
DATA: mailrec TYPE TABLE OF somlrec90 WITH HEADER LINE.
CLEAR maildata.
REFRESH: mailtxt, mailrec.
maildata-obj_name = 'SRVC_EMAIL'.
maildata-obj_descr = 'Email test'.
maildata-obj_langu = sy-langu.
mailtxt-line = 'Test line from user exit'.
APPEND mailtxt.
mailrec-receiver = '[email protected]'.
mailrec-rec_type = 'U'.
APPEND mailrec.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = maildata
document_type = 'RAW'
put_in_outbox = 'X'
commit_work = 'X'
TABLES
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.Put the function call 'SO_NEW_DOCUMENT_SEND_API1'
in a report Program & SUBMIT that report from ZXPADU02.
Arya -
FM in update task - How do you debug for a user exit (IW32)
Hi,
I am working on user exit IWO10009, fm EXIT_SAPLCOIH_009, transaction IW32.
The user-exit should be called any time an order is saved with parts added to the component tab.
The import structure of the user exit is CAUFVD, which doesnu2019t contain the items in the component. Instead, I have to go into table RESB and get the components.
However, when I go into RESB from inside the user-exit, the added components have not yet been added to the table.
As such, I was thinking of creating a Z function module in update task to process this code after the order is saved & RESB is updated.
2 questions
1 u2013 Is this the best way of accomplishing this?
2 u2013 How do you debug FMu2019s in update task? I have set a breakpoint & have switched system debugging on from inside the debugger, but it doesnu2019t stop inside the fm.
Please help.
Thanks,
JohnHi,
to debug update task you need to switch on "update debugging" not the "system debugging" from the menu Settings->update debugging.
-Ramesh -
Trigger a waiting ABAP program from a User Exit of CO01
Hi all,
We would like to launch a ABAP program from a User Exit (EXIT_SAPLCOZV_001) of CO01, this ABAP program has a special characteristic: using Function Module RFC_PING_AND_WAIT, so this program will be existing until terminating event coming.
Our purpose is terminate CO01 normally before finishing of ABAP program. We don't know if it's possible?
Actually:
1. when we use SUBMIT ..., the process will stop CO01 (stop not normally) and then launch ABAP program. => This is not suitable for our purpose.
2. when we use SUBMIT ... and RETURN, CO01 will wait for finishing of ABAP program => This is not suitable for our purpose too, because we wish CO01 terminated normally when ABAP program is still existing and waiting for its terminating event.
Do you have a solution that is suitable for our purpose, could you please help us?
(The context is below:
Time: Begin-->CO finished> ABAP finished-->
Launch CO01 --> Call User Exit --> Call ABAP program for waiting --> CO01 saved normally.
> ABAP program still waiting ---> waiting for terminating event
Thanks a lot,
Vinh VoHi,
Try with the function module BP_EVENT_RAISE, it takes eventid, and eventparm as import parameters in the User exit.
1) With Eventid, you create a background job of the ABAP program and schedule it. Eventparm can be the Production order number.
2) So when ever the Event is triggered the FM gets triggered and which in turn run the ABAP program, so the foreground the CO01 transaction runs without waiting for the ABAP program to complete.
Regards
Bala Krishna -
Starting a GP from a User Exit?
Hi all,
How do I start a GP from a user exit?
The scenario is like this: when a notification is created in SAP (transaction QM01), it should trigger the GP.
Thank you very much,
Frederik-JanThe actual place to find the information you need to start GP using Web Services (which you can then implement in a User Exit) is here
http://help.sap.com/saphelp_nw2004s/helpdata/en/44/44c59fd7c72e84e10000000a155369/frameset.htm -
How to backup files from other user logged in as administrator
RE: How to backup files from other user logged in as administrator AND/OR how to repair drive with "Invalid catalog PEOF"
Hello,
My MacBook Pro computer’s hard drive is not booting.
I booted with the base operating system and ran Disk utilities and I got the following messages:
Invalid catalog PEOF
The volume could not be verified completely.
This disk needs to be repaired.
Disk utility can’t repair this disk. Backup as many files as possible, reformat the disk,
and restore your backed-up files.
The problem is that I have a couple of USERS set up on this computer, and it won’t let me backup the files of the second user. The folders are locked and I can’t access them, even though I am logged in as the administrator.
I made a boot disk on my other computer ( a MacPro Early 2008 ) desktop computer with the DiskWarrior 4.4 updater,
but it won’t boot on my MacBook Pro.
How can I backup these user files so that I can copy them back once I fix the drive?
or better yet, How can I repair the Invalid catalog PEOF on this drive?
Thank you in advance for your time!
Bill
THIS IS THE COMPUTER
================
17” MacBook Pro 2.8GHZ 4GB Ram (purchased in 2009).
Model: A1297
Running Mac OSX 10.9.5Try using Disk Utility/Restore to copy the backup to a new location. Please note that this will reformat the destination partition which will erase all data.
Do a backup. Boot to the Recovery Volume (command - R on a restart or hold down the option/alt key during a restart and select Recovery Volume). Run Disk Utility Verify/Repair and Repair Permissions until you get no errors. Reformat the drive using Disk Utility/Erase Mac OS Extended (Journaled), then click the Option button and select GUID. Then re-install the OS.
OS X Recovery
OS X Recovery (2)
When you reboot, use Setup Assistant to restore your data. -
How to activate or deactivate a user-exit based a specific condition
hi all,
i want to activate or deactivate(make it trigger) a particular user-exit based in a condition.
can i do that. if yes please tell me how.
can we use COMMIT in user-exits or BADI's.
Thanks & Regards,
Saroja.Hello Saroja
The solution provided by Rich should be used for testing purposes only in the the reverted sense:
IF ( syst-uname ne '<specific user>' ).
RETURN.
ENDIF.
" Execute user-exit for specific user
However, for serious programming you should use a a better strategy. In principle, user-exits are either ON or OFF and, if they are ON, they are ON for <b>all </b>user which is usually not intended.
The following example shows a (possible) strategy how to execute user-exits based on specific conditions.
The SAP extension CATS0001 contains the component EXIT_SAPLCATS_001 with the following interface:
FUNCTION EXIT_SAPLCATS_001.
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(SAP_TCATS) LIKE TCATS STRUCTURE TCATS
*" VALUE(SAP_PERNR) LIKE CATSFIELDS-PERNR
*" VALUE(SAP_DATELEFT) LIKE CATSFIELDS-DATELEFT
*" VALUE(SAP_DATERIGHT) LIKE CATSFIELDS-DATERIGHT
*" VALUE(SAP_DATEFROM) LIKE CATSFIELDS-DATEFROM OPTIONAL
*" VALUE(SAP_DATETO) LIKE CATSFIELDS-DATETO OPTIONAL
*" TABLES
*" SAP_ICATSW STRUCTURE CATSW
*" SAP_ICATSW_FIX STRUCTURE CATSW OPTIONAL
INCLUDE ZXCATU01.
ENDFUNCTION.
The include ZXCATU01 contains only the following coding:
CALL FUNCTION 'Z_EXIT_SAPLCATS_001'
EXPORTING
sap_tcats = sap_tcats
sap_pernr = sap_pernr
sap_dateleft = sap_dateleft
sap_dateright = sap_dateright
SAP_DATEFROM = SAP_DATEFROM
SAP_DATETO = SAP_DATETO
tables
sap_icatsw = sap_icatsw
SAP_ICATSW_FIX = SAP_ICATSW_FIX.
This function module is just a copy of the exit function module in the customer namespace.
Let us assume that your condition at which the user-exit should be executed is that the employee (SAP_PERNR) belongs to a specific controlling area. Thus, we make another copy of the original exit function module and call this fm within the "general" customer-specific exit function module:
FUNCTION z_exit_saplcats_001.
*"*"Local Interface:
*" IMPORTING
*" VALUE(SAP_TCATS) LIKE TCATS STRUCTURE TCATS
*" VALUE(SAP_PERNR) LIKE CATSFIELDS-PERNR
*" VALUE(SAP_DATELEFT) LIKE CATSFIELDS-DATELEFT
*" VALUE(SAP_DATERIGHT) LIKE CATSFIELDS-DATERIGHT
*" VALUE(SAP_DATEFROM) LIKE CATSFIELDS-DATEFROM OPTIONAL
*" VALUE(SAP_DATETO) LIKE CATSFIELDS-DATETO OPTIONAL
*" TABLES
*" SAP_ICATSW STRUCTURE CATSW
*" SAP_ICATSW_FIX STRUCTURE CATSW OPTIONAL
" User-Exit specific for employees (SAP_PERNR)
" belonging to controlling area 1000
CALL FUNCTION 'Z_EXIT_SAPLCATS_001_1000'
EXPORTING
sap_tcats = sap_tcats
sap_pernr = sap_pernr
sap_dateleft = sap_dateleft
sap_dateright = sap_dateright
sap_datefrom = sap_datefrom
sap_dateto = sap_dateto
TABLES
sap_icatsw = sap_icatsw
sap_icatsw_fix = sap_icatsw_fix.
" User-Exit specific for employees (SAP_PERNR)
" belonging to controlling area 2000
CALL FUNCTION 'Z_EXIT_SAPLCATS_001_2000'
EXPORTING
sap_tcats = sap_tcats
sap_pernr = sap_pernr
sap_dateleft = sap_dateleft
sap_dateright = sap_dateright
sap_datefrom = sap_datefrom
sap_dateto = sap_dateto
TABLES
sap_icatsw = sap_icatsw
sap_icatsw_fix = sap_icatsw_fix.
ENDFUNCTION.
Finally, within the specific exit function module we define the condition when the exit should be executed:
FUNCTION z_exit_saplcats_001_1000.
*"*"Local Interface:
*" IMPORTING
*" VALUE(SAP_TCATS) LIKE TCATS STRUCTURE TCATS
*" VALUE(SAP_PERNR) LIKE CATSFIELDS-PERNR
*" VALUE(SAP_DATELEFT) LIKE CATSFIELDS-DATELEFT
*" VALUE(SAP_DATERIGHT) LIKE CATSFIELDS-DATERIGHT
*" VALUE(SAP_DATEFROM) LIKE CATSFIELDS-DATEFROM OPTIONAL
*" VALUE(SAP_DATETO) LIKE CATSFIELDS-DATETO OPTIONAL
*" TABLES
*" SAP_ICATSW STRUCTURE CATSW
*" SAP_ICATSW_FIX STRUCTURE CATSW OPTIONAL
IF ( <user BELONGS to CONTROLLING area 1000> ).
" execute user-exit
ELSE.
RETURN.
ENDIF.
ENDFUNCTION.
The alternative would be to place the entire coding including the conditions in the include ZXCATU01. However, in this case you can test the user exit <b>only in the context of the transaction</b> in which the user-exit is passed.
Using the strategy I have devised you are able to test the user-exit in general and the specific user-exits <b>independent </b>of the transaction. For example, if you are already working on 6.40 or higher then you could use ABAP Unit Testing for this purpose.
The same logic can be applied for BAdI where we can have only a single active implementation.
Finally, I hope to convince that it makes sense to spend some time into a reasonable strategy for implementing user-exits.
Regards
Uwe -
How can i do a variable User exit that present the values before execute
Hi Gurus,
How can i do a variable User exit that present the values before execute, i need this:
a variable that calculate SYS-DATUM until 30 days before (I got the code) but this variable run automatic because is user exit, i want this variable but first present the values, not execute automatic, this is because the users want the report that automatic present the values , helpHi,
Refer the below links,
http://documentation.softwareag.com/natural/nat424mf/pdf/ops_mf/conf_usrex.pdf
http://www.erpgenie.com/component/content/article/1097
http://www.apentia-online.at/UP/Apentia/files/Article/SAP_BW_User_Exits_and_BAdIs.pdf
Hope it helps you,
Regards,
Ravindra. -
Can the user exit EXIT_SAPMM07M_004 be called from an FM exit in my code?
Hi ,
When I create a Goods Receipt by tx MB1C , an MM adapter(FM user exit) is kicked off in my workspace creating documents wrt to that goods receipt.However if a batch does not exist during MB1C , it says that a batch would be created.But when i do a save , the user exit is kicked off before it returns to the SAP code to create a batch.As a result no MM documents are created in my workspace.Now I want that the batch be created while in my user exit and I want to implement the customer user exit EXIT_SAPMM07M_004(for copying the batch characteristics) .Is it possible to call this exit from my code?Kindly suggest.> When I create a Goods Receipt by tx MB1C , an MM adapter(FM user exit) is kicked off in my workspace creating documents wrt to that goods receipt.However if a batch does not exist during MB1C , it says that a batch would be created.But when i do a save , the user exit is kicked off before it returns to the SAP code to create a batch.As a result no MM documents are created in my workspace.Now I want that the batch be created while in my user exit and I want to implement the customer user exit EXIT_SAPMM07M_004(for copying the batch characteristics) .Is it possible to call this exit from my code?Kindly suggest.
Can you call the user exit? - Yes ofcourse.... but why dont you just add the same code that is in your exit instead of calling the user exit?
User exits are developed and called from appropriate places where sap can take the changes and apply to the transaction. there is no restriction on calling the user exit (atleast programmatically) but you need to think 100 times before you call the user exit.
For example, you want to call user exit 'A' in your program because you want to use the code in this user exit in your program '1'. Why dont you just write the code in program '1' with what is in user exit 'A' ?
Calling user exit in your program does not really helps. Better find out different ways. once again, user exits are embedded in sap business applications and remember they are not independent FM's as you think
Good luck -
User exits which can be called from the bapi BAPI_ALM_ORDER_MAINTAIN
Hi Experts,
I was trying to change work orders using the BAPI_ALM_ORDER_MAINTAIN, but this does not allow me to update the order address, one way of updating the address is using recording, but i was looking for a way in which we can use some user exit which will be called from the BAPI so that i can update the address number in the final structure before the work order is saved (without having to go for recording)?Hi,
you have restrictions to this .
Refurbishment orders are not supported.
The estimated costs cannot be processed - only the estimated overall costs of the order.
Notification data cannot be processed with the order BAPI, even if the settings in Customizing are such that the orders and notifications can be maintained on one screen. However, the system will create a notification with the order if this is specified in the Customizing settings.
Permits cannot be processed.
The order addresses cannot be processed.
Individual partner addresses cannot be maintained.
Regards -
How to move iTunes from one user to another on the same Windows 7 computer
How to move iTunes from one user to another on the same Windows 7 computer? Thanks, Bob
Move the iTunes library to a shared area and then into the desired location. If this isn’t the default one, launch iTunes with the Shift key held down and choose that library.
(122379) -
How to forward alert from one user to another user and how to reject?
Hi everybody.
How to forward alert from one user to another user and how to reject and how to complete alert?
Regards,
Vinay.What alert are you talking about? Which version of BOE / Edge do you use?
-
How to find the list of USER-EXITS or BADI for the transaction ABSO
Hi all,
Please help me to find the list of USER-EXITS or BADI for the transaction ABSO & find the exact user-exit which meets the requirement.
Thanks & Regards,
gyanarajHi,
Copy the problem in SE38 and Execute it
Enter the Tcode u want
this will the list of Userexits and badis
TABLES: TSTC,
TADIR,
MODSAPT,
MODACT,
TRDIR,
TFDIR,
ENLFDIR,
SXS_ATTRT ,
TSTCT.
DATA: JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
DATA: FIELD1(30).
DATA: V_DEVCLASS LIKE TADIR-DEVCLASS.
PARAMETERS: P_TCODE LIKE TSTC-TCODE,
P_PGMNA LIKE TSTC-PGMNA .
DATA: WA_TADIR TYPE TADIR.
START-OF-SELECTION.
IF NOT P_TCODE IS INITIAL.
SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
ELSEIF NOT P_PGMNA IS INITIAL.
TSTC-PGMNA = P_PGMNA.
ENDIF.
IF SY-SUBRC EQ 0.
SELECT SINGLE * FROM TADIR
WHERE PGMID = 'R3TR'
AND OBJECT = 'PROG'
AND OBJ_NAME = TSTC-PGMNA.
MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
IF SY-SUBRC NE 0.
SELECT SINGLE * FROM TRDIR
WHERE NAME = TSTC-PGMNA.
IF TRDIR-SUBC EQ 'F'.
SELECT SINGLE * FROM TFDIR
WHERE PNAME = TSTC-PGMNA.
SELECT SINGLE * FROM ENLFDIR
WHERE FUNCNAME = TFDIR-FUNCNAME.
SELECT SINGLE * FROM TADIR
WHERE PGMID = 'R3TR'
AND OBJECT = 'FUGR'
AND OBJ_NAME EQ ENLFDIR-AREA.
MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
ENDIF.
ENDIF.
SELECT * FROM TADIR INTO TABLE JTAB
WHERE PGMID = 'R3TR'
AND OBJECT in ('SMOD', 'SXSD')
AND DEVCLASS = V_DEVCLASS.
SELECT SINGLE * FROM TSTCT
WHERE SPRSL EQ SY-LANGU
AND TCODE EQ P_TCODE.
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ',
20(20) P_TCODE,
45(50) TSTCT-TTEXT.
SKIP.
IF NOT JTAB[] IS INITIAL.
WRITE:/(105) SY-ULINE.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
Sorting the internal Table
sort jtab by OBJECT.
data : wf_txt(60) type c,
wf_smod type i ,
wf_badi type i ,
wf_object2(30) type C.
clear : wf_smod, wf_badi , wf_object2.
Get the total SMOD.
LOOP AT JTAB into wa_tadir.
at first.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE:/1 SY-VLINE,
2 'Enhancement/ Business Add-in',
41 SY-VLINE ,
42 'Description',
105 SY-VLINE.
WRITE:/(105) SY-ULINE.
endat.
clear wf_txt.
at new object.
if wa_tadir-object = 'SMOD'.
wf_object2 = 'Enhancement' .
elseif wa_tadir-object = 'SXSD'.
wf_object2 = ' Business Add-in'.
endif.
FORMAT COLOR COL_GROUP INTENSIFIED ON.
WRITE:/1 SY-VLINE,
2 wf_object2,
105 SY-VLINE.
endat.
case wa_tadir-object.
when 'SMOD'.
wf_smod = wf_smod + 1.
SELECT SINGLE MODTEXT into wf_txt
FROM MODSAPT
WHERE SPRSL = SY-LANGU
AND NAME = wa_tadir-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
when 'SXSD'.
For BADis
wf_badi = wf_badi + 1 .
select single TEXT into wf_txt
from SXS_ATTRT
where sprsl = sy-langu
and EXIT_NAME = wa_tadir-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
endcase.
WRITE:/1 SY-VLINE,
2 wa_tadir-OBJ_NAME hotspot on,
41 SY-VLINE ,
42 wf_txt,
105 SY-VLINE.
AT END OF object.
write : /(105) sy-ULINE.
ENDAT.
ENDLOOP.
WRITE:/(105) SY-ULINE.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No.of Exits:' , wf_smod.
WRITE:/ 'No.of BADis:' , wf_badi.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'No userexits or BADis exist'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'Transaction does not exist'.
ENDIF.
AT LINE-SELECTION.
data : wf_object type tadir-object.
clear wf_object.
GET CURSOR FIELD FIELD1.
CHECK FIELD1(8) EQ 'WA_TADIR'.
read table jtab with key obj_name = sy-lisel+1(20).
move jtab-object to wf_object.
case wf_object.
when 'SMOD'.
SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
when 'SXSD'.
SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
ENDCASE.
Maybe you are looking for
-
Return Into. Can I return the old value in an update statement?
Hello - I have an update statement and I need the value of a field, prior to the update. Is it possible to use the Return Into to do this? Or do I have to have a separate select statement prior to the update statement in order to store that value in
-
USB seems to not work properly anymore with Mountain Lion
I just upgraded to Mountain Lion. Tried to transfer pictures from my DSLR camera but it cannot be detected anymore. My external hard disk does not work anymore as well. Can anybody please help? Thanks.
-
D200 P2P mode import fails on Vista 64
If I set my D200 USB mode to "PTP" Lightroom cannot see any images on the D200, but Vista can. However, if I set the D200 USB mode to "MAss Storage" Lightroom is able to see and import files. It would be nice to get that fixed, since P2P mode is requ
-
Java.security.manager ?
My understanding about Java SecurityManager is when you want to use it, it have to be installed. It can be installed through using -Djava.security.manager option with java command or calling setSecurityManager() in the application. I'm sure that WLS
-
Activation Premiere pro 1.5.1
Server not in use now, phone stopped. New c:\ drive