Deleteing Session through ABAP Program

Hi,
I want to delete a session through a custom Program.
Can anybody help me on how can I do it through An abap program.
I want to get the same functionality which we do through
SM04 and not SM12.
for. eg. I want  that program should take the userid and
and find how many sessions are open for him and delete the required session.
Please help.
Thanks
GT

You can do this like this :
call function 'TH_DELETE_USER'
        exporting client = client
                  user   = user
                  tid    = tid
                  only_pooled_user = only_pooled_user

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 Patil

    Hi 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.

  • 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.
    Hemlata

    Hi 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 PM

    Have a look at F1 help on SELECTION-SCREEN. There should be an example as well.

  • SMS through ABAP Program

    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.
    Abdullah

    Hi...
    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...

  • 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,
    Ravi

    report 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.

  • Parallel Processing through ABAP program

    Hi,
    We are trying to do the parallel processing through ABAP. As per SAP documentation we are using the CALL FUNCTION STARTING NEW TASK DESTINATION.
    We have one Z function Module and as per SAP we are making this Function module (FM)as Remote -enabled module.
    In this FM we would like to process data which we get it from internal table and would like to send back the processed data(through internal table) to the main program where we are using CALL FUNCTION STARTING NEW TASK DESTINATION.
    Please suggest how to achieve this.
    We tried out EXPORT -IMPORT option meaning we used EXPORT internal table in the FM with some memory ID and in the main program using IMPORT internal table with the same memory ID.  But this option is not working even though ID and name of the internal table is not working.
    Also, SAP documentation says that we can use RECEIVE RESULTS FROM FUNCTION 'RFC_SYSTEM_INFO'
    IMPORTING RFCSI_EXPORT = INFO in conjunction with CALL FUNCTION STARTING NEW TASK DESTINATION. Documentation also specifies that "RECEIVE is needed to gather IMPORTING and TABLE returns of an asynchronously executed RFC Function module". But while creating the FM remote-enabled we cant have EXPORT or IMPORT parameters.
    Please help !
    Thanks in advance
    Santosh

    <i>We tried out EXPORT -IMPORT option meaning we used EXPORT internal table in the FM with some memory ID and in the main program using IMPORT internal table with the same memory ID. But this option is not working even though ID and name of the internal table is not working</i>
    I think that this is not working because that memory does not work across sessions/tasks.  I think that the
    IMPORT FROM SHARED BUFFER and EXPORT TO SHARED BUFFER would work.  I have used these in the past and it works pretty good.
    Also,
    here is a quick sample of the "new task" and "recieve" functionality.   You can not specify the importing parameters when call the FM.  You specify them at the recieving end.
    report zrich_0001 .
    data: session(1) type c.
    data: ccdetail type bapi0002_2.
    start-of-selection.
    * Call the transaction in another session...control will be stop
    * in calling program and will wait for response from other session
      call function 'BAPI_COMPANYCODE_GETDETAIL'
               starting new task 'TEST' destination 'NONE'
                   performing set_session_done on end of task
        exporting
          companycodeid             = '0010'
    * IMPORTING
    *   COMPANYCODE_DETAIL        = ccdetails
    *   COMPANYCODE_ADDRESS       =
    *   RETURN                    =
    * wait here till the other session is done
      wait until session = 'X'.
      write:/ ccdetail.
    *       FORM SET_session_DONE
    form set_session_done using taskname.
    * Receive results into messtab from function.......
    * this will also close the session
      receive results from function 'BAPI_COMPANYCODE_GETDETAIL'
        importing
           companycode_detail        = ccdetail.
    * Set session as done.
      session = 'X'.
    endform.
    Hope this helps.
    Rich Heilman

  • Close session in ABAP Program Control

    Hi all,
    To avoid the users can run some transactions during the batch window, we have developed an ABAP program to lock these transactions before the start of batch period in background mode. After batch window we unlock it.
    The problem is that the users that are in transactions before the lock process is execute, can use use without problem. Therefore we need to close all sessions that are in these transactions  in background mode near the lock proccess.
    Any idea?
    Thanks a lot.

    Hi Thomas,
    I guess what you call foreign modes are the external modes.
    I don't know for ThUsrInfo, but there's a workaround : It's possible to do a batch input on SM04 and you are able to select the line(s) you want by adding a little trick to determine which external sessions run which transaction codes :
    1) duplicate dynpro rsm04000_alv 2000 (the one which displays the external modes) into a Z dynpro, and inside the PBO step loop, save MODUS table work area (that you declare with TABLES), it contains first 36 characters of transaction code texts (as what you see with SM04).
    2) fill out "TID" SET/GET parameter with the "Terminal ID" corresponding to the user session (you get it from the additional fields in the SM04 list of user sessions).
    3) call the screen a first time with SUPPRESS DIALOG so that to determine which line(s) correspond to which transaction codes
    4) call the screen in batch input mode without SUPPRESS DIALOG and with a SET CURSOR with the line determined previously and delete the mode
    Note that you have to create 2 programs (one which prepares the BDC data, the other which calls the screen) and a dummy transaction (for the batch input, so that to call the second program) so that everything works.
    Sandra

  • Parking Document  Through ABAP Program

    Dear Experts,
    I need to Park the Account Documents Using ABAP program,
    Please Suggest Any FM or Any Example.
    please suggest how to use RFBIBL00 program in my abap program. or if any other better way to post document using custom program.
    Sincerely

    Answered through sdn forums.

  • How to trigger GP workflow through ABAP Program.

    Hi All.
    i have one scnerio , i want to create BOM through Custom Ztransaction that will be developed in ABAP Modulepool.
    User will create BOM  from this ztransaction through  Transactional Iview in PORTAL,Once the user save transaction , i want to trigger a GP(Guided Procedure ) workflow,from ABAP Program.
    is it possible to trigger GP workflow?
    if yes how  to  do it , please suggest the way out.
    Regards,
    Shyam.

    Hi lingana,
    As u see in my requriment that, Workflow is not designed within SAP , But the Workflow will be designing
    in SAP Netweaver, its a GP Workflow. And Ztransaction(Developed by ABAP) will  be seen by user through portal  and
    he save transaction on PORTAL, In backend  ABAP program will run , and after meeting certain condition, it should create
    or(Initiate) GP workflow(process).
    So my question is , how ABAP Program will call GP workflow, How the connection will be made in between ABAP Code and GP workflow framework.
    If any doubt regarding requriment let me know,
    Regards,
    Shyam.

  • Server name message when triggering process chain through ABAP PROGRAM

    Hi all,
    When I am trying to execute one process chain with variant as a APD ( In this APD data is getting loaded form one Query to Transactional ODS.) This process chainis being executing through one ABAP program using the following code
    CALL FUNCTION 'RSPC_API_CHAIN_SCHEDULE'
         EXPORTING
           I_CHAIN      =  'XYZ'. ( Dummy Process chain name)
    While executing this program I am getting following message :
    You can specify the name of the application server here
    on which all jobs in the chain are scheduled
    If you do not specify a name, the jobs from batch
    management are divided between the available servers
    How to avoid this message.
    Can we write any code in the above program to assign any fixed server name so that it will not ask for any server name.
    Your help is much appreciated.
    Thanks,
    Uday.

    Hi Shanthi,
    How to write exception handling for this.
    Quick reply is nedeed.
    Thanks,
    Uday.

  • How to Trigger a Process Chain through ABAP Program

    Hi
    I have a Requirement to trigger a process Chain on 1st, 2nd and 3rd day of the month for 2 times in a Day.
    Can any one give me any idea, how i can do it by writing a ABAP program and triggering the Process chain.
    If anyone can share the Logic for ABAP program means, that will be helpful for me, as i dont have much expertise on writing ABAP program.
    Regards,
    Muruganand.K

    Hi,
    you can achieve this in a following way.
    DATA : v_date type sy-datum,
    v_day(2) type c.
    v_date = sy-datum.
    v_day = v_date6(2).+
    if v_day = '01' or
       v_day = '02" or
       v_day = '03".
    CALL FUNCTION RSPC_API_CHAIN_START.
    pass the name of the chain to this function module.
    hope this wil help.

  • Can we run a java class in a external server through abap program?

    Dear Experts,
    Can we run a java class in an external server ( other than application server and client system )?
    I have tried running it in the client system through a program and it works.
    But i have the requirement of running it in another system. Can it be done?

    Hi,
    If this is the case I think you can call this web service from SAP and triger the execution of the application on the "external server".
    SAP is behaving as a client in this case.
    Another alternative:
    "have tried running it in the client system through a program and it works." please elaborate.
    Regards.

  • How to catch errors watched in sxmb_moni through abap program??

    Dear Gents,
    I have one scenario which is proxy -> xi -> jdbc. Scenario works fine when every thing is good, but if there are any errors in XI usually we catch the exception after calling the proxy as :
    TRY.
        CALL METHOD cl_rfq_sapin->mios_rfq_sapin
          EXPORTING
            output = output
          IMPORTING
            input  = input.
        COMMIT WORK.
      CATCH cx_ai_system_fault INTO cl_system_fault .
        gv_system_fault = 'X'.
      CATCH cx_ai_application_fault INTO cl_application_fault.
        gv_application_fault = 'X'.
    ENDTRY.
    But by this code we are able to know whether it is system error or application error. But we cant get actual error. To see the actual error we need to go to SXMB_MONI in XI. The some sample error in sxmb_moni is as follows :
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIAdapterFramework</SAP:Category>
      <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Error when attempting to get processing resources: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: DriverManagerException: Cannot establish connection to URL 'jdbc:microsoft:sqlserver://10.56.5.79:1433;databaseName=SXD': SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]The requested instance is either invalid or not running.</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    So is there any way we can catch the above error in the abap program ??
    Your responeses were highly appreciated.
    Regards,
    Santhosh

    hi,
    did you try using acknowledgments?
    http://help.sap.com/saphelp_nwpi71/helpdata/en/f4/8620c6b58c422c960c53f3ed71b432/content.htm
    (code at the bottom of this page)
    Regards,
    Michal Krawczyk

Maybe you are looking for

  • Toshiba Satellite L675D-S7104 wont start up

    Looking for help! I was having problems with IE not responding so decided to upgrade to internet explorer 9 during process I needed to know if I had a 64 or 32 bit. So I minimized to check on my start menu and all my icons were gone. After pulling up

  • OBIEE 11g (11.1.1.5.0) - Issue with starting Node Manager

    Hi, Have anyone faced an issue with starting Node Manager in OBIEE 11g (11.1.1.5.0)? OS is 64 bit Linux, WebLogic is 10.3.5. I used the software-install method and followed by running config.sh. Everything completed successfully. I updated the catalo

  • Need help with class info and cannot find symbol error.

    I having problems with a cannot find symbol error. I cant seem to figure it out. I have about 12 of them in a program I am trying to do. I was wondering if anyone could help me out? Here is some code I am working on: // This will test the invoice cla

  • Get total from string valve

    hi , I have some like String quesFour=req.getParameter("quesFour"); String quesFive=req.getParameter("quesFive"); String quesSix=req.getParameter("quesSix"); String quesSeven=req.getParameter("quesSeven"); String quesEight=req.getParameter("quesEight

  • Displaying 'Date & Time' Column

    Hi there, I did do some searching/ reading prior to posting this, but haven't found what I'm looking for... I want to copy/ paste all my texts from my Nokia 6288 to my pc... -this works no hassle, I simply use the Nokia Phone Browser to load all my '