Find original calling program or transaction...
Hello,
I want to keep a User-exit from running when it is ran from LT23, but I want it to work from LT11. The problem is when the function to confirm the TO is executed in LT23, it does a call transaction to LT11.
So, in the user-exit SY-TCODE has LT11 in it.
I have tried using SYSTEM_CALLSTACK and the first program in there is the initiating program for LT11, SAPML03T.
So, does anyone know a way to be able to find that either LT23 or the program RLLT2300, was the calling program for the CALL Transaction to LT11?
Any help would be greatly appreciated.
Thanks,
Rocky
Interesting. The only way that I can think of off the top of my head is to have a "Z" version of LT23 and hence a "Z" version of the program behind it. Just before calling the transaction LT11, set some flag in a memeory id using the EXPORT statement. Then in the user exit, IMPORT that flag, if the value is set, then exit out of the user exit.
In the "Z" version of LT23.
data: flag(1) type c.
flag = 'X'.
EXPORT flag to MEMORY ID 'WHATEVER'.
In the user exit function module.
IMPORT flag FROM MEMORY ID 'WHATEVER'.
if flag = 'X'.
exit.
endif.
Probably not the best way, but can't think of anything else right now.
Welcome to SDN. Please remember to award points for any helpful answers that you might receive. Thanks.
Regards,
Rich Heilman
Similar Messages
-
To find the Calling Program of an sap script
Hi All,
Can any body please let me know how to find the calling program ( main program ) of an SAP Script Form.
Thanks and Regards,
RupeshHi,
if it's possible to create the form online (no background job), this works:
From SE71 (Form painter), use menu Utilities-->activate debugger.
Then start the program creating the SAPscript form.
As soon as form processing starts, you are inside the SAPscript debugger. At this point, enter /h in command line to activate ABAP debugger. Continue to get into abap debugging. In ABAP debugger, use button 'calls' to see the call stack. The program at the bottom is the starting point, this or one of the more upwards program triggers the form.
Hope this helps.
regards,
C. -
Issue calling program from transaction with selection criteria
Hi Guys,
I ve a issue regarding calling a program from transaction.
There is a standard transaction calling a program using selection criteria no (say for eq 10 fields, just look at the eg below)
Submit <table-proname> and return using selection-set <table-varia>
With rbukrs = i_bkorm-burks Comp Code
with Revent = i_bkorm-event event
with rbelnr = ibkorm-belnr Doc no
with rgjahr = ibkorm-gjahr fiscal year
with ruzeit = ibkorm-ruzeit time
with rusnam = ibkorm-rusnam user name
And so on
Now, In my program selection screen i ve only three fields, (not all mentioned above)
Parameter:
Rbukrs type bukrs, comp code
Rbelnr type belnr, doc no
Rghar type gjahr. fiscal year
Now, i configure this transaction with this program i can able to run this program from transaction.
Is every thing go right, Pls give your sugg
Points & help awarded.
Thanks in advance.Hi,
you can call the program using 3 selection screen fields even though it is having 10 fileds, but before calling make sure that there is no mandatory fields (in rest of the 7 fields), then it will runs you report.
reward if needful.
Thanks,
Sreeram. -
Hi experts,
I had created an implementation for a BADI. How do i link this implementation to the calling program.
In the first place can you please tell me how do i find the calling program using a BADI in general.
Will appreciate your help.Badi's are called based on user action and the transaction. You can use the reverse approach to find when you badi is getting triggered. Say for example you inplemeted a Purchase order BADI the only way to find id you code will be triggered is by putting a break point in the code and executing the transaction. If you have not implemeted the badi yet you can use the below steps to find if the badi is triggered by the transaction.
hese steps should enable you to find any BADI related to any transaction.
1) Go to the transaction SE37 to find your function module.
2) Locate the function SXV_GET_CLIF_BY_NAME.
3) Put a breakpoint there.
4) Now open a new session.
5) Go to your transaction.
6) At that time, it will stop this function.
7) Double click on the function field EXIT_NAME.
8) That will give you name of the BADI that is provided in your transaction. -
How do I get the calling program?
Hi,
I have been using a function module for a long time which is called by quite a number of programs. Now I want it to react differently dependent on the calling program.
I could use a new optional parameter of course transferring the program id. In that case I have to change quite a number of programs.
I was just wondering if there is a possibility to get the information of the calling program on the fly. (In the debugger you can find your calling program easily in the 'call stacks'). Does anyone know how to retrieve this information?
Thanks in advance.
Regards JohannesHi,
I am quite overwhelmed by the amount of answers.
Actually ufortunately neither of the solutions offered solve my problem.
1.) sy-cprog gives the name of the main program and not the name of the module/include/method that has called my function.
2.) The function 'RS_EU_CROSSREF' was unknown to me. It is very interesting but it is a cross reference und shows all calling programs and not the one that was actually calling the function.
Does anyone has got any other ideas?
Regard Johannes -
Calling 2 Z transactions in one Program
Hi Guru's,
I've a small requirement.
I've developed 2 different programs and 2 different T-Codes for those programs,
Now my requirement is i want to call those two Z t-codes in one program.
if i run one program, the program should execute the T-codes.
Please help me on this.
Thanks,
Adi.Hi,
Find the below code.
Selection-screen begin of block b1.
Parameters:RB1 radiobutton group r1,
RB2 radiobutton group r1.
selection-screen end of block b1.
Start-of-selection.
If RB1 = 'X'.
Call Transaction TCODE1. "if call transaction
Submit Program Name1 Via Selection-Screen and Return. "if calling program
Clear RB1.
Elseif RB2 = 'X'.
Call Transaction TCODE2. "if call transaction
Submit Program Name2 Via Selection-Screen and Return. "if calling program
Clear RB2.
Endif. -
How to find Program or transaction is already running
Hi ,
How to find one program or transaction already running in background or foreground ( any user).
this is very useful to me , to avoid double time running the same program or transaction.
Thanks in advance
regards,
Moon
Moderator message: FAQ, please search for previous discussions of this topic.
Edited by: Thomas Zloch on Apr 21, 2011 10:15 PMHi Goldmoon,
Please search before posting. There are many threads available regarding this.
Kesav -
How to find called programs for all zprograms?
Hello dear colleagues,
I need kind of a report tree that answer the following question:
Wich transactions and external programs are called from every Ztransaction?, considering that such called program/transactions also call others.
Besides i need to know about authority check related to each call.
Is there a standard report or useful code?
Any suggestion is appreciated.
Thanks!Hi Lidya,
Check the below thread,
https://forums.sdn.sap.com/click.jspa?searchID=14358915&messageID=5386905
Kindly Reward Points If You Found The Reply Helpfull
Cheers,
Chaitanya. -
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? -
Come back to calling program from Call Transaction
Hi,
From my program, i am calling a standard tcode :
Call Transaction - sy-calld is set in called transaction which deactivates some buttons there.
Leave To Trnasaction - sy-calld is not set , but then I am not able to come back to the calling program.
Please tell me how should this be achieved.
ThanksHi, shalaxy s
If you do mean calling the transaction and being able to go back !!
You can use the following
For Example : CALL TRANSACTION 'SE80' VIA SELECTION-SCREEN AND RETURN.
OR: CALL TRANSACTION 'SE80' AND SKIP FIRST SCREEN.
Best Reagrds, AlMaReD
Edited by: AlMaReD on Jun 12, 2010 9:47 AM -
Writing a Batch Input or Call Transaction program for transaction code MMAM
Hi All,
I'm writing a Batch Input or Call Transaction program for transaction code MMAM (Changing Material Type). The program was able to run but somehow I was not able to capture the log of the output after running MMAM. The log was not part of the SY-MESSAGE so adding in MESSTAB into call transaction doesn't help while BDC session logs shows only the transaction was processed.
Anyone has encounter such problems before?
Regards,
Ramu.Hi
Overview of Batch Input Session
The first batch input method is to create a batch input session. It is the processing of this batch input session that updates the database, not the execution of the batch input program. i am giving you example for Change Vendor you practice for ur tcode
For our example, we will use the Change Vendor transaction (FK02) to add a street address to an already existing vendor.
Step #1
Use SystemStatus menu path to determine online program name (SAPMF02K), screen number (0110)
Step #2
Use F1 key and Technical Info pushbutton in each screen field to be filled to determine the field name.
Step #3
Determine how to proceed in the transaction
(save the record by clicking on the Save pushbutton or pressing the F11 key).
The process flow of CALL TRANSACTION
A program that uses CALL TRANSACTION USING to process legacy data should execute thefollowing steps:
Prepare a BDCDATA structure for the transaction that you wish to run.
Prepare a internal table to store error messages Tab_Mess like structure of BDCMSGCOLL.
With a CALL TRANSACTION USING statement, call the transaction and prepare the BDCDATA structure. For example:
CALL TRANSACTION MM01' USING BDCDATA MODE 'A' UPDATE 'S'. MESSAGES INTO TAB_MESS.
IF SY-SUBRC <> 0.
<Error_handling>.
ENDIF.
Overview of Batch Input Session
The first batch input method is to create a batch input session. It is the processing of this batch input session that updates the database, not the execution of the batch input program -
How to find the user-exit for transaction fpp2
Hi experts,
could you help me how can I find the user-exit for transaction fpp2. I tried to after the package, but I did not find it.Hi,
Use the following program to find user exits of specified code.
*& Tables
TABLES : tstc, "SAP® Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP® Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
*& Variables
DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA : field1(30).
DATA : v_devclass LIKE tadir-devclass.
*& Selection Screen Parameters
SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK a01.
*& Start of main program
START-OF-SELECTION.
Validate Transaction Code
SELECT SINGLE * FROM tstc
WHERE tcode EQ p_tcode.
Find Repository Objects for transaction code
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 = enlfdir-area.
MOVE : tadir-devclass TO v_devclass.
ENDIF.
ENDIF.
Find SAP® Modifications
SELECT * FROM tadir
INTO TABLE jtab
WHERE pgmid = 'R3TR'
AND object = 'SMOD'
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:/(95) sy-uline.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE:/1 sy-vline,
2 'Exit Name',
21 sy-vline ,
22 'Description',
95 sy-vline.
WRITE:/(95) sy-uline.
LOOP AT jtab.
SELECT SINGLE * FROM modsapt
WHERE sprsl = sy-langu AND
name = jtab-obj_name.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
WRITE:/1 sy-vline,
2 jtab-obj_name HOTSPOT ON,
21 sy-vline ,
22 modsapt-modtext,
95 sy-vline.
ENDLOOP.
WRITE:/(95) sy-uline.
DESCRIBE TABLE jtab.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No of Exits:' , sy-tfill.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'No User Exit exists'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'Transaction Code Does Not Exist'.
ENDIF.
Take the user to SMOD for the Exit that was selected.
AT LINE-SELECTION.
GET CURSOR FIELD field1.
CHECK field1(4) EQ 'JTAB'.
SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
I executed the above program but there are no user exits for the specified Transaction.
Thanks,
Naveen Kumar. -
IPhoto can't find original photos, but I can!
When I launch iPhoto, I get error messages telling me photos are missing, and asking if I want to "find original" or cancel. If I try to find the original, I can't navigate into the library file itself, even though a search in spotlight reveals the missing photo is inside the iPhoto library bundle itself.
So I hit 'cancel' but I have to do this dozens of times each time I launch iPhoto, which is a huge hassle.
The 'missing' photos show up as blank thumbnails with a dotted white line around them in the photo viewer. If I scroll around iPhoto's viewing pane, the same message appears constantly.
I have rebuilt the library, repaired disk permissions, and even tried reverting to an older library from backup. No dice.
I'm out of ideas, other than exporting all the photos and then creating a new library and reorganizing everything. Seems like a huge hassle for 9000 photos, though.
Any help is greatly appreciated.Thank you for the insights, Terence. I'm glad I didn't export then re-import.
I did try iPhoto Library Manager before posting here, but it told me it couldn't rebuild the database because it was corrupt! Yikes.
Okay, so I did what someone suggested on another thread, and tried to identify all the 80 or so photos that were supposedly 'missing'. I wrote down the name of every photo on a text edit doc.
Then I did something strange that seems to have worked: I went to Spotlight, and searched for one of the image names. I found it inside the iPhoto library. (I'm not sure why you can't navigate to photos from inside iPhoto, but you can from Spotlight - note, you can't find them in any other finder window, just Spotlight).
I dragged the culprit file to my desktop. Then, when the alert came up again, I used File > Reveal in Finder to navigate to the photo...interestingly, iPhoto then pointed to the original location of the missing file...I then dragged the photo from my desktop back into iPhoto's library via the Finder. Voila, the photo was re-linked.
But here's where it gets interesting. Somehow other photos got re-linked, too!
I quit the program, and the same problem reoccurred. So I took the steps again above, but this time I did something slightly different afterward.
I went to the TextEdit doc, and I found each and every photo, and dragged it into an album I'd created (I called it something like "Photos to Fix" or something). I then went to the Trash, and found some broken aliases in there, too. I emptied the Trash, after clicking 'cancel' on each error message. Then, I quit and restarted iPhoto several times. The problem is gone! I then moved the photos out of the "Photos to Fix" album, and the problem has not returned.
In short:
- Find a broken photo in iPhoto, note the name
- Navigate to the photo in Spotlight (not finder)
- Drag it out of the iPhoto Library and onto the desktop
- Go back to iPhoto
- Select "Reveal in Finder" on the broken thumbnail
- iPhoto will go to the location the photo USED to be
- Go back to Finder
- Drag the photo back into its old location
- Go back to iPhoto
- Move that photo, and any other problem photos, to a new album
- Empty Trash if there are any problem files there, too
- Restart iPhoto
- Problem solved
That's what worked for me, though I admit it is wonky and illogical. Maybe someone can shed light on why this worked. -
How to call external application (transaction launcher) from event method
Hi all
Can somebody tell me which program lines to put into an event handler method in a view controller to get an external application called. I intend to define the link to the external application in the Transaction Launcher. But I cannot find any instructions on how to call the Transaction Launcher from my event handler method. I do not want to launch the application from the navigation bar, ONLY via a link in a list of invoices in a table view, and I want to press the invoice number to get an external application called to display the invoice. My event handler method gets called fine enough, but I have no clue which program lines to put into the method to pass on the call to the Transaction Launcher
Best regards
Arne Thage / MarchIT / Denmarkhi,
check class CL_CRM_UI_LTX_NAVBAR_PARAM.
call method : CREATE_PARAMETER_OBJECT with parameters
IV_LINK_ID Importing Type CRMT_UI_LOGICAL_LINK_ID Logical Link ID
IV_PARAMETER Importing Type CRMT_UI_LINK_PARAMETER Link Parameter
RV_RESULT Returning Type Ref To IF_BOL_BO_PROPERTY_ACCESS BO Attribute
I think it should work but have never done myself.
Best Regards
Pankaj Kumar -
Reset or Clear SAP user context by external RFC caller program
Hello,
I have a SAP system with performance problems due to a SAP user context starts using a lot of memory.
This user context comes from an External RFC caller program written in Delphi and which uses the SAP RFC SDK provided by SAPGUI 6.40: SAP Automation library, SAPFuntionsOCX, I mean, using methods in the object "SAPFunctions" in SAPFunctionsOCX in file "wdtfuncU.ocx", in SAPGUI directory.
Everytime we have performance problems, this RFC SAP user context is using near 1400 Mb of extended memory, although there is a lot of free physical RAM memory available, there are free dialog processes and CPU load is low (no more than 30%).
This performance problem is solved by closing the external program (written in Delphi) which connects to SAP via RFC.
This external program works for the warehouse management and connects to SAP several times per minute. Due to connection performance and the high frequency with which this external program must connect to SAP, the connection to SAP is not closed after each call to RFC SAP function modules.
The extended memory used by this SAP RFC user is growing along time. I detected, using ST03 transaction, that these user sessions have always the same transaction code hash, I mean, although the external programs call the same SAP RFC funcion modules several times (¡¡¡ always clearing the variables at the beginning and at the end of de ABAP code, with ABAP commands like REFRESH and FREE ¡¡¡¡) the technical transaction code is the same and I suppose the user context (in extended memory) is not deleted.
I think it is better than the external program close the context memory (similar to "/n" okcode in SAPGUI).
But we don't want to close the connection, because the external program connects to SAP with a high frequency, and the logon process is expensive.
Is there any way to send something similar to "/n" (end of transaction) from the external program? Is there any command in the SAP RFC SDK library (SAPFuntionsOCX or something similar?
I cannot find any method to do that in the object "SAPFunctions" in SAPFunctionsOCX in file "wdtfuncU.ocx", in SAPGUI directory.
Old information for Object Classes "SAPFunctions" in SAPFunctionsOCX in file "wdtfuncU.ocx", in SAPGUI directory, is described in the following URL:
http://help.sap.com/saphelp_45b/helpdata/en/39/7e00d1ac6011d189c60000e829fbbd/frameset.htm
But I cannot find anything related to something similar to a "/n" in SAPGUI.
As I have the SAPGUI installed on my desktop, I can see all SAP RFC classes and methods from Excel, by opening the Visual Basic editor.
I am only asking a way to send to SAP a command to free the user context used for an open RFC session in order to avoid the memory used to be continuously growing, without having to close the RFC session.
The external program only calls a certain SAP function module periodically and we want to free the user context between calls without logging off. This is the same, very similar, as if we called that function from SAPGUI and we used "/n" in SAPGUI between calls.
Anyone can help me?
Thanks and best regards.Hello,
I don't know if this will solve your problem, but you may be using MF 'RFC_CONNECTION_CLOSE' between each call of you RFC function.
Regards
Brice
Edited by: blsapsdn on Apr 15, 2011 5:27 PM
Maybe you are looking for
-
I cannot open any tabs on Firefox. It opens to my homepage, but there is no line for a URL address. Therefore, there is no way to type in a new URL address. I have uninstalled and reinstalled Firefox twice and it has not helped. I am a former PC user
-
D-link 524, appletalk and printing
hi! i am trying unsuccessfully to print via wireless d-link router to my old laserjet... my setup: powerbook g4 12" [linking via airport to:] d-link524 wireless router [ethernet connection from back of above router to:] hp laser jet 2100tn [which wor
-
I have a pdf that is 16 pages, and I want the first page to be the last! How can I accomplish this using Acrobat? thank you
-
my ipad mini is unable to shut down, nor can I get a message closed from the home screen
-
Dear All , I want to block profit centers (Not thru Basis ), so that no posting can happen to these profit centers . How to do the same ? pl guide Regards