ABAP Objects Questions

Hello Everyone,
I hope someone could answer the following questions:
Please look at the below ABAP code
data: zVar(30)                type c value 'ZTEST_CLASS',
        methodName(30)    type c value 'Test_Method'.
Question # 1:  Can I define the objVar as below or is there anyother way to accomplish this?
data:  objVar  TYPE REF TO  zVar.  (Please note that zVar is the variable that contains the name of the 
                                                       class)
Question # 2: Can I create the object objVar from the above question as below?
CREATE OBJECT objVar.
Question # 3: Can I call the method of objVar as below
CALL METHOD objVar->Test_Method (please note that test method is a variable that contains the name
                                                         of the actual method)
Thanks in advance.
Regards

All these Can be done using Dynamic programming.
check this
REPORT  ZTEST_CLASS.
data: zVar(30) type c value 'ZCL_TEST1',  "<--class name
methodName(30) type c value 'TEST'.   "<----Method name
data: obj type ref to object.
create object obj TYPE (zvar) .
call method obj->(methodname).
break-point.

Similar Messages

  • Help In ABAP Object Certification Question

    Hi ABAP Gurus,
       iam going to write certification Exam on Nov 11. i have got some model question from SAP domain for all the topics Except ABAP Objects which is so important...
    Please anybody send me some Example question you guys got from the Certification Exam
    it will be be grateful to me...
    Thanks a lot in advance.
    Prabhu
    SAP Lead Consultant

    Hi,
    Sending ABAP Objects questions is not an option but normally, your concepts are tested for:
    - Classes and objects
    - Inheritance
    - Casting
    - Interfaces
    - Events
    - Global classes and interfaces
    - Exception handling
    - Dynamic programming
    You can use help.sap.com to take a look at these topics one by one. Hope this helps.
    Good luck.

  • Significance of Interfaces in ABAP Objects

    Hi Guys, here I have a query -
    Why do we use Interfaces in ABAP Objects?, and what is the significance of Interfaces in ABAP Objects?
    Please clarify the above with a suitable example.

    Moderator message - Welcome to SCN.
    But
    Moderator message - But this isn't a training forum. Please ask a specific question - post locked

  • Re : select-options in abap objects

    Dear friends,
    I want to give select-options in abap-objects program. How to give that.
    Thanking You
    with regards,
    Mani

    HI Mani,
    It's common mix ABAP Procedural with ABAP Objects in the same program.
    You should use the same way used in ABAP procedural program as Marco Cerdelli sad.
    But inside ABAP OBJECTS classes you can't use is these statement type.
    Don't forget to close this thread and all yours previous when your question be answered ! In case of doubt read the [rules of engagement|https://forums.sdn.sap.com/].
    Best Regards.
    Marcelo Ramos

  • Java package concept in ABAP Objects

    Hi, just a question on grouping of classes in ABAP Objects.
    In Java, you can group classes by "package" to avoid
    namespace collision, my question, in ABAP Objects, how
    do you group classes to avoid namespace collision?
    I know that there is package concept in SAP/ABAP but it
    is different concept in Java.
    Thanks in advanced for your reply.

    Hello One and Lonley,
    the package concept in ABAP and Java is quite different. In java the package name is part of the development object in ABAP not. So any class pool name is global unique. In combination with the restriction on 30 chars this leads often to somehow cryptic names.
    The only way to escape this somehow is the excessive use of local classes. That mean classes defined within main programs. If you are on 7.00 you may check FuGr SAPLSAUNIT_TREE_CTRL_LISTENER for this technique.
    Best Regards
      klaus

  • Poll: Development in ABAP Objects / Webdynpro vs. classical Dynpro

    Hey there ABAP developers,
    I just want to ask if you can give me one or two minutes of your attention for two poll questions.
    At the moment I´m writing my master thesis about the development of a monitoring tool in ABAP. One of my bigger chapters is about the decision, which programming paradigm should be used for new development projects in SAP. And another important one is about WebDynpro vs. classical Dynpros.
    Because of the fact, that I can´t create any polls in here, I just started this discussion and hope for many replies .
    It would be very nice if some of you could give me an answer to the following questions (only 2 ), so that I can maybe use the result of this poll in my master thesis, if there are enough responses.
    1. What percentage of new development projects are you developing in ABAP Objects? (Not to be considered small reports that just runs for only one time)
         A. 0 %
         B. less than 25%
         C. 25% - 49%
         D. 50% - 75%
         E. more than 75%
    2. Which GUI technology do you prefer?
         A. Classical Dynpro
         B. WebDynpro
         C. Business Server Pages (BSP)
         D. others (please mention)
    I want to thank you in advance for answering the questions,
    Best regards,
    Christoph

    Hi,
    Present SAP Implementation projects are very rare, maximum projects are support and up gradations only .
    If they want Implement the  SAP  newly  , defiantly they should creating ABAP Objects.
    Why Because  ABAP Objects are Object Oriented Concepts,  so,  for  future reference and re usability..etc .
    Now Come to the First Quetion.
    if it is implementation project   ABAP Objects are   25% - 49%.
    if it is Support project ABAP Objects are   25%
    Now Come to the Second Quetion.
    Depend upon Reqmnt, but Most of the Applications are Webdynpro .  i.e 70%.
    Remaining 30% All ( BSP and GUI ....Etc..)
    This is my opinion.
    Sambaiah.Paidipelli.

  • Single click in abap objects

    hi,
        can any1 pls explain me the single click event LINK_CLICK in abap object.
    does this single click event mean that if i click anywhere on my alv report it will trigger the event.
       pls explain me about this LINK_CLICK event in details pls

    answered the similar question last week. You can see here Event
    Link_click or ALV_Object Model HYPERLINK.
    This example demonstrates how to use a Hiperlink field in ALV. These example was based on 'SALV_DEMO_TABLE_COLUMNS' that contains Hiperlink, icon, Hotspot...
    The Code is:
    REPORT zsalv_mar NO STANDARD PAGE HEADING.
          CLASS lcl_handle_events DEFINITION
    CLASS lcl_handle_events DEFINITION.
      PUBLIC SECTION.
        METHODS:
          on_link_click FOR EVENT link_click OF cl_salv_events_table
            IMPORTING row column.
    ENDCLASS.                    "lcl_handle_events DEFINITION
          CLASS lcl_handle_events IMPLEMENTATION
    CLASS lcl_handle_events IMPLEMENTATION.
      METHOD on_link_click.
        DATA: l_row_string TYPE string,
              l_col_string TYPE string,
              l_row        TYPE char128.
        WRITE row TO l_row LEFT-JUSTIFIED.
        CONCATENATE text-i02 l_row INTO l_row_string SEPARATED BY space.
        CONCATENATE text-i03 column INTO l_col_string SEPARATED BY space.
        MESSAGE i000(0k) WITH 'Single Click' l_row_string l_col_string.
      ENDMETHOD.                    "on_single_click
    ENDCLASS.                    "lcl_handle_events IMPLEMENTATION
    DATA: gr_events TYPE REF TO lcl_handle_events.
    TYPES: BEGIN OF g_type_s_outtab.
    INCLUDE TYPE alv_tab.
    TYPES:   t_hyperlink TYPE salv_t_int4_column,
           END   OF g_type_s_outtab.
    DATA: gt_outtab TYPE STANDARD TABLE OF g_type_s_outtab.
    DATA: gr_table   TYPE REF TO cl_salv_table.
    TYPES: BEGIN OF g_type_s_hyperlink,
             handle    TYPE salv_de_hyperlink_handle,
             hyperlink TYPE service_rl,
             carrid    TYPE s_carrid,
           END   OF g_type_s_hyperlink.
    DATA: gt_hyperlink TYPE STANDARD TABLE OF g_type_s_hyperlink.
    SELECTION-SCREEN BEGIN OF BLOCK gen WITH FRAME.
    PARAMETERS: p_amount TYPE i DEFAULT 30.
    SELECTION-SCREEN END OF BLOCK gen.
    START-OF-SELECTION.
      PERFORM select_data.
      PERFORM display.
    *&      Form  select_data
          text
    -->  p1        text
    <--  p2        text
    FORM select_data .
      DATA: line_outtab  TYPE g_type_s_outtab,
            ls_hype      TYPE g_type_s_hyperlink,
            lt_hyperlink TYPE salv_t_int4_column,
            ls_hyperlink TYPE salv_s_int4_column,
            v_tabix      TYPE sytabix.
      SELECT *
        FROM alv_tab
        INTO CORRESPONDING FIELDS OF TABLE gt_outtab
            UP TO p_amount ROWS.
      LOOP AT gt_outtab INTO line_outtab.
        v_tabix = sy-tabix.
        ls_hype-handle    = sy-tabix.
        ls_hype-hyperlink = line_outtab-url.
        ls_hype-carrid    = line_outtab-carrid.
        INSERT ls_hype INTO TABLE gt_hyperlink.
        ls_hyperlink-columnname = 'URL'.
        ls_hyperlink-value      = sy-tabix.
        APPEND ls_hyperlink TO lt_hyperlink.
        line_outtab-t_hyperlink = lt_hyperlink.
        MODIFY gt_outtab FROM line_outtab INDEX v_tabix.
        CLEAR line_outtab.
        CLEAR lt_hyperlink.
        CLEAR ls_hyperlink.
      ENDLOOP.
    ENDFORM.                    " select_data
    *&      Form  display
          text
    -->  p1        text
    <--  p2        text
    FORM display .
      TRY.
          cl_salv_table=>factory(
            IMPORTING
              r_salv_table = gr_table
            CHANGING
              t_table      = gt_outtab ).
        CATCH cx_salv_msg.                                  "#EC NO_HANDLER
      ENDTRY.
      DATA: lr_functions TYPE REF TO cl_salv_functions_list.
      lr_functions = gr_table->get_functions( ).
      lr_functions->set_default( abap_true ).
    *... set the columns technical
      DATA: lr_columns TYPE REF TO cl_salv_columns_table,
            lr_column  TYPE REF TO cl_salv_column_table.
      lr_columns = gr_table->get_columns( ).
      lr_columns->set_optimize( abap_true ).
    *... §4.7 set hyperlink column
      DATA: lr_hyperlinks TYPE REF TO cl_salv_hyperlinks,
            ls_hyperlink  TYPE g_type_s_hyperlink.
      DATA: lr_functional_settings TYPE REF TO cl_salv_functional_settings.
      TRY.
          lr_columns->set_hyperlink_entry_column( 'T_HYPERLINK' ).
        CATCH cx_salv_data_error.                           "#EC NO_HANDLER
      ENDTRY.
      TRY.
          lr_column ?= lr_columns->get_column( 'URL' ).
          lr_column->set_cell_type( if_salv_c_cell_type=>link ).
          lr_column->set_long_text( 'URL' ).
        CATCH cx_salv_not_found.                            "#EC NO_HANDLER
      ENDTRY.
      lr_functional_settings = gr_table->get_functional_settings( ).
      lr_hyperlinks = lr_functional_settings->get_hyperlinks( ).
      LOOP AT gt_hyperlink INTO ls_hyperlink.
        TRY.
            lr_hyperlinks->add_hyperlink(
              handle    = ls_hyperlink-handle
              hyperlink = ls_hyperlink-hyperlink ).
          CATCH cx_salv_existing.                           "#EC NO_HANDLER
        ENDTRY.
      ENDLOOP.
      DATA: lr_events TYPE REF TO cl_salv_events_table.
      lr_events = gr_table->get_event( ).
      CREATE OBJECT gr_events.
      SET HANDLER gr_events->on_link_click FOR lr_events.
      gr_table->display( ).
    ENDFORM.                    " display

  • FAQ's In abap Objects

    Hi Guys,
    I am having an interview tmmorrow in Abap Objects.
    Could any one help me  in sending me the Faq's ASAp.
    Thanks in advance

    Hi,
    If you do a media search on ABAP Objects you will find:
    1)Eight Reasons Why Every ABAP Developer Should Give ABAP Objects a Second Look by Horst Keller
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/37c5db90-0201-0010-3a9b-d0a5288f3c15
    2) Questions: Why use ABAP Objects
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3e59b790-0201-0010-88aa-bc8a7f95f6fb
    3) Why use ABAP Objects Exercise
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3412d190-0201-0010-aaaa-ff5a315ae5fe
    4) ABAP Objects for Java Developers:
    https://media.sdn.sap.com/public/eclasses/teched04/ABAP151_files/Default.htm#nopreload=1
    There is also an excellent class offered by SAP Education called BC401 that describes Objects and BADIs in exruciating detai ;-).
    http://www8.sap.com/useducation/curriculum/course.asp?rid=276&cid=60167031
    Check the links -
    Re: Need FAQ's
    The specified item was not found.
    Regards,
    Priyanka.

  • Abap objects

    interview  questions on abap objects?

    Hi,
    Go thru these links.
    They nay help you.
    http://www.ittestpapers.com/articles/796/1/ABAP-FAQ/Page1.htmlwww.sap-basis-abap.com/abap/abap-interview-questions.htm
    http://www.ittestpapers.com/articles/796/1/ABAP-FAQ/Page1.html
    Regards
    Sandeep Reddy

  • Abap objects and selection screen

    Hello everybody,
    I am interested in your ways of implementing selection-screens in the style of ABAP Objects.
    In earlier times (when I used to implement ABAP objects in a procedural way) I just put the selection-screen commands in an include or a form routine of my ABAP report. So it was possible to run the report in background.
    Now I read something about selection-screens/dynpros and "separation of concerns" in the book "ABAP Objects" written by Keller. He advises using function groups to encapsulate presentation from logical matters. (Selection-screen commands are in an automatically generated include now). I implemented this way. (ABAP report with a local class, which has a main method, where function module of the function group is called). It works, but i see no chance to run my report in background now.. but I need to run the report in background.
    Does anybody know a solution without deleting function group?
    What do you think is the best way of using selection-screen-commands and ABAP Objects, especially regarding running in background?
    Thx for your advise in advance.
    Kind regards,
    Anne

    Hi Naimesh,
    thx for explanation. I am not sure, if I understood everything in the right way.
    Where do you write the code for building the selection-screen? (PARAMETERS, SELECT-OPTIONS etc.)
    If you write these commands in a class method, you will get a syntax error ( because it's forbidden per definition of ABAP objects). So, am I right assuming that you put the coding just at the beginning of the ABAP report ? And after START-OF-SELECTION-event you start the processing... ?
    Furthermore, I don't really understand why you create an separate class for ALV. I found your "SAP abap help"-blog, where you explained the concept of MVC ((By the way, well done!), but you didn't mention an "ALV class" there..
    Mh.. another question - have you ever combined MVC with object services?
    At the moment I'm working on a software project where I use object services. I created 2 persistent classes via SE24 and one local class in my ABAP Report.
    I don't really see possibility to implement MVC in this project without change very much of coding and class structure...
    In my opinion the M (data&business logic) are my existing global classes and my local class is kind of Controller class?!
    Thx in advance,
    Anne

  • Object casting: confusion in ABAP Objects: Complete Reference book

    Hi,
    During Object Assignments using casting, is a Type Test carried out during the syntax check or at runtime?
    A.5.2.2 (page 1008) of 'ABAP Objects: The Complete Reference' says about Widening Cast: "...you must check at runtime...". However on the next page under A.5.3.2 it says of Widening Cast in Data References: "The syntax check precludes...".
    A.5.4 (page 1010) concerns Assignments between Object Reference Variables, but makes no mention of whether checks are carried out by a syntax check or at runtime.
    Also nowhere does it mention when Type Tests for Narrow casting takes place. Can anyone clear my confusion please? Unfortunatly I don't know enough about this stuff to test by writing some code.
    Thanks.

    William,
    Your questions can be answered by the following rule for object references, which I found in the book "ABAP Objects" by Horst Keller and Sascha Krüger:
    "... that the static type of the target variable must be equal to or more general than the dynamic type of the source variable."
    Here "static type" means the type with which an object reference variable is declared. "Dynamic type" is the type that the object reference variable has at runtime. The dynamic type of an object reference is always more special than its static type, otherwise a runtime error occurs.
    With this rule all your questions can be answered:
    1. The Narrowing Cast is always checked during the syntax check. Example:
    DATA o_ref1 TYPE REF TO object.
    DATA o_ref2 TYPE REF TO class_1.
    o_ref1 = o_ref2.  
    Here the reference o_ref2 has a dynamic type "class_1" or a subclass of it, which is narrower than its static type "class_1", which is narrower than the static type "object" of the reference o_ref1. Therefore, the syntax check says that the assignment is OK.
    2. The Widening Cast is always checked at runtime and requires an assignment using the operator ?=. If you use the operator = in the assignment, a syntax error occurs. Therefore the following  example produces a syntax error (try it yourself):
    DATA o_ref1 TYPE REF TO object.
    DATA o_ref2 TYPE REF TO class_1.
    o_ref2 = o_ref1.  
    The correction for this syntax error is:
    DATA o_ref1 TYPE REF TO object.
    DATA o_ref2 TYPE REF TO class_1.
    o_ref2 ?= o_ref1.
    Now the syntax check is satified, and the correctness of the widening cast is checked at runtime.
    Kind regards,
    Michael Kraemer
    Message was edited by: Michael Kraemer

  • Begin-of-transaction in ABAP Objects

    Hi,
    I have a question regarding the (implicit or explicit) begin of a transaction (read: SAP LUW) in ABAP Objects. In this piece of code
    CREATE OBJECT mapping.
    TRY.
      mapping->delete_all_embraced_mappings( ).
      mapping->merge_with_begda_overlap( ).
      mapping->merge_with_endda_overlap( ).
      mapping->store( ).
      COMMIT WORK.
    CATCH /my/mapping_exception.
      ROLLBACK WORK.
    ENDTRY. 
    I need a all-or-nohting logic, i.e. I'd like all the methods <i>delete..(), merge..()</i> and <i>store()</i> to run in a single transaction. If any of the methods throws a <i>/my/mapping_exception</i> I want all DB changes (carried out in the methods) rolled back.
    Now, how can a mark the <b>begin-of-transaction</b> (the counterpart of the commit work)? I couldn't find information about this in the docu or in the SDN. To prevent misunderstandings: I am building a web application with ABAP Objects, so no dialog steps, PBO-PAIs, function modules, performs etc. are involved!
    Regards,
    Sebastian Kamp

    Maybe by using
    SET UPDATE TASK LOCAL
    I think this command acts as a BeginOfTransaction command, it especifies that, till the next CommitWork, all the process has to be done as part of a Transaction.
    You could try something like this:
      TRY
          SET UPDATE TASK LOCAL
          <YOUR_PROCESS_HERE>
          COMMIT WORK
       CATCH
       ENDTRY
    Hope it helps.

  • Faq's on abap objects?????

    Hi guys,
       can anybdy send me faq's on abap objects.... my id is [email protected]
    thnaks in advance

    Hi
    There are some nice tutorials and introductory articles and presentations in SDN.
    If you do a media search on ABAP Objects you will find:
    1)Eight Reasons Why Every ABAP Developer Should Give ABAP Objects a Second Look by Horst Keller
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/37c5db90-0201-0010-3a9b-d0a5288f3c15
    2) Questions: Why use ABAP Objects
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3e59b790-0201-0010-88aa-bc8a7f95f6fb
    3) Why use ABAP Objects Exercise
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3412d190-0201-0010-aaaa-ff5a315ae5fe
    4) ABAP Objects for Java Developers:
    https://media.sdn.sap.com/public/eclasses/teched04/ABAP151_files/Default.htm#nopreload=1
    There is also an excellent class offered by SAP Education called BC401 that describes Objects and BADIs in exruciating detai ;-).
    http://www8.sap.com/useducation/curriculum/course.asp?rid=276&cid=60167031
    Check if the material is of help...
    Regards
    Dinesh

  • FAQ's, intros and memorable discussions in the ABAP Objects Forum

    Welcome to the SDN ABAP Objects Forum!
    In addition to release dependent information avalaible by:
    - pressing the F1 key on an ABAP statement,
    - or searching for them in transaction ABAPDOCU,
    - using the [SDN ABAP Development Forum Search|https://www.sdn.sap.com/irj/sdn/directforumsearch?threadid=&q=&objid=c42&daterange=all&numresults=15&rankby=10001],
    - the information accessible via the [SDN ABAP Main Wiki|https://wiki.sdn.sap.com/wiki/display/ABAP],
    - the [SAP Service Marketplace|http://service.sap.com] and see [SAP Note 192194|https://service.sap.com/sap/support/notes/192194] for search tips,
    - the 3 part [How to write guru ABAP code series|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f2dac69e-0e01-0010-e2b6-81c1e8e5ce50] ... (use the search to easily find the other 2 documents...)
    ... this "sticky post" lists some threads from the ABAP forums as:
    - An introduction for new members / visitors on topics discussed in threads,
    - An introduction to how the forums are used and the quality expected,
    - A collection of some threads which provided usefull answers to questions which are frequently asked, and,
    - A collection of some memorable threads if you feel like reading some ABAP related material.
    The listed threads will be enhanced from time to time. Please feel welcome to post to [this thread|Suggestions thread for ABAP FAQ sticky; to suggest any additional inclusions.
    Note: When asking a question in the forum, please also provide sufficient information such that the question can be answered usefully, do not repeat interview-type questions, and once closed please indicate which solution was usefull - to help others who search for it.
    ABAP Objects
    About polymorphism - still not sure after searching... => Polymorphism adaptation with referencing the source, and a Guest who did not...

    Obsolete ABAP Statements from 2004s - what about your existing code-base?  A great discussion about the changes in syntax checking between 46c and basis release 7.0.

  • Parallel processing using ABAP objects

    Hello friends,
                        I had posted in the performance tuning forum , regarding a performance issue problem , I am reposting it as it involves OO concept .
    the link for the previous posting
    Link: [Independent processing of elements inside internal table;
    Here is the scenario,
    I have a internal table with 10 records(indepentent) , and i need to process them .The processing of one record doesnt have any influence on the another . When we go for loop , the performance issue is that , the 10 th record has to wait until the 9 records get processed even though there is no dependency on the output.
    Could some one tell a way out to improve the performance..
    If i am not clear with the question , i would explain it still clearer...
    A internal table has 5 numbers , say( 1,3,4,6,7)
    we are trying to find square of each number ,,,
    If it is a loop the finding of suare of 7 has to wait until 6 is getting completed and it is waste of time ...
    This is related to parallel processing , I have refered to parallel processing documents,But I want to do this conceptually ..
    I am not using conventional procedural paradigm but Object orientedness...I am having a method which is performing this action .What am I supposed to do in that regard.
    Comradely ,
    K.Sibi

    Hi,
    As examplified by Edward, there is no RFC/asynchronous support for Methods of ABAP Objects as such. You would indeed need to "wrap" your method or ABAP Object in a Function Module, that you can then call with the addition "STARTING NEW TASK". Optionally, you can define a Method that will process the results of the Function Module that is executed asynchronously, as demonstrated as well in Edward's program.
    You do need some additional code to avoid the situation where your program takes all the available resources on the Application Server. Theoretically, you cannot bring the server or system down, as there is a system profile parameter that determines the maximum number of asynchronous tasks that the system will allow. However, in a productive environment, it would be a good idea to limit the number of asynchronous tasks started from your program so that other programs can use some as well.
    Function Group SPBT contains a set of Function Modules to manage parallel processing. In particular, FM SPBT_INITIALIZE will "initialize" a Server Group and return the maximum number of Parallel Tasks, as well as the number of free ones at the time of the initialization. The other FM of interest is SPBT_GET_CURR_RESOURCE_INFO, that can be called after the Server Group has been initialized, whenever you want to "fork" a new asynchronous task. This FM will give you the number of free tasks available for Parallel Processing at the time of calling the Function Module.
    Below is a code snippet showing how these Function Modules could be used, so that your program always leaves a minimum of 2 tasks for Parallel Processing, that will be available for other programs in the system.
          IF md_parallel IS NOT INITIAL.
            IF md_parallel_init IS INITIAL.
    *----- Server Group not initialized yet => Initialize it, and get the number of tasks available
              CALL FUNCTION 'SPBT_INITIALIZE'
              EXPORTING
                GROUP_NAME                           = ' '
                IMPORTING
                  max_pbt_wps                          = ld_max_tasks
                  free_pbt_wps                         = ld_free_tasks
                EXCEPTIONS
                  invalid_group_name                   = 1
                  internal_error                       = 2
                  pbt_env_already_initialized          = 3
                  currently_no_resources_avail         = 4
                  no_pbt_resources_found               = 5
                  cant_init_different_pbt_groups       = 6
                  OTHERS                               = 7.
              md_parallel_init = 'X'.
            ELSE.
    *----- Server Group initialized => check how many free tasks are available in the Server Group
          for parallel processing
              CALL FUNCTION 'SPBT_GET_CURR_RESOURCE_INFO'
                IMPORTING
                  max_pbt_wps                 = ld_max_tasks
                  free_pbt_wps                = ld_free_tasks
                EXCEPTIONS
                  internal_error              = 1
                  pbt_env_not_initialized_yet = 2
                  OTHERS                      = 3.
            ENDIF.
            IF ld_free_tasks GE 2.
    *----- We have at leasr 2 remaining available tasks => reserve one
              ld_taskid = ld_taskid + 1.
            ENDIF.
        ENDIF.
    You may also need to program a WAIT statement, to wait until all asynchronous tasks "forked" from your program have completed their processing. Otherwise, you might find yourself in the situation where your main program has finished its processing, but some of the asynchronous tasks that it started are still running. If you do not need to report on the results of these asynchronous tasks, then that is not an issue. But, if you need to report on the success/failure of the processing performed by the asynchronous tasks, you would most likely report incomplete results in your program.
    In the example where you have 10 entries to process asynchronously in an internal table, if you do not WAIT until all asynchronous tasks have completed, your program might report success/failure for only 8 of the 10 entries, because your program has completed before the asynchronous tasks for entries 9 and 10 in your internal table.
    Given the complexity of Parallel Processing, you would only consider it in a customer program for situations where you have many (ie, thousands, if not tens of thousands) records to process, that the processing for each record tends to take a long time (like creating a Sales Order or Material via BAPI calls), and that you have a limited time window to process all of these records.
    Well, whatever your decision is, good luck.

Maybe you are looking for

  • Midi Apple Loops Problem

    Hi, Im having some issues with the midi apple loops loosing some effects that are heard when previewed in the media section, then once dragged into the arrange it'll loose for example a prevalent reverb and other notable sonic qualities...even when t

  • Recovery from External hard drive

    So I backed up all my files onto an external hard drive using the hp program, before reinstalling windows. However when I go to restore them it goes through and restores some of the files and then when it gets to 100% and it says please insert disk 2

  • How to use a function

    Hi I want to determine the variance for a column of numerical values.  I gather I should use 'insert function' in a new cell for this.  I'll get a display like this: =VAR(num-date,num-date...).  What do I enter to calculate the variance for, say, the

  • How to go back to version 5 iTunes

    This version 6 is crap - doesn't load, wasting hours of my time. How do I go back to version 5?

  • When i import to iPhoto from nikon, photos download perfect - when i click off, they are gone. Huh??

    when i import photos from my nikon d3000, they import perfect, when i click off, they are gone. apple store has no answer.