Delete Mode

Hi,
I would like to delete a single mode of any user/terminal (depending on the used tcode) after 5 min inactivity.
My coding works so far, but it closes the parent mode (where I run my abap-program), not the mode I what it to close (where the tcode runs).
I don´t want to kick off the user from the system.
Program RSM04000_ALV is the basis of my coding.
Has anybody an idea?
thanx
Sebastian
* get user list
CALL FUNCTION 'TH_USER_LIST'
  TABLES
    list = i_list.
* get detailed user-info of all transactions
LOOP AT i_list INTO w_list.
  REFRESH i_user_info.
  CALL FUNCTION 'TH_LONG_USR_INFO'
    EXPORTING
      user      = w_list-bname
    TABLES
      user_info = i_user_info.
  APPEND LINES OF i_user_info TO i_alluser_info.
ENDLOOP.
* check tcode
LOOP AT i_alluser_info INTO w_alluser_info
     WHERE tcode EQ 'SM04'.
  GET TIME.
* check time (5 Min)
  h_time_tcode =  w_alluser_info-time.
  h_time_tcode = h_time_tcode + ( 5 * 60 ).
  IF h_time_tcode LE sy-uzeit.
    mode = w_alluser_info-mode.
    CALL FUNCTION 'THUSRINFO'
      TABLES
        usr_tabl = usrtab.
    LOOP AT usrtab WHERE bname = w_alluser_info-user.
      opcode = 24. "Operation code value to delete a mode
* delete mode
      CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode
      ID 'TID' FIELD usrtab-tid
      ID 'MODES' FIELD mode.
    ENDLOOP.
  ENDIF.
ENDLOOP.

Hi,
In fact, in order to get the TID of the window that you want to close, you call the MF 'THUSRINFO' which only gives you ONE mode per user (I don't know why)...
But you can directly call ThUsrInfo (the system call and not the MF) with the appropriate OPCODE which will give you the whole TID on the current system. One such OPCODE is :
OPCODE_DETAILED_BLK_INFO LIKE TH_OPCODE VALUE 76
(you can get all OPCODE in the include TSKHINCL of the function group TSHK )
The code you have to put in your program is (instead of your call at the MF 'THUSRINFO') :
DATA : gt_all_screens TYPE TABLE OF ublksd.
CALL 'ThUsrInfo' ID 'OPCODE' FIELD gd_opcode_detailed_blk_info
                 ID 'TAB'    FIELD gt_all_screens.
The table gt_all_screens contains all screens with their TID : you just have to select the correct one in order to kill it...
Samuel

Similar Messages

  • File is not picking in delete mode.

    Hi All,
    I have created a file to BAPI scenario using content conversion parameters .
    my file is getting picked and successfull when i give processing mode to test and archive.
    It is failing if i give the processing mode to delete.
    Can you please suggest.
    Thanks in advance,
    Radhika.

    Hi Radhika,
    Please check the same Thread replies in the Morning which is raised By U
    File is not picking in delete mode.
    Regards
    Seshagiri

  • Unable to delete Mode

    I built several modes to test functionality out.  I then deleted them all except one.  I am unable to delete it or modify it.  I keep getting the message "Unable to delete Mode", or "Unable to Save mode. Please try again later".  But the changes do show up later.  Any thoughts?  I have tried over several days but to no avail.
    Solved!
    Go to Solution.

    I received a call from Verizon today stating that there had been an update made and for me to try and delete the modes.  If I can not then to power cycle the Gateway and try.  I did all that and was still not able to delete any of the Modes.  I called Verizon back and they are re-submitting the problem.  They show that I have received the latest update on my Gateway.  You might want to try and see if you can delete your modes.  I hope yours works.  I will repost when I get further information.

  • How to check if a view is in a edit/create/delete mode ?

    Hello Experts,
    I have a custom requirement where I have to check the mode of the view. I have some custom logic placed in ON_NEW_FOCUS event handler method of a context node class ZCL_CLASS00004U_CN02. Now I want to execute a piece of code only in the create/edit mode.
    Can someone pls help me how to achieve this ? Pls help me out I am new to Web UI.

    Hi,
    You have to create an attribute(in attributes tab) in your context node class like the following.
    OWNER     Instance Attribute     Public     Type Ref To     CL_BSP_WD_CONTROLLER
    In the create_(context_node) method of the context controller class CL_ ...... _ CTXT,
    Set view controller reference to your context node 
    context_node->owner = owner.
    Now in the ON_NEW_FOCUS method of the context node class, you can access the controller like this.
    DATA: lr_controller  TYPE REF TO (give view controller class name here).
    * Get view controller
      lr_controller ?= owner.
    * Determine collection that shall be displayed
      IF lr_controller->view_group_context IS NOT BOUND.
      ELSEIF lr_controller->view_group_context->is_view_in_display_mode( lr_controller ) = abap_true.
      ENDIF.
    Regards,
    Leon
    Edited by: Leon Limson on Feb 24, 2012 5:23 AM

  • Processing Mode = 'Delete'; Archive Faulty Source Files; Add Timestamp ?

    XI3.0 SPS 19
    For FTP Sender adapter, if Processing Mode is Delete, and you want to Archive Faulty Source Files with an added timestamp, it does not work (meaning it does not archive the faulty source file at all).
    Any suggestions?
    If I change the processing mode to Archive, it works. But my requirement is to archive only faulty files after adding timestamp and the source files should be deleted if processed.
    Thanks
    JB

    Hi james
    If you are using FCC or Modules then only Faulty files will be archived.
    The error that works with this should be a permanent error of file like field missing or compulsory field etc.
    if i understand correct you are trying to use Archive faulty messages in delete mode and you have FCC right ?
    I have also seen this behavior in delete mode it File adapter never archive. So it wont archive the faulty file as well.
    Thanks
    Gaurav

  • File Adapter gets error while deleting the file

    Hi,
    We are running on PI 7.0 SP6. I built a simple integration scenario where a file is picked up from a certain directory on the server (PI server itself) and get processed according to some mapping rules and again put to an other directory. I used the file adapter for picking and putting the file with 2 different communication channels.
    My integration works fine. File is picked up processed and put into its new location.
    But the file adapter cannot work in archiving or deletion mode. So the file (to be picked up by PI) remains in its original location.
    I am getting the following error:
    Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/File##com.sap.aii.adapter.file.File2XI.deleteFile(FileHandle)#J2EE_GUEST#0####18a971f3338011dbcde800145e69a8d4#XI AF File2XI[:EBI:File_from_EBI_to_EXS]##0#0#Error#1#com.sap.aii.adapter.file.File2XI#Java###Deleting of file failed - cannot proceed#1#E:
    SCENARIOS
    EBITOEXS
    RFID
    GELEN
    tagdata22082006035719.xml#
    #1.5#00145E69A8D4005B0000004700000A6400041BC49A1D56D3#1156431120046#/Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/File##com.sap.aii.adapter.file.File2XI.processFileList()#J2EE_GUEST#0####18a971f3338011dbcde800145e69a8d4#XI AF File2XI[:EBI:File_from_EBI_to_EXS]##0#0#Error#1#com.sap.aii.adapter.file.File2XI#Plain###File 'E:
    SCENARIOS
    EBITOEXS
    RFID
    GELEN
    tagdata22082006035719.xml' - deleting after processing failed - retry#
    I tried everything but upgrading to a higher SP level and will do so unless anyone has an other suggestion.
    Thanks a lot,
    Murat Gölcü
    [email protected]

    Hi,
    These are a few things you can do:
    Check the permissions of the folder where the file is being Placed. (it will mostly have only read permission, this is what i could understand from your explanation)
    If you are doing Content conversion, please can you just remove it and see if the XML file is getting generated.
    Also, please check if it's picked up by any other application when you place it on the server.
    Regards,
    Abhy

  • Deleting partner records from CRM order.

    Hi Experts ,
    I have a requirement where I need to delete partner record from order. For that I am using the function module 'CRM_ORDER_MAINTAIN' . This is the code that I am using but  I  am  unable  to  delete the record.
    REPORT  ZSDTESTORDER5.
    parameters: guid1 type crmd_orderadm_h-guid.
    data: guid2(32) type c.
    data: ls_new_partners type CRMT_PARTNER_COM.
    data: lt_new_partners type CRMT_PARTNER_COMT.
    data: guid type COMT_PARTNERSET_GUID.
    data: ls_input_fields type CRMT_INPUT_FIELD.
    data: lt_input_fields type CRMT_INPUT_FIELD_TAB.
    data: ls_logical_key type CRMT_LOGICAL_KEY.
    data: ls_input_field_name type CRMT_INPUT_FIELD_NAMES.
    data: IT_OBJECTS_TO_SAVE type CRMT_OBJECT_GUID_TAB.
    data: ET_OBJECTS_NOT_SAVED type CRMT_OBJECT_GUID_TAB.
    data: ET_OBJECTS_NOT_SAVED_WA type CRMT_OBJECT_GUID.
    data: IT_OBJECTS_TO_SAVE_WA type CRMT_OBJECT_GUID.
    data: txt1(42) type c.
    move guid1 to guid.
    CLEAR ls_new_partners.
    guid2 = guid1.
    ls_new_partners-ref_guid = guid.
    ls_new_partners-ref_kind = 'A'. "A
    ls_new_partners-kind_of_entry = 'C'.
    ls_new_partners-ref_partner_handle = '0000'.
    ls_new_partners-partner_fct = '00000004'.
    ls_new_partners-ref_partner_fct = '00000004'.
    ls_new_partners-partner_no  = '9000000112'.
    ls_new_partners-ref_partner_no  = '9000000112'.
    ls_new_partners-display_type = 'BP'.
    ls_new_partners-ref_display_type = 'BP'.
    ls_new_partners-no_type = 'BP'.
    ls_new_partners-MAINPARTNER =''.
    ls_new_partners-REF_HANDLE = '0000000000'.
    INSERT ls_new_partners INTO TABLE lt_new_partners.
    CLEAR ls_input_fields.
    REFRESH ls_input_fields-field_names.
    ls_input_fields-ref_guid  = ls_new_partners-ref_guid.
    ls_input_fields-ref_kind = ls_new_partners-ref_kind. "A
    ls_input_fields-objectname = 'PARTNER'.
    ls_input_fields-ref_handle = '0000000000'.
    "move ls_new_partners to ls_logical_key.
    "concatenate guid2 ls_new_partners-ref_kind ls_new_partners-kind_of_entry ls_new_partners-ref_partner_handle ls_new_partners-partner_fct ls_new_partners-partner_no ls_new_partners-display_type ls_new_partners-no_type into ls_logical_key.
    "concatenate '0000' '00000004' '9000000111' into txt1.
    "write  'BPBP' to txt1+0(28) .
    "txt1 = '0000000000049000000111      BPBP          '.
    ls_input_fields-logical_key =  '0000000000049000000112    BPBP           ' ."  '0000'  ls_logical_key.
    write:/ ls_input_fields-logical_key.
    ls_input_field_name-fieldname = 'PARTNER_FCT'.
    "ls_input_field_name-changeable = 'X'.
    INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
    ls_input_field_name-fieldname = 'NO_TYPE'.
    INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
    ls_input_field_name-fieldname = 'DISPLAY_TYPE'.
    INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
    ls_input_field_name-fieldname = 'PARTNER_NO'.
    INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
    ls_input_field_name-fieldname = 'KIND_OF_ENTRY'.
    INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    "ENDLOOP.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
      it_partner        = lt_new_partners
    CHANGING
      ct_input_fields   = lt_input_fields
    EXCEPTIONS
      error_occurred    = 1
      document_locked   = 2
      no_change_allowed = 3
      no_authority      = 4
      OTHERS            = 5.
    "CALL FUNCTION 'CRM_ORDER_INITIALIZE'
    EXPORTING
      IT_GUIDS_TO_INIT                 =
      IV_INITIALIZE_WHOLE_BUFFER       =
      IV_INIT_FRAME_LOG                =
      IV_LOG_HANDLE                    =
      IV_KEEP_LOCK                     = FALSE
    EXCEPTIONS
      ERROR_OCCURRED                   = 1
      OTHERS                           = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    commit work.
    IT_OBJECTS_TO_SAVE_WA = guid.
    append IT_OBJECTS_TO_SAVE_WA to   IT_OBJECTS_TO_SAVE.
    CALL FUNCTION 'CRM_ORDER_SAVE'
       EXPORTING
         IT_OBJECTS_TO_SAVE         = IT_OBJECTS_TO_SAVE
       IV_UPDATE_TASK_LOCAL       = FALSE
       IV_SAVE_FRAME_LOG          = FALSE
       IV_NO_BDOC_SEND            = FALSE
      IMPORTING
       ET_SAVED_OBJECTS           = ET_SAVED_OBJECTS
       ET_EXCEPTION               =
        ET_OBJECTS_NOT_SAVED       = ET_OBJECTS_NOT_SAVED
    CHANGING
       CV_LOG_HANDLE              =
    EXCEPTIONS
       DOCUMENT_NOT_SAVED         = 1
       OTHERS                     = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    commit work.
    *loop at ET_OBJECTS_NOT_SAVED into ET_OBJECTS_NOT_SAVED_WA.
    write:/ ET_OBJECTS_NOT_SAVED_WA.
    *endloop.
    Through this code I  want  to  delete the  partner  number  '9000000112' for the partner function  '00000004'.
    But  this is not  coming. Please tell me if I  am  missing  out  something . This is  very urgent.
    Thanks & Regards,
    Samrat Dutta

    Hi Samrat Dutta,
              Looks like this FM can not be used to delete partner functions. Generally other parameter structures like appointment etc will have one field called MODE, there we give whether it is creation,change or delete mode. unfortunately for partner parameter structre CRMT_PARTNER_COM does not have MODE field in it to identify whether we are creating,chaging or deleting. i would recommond you try to find out some other FM to delete partners of Order. will let you know if i get come clue on this
    Siva

  • Deleting OIM User completely

    Hi all
    I have tried deleting an OIM User.But I still see it when I search for the deleted User in a deleted mode(with status set to delete).
    How do I delete the User completely from OIM ?
    Thank you
    Regards

    The property which allows you to reuse OIM logins is XL.UserIDReuse. You can change it in the Design Console's System Configuration form.
    You have to advice your client this is also not recommended at all. OIM won't be able to distinguish about newer and older "versions" of that login in Reports generations, neither in audit issues.
    So if you run a report which shows logins or filters results by login, it will show you all records based on the provided login String value. This is common in historical reports, which shows resources from both deleted and active users.
    A common scenario where you'll need this functionality is when a users leaves the company, and for any reason comes back to the organization a time after. If this is happens in your client's system, I would recommend not to delete users, but leave them deactivated, with all its resources revoked.
    Hope it helps

  • File Adapter archiving mode....

    Putting message into send queue failed, due to: com.sap.aii.af.ra.ms.api.DuplicateMessageException: Message ID a7cbcf00-4e00-11db-bd7f-0018717400ed(OUTBOUND) already exists in database: com.sap.sql.DuplicateKeyException: ORA-00001: unique constraint (SAPSR3DB.SYS_C00135467) violated.
    2006-09-27 17:17:47 Error Returning to application. Exception: com.sap.aii.af.ra.ms.api.DuplicateMessageException: Message ID a7cbcf00-4e00-11db-bd7f-0018717400ed(OUTBOUND) already exists in database: com.sap.sql.DuplicateKeyException: ORA-00001: unique constraint (SAPSR3DB.SYS_C00135467) violated
    2006-09-27 17:17:47 Error Attempt to archive file "D:\SSNEDI\test\in\queue\20060926070906359.txt" after processing failed. Retry
    source directory : D:\SSNEDI\test\in\queue
    target directory : D:\SSNEDI\test\in\queue\FB
    But, source directory not deleted 20060926070906359.txt.
    Target directory exist file too.
    what's the matter?

    Hi Kim,
    If it is in test mode,the file wont get deleted in your source direcory.  So the adpater will keep polling the file and the server will be flooded with messages.  If it is in the delete mode file will be deleted,archive mode it will be moved in to the archived directory but in the test mode file will not be deleted from your source directory and will be polled continously by the adapter.
    Also go thro' this link:-
    Re: Archiving ftp files
    Hope this provides a solution.
    Regards.
    Praveen

  • How can I delete a page I've entered into a Dashboard Window

    How can I delete a page I've entered into a Dashboard Window?

    If by "page" you mean a Dashboard Widget, then it's simple:
    Open Dashboard (F4 on my keyboard) and in the lower left corner you'll see a cross in a circle. Clicking it enables add/delete mode and all possible adds show up at the bottom of the screen while all currently added Widgets stay where they are but get an X in a circle attached to them. Clicking on the X deletes the Widget.
    hope this helps

  • Delete Employee Records in Infotype 14

    Hi all,
    Is there any standard program that will delete records from infotype 14... Thanks a lot

    Hi Jim
    I do not know any programs for this but you can write your own utilizing the FM 'HR_INFOTYPE_OPERATION' with delete mode. For more details about the FM you can refer to Re: HR: creating IT "0015 - Additional Payments" item

  • Deleting Application Instance Form OIM 11gR2

    Hi Experts,
    I deleted an application instance from sysadmin console and ran "Application Instance Post Delete" job on "Delete" mode.
    I noticed that application instance got completely removed but, When I tried to add a new form in that App Instance, i could still see older Form in the drop down list.
    Is there a way to delete those forms seperately?
    thanks

    Thanks NN, I did not check after removing from sandbox earlier, the form still shows up in the dropdown.. Is there some table or lookup from where we need to remove some enteris?
    thanks

  • Cancel or delete "Add Data Point" entry

    I was trying to see what my milage was for yesterday and hit the add data point button and made an entry hoping that it would show my milage walked from yesterday which was 6.92 but instead it added that to my milage walked today doubling my total to 13.4 mi when I really only walked 6.91 mi. How can I subtract it back down to my original milage for today.
    On another note I noticed a window on the health app home page that shows the route walked. How do I access that?

    Hello Sreedhar,
    in general you can delete opportunities in rel 4.0. There are a few checks that could forbid it - f.e. follow up documents or status won. You should also check if you have order_save badi active. Usually you need no checks in delete mode.
    I hope that helps.
    Best regards
    Marion

  • Selective deletion and plan data

    Hello Gurus,
    I am having some doubts
    Any one of  them,could you please  clarify my doubts.
    1.By using the selective deletion (for Infocube),I have deleted some records.
    when i checked it on the log,In Deletion mode its showing the different values such as D,N and R....
    When I deleted the records,it has created 2 requests in log .
    onething its showing the status as 'N' and another thing as 'R'
    What is this mean.why its differing by requests.
    2.Reg plan data,How we are getting this plan data.(I know,based on actual data we are creating),But what is the procedure,how and  where we are creating this plan data like R/3 or BW.
    Will assign points.
    Thanks in advance
    Brgds
    Kumar

    Hi,
    As far as plan data is concern, there would be various plan data requirements for an org. let's say 'sales budget' / 'Production Planning' / 'Procurement plan' /
    'inventory status'..and so on so forth..
    basically when ever there is plan data requirement normaly the concern department has to prepare the paln data for the quater/Half/fiscal year, on either
    a legacy system or R/3 system..
    If it is from R/3 you are suppose to create a DS and then an infosource and so on..
    If it is a Legacy system - then go for the File Upload, after making your flat file
    infosource.
    Hope this helps..
    assign points if useful..
    cheers,
    Pattan.

  • Deleting unused master data

    Hi All,
    We want to delete unused master data. In our case, we need to delete material numbers from infoobject ZVD_MAT that is no longer used.
    There is standard SAP program RSDMD_DEL_BACKGROUND to perform this activity.
    But the problem is there is huge amount of data in ZVD_MAT and the above program will not give us any information of the material numbers that are deleted.
    By using this program, it might happen that new material numbers which are required are deleted. In this case, it will be difficult to refresh ZVD_MAT for those new material numbers.
    Can anyone suggest if there is any other way or programs/transactions to check the deleted materials?

    Hi,
    Try using the program
    RSDMDD_DELETE_BATCH
    Selective Deletion Using the Report
           1.      Enter report RSDMDD_DELETE_BATCH in ABAP Editor (transaction SE38) and create a variant for it.
           2.      Execute the variant.
           3.      Enter the InfoObject whose master data you want to delete.
           4.      In Filter Data, you can specify which data you want to delete.
           5.      You can specify a deletion mode for the data (parameter P_SMODE).
    More information: Deleting Attributes and Texts for a Characteristic
           6.      You can simulate the report before running it (parameter P_SIMUL).
           7.      You can schedule the report in the background. If you want to clear up your master data at regular intervals, you can also integrate the report into a process chain using process type ABAP Program
    or you can use function module as well
    Check if the function module RSDMD_DEL_MASTER_DATA
    Couple of import parameters:
    I_IOBJNM -
    Give info object name
    I_T_CHAVL---Characteristic values
    I_FLG_FORCE_DELETE-- to force delete
    Use I_FLG_SIMULATION to simulate first and then delete
    Thanks and regards
    Kiran

Maybe you are looking for

  • I have to WIPE iPod every time I add music to iTunes!

    Hi. I seem to have everyone's problem at once. I've just upgraded to an 80Gb Video iPod after filling up my old 20Gb click-wheel model, which still works as wonderfully as the day I bought it over 4 years ago. My new model is, however, driving me cra

  • Problem with  Windows Vista and Ipod!!!!

    I tried a couple of times to import my music from my computer and cds to my ipod nano . The thing is that I know I have transfered some songs and photos properly cause I can see the files are in the ipod memory but as soon as I unplug it from the USB

  • Timer shows incorrect hours on lock screen in iOS 7.0.4 (11B554a)

    Majority of time, I only use timer to count down for 30 min or 45 min so I did not notice the problem. However, when it came to 1 hour and 30 min, it displayed as 23:30:00 in the lock screen. Therefore I came back and checked again to make sure i did

  • Need Siebel ThinClient Settings

    Hi Everyone, I have installed the Siebel 8.0 Enterprise server,Gateway server,Siebel server,Siebel Thick client and Tools. I want to launch the Thin client.I am looking into it's settings in eapps.cfg and Siebel server\bin\enu\siebel.cfg. But i am no

  • Javax.ejb.EJBException; Local class not compatible ???????

    Hi, Can you any one help me to resolve this exception below. The conext is I have successfully deplyed a bean and when i call the bean remot method I am getting the following exception. Can you any one help me in what situations we will get this type