Restrict to use of two transaction concurrently in ABAP program
Hi,
We have requirement to restrict a user could not using two transaction
at the same time. how could i achieve this. Please throw some light on this.
Hi
--> create a lock object from SE11
Ex : lock object name is EZLOCK
-->Click on Create
-->Give the table name
--> Lock mode (Write, read, Exclusive not cumulative)
--> Give the Lock parameters
-->save --> activate --> Then system will generate to function module
1. ENQUEUE_EZLOCK (for locking)
2. DEQUEUE_EZLOCK (For Unlocking)
--> you need to call these function module in respective areas
ex: In PAI of the screen call ENQUEUE F.M and in
the exit perfroms use DEQUEUE F.M
Ex code to use the f.m's
*To avoid acces of multiple users at a time
CALL FUNCTION 'ENQUEUE_EZCONIC'
EXPORTING
mode_zpicci = 'E'
zpicnum = g_fffc
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
LEAVE TO SCREEN 1000.
ENDIF.
*To unlock the trascation
CALL FUNCTION 'DEQUEUE_EZCONIC'.
Thanks & Regards
Mallikharjuna Reddy
Similar Messages
-
How to call transaction in an abap program
how do we open a transaction thru an abap program and pass a parameter to it
Use call transaction. You can fill up the parameters in the BDC internal table
DATA: bdc_tab LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
CONSTANTS: c_tcode LIKE t130m-tcode VALUE 'FB01'. "Tcode you want to call
CALL TRANSACTION c_tcode
USING bdc_tab
MODE 'N'
UPDATE 'S'
MESSAGES INTO messtab.
Error message will be captured in the messtab.
You can goto the SAP help on Call transaction to see all the details and options.
<b><REMOVED BY MODERATOR></b>
Thanks.
Message was edited by:
Alvaro Tejada Galindo -
Can I use logical databases in a WebDynpro ABAP program?
can I use logical databases in a WebDynpro ABAP program?
I need to build a WDA screen that is similar to the SAPDBPNP selection screen (user can find the personnel number based on several criteria, such as last_name/first_name of the employee). So it seems that the existing logical databases have already many nice features already built (like the selection screens, the logic behind the screens etc). So I was wondering if/how I can use them in my WDA application.Hello, Tiberiu.
You cannot use LDB directly within your WDA programa. BUT, you can fetch results from this LDB by using FM LDB_PROCESS. This function module can be called anytime from any kind of ABAP program. But you will still have to create the screen, as it only processes data, not screens.
Regards,
Andre
PS: Pls reward points if it helps. -
Regd using of lock object in an abap program
Hi all,
i have created an lock object but doesnot know how to use that lock object in an abap program. can anyone guide me how to use lock object in an abap program.check this sample for Production Order.
<b>* Lock request for order
call function 'ENQUEUE_ESORDER'
exporting
aufnr = p_aufnr
exceptions
foreign_lock = 1
system_failure = 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.</b>
Regards
Prabhu -
Urgent!! How to call a custom transaction or an ABAP program in BSP?
Urgent!! How to call a custom transaction or an ABAP program in BSP?
We are pretty new on BSP. Would be very appreciated if any expert here give us the detailed steps on how to build up the application to just call a custom transaction (e.g., t-code: ztest) or an ABAP program. Would we have to create a button or event handler to do that? And the detailed steps?
Thanks in advance and we will definately give you reward points!hi Durairaj,
During the time to wait for your answer, we copied Bernd's code from your last link, but when activating it, get the 1st error msg:
Field "CLIENT" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement."DATA" statement. The error shows up here:
<td>
<htmlb:inputField id = "client"
value = "<%= client %>" />
</td>
Then we added Client to the page attribute and define it as type String, then get another error:
The field "EVENT" is unknown, but there is a field with the similar name "EVENT_ID"."EVENT_ID". This error shows up at the beginning in the Event Handler:
OnInputProcessing:
code
event handler for checking and processing user input and
for defining navigation
event handler for data retrieval
event = cl_htmlb_manager=>get_event( runtime->server->request ).
IF event->name = 'button' AND event->event_type = 'click'.
button_event ?= event.
How to resolve this unknown Event error, need to define in Page Attribute tab? but with what type?
Actually we only want to run an ABAP4 program in BSP, the code is complicated, could you show us an easy way of doing this in BSP? -
Calling two smartforms in one Abap program
Hi ABAPers,
Can anybody know how to call 2 smartforms in 1 abap program?actually i used the FM SSF_FUNCTION_MODULE_NAME...and two smart forms are called...but my main problem is...the first smartforms is called and the print dialog box appeared...once i click the button back ...the second smartforms is called and print dialog box appeared again..
I want to correct this...i want this to be happen once i click the print button...the two smart forms will be combined in a one printing...meaning the first page is the first smartforms and the next page will be the second smart forms...no matter how many pages will be the first smartforms...the second smartforms will concatenate or will append to the last page of the first smartforms..how can i do this?
Please help...this is my sample code..kindly correct the error.
Will reward points...
suppressing the dialog box****************************
outop-tddest = 'LP01'.
cparam-no_dialog = 'X'.
cparam-preview = space.
cparam-getotf = 'X'.
Call the First Smartforms *******************
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSF_CHEQUE'
IMPORTING
fm_name = ly_formname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
CALL FUNCTION ly_formname
EXPORTING
prepared_by = p_prepb
approved_by = p_apprb
TABLES
it_cheque = it_final
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
Call the Second Smartforms *******************
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSF_TSHEET'
IMPORTING
fm_name = ly_formname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
CALL FUNCTION ly_formname
EXPORTING
prepared_by = p_prepb
approved_by = p_apprb
TABLES
it_cheque = it_final
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
Thanks in advance
aVaDuDzhi,
i never used these function but i've found this link.
[http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/62ae7fcd-0b01-0010-3e9d-a54f26944450]
[http://help.sap.com/saphelp_nw2004s/helpdata/en/64/bf2f12ed1711d4b655006094192fe3/content.htm]
[http://help.sap.com/saphelp_nw04/helpdata/en/64/bf2f12ed1711d4b655006094192fe3/frameset.htm]
[SMartform printing;
hope that is useful.
bye
Marco
Edited by: nicolai marco on Jan 14, 2008 12:36 AM -
Plase can anybody tell me how to use SETS (GS01/02/03) in ABAP program
Plase can anybody tell me how to use SETS (GS01/02/03) in ABAP program
http://wiki.sdn.sap.com/wiki/display/Snippets/Reading+Sets+-+GS01+-+GS02+-+GS03
-
Create a Job for a transaction dynamically through ABAP program.
Hello Experts,
Can a job be created for a transaction dynamically, say for example i have a parameter on selection screen which will take the name of the transaction and then i have to create a job to run that transcation.
Plz provide sample code.
Regards,
Mansi.hiii
yes you can call transaction like that..take tcode in that parameter then you can use it in your program with statement like
call transaction (variable)..in background process.
regards
twinkal -
Using function from windows dll in abap program
Hi
How can i use a function from a standard DLL that in c:\winnt\system32.?.
AmiHello ami,
here is the solution to your question - I know, a little bit late, but I hope not to late.
Cheers
Stefan
"-Begin-----------------------------------------------------------------
Report ZLOGON.
"-Variables-----------------------------------------------------------
Data Win32 Type OLE2_OBJECT.
Data Token Type String Value '0000'.
Data hToken Type Integer.
Data phToken Type Integer.
Data ret Type Integer.
"-Main----------------------------------------------------------------
Create Object Win32 'DynamicWrapperX'.
If Win32-Handle > 0.
"-Define external functions---------------------------------------
Call Method Of Win32 'Register' Exporting
#1 = 'advapi32.dll' #2 = 'LogonUserA'
#3 = 'i=sssuup' #4 = 'r=l'.
Call Method Of Win32 'Register' Exporting
#1 = 'kernel32.dll' #2 = 'CloseHandle'
#3 = 'i=h' #4 = 'r=l'.
Call Method Of Win32 'Register' Exporting
#1 = 'kernel32.dll' #2 = 'GetLastError'
#3 = 'r=u'.
Call Method Of Win32 'StrPtr' = phToken Exporting
#1 = Token #2 = 's'.
Call Method Of Win32 'LogonUserA' = ret Exporting
#1 = 'bambi' #2 = '.' #3 = 'hugo' #4 = 2 #5 = 0 #6 = phToken.
If ret <> 0.
"-Logon successful----------------------------------------------
Write: 'Logon as bambi user'.
Call Method Of Win32 'NumGet' = hToken Exporting
#1 = phToken.
Call Method Of Win32 'CloseHandle' = ret Exporting
#1 = hToken.
If ret = 0.
Call Method Of Win32 'GetLastError' = ret.
Write: / ret.
EndIf.
Else.
Call Method Of Win32 'GetLastError' = ret.
Write: / ret.
EndIf.
Free Object Win32.
EndIf.
"-End-------------------------------------------------------------------
Edited by: Stefan Schnell on Sep 6, 2011 7:07 AM -
Whether program is used in any transaction?
Hello Good morning,
Can any one help me out of the problem. The problem is I want to check whether the program is used in any transaction.
Or the program is used anywhere
One of the option which I have is I can check in TSTC table but I want to get the other way.
Thanx !Hi
Greetings!!!!!
you can get this in two ways
1) go to transaction SE93 put transaction name and click display ...
2) go to transctionn SU24 and put your transaction name and select transaction in the drop down menu and click execute
in the next screen you will get, list of authorization objects being checked search for object S_program and see if it is checked for that transaction...
Thanks
Sandeep -
How to use SUBMIT for transaction program?
Hello,
Please help me with following requirement.
I need to pass selection screen values from ZReport to transaction F.01 and collect displayed data output in internal table in ZReport and use internal table for further processing.
Please let me know,
1) How to use SUBMIT with transaction code or modulepool program (<b>remember I don't want to submit report program</b>)?
2) How to collect F.01 output data and bring back to Zreport ?
Thanks in advance.Hi ab,
1. How to collect F.01 output data and bring back to Zreport
The data (of output) can be collected,
for display purpose.
We cannot get the full data, which makes sense.
2. The data shall be collected, in a printable format only,
ie. with vertical lines, horizontal lines (if any) etc.
regards,
amit m. -
Urgent: Calling ABAP Program using JMS
Hi,
I have a scenario where legacy system pass some messages to ABAP Program and this program can handle one message at a time (written in that way).
Now the receiver communication channel is configured to access J2SE adapter. This J2SE adapter stores the message on R/3 system and triggers the ABAP program located in R/3 system.
Now when multiple messages are coming at a time in SAP-XI and processed successfully and handover to J2SE adapter. But J2SE adapter triggers the ABAP program for all messages. And here is the problem. ABAP program is not supporting multi - threading.
my idea is to use JMS adapter...can you guys suggest me how to achieve result and how to configure JMS or any other adapter to call ABAP Program so that only one message will pass to ABAP program at a time.
Regards,
Gourav KhareHi,
First find out where your ABAP program the data written.You need to write it into and spool then only you can see it.
Transaction SP01, you can use the FM 'GET_PRINT_PARAMETERS' in your abap program to write to spool.
Thanks,
Ravi -
Can I use logical databases in a WebDynpro for ABAP program?
can I use logical databases in a WebDynpro ABAP program?
I need to build a WDA screen that is similar to the SAPDBPNP selection screen (user can find the personnel number based on several criteria, such as last_name/first_name of the employee). So it seems that the exisinting logical databases have already many nice features already built (like the selection screens, the logic behind the screens etc). So I was wondering if/how I can use them in my WDA application.Hi
Please let me also know the solution to this. I am a beginner to WebDynpro and want to know if I can make use of LDB's as we do in our normal HR programming do develop a WDA in HR.
Thanks and regards,
Uma. -
Use of ERP Infoset inside ABAP program
Hello experts,
I created a quite complex InfoSet which is supposed to extract business relevant information from FI tables (above all BSID and BSAD) and provide them to users as a mean to interpret data. I'd like to use those data in a custom ABAP program with an extended logic, but I'm not sure how to use it inside my code.
The final result should be to send daily updates on BSAD activities to BI system, and given that BSAD does not have (as far as I know) any mean to completely track creation/modify actions, I came out with the InfoSet solution that make use of an additional field (called update_timestamp) derived from a complex query.
Any help/suggestion on how to overcome the issue will be greatly appreciated.
Best regards
Davide RizzoHi
Yes it's true.
If you put "#ec * at the end of a abap code row, you can suppress the warnining messages of extended program check.
Every kind of warning has own sign, you find out them while running extended check.
It's a way to clear the useless messages.
For example, you have created an include where you have defined several routines you have to use in several programs, but every program don't use all routines of that include, or you dynamically call those routines, so if you run the extend check for a certain program you can get a warning like that:
FORM PLUTO not called directly
Now you can't delete the routine from the include, because it can be used by other program, but you can hide that message by "#ec CALLED:
FORM <MY_FORM>. "#EC CALLED
ENDFORM.
Max -
How to use FTI_TR_CASH_FLOWS ldb in abap programming.
I want to use FTI_TR_CASH_FLOWS logical database in existing ABAP program but i am not able to use this logical data base in the program.Please suggest how to use this logical database in the program.
I have developed a customized report and i want to use logical database "FTI_TR_CASH_FLOWS" into my program . i don't know how to use SAPDBFTI_TR_CASH_FLOWS into my report. how i pass data from my report to this LDB report. plz suggest.
Maybe you are looking for
-
How to fix Unknown device in windows 7
Hi I have just install windws 7 pro on HP Envy dv6-7200SA Notebook PC When I open Unknown device Properties, I see following in details For Other devices - Unknown device ACPI\HPQ0004 *HPQ0004 How do I fix it.
-
Regarding Techincal settings.
Hi, When we create technical settings, what is the use of one step & two steps. can any one explain me in details what is the use of those two radio buttons. Thanks in Advance. Regards, Ramana Prasad.
-
Freeing up space by removing iphone photos
Hi Forum, Tonight i encountered something very unfamilar to me when syncing my iphone 6. when plugged into my computer the task bar located at the bottom of the iTunes details the space being used by particular applications (EG, music, photos, apps,
-
How to handle a Connection Timeout
Hi Everybody, My situation is as follows: I have a web application, some sort of content management system. I'm using MySQL to store information. The application is obtaining Connection objects via a Connection Pool. I'm runngin Sun Java Application
-
Newbie- Java simply put, isn't to me
I am totally ignorant about computers & how they work. All I know is the problems that I have when I turn on my PC. For instance, the other night I was at a web site and I was playing a game. The next thing I know is I got dropped from the game & I s