How to lock transaction codes in ABAP report

Hello all,
I'm now planning to lock several transaction codes as a batch job to prevent end users from using locked tr-cds while processing batch jobs during online service period.
I found out tr-cd: SM01 to lock tr-cds, but I don't get what I can do with this tr-cd when you want to execute this as a background job.
I suppose I can make it by using transaction recorder or call transaction.
But I want to do this in smarter manner (like executing certain report PGM with a variant containing tr-cds to be locked).
I rather prefer using FM or BAPI to using transaction recorder etc if possible...
If you know anything on this issue, please please help me..
Hozy

Hi,
Not quite correct - this is the FM that posts a record about the lock/unlock to the audit log (SM01 calls it), but ir doesn't change the transaction lock itself.
Here is a sample report that does do the trick. You may want to change it to your needs, e.g. allow changing multiple transactions in one run:
REPORT  ZTXLOCK.
parameters:
  p_tcode      type tcode obligatory,
  p_mode       type char1 obligatory.   "L=lock, U=unlock
tables: tstc.
at selection-screen on p_tcode.
  select single * from tstc where tcode = p_tcode.
  if sy-subrc <> 0.
    message e002(sy) with 'Transaction code not found'.
  endif.
at selection-screen on p_mode.
  if p_mode na 'LU'.
    message e002(sy) with 'Invalid mode, use L (lock), U (unlock)'.
  endif.
start-of-selection.
  case p_mode.
    when 'L'.
      perform bit-set(sapmtstc) using tstc-cinfo 6.
    when 'U'.
      perform bit-reset(sapmtstc) using tstc-cinfo 6.
  endcase.
  update tstc.
  if sy-dbcnt = 0.
    message e002(sy) with 'TSTC update failed'.
  endif.
Regards,
Mark

Similar Messages

  • How to create Transaction code for ABAP and execution by other user

    Hi All,
    Could someone please let me know how to create transaction code in detail for ABAP program. Step by step procedure expected. I would like to know how other user can execute the report using same transaction code which I have created.
    More about authorization.
    Thanks in advance.

    Hello,
    You can create transaction code from se80 as well.In object navigator,right click on your program name and create->transaction code.You can create transaction and select if it is only a report,a report with selection-screen depending on your requirement.You can run your report directly by entering the transaction code in the command field.
    You can authorise the users who can use your transaction:
    <b>Authorisation objects</b> are used to restrict certain transactions to users.Critical data must be protected from unauthorised users.For example,the head has access to certain data.But it cannot be accessed by his subordinate.For this we need to define <b>roles</b>.
    •Create an authorization object with transaction SU21.
    An object usually consists of the ACTVT (activity) field and one other field,which specifies the data type to be protected.By ACTVT, we can decide if the data is accessible for change,display only etc.
    •Add authorization fields to the authorization object created.
    •Assign the authorization object to the transaction using SE93.
    Attach the authorization object to the role using transaction PFCG.
    If you want <b>to assign roles</b>,use transaction PFCG.Create a new role.In the AUTHORIZATIONS tab,you can get a self generated profile name and a profile text by clicking on the icon next to it.Then go to the "Change Authorization data" and choose an authorization template.Then you can choose to display/change/create an activity and after the selection,click on the red and white circle.The profile will now be created.
    In the user tab,you can give the user details who can use this role.
    <b>Also check this link:</b>
    http://www.*********************/r3_security/r3_security_tips.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/52/6716a6439b11d1896f0000e8322d00/content.htm
    <b>Very helpful guide:</b>
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a92195a9-0b01-0010-909c-f330ea4a585c
    Regards,
    Beejal
    **Reward if answer is helpful

  • Create transaction code for abap report

    Hello,
    don't know if this is the correct subforum (sorry in advance).
    I have created a ABAP Report in SE38 having a SELECTION-SCREEN.
    Now I would like to have a Transaction code to refer to the report. So that I can call the Transaction and then get the selection screen to use the abap report.
    How can I do this the simplest way? I can't find anything in google, can you give me some hints?

    hi
    goto se93
    give transaction code and click create
    select the second radio button(transaction code for reports)
    give short description and press enter
    after that give your program name
    and select the gui check boxes as required for html ,java,
    and save it
    you can use the transaction code
    REGARDS
    PRASANTH

  • How to Create Transaction code for a Report

    Hi Gurus,
    I created some reports and I wants those reports
    should be placed in the SAP Menu(initial screen) not
    in the User menu in the form of Transaction codes.
    I would really appreciate if any one can please send the process to create transaction codes for the User reports/Report groups in R/3 and how to add those created Transaction codes to the SAP MENU.
    Thanks in Advance
    Danial

    Try to insert it into the main menu if you must change S000 (there is a function module for everything)? Perhaps SAP protects their menu trees from foreign subnodes in SE43?
    Also note that for report transactions you do not need to give the user transaction code start_report. If you do, then they could enter it directly and potentially start many other reports too. The system will call start_report for submitting the report internally without authorizations for it required (unless start_report is maintained in SE97).
    Regarding DE, this also confuses me sometimes and I noticed that it generally indicates that I am doing something which has an implication for a SAP standard object. Try either hitting the enter button to see what the next screen is, or, choose original language in the previous screen, or, logon in sy-langu = DE and (remember the path if you dont speak German) change it, or, follow JCs advice to create your own menu.

  • How to display BAR-CODE through ABAP report

    Hi,
    Could you please help me, how to display BAR-CODE through the ABAP report.
    I am writing below code, but BAR-CODE is not displaying on report.
               PRINT-CONTROL FUNCTION 'SBP01'.
                WRITE: 20  BAR_CODE1 NO-GAP.
               PRINT-CONTROL FUNCTION 'SBS01'.
    Regards,
    SSRAJU.

    Hi RAJU,
    you can see this forum link and its sub-links, here it is clear about it.
    Re: Barcode printing on report
    Thanks & Regards,
    Dileep .C

  • Transaction code for Custom report

    Hi,
    How to create transaction code for Custom report ?
    the custom report is a drilldown report of COPA, which can seen in tcode  FDI3.
    then how to add this new transaction to the menu path Easy assess->FI->AR->Information system->Reports->customers:items.
    Thanks,
    Swetha

    Hi Swetha,
    There is a special way to assign tcodes to such reports. Normally you create the report via report painter/writer. These reports are part of library and report group.
    Create the tcode in SE93. Then at the bottom of the screen you would find option to specify report group, report name, variant to lauch with. Don't have system to specify the exact way of specifying, if you need I can provide on monday. You can take some existing COPA standard report and check from SE93.
    --Ram

  • Create transaction code for CJE0  report

    Dear friend:
        Who's know  how to create transaction code for CJE0  report.

    Hi,
    Alternatively, you can try adding anew entry to your menu area in development (SE43N), creating a subnode, selecting the report as your option and provide the information. Do not forget to give your own transaction name. I'm quite sure, that in this case (if you will transport this together with the report), it should work.
    Regards,
    Eli
    P.S. I know that program names changes when it's about a writer/painter report. Is it really the same thing with CJE0 reports?

  • How to assign transaction code to report group.

    hi experts,
      i used report painter to create some reports and assign these reports to a report group, i want to assign a transaction code to the report group, how can i do that? hunger for your adivces, thanks a lot!!

    Hi Liu,
    when you change an area menu, you can add transactions that launch ABAP/4 reports, Query lists or report writer's. You can use it for your purpose:
    1. Enter transaction SE43 and change a Z* area menu (no matter which one, you will not change it in the end)
    2. Click on "Add entry as subnode" or "Add entry at the same level" (no matter which one of them)
    3. When SAP shows the popup "Add new entries", click on "Add report"
    4. On the next popup, click on radio-button "Report Writer". Then you will be asked foe the code of the report group.
    5. Then save, and... that's it! SAP will automatically create a transaction for the report group
    6. Now you can cancel the changing of the area menu
    I hope this helps. Best regards,
    Alvaro

  • How to find Transaction code from Report/program name ?

    Dear all,
    How to find Transaction code if i know Report/program name ?

    Hi,
    In se 38 when u open ur program,in the application toolbar u have a button beside the where-used list button as display object list.on clicking this button,a window will be opened at the left most corner for repository browser,in this u can find any tranasctions,fileds,screens,dictionary structures defined for the program.
    if any transaction is created for the program u can find it under the transaction folder.
    revert back for further queries.
    Regards,
    Sravanthi

  • How to save the data of ABAP report into a notepad in desktop location???

    HI all,
    Can any one tell me how to transfer the data of ABAP report into a Notepad.
    Actually I have to schedule a ABAP report in background on daily basis and I want to transfer the
    whole record into Notepad.
    If any program is available for this..please clearify the relevent code for transferring.
    Thanks
    Rajeev

    declare a character type internal table.
    now move your data from it_data ( internal table with data ) into table itab.
    since you are running this report in background, you cannot save it to the desktop. Instead give any app server location
    data: itab(400) occurs 0 with header line.
    field-symbols: <fs1> type any.
    data: gv_file type rlgrap-filename default 'TEST.TXT'.
    data: gv_filepath type rlgrap-filename default <path>.
    LOOP AT it_data.
        DO 100 TIMES.
          ASSIGN COMPONENT sy-index OF STRUCTURE it_data TO <fs1>.
          IF sy-subrc = 0.
            CONCATENATE itab <fs1> INTO itab SEPARATED BY ' '.
          ELSE.
            EXIT.
          ENDIF.
        ENDDO.
        SHIFT itab LEFT DELETING LEADING ' '.
        APPEND itab.
        CLEAR itab.
      ENDLOOP.
      concatenate gv_filepath '/' gv_file into gv_file.
      OPEN DATASET gv_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc = 0.
        LOOP AT itab.
          TRANSFER itab TO gv_file.
        ENDLOOP.
        CLOSE DATASET gv_file.
      ENDIF.

  • Create a Transaction code for a Report

    Hi
    I have created a report through report painter. How can i create a transaction code for the report.
    Thanks
    J

    Hi,
    T.Code: SE93 - Maintain Transaction
    Transaction Code = Zxxxxxx
    Click on Create.
    Short Text = Name of Report
    Click on the radio button for 'Transaction with Parameters'
    Press Enter.
    Transaction = GR55
    Parameters Window...
    Screen Field : Screen field can be viewed in technical information screen of the report group to which report belongs for which t.code is to created.
    Value: Report Group
    Click on Save.
    Now you have a custom transaction for the report(s) in a report group.
    Hope this helps.
    Please assign points to say thanks.

  • How to create transaction code for a Z-table

    How to create transaction code for a Z-table?
    Se93 --> then which radio button to be selected? and what is the program nam e to  be given

    Hi Sam,
    <b>Procedure to create a TCODE for ZTABLE:</b>
    Create a table maintainance/View for the Z* Table.
    Once you create the view goto SE93>Select Parameter transaction and give the short desc.>
    Give the transaction as SM30(Skip the first screen-optional)>Check all check boxes under GUI support>In the default values(grid)section first row give the VIEWNAME as you created initially and the second row UPDATE as X.
    <u><i>Se93 --> then which radio button to be selected</i></u>
    Select the parameter transaction as a radio button.
    <u><i>what is the program nam e to be given</i></u>
    no need to give any program name. Instead you have to give the transaction code name as SM30.
    Pls mark the helpful answers.
    Thanks
    Eswar

  • How to create transaction code for maintenance view

    hai friends,
    i hope every thing goes good.
    i have doubt, how to create transaction code for maintenance view. I created view for tranperant table and now i want to create transaction code for the view.
    i tried and i donot know the screen number and program name and where can i give the view name.
    if any one know please post in details.
    thanks in advance.

    Hi Elam,
    You need to create a "Parameter Transaction".
    What this means is that you will have a transaction (let's call it "ZMAINT") which calls "SM30" and passes in your table name.
    Go to transaction SE93 and enter your new transaction code. Enter in the Tcode description and choose "Transaction with Parameters" (it shouldbe the last radio button).
    Enter in the default transaction "SM30" and tick the "Skip Initial Screen" check box. Hit Enter.
    Now scroll to the bottom of the screen and you will see a Table Control where you will need to enter in the values to the SM30 selection screen.
    Because you hit ENTER, the program will have loaded in the Selection Screen parameters into it's memory. Hit the drop down for "Name of Screen Field" and select "VIEWNAME" and then enter in your Z Table in the "Value" column.
    Now go to the next line and hit the drop down and select "UPDATE" in the "Name of Screen Field". Enter in a "X" in the value column.
    Now save the transaction and there you have it.
    Hope this helps.
    Cheers,
    Pat.
    PS. Kindly assign Reward Points to the posts you find helpful.

  • Transaction code for Depricitation Report

    Hi,
    we have asset accouting with WDV Method & maintaing our books as per F.Y. April to March
    But, due to foreign investor's investment, we have need to closed our books, twicely, i.e.  IFRS - F.Y.-Jan to Dec / ( US gap ) & Indian gap, FY. April to March.
    Currently, We are using, AR03 trasaction to view the Depriciation Report (Asset Register)
    My problem is, when we run the Deprication report for IFRS Books closing, we could't get report, properly, because of our F.Y. maintan April to March.
    in that case we have need to maintain Manually on XLS.
    Please tell me any transaction code for depriciation report for IFRS  Books closing as well as Indian Gap.
    Thanks
    Regards
    Jitendra

    dont you have an option in there to run based on your depreciation area? Select your depreciation area and the report date based on your fiscal year variant. Optionally, you can also try reports like S_ALR_87012006 - Ordinary Depreciation, and S_P99_41000192 - Posted depreciation by asset and posting period with depreciation area selection.

  • Creating transaction code for CJE0 reports

    Hi,
    Can anyone let me know a step by step precess for creating Transaction Code for CJE0 reports?
    Thanks in Advance.

    Hi,
    There's just one proper solution:
    Via trx SE43N. Steps:
    1. I suggest you choose area menu PS01
    2. Choose extend to create a new Z-folder (or select 'change' to add to an existing (standard SAP) folder)
    3. Create extension , ehancement ID: f.e.: ZPS01
    4. Select the new folder in the tree
    5. Click 5th button: 'add entry as a subnode'
    6. In pop-up 'Add new entries' click button 'Report'
    7. Select radio button at 'Drilldown'
    8. A pop up appears to select the application class
    9. I guess you'll no what to do from here... it speaks for itself.
    enjoy, Kind regards,
    Gerjan

Maybe you are looking for

  • Upgraded to iOS 5, now my iPad is stuck

    Another issue, one of many...I upgraded to iOS 5, can get past set up, can't get back to settings without going back to factory settings...recevied e-mails and verified all of those...following the prompts I was led to the point of "Find My iPad"...w

  • Two R/3 Systems on one Windows NT Server

    Hello SAP  Guru , I have ECC6 on database DB2 for Development server and quality server as different client . Now i want to install quality server on same H/W . i go through sdn forum and market place but not found sufficient information for DB2 data

  • Is there a way to rotate an extrnal image in the report builder?

    hello, my current format of this pictures is WMF.  i want rotate an image by a condtion, is it possible?

  • Flash Player won't work on my Mac

    It just happened last night when I tried to view a video and wouldn't let me because of a missing plug in. So I downloaded the lastest version of flash which was flash 10. Installed, but still won't load up videos. HELP!! I've uninstalled both Flash

  • Upgrade Photoshop CS3 to CS4: preparations?

    Hi, I just purchased Photoshop CS4 upgrade. I have CS3 installed. Do I have to uninstall Photoshop CS3 before I can install CS4 or can I just install CS4 over CS3? Since this is an upgrade version, does it require CS3 to be present? Thanks in advance