Standard ABAP functions for creating events?

Hi,
I'm a little bit confused which ABAP functions to use for creating academic events with schedules (e.g. lecture takes places each Friday at 4 pm), rooms and instructors attached.
Data transfer documentation SAP team recently released ("SLCM Data Transfer" archive, "Intro" document, page 18) suggests <b>HRIQ_CREATE_EVENT</b> as a solution. However, after experimenting for a while, I noticed a note attached to this function that "DO NOT USE ANYMORE, USE <b>HRIQ_EVENT_CREATE</b>".
So which one is the correct/recommended one? Also, if possible, I would prefer an RFC-enabled one.
Thanks
Janek

Hi Janek,
We've created a custom RFC enabled function module to wrap the SAP function module HRIQ_CREATE_EVENT in.  We are on a 4.7 system.  Here is our code.  Hope it helps.
FUNCTION zcep_event_create .
*"*"Local interface:
*"  IMPORTING
*"     VALUE(VTASK) TYPE  HRRHAP-VTASK DEFAULT 'V'
*"     VALUE(EVENTPACKAGEID) TYPE  HROBJID
*"     VALUE(ACAD_YEAR) TYPE  PIQPERYR
*"     VALUE(ACAD_SESSION) TYPE  PIQPERID
*"  TABLES
*"      MEETING_PATTERN STRUCTURE  ZCEP_MEETINGPATTERN
*"      EVENT STRUCTURE  ZCEP_EVENT
*"      RETURN STRUCTURE  BAPIRET2
  DATA: is_schedule TYPE bapisched,
        schedule TYPE bapisched OCCURS 0 WITH HEADER LINE,
        capacity LIKE hri1024,
        wa_capacity LIKE hri1024 OCCURS 0 WITH HEADER LINE,
        location LIKE bapilocdat-locid OCCURS 0,
        new_event_package LIKE p1000 OCCURS 0 WITH HEADER LINE,
        objid  LIKE hrrootob OCCURS 0 WITH HEADER LINE,
        parent LIKE hrhctobjc OCCURS 0 WITH HEADER LINE,
        eventid TYPE hrobjid,
        event_id_out LIKE bapievdat-eveid,
        lt_1739 TYPE TABLE OF p1739,
        ls_1739 TYPE p1739,
        ls_error_record TYPE bapiret2,
        ls_nnnn TYPE wplog,
        open_resources_exits TYPE xfeld.
  DATA:  it_1035 TYPE piq_p1035_t,
         it_pt_1035t TYPE piq_hrt1035_t,
         it_daysoff TYPE piq_pt1035_t,
         it_daysfree TYPE piq_pt1035_t,
         ls_daysfree TYPE pt1035,
         ls_1035t TYPE hrt1035.
  DATA: it_bapiresou TYPE TABLE OF bapiresou,
        is_bapiresou TYPE bapiresou,
        resources TYPE bapiresou OCCURS 0.
  DATA: it_pa0002 TYPE TABLE OF pa0002,
        is_pa0002 TYPE pa0002,
        it_hrp1000 TYPE TABLE OF hrp1000,
        is_hrp1000 TYPE hrp1000,
        lv_dayoff(1),
        bp(12),
        im_begda LIKE sy-datum,
        im_endda LIKE sy-datum,
        sobid LIKE hrp1001-sobid,
        event_counted_dates TYPE dayct,
        event_counted_hours TYPE hrsct,
        ndays TYPE p1035-ndays,
        nhours TYPE p1035-nhours.
  FIELD-SYMBOLS: <ls_1035t> LIKE LINE OF it_pt_1035t.
  CLEAR gt_error_record[].
  SORT event BY short.
  SORT meeting_pattern BY eventname.
*************************  Get Calender Date  *************************
  SELECT SINGLE begda endda FROM hrt1750 INTO (im_begda,im_endda)
          WHERE peryr = acad_year
            AND perid = acad_session
            AND timelimit = '0100'.
***************************  Create Event  ****************************
  LOOP AT event.
    CLEAR resources.
    LOOP AT meeting_pattern WHERE eventname = event-short.
*********************  Create Schedule for Event  *********************
      CALL FUNCTION 'HRIQ_EVENT_SCHEDULE_BUILD'
        EXPORTING
          plvar                = '01'
          istat                = '1'
          event_begda          = event-begda
          event_endda          = event-endda
          monday               = meeting_pattern-monday
          tuesday              = meeting_pattern-tuesday
          wednesday            = meeting_pattern-wednesday
          thursday             = meeting_pattern-thursday
          friday               = meeting_pattern-friday
          saturday             = meeting_pattern-saturday
          sunday               = meeting_pattern-sunday
          event_beguz          = meeting_pattern-start_time
          event_enduz          = meeting_pattern-end_time
          frequency            = '1'
          event_location       = meeting_pattern-location
        IMPORTING
          pt_1035              = it_1035
          pt_1035t             = it_pt_1035t
          pt_daysoff           = it_daysoff
          pt_daysfree          = it_daysfree
        EXCEPTIONS
          no_date_number       = 1
          frequency_is_initial = 2
          OTHERS               = 3.
      LOOP AT it_daysfree INTO ls_daysfree.
        CALL FUNCTION 'HRIQ_CHECK_MODULOFFER_DAYSOFF'
          EXPORTING
            iv_date             = ls_daysfree-evdat
          IMPORTING
            ev_dayoff           = lv_dayoff
          EXCEPTIONS
            otype_not_supported = 0
            OTHERS              = 0.
        IF lv_dayoff = space.
          MOVE-CORRESPONDING ls_daysfree TO ls_1035t.
          APPEND ls_1035t TO it_pt_1035t.
        ENDIF.
      ENDLOOP.
* no double entries
      SORT it_pt_1035t.
      DELETE ADJACENT DUPLICATES FROM it_pt_1035t.
      DESCRIBE TABLE it_pt_1035t LINES event_counted_dates.
      CLEAR event_counted_hours.
      LOOP AT it_pt_1035t INTO ls_1035t.
        nhours = ( ls_1035t-enduz - ls_1035t-beguz ) / 3600.
        event_counted_hours = event_counted_hours + nhours.
        ADD 1 TO ndays.
      ENDLOOP.
      LOOP AT it_pt_1035t ASSIGNING <ls_1035t>.
        MOVE-CORRESPONDING <ls_1035t> TO schedule.
        APPEND schedule.
      ENDLOOP.
*Room
      IF NOT meeting_pattern-room IS INITIAL.
        SELECT SINGLE short stext FROM hrp1000
                 INTO (is_hrp1000-short,is_hrp1000-stext)
                WHERE plvar = '01'
                  AND istat = '1'
                  AND otype = 'G'
                  AND objid = meeting_pattern-room
                  AND begda LE sy-datum
                  AND endda GE sy-datum.
        SELECT SINGLE sobid FROM hrp1001 INTO sobid
                WHERE otype = 'G'
                  AND plvar = '01'
                  AND istat = '1'
                  AND relat = '020'
                  AND rsign = 'A'
                  AND sclas = 'R'
                  AND objid = meeting_pattern-room
                  AND begda LE im_endda
                  AND endda GE im_begda.
        IF sy-subrc = 0.
          is_bapiresou-retid = sobid(8).
        ENDIF.
        LOOP AT it_pt_1035t ASSIGNING <ls_1035t>.
          is_bapiresou-resht = is_hrp1000-short.
          is_bapiresou-resxt = is_hrp1000-stext.
          is_bapiresou-resbg = <ls_1035t>-evdat.
          is_bapiresou-resed = <ls_1035t>-evdat.
          is_bapiresou-beguz = meeting_pattern-start_time.
          is_bapiresou-enduz = meeting_pattern-end_time.
          is_bapiresou-resid = meeting_pattern-room.
          is_bapiresou-restp = 'G'.
          APPEND is_bapiresou TO resources.
        ENDLOOP.
      ENDIF.
* Instructor
      IF NOT meeting_pattern-instructor IS INITIAL.
        SELECT SINGLE nachn vorna FROM pa0002
                 INTO (is_pa0002-nachn, is_pa0002-vorna)
                WHERE pernr = meeting_pattern-instructor
                  AND begda LE im_endda
                  AND endda GE im_begda.
**************************  Meeting Pattern  **************************
        SELECT SINGLE objid INTO is_bapiresou-retid FROM hrp1000
                WHERE plvar = '01'
                  AND langu = 'E'
                  AND otype = 'R'
                  AND mc_short = 'INST-CM'
                  AND begda LE im_endda
                  AND endda GE im_begda.
        LOOP AT it_pt_1035t ASSIGNING <ls_1035t>.
          is_bapiresou-resht = is_pa0002-nachn.
          CONCATENATE is_pa0002-vorna is_pa0002-nachn
                 INTO is_bapiresou-resxt
            SEPARATED BY space.
          is_bapiresou-resbg = <ls_1035t>-evdat.
          is_bapiresou-resed = <ls_1035t>-evdat.
          is_bapiresou-beguz = meeting_pattern-start_time.
          is_bapiresou-enduz = meeting_pattern-end_time.
          is_bapiresou-resid = meeting_pattern-instructor.
          is_bapiresou-restp = 'P'.
          APPEND is_bapiresou TO resources.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
    wa_capacity-kapz1 = event-mincapty.
    wa_capacity-kapz2 = event-optcapty.
    wa_capacity-kapz3 = event-maxcapty.
    capacity = wa_capacity.
    CALL FUNCTION 'HRIQ_CREATE_EVENT'
      EXPORTING
        planversion     = '01'
        event_id_in     = '00000000'
        event_short     = event-short
        event_stext     = event-stext
        status          = '1'
        begin_date      = event-begda
        end_date        = event-endda
        language        = sy-langu
        eventtype       = event-betype
        capacity        = capacity
        location        = meeting_pattern-location
        check_resources = ' '       "'X'
        vtask           = 'B'
      IMPORTING
        event_id_out    = event_id_out
      TABLES
        schedule        = schedule
        resources       = resources
        return          = return.
    IF sy-subrc NE 0.
      CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
      CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
      return-type = 'E'.
      return-message = 'Error during save'.
      APPEND return.
    ENDIF.
    LOOP AT return WHERE id = 'HRPIQ000'
                     AND number = '846'.
      return-type = 'E'.
      return-message = 'Resources already in use'.
      APPEND return.
      EXIT.
    ENDLOOP.
**********************  Create Session offering  **********************
    MOVE-CORRESPONDING ls_nnnn TO ls_1739.
    ls_1739-mandt = sy-mandt.
    ls_1739-plvar = '01'.
    ls_1739-otype = 'E'.
    ls_1739-objid = event_id_out.
    ls_1739-istat = '1'.
    ls_1739-begda = event-begda.
    ls_1739-endda = event-endda.
    ls_1739-aedtm = sy-datum.
    ls_1739-uname = sy-uname.
    ls_1739-infty = '1739'.
    ls_1739-peryr = acad_year.
    ls_1739-perid = acad_session.
    APPEND ls_1739 TO lt_1739.
    PERFORM create_infotype USING lt_1739
                         CHANGING ls_error_record .
    APPEND ls_error_record TO return.
    READ TABLE return  WITH KEY type = 'E'.
    IF sy-subrc <> 0 AND vtask = 'V'.
      CALL FUNCTION 'HRIQ_UPDATE_DATABASE'
        EXPORTING
          vtask          = 'D'
          commit_flg     = 'X'
        EXCEPTIONS
          corr_exit      = 1
          internal_error = 2
          OTHERS         = 3.
      IF sy-subrc NE 0.
        CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
        CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
        return-message = 'Error during save'.
        APPEND return.
      ENDIF.
    ELSE.
      CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
      CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
      EXIT.
    ENDIF.
*********************  Create Relationship(E-SE)  *********************
    parent-objid = event_id_out.
    parent-otype = 'E'.
    APPEND parent.
    PERFORM create_relation TABLES parent
                             USING 'B512'
                                   'SE'
                                   event-begda
                                   event-endda
                                   eventpackageid
                          CHANGING ls_error_record.
  ENDLOOP.
  IF vtask = 'V' AND ls_error_record IS INITIAL.
    PERFORM update_database CHANGING ls_error_record.
  ELSE.
    APPEND ls_error_record TO return.
    CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
    CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
  ENDIF.
  DELETE return WHERE type IS INITIAL.
ENDFUNCTION.

Similar Messages

  • ABAP Functions for creating vendor

    Hello,
    I would like to create a program for creating vendor automatically by uploading a text file, where the text file contain the vendor information.
    Can I ask are there any ABAP function for creating vendor? I have searched a function BAPI_VENDOR_CREATE, but I don't know how to use it.
    Can anyone give me some ideas?
    Many thanks
    Sunny

    Hi,
    BAPI_VENDOR_CREATE is a online BAPI which calls the XK01 screen internally. There wont be any import or export parameters for this BAPI. If you have to upload from a text file, you can try with either of the options
    1) Use the standard program RFBIKR00 to upload the vendor from the flat file. check the documentation of the report for details
    2) Create a BDC recording on XK01 and upload the vendor from the flat file
    Vikranth

  • Standard ABAP functions for assign resources?

    Hi all.
    I would like to share this with you all.
    After loosing three days looking for any kind of standard FM to assign resources (rooms or instructors) to an event (E), I request your help.
    Any of you have found or used those functions in SAP?
    Thanks in advance for your support.

    Hello Roberto:
      the FM we're using is HRIQ_EVENT_CREATE, not very creative , but we found nothing more appropriate, and we found it very flexible to work with events (unluckily flexible is a synonym of complex and hard work).
    Let's move into when and how we used it:
    regular courses are still created using SAPgui
    we needed something more agile to use when a room or resource was needed for unusual activities (meetings for example), and no instructors were needed. We went into a web app. The user will indicate date(s), start and end time and resource. We developed a FM+webservice which "receives" the data inserted by the user and ends executing HRIQ_EVENT_CREATE. (precondition: we have a generic module created with its correpsonding event type needed to execute HRIQ_EVENT_CREATE)
    a previous step to the event creation (on a separate FM+webservice) will check for conflicts in the proposed resource reservation, where the user will see a report of conflicts and make necessary changes before submitting the reservation.
    Would you like to see our codes? Part of it is in Spanish which'll help you read the code
    Cheers,
    Michael

  • ABAP Function for renaming of a planning level?

    Hi all,
    i wanna know if does exist an ABAP Function for renaming of a planning level or parameter group.
    Someone can help me please?
    Thanx a lot,
    Paolo.

    <Font Face="Tahoma" Color="Blue">
    Hi,
    I don't think any such Function Module exists. Nonetheless I can give you a good hint.
    All the details of all planning objects (Planning Areas, Planning Levels, Planning Functions. Parameter Groups etc) are stored in UP* Tables. Just go to T-code SE11 and search for tables with name UP*.
    Once you know the tables, you can write your own customized ABAP code.
    PS: I can recommend above method to just read the details of Planning Objects. I don't think you should be ambitious to change planning object names by attempting to change system table contents. Hope you are getting me.
    Regards,
    Abhijit
    </Font>

  • Standard ABAP program for process chains

    Hi gurus,
      Is there any standard ABAP program to trigger process chains?
    I do not have authorization for RSPC_API_CHAIN_START. So is there any alternative function module or any standard ABAP program that I could use?
    Please help.

    Hi Apara,
      Did you try scheduling the chain via rspc1? If not then follow the steps as given below and see if it is successful
    1) Goto RSPC1.
    2) Enter your chain technical name.
    3) Go to display variant by right clicking the chain. Select the immediate option. save the settings.
    4) Come back to the process chain screen. Click on execute button. See if this succeeds.
    or in case if the chain has been already scheduled once:
    Just open the PC in RCPC1/RCPC
    right click on the start variant (i.e the first process in the PC)
    and select display scheduled jobs...
    this will show you the released jobs for this pC
    just selsct the check box in front of the released job and the select the menu option Job - > selct Repeat scheduling.
    selct immediate and remove the periodic tick mark and save which will run your process chain immediately.
    But i doubt if you will be able to schedule the process chain via a function module or a ABAP code without prior authorization. Maybe you can request some one from your team to run the chain for you until you get access.
    You will surely need to get access for running the chain without which it should not be possible to run the chain.
    Thanks
    Pawan

  • GP: How to keep action  sleeping until ABAP function module raises event

    Hello experts,
    I'd like to develop a gp process which contains a callable objects which keeps the process instance waiting until an abap function module send something like an event.
    I don't want to put too much load on the machine and block expensive JCO ressources.
    Does anyone have an idea how to solve this?
    Thanks very much
    Stefan

    Hi Mike,
    GREAT! Many thanks! Sometimes solutions may be so simple.
    For all others who have the same problem a bit more in detail:
    In your FM just enter as exception: CX_BO_ACTION_CANCELLED and mark 'Exceptn. Classes'.
    Declare your class method with the exception cx_bo_action_cancelled.
    In your class method just enter your FM via the 'Pattern'-Button.
    The Pattern will show only the Import- and Export-Parameters but not the exception (class).
    Regards,
    Georg

  • Functions for creating external organizations?

    Hi,
    Is there a predefined ABAP function in SAP for creating an external organization? Currently I find only the ones for reading EO data, e.g. HRIQ_EO_GETDETAILS
    Thanks
    Janek

    Hi ,
    To create an external organization - PIQEO is the tcode.
    Don't use PP01 for all purpose which is not advisable yet all the data's can be edited , created , displayed , deleted . It is like master transaction .
    Regards
    Gajalakshmi

  • Upload Functionality for creating Screens in SE51

    Hi Experts,
    I am working in 4.7
    I successfully downloaded the screen from 4.6 into a text file but when i went to 4.7; upload functionality is disabled.
    Is there any other way or  standard program available to create Screens in SE51 if we have downloaded files for the screen .>??
    Thanks in Advance,
    Harkamal

    Thanks for ur reply ARS..
    but in my case Upload is grayed out in case of this particular program even if I am creating a dummy screen
    My program already exist in SE38 in 4.7 and i have to copy screen from 4.6 . So I was looking for some simple tool like UPload /Download ..
    I dont know why Uplaod is inactive in case of this program
    Thanks,
    Harkamal

  • SAP Standard ABAP Proxy for PO 855 SRM-R/3

    Hi :
    855 PO Confirmation in R/3 from SRM
    Can I use the ABAP Proxy "PurchaseOrderConfirmation_In" to Confirm the PO response in SRM from R/3
    ( In R/3 i get a idoc formatted file as 855 from vendor and can do PO Confirmation uisng custom program in R/3).
    PurchaseOrderConfirmation_In is standard abap proxy out of the sap box  for the SRM-SUS integration.Sender Interface is PurchaseOrderConfirmation_Out(SUS) and receiver Interface is PurchaseOrderConfirmation_In(SRM) for the PO Confirmation for SUS-SRM scenario.
    The 855 file from vendor is in the form of IDOC structure and how to customize the file to be used in conjunction with PurchaseOrderConfirmation_In(as this is based on XML).
    How to Convert the 855 IDoc to XML format and feed  it to standard SAP Interface PurchaseOrderConfirmation_In  via XI ,if yes will this work and how??
    Thanks in advance..

    Hi Srivatsan,
    How are you?  Hope you remember me..We got a similar kind of requirement in our project. Do you have solution for this issue?
    regards
    Paris

  • ABAP interfaces for creating WM TO for Delivery

    I am looking for a function module, bapi, badi, or any other mechanism for creating a warehouse management transfer order for a delivery. I have tried using L_TO_CREATE_DN, but it does not expose some fields I need to populate. Specifically I need to update the ZEUGN (certificate) field.
    Again, my requirement is to be able to pass information to a routine that will create a warehouse management transfer order for a delivery.
    Any help would be greatly appreciated.
    thanks,
    Chip

    try this enhancement
    MWMIDO11---Enhancement for message WMTORD: TO with several items
    in above enhancement we have structure..
      LTAP_CREAT
    this structure consist of that field zeugn that u asked....

  • HR-ABAP--infotype for the event

    Hello Gurus,
    I have the event type as FMLA .I have got the infotype for this event as P0672.
    Can you please tell me the infotype for this event type OFLA .
    Thanks,

    I don't understand the question, could you provide us with the transactions you use.
    If I hear HR, infotype and event, I'm thinking transaction SWEHR3 and business objects BUS1065, EMPLOYEET and FAMILY
    Regards, Rob.

  • Standard ABAP report for XI performance monitoring?

    Hi All,
    Is there any standard ABAP report that can be run in ECC, that would provide summary of which interfaces(namespaces) ran over the 24 hour period in a graphical view.
    Regards,
    XIer

    Hi,
    Performance tuning :
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/70ada5ef-0201-0010-1f8b-c935e444b0ad
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/489f5844-0c01-0010-79be-acc3b52250fd
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/defd5544-0c01-0010-ba88-fd38caee02f7?prtmode=navigate
    Performance Tuning Checks in SAP Exchange Infrastructure(XI): Part-III
    REgards
    Seshagiri

  • ABAP functions for BI Queries

    Hi Experts,
    We are trying to obtain a csv file from the data result of a query in a report. Like the option: rsrt, query visualization HTML, export to csv.
    Is there any abap function we can use to achieve it ? Our SAP BI version is 3.X, so it's better if this function is used in 7.0 version too.
    Thanks in advance.

    Hi,
    Use ADP or RSCRM_BAPI tcode.
    Analysis Process Designer (APD): Part - 1
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f06353dd-1fe3-2c10-7197-dd1a2ed3893e?quicklink=index&overridelayout=true 
    Re: Running Quaries automatically and saving them in as a Excel file in Server
    Re: Data transfer to external systems
    Re: Loading from a Custom R/3 Table
    Re: How can I schedule my Bex report to execute in background
    Re: How can I insert the RSCRM_BAPI into Process chain?
    Thanks
    Reddy

  • ABAP code for creating a report variant

    Hi,
    I would like to create parameter on selection screen type SLIS_VARI. I would like that the program will start with pre-defined variant in ALV grid, the same as it is on standard stock report (MB52)...
    Can someone tell me how to do this, and where to put the code?
    Thanks in advance,
    Saso

    Hi,
    This is the code for variant as parameter and F4 help.
    DATA: g_repid LIKE sy-repid,
          g_dynnr LIKE sy-dynnr.
    DATA: g_save(1) TYPE c VALUE 'A',
          g_exit(1) TYPE c,
          gx_variant LIKE disvariant,
          g_variant LIKE disvariant.
    PARAMETERS: p_vari LIKE disvariant-variant.
    INITIALIZATION.
      g_repid = sy-repid.
      g_dynnr = sy-dynnr.
      PERFORM variant_init.
    *Get default variant
      gx_variant = g_variant.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save     = g_save
        CHANGING
          cs_variant = gx_variant
        EXCEPTIONS
          not_found  = 2.
      IF sy-subrc = 0.
        p_vari = gx_variant-variant.
      ENDIF.
                      AT SELECTION SCREEN                               *
    AT SELECTION-SCREEN.
    *--PAI of selection screen
      PERFORM pai_of_selection_screen.
    *---F4 option for report variant
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
      PERFORM f4_for_variant.
                         SUB-ROUTINES                                   *
    FORM variant_init.
      CLEAR g_variant.
      g_variant-report = g_repid.
    ENDFORM.                    " variant_init
    FORM pai_of_selection_screen.
      IF NOT p_vari IS INITIAL.
        MOVE g_variant TO gx_variant.
        MOVE p_vari TO gx_variant-variant.
        CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
          EXPORTING
            i_save     = g_save
          CHANGING
            cs_variant = gx_variant.
        g_variant = gx_variant.
      ELSE.
        PERFORM variant_init.
      ENDIF.
    ENDFORM.                    " pai_of_selection_screen
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant = g_variant
          i_save     = g_save
        IMPORTING
          e_exit     = g_exit
          es_variant = gx_variant
        EXCEPTIONS
          not_found  = 2.
      IF sy-subrc = 2.
        MESSAGE ID sy-msgid TYPE 'S'      NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        IF g_exit = space.
          p_vari = gx_variant-variant.
        ENDIF.
      ENDIF.
    AND pass this gx_variant to ALV Function module.
    Rewards points if helpful.
    Regards,
    Srinivas ch

  • Callback function for network events

    Hi all,
    I'm working on a project, and I need to be able to respond to network events. I receive the data through a BufferedInputStream from a socket. What I want is a callback-type thing, i.e. When new data is sent to the socket, a function is called to receive that data. I've looked through the documentation, I can't find anything that could be used for that. The only thing I can think of is linking it to a JTextArea/JTextField, and attaching a change listener to that, but I'd prefer not to have to do that. My current method involves a loop, which I don't like at all:
    while (true) {
    if (server.Available()) {
    do stuff here
    I don't like it because it wastes processor cycles that really should go elsewhere. So what can I do?
    -ReKleSS

    When you read from a socket and there is no data available, it just blocks until something does become available. While the thread is blocked waiting for I/O it won't take up any processor time.

Maybe you are looking for