Close a transaction through ABAP program without user log off.
Hi,
I have to write an ABAP program that will check if a particular transaction (for example tcode VA01) is running than it must close the transaction.
Please give me your inputs or sample code if possible.
Thanks for your suggestions.
--Sanjay
Sanjay,
Check with this how much it is going to help you out..
PARAMETERS: p_user LIKE sy-uname.
DATA: gt_user_info TYPE TABLE OF /sdf/user_context,
wa_uinfo LIKE /sdf/user_context.
START-OF-SELECTION.
CALL FUNCTION '/SDF/MON_USER_MEMORY'
TABLES
modes = gt_user_info.
CHECK NOT gt_user_info IS INITIAL.
LOOP AT gt_user_info INTO wa_uinfo WHERE uname EQ p_user.
IF wa_uinfo-tcode = 'VA01'.
CALL FUNCTION 'TRANSACTION_ABORT'
EXPORTING
transaction_id = transaction_id
EXCEPTIONS
OTHERS = 1.
EXIT.
ENDIF.
ENDLOOP.
Regards,
CK
Similar Messages
-
Assign loading / handling resource to location through ABAP program
Hello Experts,
I have a requirement where by I have to assign loading / unloading resource to a location through ABAP program. Need to assign the resource in Resources Tab in TP/VS section. Is there any function module or any method available to this?
Responses highly appreciated. Thanks in advance
Regards
Sandeep PatilHi all
I have the same requirement for the end user.
Is it a good idea update active Table of ODS behind an ABAP Program Z?, I understood that you can't have log history... and you can't delete request.. because you will not generate this..
We actually have one ODS that contain invoices... all the fields that contain the invoice..like material, vendor, etc.. was updated according to ABAp programa that we specify on start routine, each time that we need to update these fields we need to unload fros ODS to PSA and load again with dtp...
Let me copy more details:
Actually, we have an DSO that is updated each week, we load the information into different PSA, all of this PSA pass to ODS for one info source and transformation rule, in this transformation rule we have an ABAP rotine that have some validation and assign some values for different fields.
In this procees everthing look fine, actually If we need to update this information from DSO (that was loaded and the user need to update some fields) we need to download information from DSO to PSA and load again with DTP process, this was fine.
Actually the user want that this kind of changes will be apply on line, this mean that for example all the invoices that I have actually loaded into DSO need to be analyzed and update according new parameters that they specify in other tables.
The DSO is standard, and contain three basis tables, active, delta, modified.
My question is: Is it possible update directly table of active records of DSO with one Z program?? is it a good idea?, We want to discard the option of unload and load information each time that they need to update certain field that are calculated or updated whit the transformation rule or load.
Than you for your help. -
Logic to run Unix script file through ABAP program
Hi Friends,
I need to run the Unix script file from abap program, for that user provided file directory of application server.
Is there any logic/FM to run through abap programing.
pls can any one provide logic.
Thanks,
Ravireport zsrchsap.
*-This is a demo report for Search Sap
*-Author : Sandeep Kulkarni
*-Date : 09/20/2001
parameters : p_sfile(60) lower case
"File to be moved
"Eg : /home/in/SFILE1.txt
p_dfile(60) lower case.
"File's Destination
"Eg: /home/archive/SFILE1.txt
data : t_btcxpm
like btcxpm occurs 0,
p_addparam
like sxpgcolist-parameters.
concatenate
'/home/ABAP/scripts/Archive_file.sh'
p_sfile
p_dfile
into p_addparam separated by space.
refresh t_btcxpm. clear t_btcxpm.
call function 'SXPG_CALL_SYSTEM'
exporting
commandname = 'ZSHELL'
additional_parameters = p_addparam
tables
exec_protocol = t_btcxpm
exceptions
no_permission = 1
command_not_found = 2
parameters_too_long = 3
security_risk = 4
wrong_check_call_interface = 5
program_start_error = 6
program_termination_error = 7
x_error = 8
parameter_expected = 9
too_many_parameters = 10
illegal_command = 11
others = 12.
if sy-subrc = 0.
write : /
'File',p_sfile,'moved to',p_dfile.
else.
write : / 'Error Occured'.
endif. -
Creation of IDOC through abap program.
hello all,
I hav created idoc through abap program. I hav used FM 'Master_idoc _distrribute'.this program creates an idoc but giving status 30. can any one tell me how to get status 03. I hav already created port, Logical sys,partner no.,distribution model.
My Program is as follows:
ABLES : CRMD_ORDERADM_I,CRMD_ORDERADM_H,CRMD_SCHEDLIN.
DATA : S_CTRL_REC LIKE EDIDC OCCURS 0 WITH HEADER LINE,"Idoc Control Record
ORDER_NO TYPE CRMT_OBJECT_ID VALUE '5000000032'," SEGMENT ORDER DATA
PRODUCT TYPE CRMT_ORDERED_PROD VALUE 'SRV_01',
QUANTITY TYPE CRMT_SCHEDLIN_QUAN VALUE '1.000'.
DATA : ZORDER LIKE ZORDER_NUM OCCURS 0 WITH HEADER LINE.
DATA : T_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE. "Data Records
DATA : T_COMM_IDOC LIKE EDIDC OCCURS 0 WITH HEADER LINE. "Generated Communication IDOc
CONSTANTS :
C_ZRZSEG1 LIKE EDIDD-SEGNAM VALUE 'ZORDER_NUM'.
PARAMETERS : C_MESTYP LIKE EDIDC-MESTYP DEFAULT 'ZORDER_IDOC2', "Message Type
C_RCVPRT LIKE EDIDC-RCVPRT DEFAULT 'LS', "Partner type of receiver
C_LOGSYS LIKE EDIDC-RCVPRN DEFAULT 'BSNL_OUT',
C_RCVPOR LIKE EDIDC-RCVPOR DEFAULT 'A000000006',
C_SNDPOR LIKE EDIDC-SNDPOR DEFAULT 'SAPBCD0000',
C_SNDPRN LIKE EDIDC-SNDPRN DEFAULT 'BCDCLNT100',
C_IDOCTP LIKE EDIDC-IDOCTP DEFAULT 'ZORDER2',
C_SNDPRT LIKE EDIDC-SNDPRT DEFAULT 'LS'. "Destination System
***START-OF-SELECTION
START-OF-SELECTION.
PERFORM GENERATE_CONTROL_RECORD.
PERFORM SEND_IDOC.
*& Form generate_control_record
FORM GENERATE_CONTROL_RECORD .
S_CTRL_REC-RCVPOR = C_RCVPOR. "Receiver Port
S_CTRL_REC-MESTYP = C_MESTYP. "Message type
S_CTRL_REC-IDOCTP = C_IDOCTP. "Basic IDOC type
S_CTRL_REC-RCVPRT = C_RCVPRT. "Partner type of receiver
S_CTRL_REC-SNDPOR = C_SNDPOR. "SENDER PORT
S_CTRL_REC-RCVPRN = C_LOGSYS. "Partner number of receiver
S_CTRL_REC-SNDPRT = C_SNDPRT. "Sender Partner type
S_CTRL_REC-SNDPRN = C_SNDPRN. "Sender Partner Number
APPEND S_CTRL_REC.
ENDFORM. " generate_control_record
*& Form send_idoc
FORM SEND_IDOC.
ZORDER-ORDER_NO = ORDER_NO.
ZORDER-PRODUCT = PRODUCT.
ZORDER-QUANTITY = QUANTITY.
APPEND ZORDER.
T_EDIDD-SEGNAM = C_ZRZSEG1.
T_EDIDD-SDATA = ZORDER.
APPEND T_EDIDD.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
MASTER_IDOC_CONTROL = S_CTRL_REC
TABLES
COMMUNICATION_IDOC_CONTROL = T_COMM_IDOC
MASTER_IDOC_DATA = T_EDIDD
EXCEPTIONS
ERROR_IN_IDOC_CONTROL = 1
ERROR_WRITING_IDOC_STATUS = 2
ERROR_IN_IDOC_DATA = 3
SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
COMMIT WORK.
LOOP AT T_COMM_IDOC.
WRITE:/ 'IDoc Generated - ', T_COMM_IDOC-DOCNUM.
ENDLOOP.
ENDIF.
ENDFORM. " send_idoc
I hav created segment , basic type,message typealso and release also .I also linked them.
Plz help me.
HemlataHi Hemalatha,
Just call this Progream RSEOUT00 from your Zprogram and pass the basic parameters like IDOC number, Basic type,Partner number etc.
You can check the parameters by executing the Program RSEOUT00.
This Program will change the status of your IDOC 30 to 03.
Thanks.
Note:Reward Points if you find useful. -
How to pass table data to brf plus application through abap program
Dear All,
i have a question related to BRF Plus management through abap program.
In brf plus application end, Field1,field2,field3 these 3 are importing parameters.
Table1->structure1->field4,field5 this is the table,with in one structure is there and 2 fields.
in my abap program, i am getting values of fields let us take field1,field2,field3,field4,field5.
And my question is
1) How to pass fields to BRF Plus application from abap program.
2)How to pass Table data to BRF Plus application from abap program.
3)How to pass Structure data to BRF Plus application from abap program.
4)How to get the result data from BRF Plus application to my abap program.
And finally , how to run FDT_TEMPLATE_FUNCTION_PROCESS.
How do i get the code automatically when calling the function in brf plus application.
Regards
venkata.Hi Prabhu,
Since it is a Custom Fm i cant see it in my system.
Look if u want to bring data in internal table then there could be two ways::
1) your FM should contain itab in CHANGING option , so that u can have internal table of same type and pass through FM,
2) read values one by one and append to internal table.
Thanks
Rohit G -
How to crete Button through ABAP programming
Hello Friends,
I am creating 2 selection screens through ABAP code and using them in my Tabstrip control also created through ABAP programming.
Can I also create button on the selection screen through abap programming. If yes then how, and how to assign funtion code and capture the Function Code???
Moderator Message: Read the below advice.
Edited by: kishan P on Dec 30, 2010 7:44 PMHave a look at F1 help on SELECTION-SCREEN. There should be an example as well.
-
Hi Experts,
How can we send sms through ABAP program. What are the web services required? Is there any tutorial/resource on this topic?
Regards.
AbdullahHi...
Go through this code.....
REPORT y_sms_to_india620.
DATA: http_client TYPE REF TO if_http_client .
DATA: wf_string TYPE string ,
result TYPE string ,
r_str TYPE string .
DATA: result_tab TYPE TABLE OF string.
SELECTION-SCREEN: BEGIN OF BLOCK a WITH FRAME .
PARAMETERS: mail(100) LOWER CASE,
m_no(20) LOWER CASE ,
m_mss(120) LOWER CASE.
SELECTION-SCREEN: END OF BLOCK a .
START-OF-SELECTION .
CLEAR wf_string .
CONCATENATE
'http://www.webservicex.net/SendSMS.asmx/SendSMSToIndia?MobileNumber='
m_no
'&FromEmailAddress='
mail
'&Message='
m_mss
INTO wf_string .
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = wf_string
IMPORTING
client = http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4.
CALL METHOD http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2.
CALL METHOD http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3.
CLEAR result .
result = http_client->response->get_cdata( ).
REFRESH result_tab .
SPLIT result AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab .
LOOP AT result_tab INTO r_str.
WRITE:/ r_str .
ENDLOOP .
Reward if it helps u... -
Java dying when user logs off machine
I have developed a class that monitors a MQ queue, I used the active-x bridge to allow distribution to both java and VB developers to use. The application that is to be developed should be running on a machine in the background.
I created a test VB program using the java class and created a "scheduled task" to start on system start up. When I start the machine, the application starts up and runs. Then a user logs into the machine, and application is still running. Then the user logs off the machine, and the program stops.
I have a VB porgram without the java active-x bridge object and that works throughout the login/logout process.
Any thoughts on how I can keep the program running continously, thanks.Well, I found a solution. If you add the paramater -Xrs to the java command, it will reduce the use OS signals. Thus it will ignore the hook that Windows has.
It turns out this was a bug in version 1.3. For some non-light reading and more info, see http://developer.java.sun.com/developer/bugParade/bugs/4323062.html -
Run LabVIEW executable when user logs off
I have a customer request to do this.
My customer has a computer in their plant that I wrote a LabVIEW applicaiton to monitor part of their process. This computer performs other functions in addition to my program. Their IT department has changed their policy that mandates that anybody using this computer has to log in under their own user name and password. Prevoulsy it was just a group user name and password. What this means for me is everytime a new user needs to use the PC they have to log off and log back on. This stops my program.
Is there a way to have a LabVIEW executable keep running when different users log off and log on?
Thanks
DanSounds like you need a service. It may be a complete architecture change, but you could have an executable running as a service and a user interface executable connecting to it (e.g. via TCP/IP). The service itself can't have a UI.
Without using a service there's no way an application can continue running when a user logs off (afaik).
A service is started even if no user logs on.
There's tools like srvany or similar that allow to run an executable as a service.
Daniel
Message Edited by dan_u on 08-18-2009 03:13 PM -
Hello,
i am using Firefox version 31. I have a problem with page setup margins. I need to use left
30mm; right 10mm; top 20mm; bottom 20mm. I am using VMware floating assignemnt linked clones
virtual desktops. After users log off - machines are deleted and users next time logs on get's brand
new VDI's. Users gets printers to VDI using login script from Active Directory.
Option Explicit
Dim strPrinterUNC, objNetwork
strPrinterUNC = "\\some_server\printer_number_1"
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strPrinterUNC
WScript.Sleep (20000)
objNetwork.SetDefaultPrinter strPrinterUNC
Set objNetwork = Nothing
Each user have different logon script, because they use different printers (different printer names e.g. \\some_server\printer_number_2 ; \\some_server\printer_number_3 and etc. Page setup margins in Internet Explorer are ok. But how to make Firefox page setup margins as i need? For other options i have
used CCK2 Wizard 2.0.4 tool. It worked fine. Maybe i can put some information in C:\Program
Files\Mozilla Firefox\defaults\pref\autoconfig.js I have some usefull data in it allready. I
have found info that: "Setting print margins is done in the printer settings". I have a lot of
printers, so i can not set printer margins individualy for each of them. Now mozilla shows top,
bottom, right, left each 12.7 mm. What should i do if i have a lot of printers in enterprise
environment?Firefox has a profile folder that has preferences to save this. But the config that would need to be changed is:
print. save_print_settings = True - (default): Save the print settings after each print job
Locking that preference: [http://kb.mozillazine.org/Locking_preferences]
Or done manually:
#In order to check the margins, we need to go to ''File'' > ''Page Setup''.
#Once this is done, switch to the ''Margins & Header/Footer'' tab.
#Check what's set there under ''Margins''.
The following are the default values for ''Margins'':
Check these values accordingly and change them if necessary. -
Applications still run after user logged off
Hi,
I have a w2k8r2 Terminal server and have a problem that have eluded me for some time now.
When a user is logged off, by either being disconnected or being inactive for a prolonged time, the user initiated programs are still running.
To be more exact, Some times when a user is logged off I have the following situation:
In the task manager on the users tab I cannot see the user anymore (nor in the remote desktop services manager), but in the Processes tab I can still see user initiated programs running. Furthermore I am not able to kill any of those programs, getting an
"Access is denied" error message.
My problem is that when the Terminal Server enters this "state" it becomes all buggy and itchy, causing loads of problems for the users that are already logged in (and for the new ones trying to log in). The only solution I have found is rebooting
the server.
Any solution, or further troubleshooting steps, are more than welcome. For me the next step is reinstalling which I really don't want1. Check any task schedular is running for application or not,
Refer :
http://answers.microsoft.com/en-us/windows/forum/windows_7-security/if-i-log-off-at-night-leave-computer-on-will/559eec53-1d2a-46f8-ac12-f0d4a32ab57a?msgId=b51d42b3-e727-40c0-b94e-8a01b31bf526
2. Also update Antivirus and scan completely.
3. Is it specific application or all the application, Which user opened in his session?
4. If specific application is running (In this scenario Outlook is running even user logs off), Try the below Citrix forum thread.
Refer :
http://discussions.citrix.com/topic/301644-user-logs-off-process-outlookexe-stays-active-error-the-citrix-server-has-reached-its-concurrent-application-limit/
5. Check and update TCP/IP driver
Refer : http://support.microsoft.com/kb/2465772/en-us
6. Also cross verify Dharmesh suggestions also.
Regards,
Manjunath Sullad -
RMI listener stops whenever the user logs off Windows
Hi guys...
I have a problem whereby the RMI listener stops whenever the user logs off Windows.
I've gone through the net and the only solution was to add "-Xrs" to the end of the "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IBM Tivoli Identity Manager Adapter" service for the ImagePath statement.
Unfortunately for me, that did not work.
Anybody knows how I can go around fixing this.
Much appreciated.What's the RMI listener?
Do you mean the RMI Registry?
In which case the solution is to add that same flag when you run the registry. -
Rmiregistry surviving user log off
Is there any way to get rmiregistry to survive a user log off in Wni32?
If not is there a way to get source code so that it may be altered to start as a service and survive a user log off?
I am using 1.3.1_04 and 1.4.0_01 of the SDK and JRE on various machines and none survive the log off of a user in WinNT. I have my services start and they will survive the log off of a user but I will not be able to service any new connections after that because rmiregistry has been killed.
I know that Sun has no plans to correct this and there are several who could use this feature. What are possible work arounds?I don't know if there's a direct solution but you can split this into two problems that are easy to solve:
1) You can start an RMI registry from any Java program -- check out
LocateRegistry.createRegistry(1099);
2) Using the "Java Service Wrapper" at http://sourceforge.net/projects/wrapper/ you can turn the above program into an NT service that is robust with respect to logoffs.
Check out the user forums on the above site -- especially the post "Application that starts the RMI service..." on http://sourceforge.net/forum/forum.php?forum_id=122338 .
Perhaps someone has a simpler solution ... -
Hello Gurus
I need to find the user log off and log on details.Suppose if the user logs of today and Logs on tommmorow...Then I need to get both those log off and log on details.The log details can be found from USR02 table..Plz help me in finding out the log off date of the user..IThanks
Ganesh
Edited by: Ganesh Kumar on Mar 9, 2009 6:57 PMExplore SM19 and SM20 tcodes for your requirement.
-
IPlanet 6.0 SP2 restart on Windows NT when a user logs off the server.
UPDATE: We have found that the iWS 6.0 only restart with JDK 1.3.1 installed for JSP pages. What is the best JDK to use?
iPlanet 6.0 SP2 restart on Windows NT when a user logs off the server. If a admin or joe developer logs into the server (C+A+D) and does what ever... When the
person logs off the NT 4.0 box ... ALL the httpd process restart. We have 80 & 443 & Admin. The processes are running under a user account. Any one have an idea why the process are restarting?"Hi,
You can use following JDK version for Windows NT.
And please check it out whether WinNT-SP6 as been installed in winNT box.
Window NT:
SDK and JRE 1.4 http://java.sun.com/j2se/1.4/
SDK and JRE 1.3.1_02 http://java.sun.com/j2se/1.3/
SDK and JRE 1.2.2_011 http://java.sun.com/products/jdk/1.2/
JDK and JRE 1.1.8_009
http://java.sun.com/products/jdk/1.1/download-jdk-windows.html
I hope this helps.
Regards,
Dakshin.
Developer Technical Support
Sun Microsystems
http://www.sun.com/developers/support.
Maybe you are looking for
-
How to populate table at run time
Hi All, I have a requirement like , i have department table and i created view object for that and dragged into jsp page as a single selection choice. when i select department id in the drop down list a table should be populated with the details //--
-
Mac won't recognize iPod Touch after library move
Ever since my music library outgrew my internal hard drive and I moved it to my Time Capsule, my computer doesn't recognize my iPod Touch when I plug it in, though the iPod is charging from the USB port. I've deleted iTunes, rebooted and reinstalled
-
Export from iPhoto 4 yeilds JPG's with Quicktime icon?
Hi, I am using iPhoto 4.0.3 I am exporting some old photos from iPhoto, I choose File>Export... Full size images / Use Title / Use Extension Format : JPG After the export if I locate the files in the finder window, all the files have .jpg extension.
-
Self Services-- Payroll & Compensation--- Tax Saving Declarations IND
Hi, Hope you are doing well, am using Peopletools 8.52.12 HRMS 9.1 FP2 Sql server 2008R2 on windows server 2008 In PIA: Self Services-->Payroll & Compensation--->Tax Saving Declarations IND page displaying "You do not have privilege to access the Sel
-
Very slow working Satellite L30-10V
I've had my toshiba just under two years now and for pretty much as long as I remember its been very slow. Last week it died completly and kept telling me there was a harddisk error preventing windows from opening. I did the product recovery on toshi