IS SUPPLIED in nested call

Hi,
I have a method which is potentially slow (due to remote RFC connections).
Therefore I want to check which of the export parameters the caller actually requested. I found IS SUPPLIED for this purpose.
Unfortunately the method is also long and I would like to split it into some private method calls inside. But when I make a nested call into a submethod, the IS SUPPLIED method in there does not work anymore, since from the main method it is always requested.
Is there any easy way to come around this problem? Otherwise I will have to remember some booleans "XXX_IS_SUPPLIED" in the main method and pass them into the sub methods.
Thanks
Bruno
Edited by: Bruno Haller on Nov 24, 2009 1:39 PM

What I think you can do is:
- check if parameter is not initial in submethod -> this however will not always be true as you might pass empty param on purpose
- make importing parameter of submethod optional , then write two calls of submethod, one with passing you parameter when in method it is supplied , the other one without the parameter - if not supplied.
class lcl1 DEFINITION.
  public SECTION.
  methods: m1 importing i_par type c optional,
           m2 IMPORTING i_par type c OPTIONAL.
endclass.
class lcl1 IMPLEMENTATION.
  method m1.
    if i_par is SUPPLIED.
      m2( i_par = i_par ).
    else.
      m2( ).
    endif.     
  ENDMETHOD.
  method m2.
    if i_par is SUPPLIED.
      write: / 'Parameter is supplied'.
    else.
      write / 'Parameter is not supplied'.
    endif.
  endmethod.
ENDCLASS.
data:r type ref to lcl1.
START-OF-SELECTION.
CREATE OBJECT r.
write: / 'First call'.
r->m1( ).
write / 'Second call'.
r->m1( 'X' ).
Regards
Marcin

Similar Messages

  • In module pool program dump due to ''too many consecutive nested call scree

    i got a dump i found that this is due too many consecutive nested call screens ,i have used call screen
    statement in program ,in program once the transaction is completed successfully ,on pressing the ok button ,it will go to the first screen , here where the call screen is executed
    so to prevent this dump what shall i do ,plz suggest

    Hi,
    Use LEAVE TO SCREEN 0 statement in OK code
    Try this.

  • Consecutive nested call screen  dump

    Hi,
    I have created a table control and displaying data on the screen.I have included this in an include program and calling this program from another program
    calling program...
    include called program.
    whene ever i select a radio button on main program i initiate a call
    if rad = 'x'
    perform called program.
    endif.
    Here i am getting a dump, that "You have requested too many consecutive nested call screens"
    Can any one plz help me

    Hi
    What i understand from your Q is that, you have an include program which contains the logic for populating an internal table and also the screen with table control to be called in that Include Program.
    If i am correct, then put the logic in some subroutine say perform table_display.
    Now dont call that program instead Include that program in your main program and give PERFORM table_display.
    If my understanding of your Q is wrong, then please make it clear.
    Regards,
    Navneet.

  • Prepared Statement nested calls (Oracle)

    I have a prepared statement like
    select type
    , id
    from ms_page_position where page_id =
    (select id from ms_url where url = ?)
    and column_id =
    (select id from ms_column where name = ?)
    and preview = ? order by position asc.
    If i place in
    pstmt.setString(1, "/news/");
    pstmt.setString(2, "RIGHTCOLUMN");
    pstmt.setString(3, "Y");
    res = pstmt.executeQuery();The three fields are strings
    i get this error -
    java.sql.SQLException: ORA-01460: unimplemented or unreasonable conversion requested.
    If i use a straight statement object and concatenate strings then i have no problem. Can you use prepared statements with nested selects - ?
    Cheers

    I've exactelly the same problem. Any ideas how to solve this. Concatenation works fine but two setString() on PS couses this exception.

  • Nested calls to XMLAgg

    I would like to generate arbitrarily deeply nested XML documents by some declarative mechanism. I've looked at SQL/XML for the first time today, and in particular the XMLAgg function. Whereas I can use this for one level of group-by and hence one level of nesting of the returned document, can I use it at a deeper level of nesting? So if I have (say) four tables A,B,C,D that form a natural containment hierarchy via foreign keys, can I use XMLAgg to generate an XML hierarchy where D is nested in C, C in B, B in A etc? Or is the only mechanism to use Oracle nested tables?

    OK, found it page 10.52 of the dev guide (Part No. A96620-02, the one that has 1044 pages).
    Looks like you need all your brain to write something like these queries...

  • How to CATCH error from call to standard SAP Function Module

    Please, is it possible to catch the following error with the TRY CATCH ENDTRY construct?
    From a custom program, am calling CS_BOM_EXPL_MAT_V2.
    Several nested calls in, Form STL_DATEN_HOLEN (LCSS4F1I) calls FM CS_ALT_SELECT_MAT. 
    However, that call is missing the CALL_INVALID Exception. 
    CS_ALT_SELECT_MAT is raising CALL_INVALID, but since it was not included in the FM call, the RAISE_EXCEPTION runtime error is issued.
    I added a TRY CATCH ENDTRY construct around the call in the custom program using CATCH cx_root, but the program is still short dumping.
    All the research I have done has been misleading...some articles indicate all errors should be caught, some indicate only catchable runtime errors can be caught, others are not quite clear.
    So, I would like to find out if, in this scenario, it is even possible to catch this error and avoid the short dump.
    I will open a message to see about having the SAP code fixed as soon as I get authorization to do so, (as well as fix the data causing the issue in the first place), but in the meantime, I would like to handle it in my code if possible.
    ECC 6.0
    Thanks for any information!
    Kind Regards,
    Deb
    Edited by: Debra Garner on Jan 26, 2012 5:19 PM

    Hi Debra,
    You cannot catch non class based exceptions using the TRY/ENDTRY.  You might also find no luck with help from SAP since the FM in question 'CS_BOM_EXPL_MAT_V2' is not released for customer use.  The best bet is to examine why the error is occurring and figure out what needs to be done to fix it and/or avoid it in the future.
    Regards,
    Ryan Crosby

  • Error messages when calling RSDRI_INFOPROV_READ for more than one time

    Hello all,
    I need to write a cube, however, before I do this I need to check whether there are already data in the target cube for a certain accounting period. This I do by reading the cube via FM RSDRI_INFOPROV_READ. The following coding is called from a running program after pushing a button on the screen.
    <i>* clear internal tables.
          CLEAR gt_range.
          CLEAR gt_sfc.
    *fill internal tables
          CLEAR ls_sfc.
          ls_sfc-chanm    = '0FISCPER'.
          ls_sfc-chaalias = '0FISCPER'.
          ls_sfc-orderby  = 0.
          INSERT ls_sfc INTO TABLE gt_sfc.
          CLEAR ls_range.
          ls_range-chanm    = '0FISCPER'.
          ls_range-sign     = rs_c_range_sign-including.
          ls_range-compop   = rs_c_range_opt-equal.
          ls_range-low      = '2007001'.
          APPEND ls_range TO gt_range.
    here I do not know what exactly to do with this flag
          lf_first_call = abap_true.
          CALL FUNCTION 'RSDRI_INFOPROV_READ'
            EXPORTING
              i_infoprov             = 'T01'
              i_th_sfc               = gt_sfc
              i_th_sfk               = gt_sfk
              i_t_range              = gt_range
              i_packagesize          = 1
            IMPORTING
              e_t_data               = lt_rd_cube
              e_end_of_data          = lf_eod
            CHANGING
              c_first_call           = lf_first_call
            EXCEPTIONS
              illegal_input          = 1
              illegal_input_sfc      = 2
              illegal_input_sfk      = 3
              illegal_input_range    = 4
              illegal_input_tablesel = 5
              no_authorization       = 6
              illegal_download       = 7
              illegal_tablename      = 8
              trans_no_write_mode    = 9
              inherited_error        = 10
              x_message              = 11
              OTHERS                 = 12.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          lf_eod = abap_false.
          IF NOT lt_rd_cube IS INITIAL.
            RAISE target_data_found.
            EXIT.
          ENDIF.</i>
    When testing with a period for which data already exists, it runs through quite perfectly. The return table is filled and I know that data exists and I EXIT.
    However, if I press the button again (program is still running) I get an error message 'Nested call of RSDRI_INFOPROV_READ'. And this for each time I press the button.
    So I thought I should clear the flag lf_first_call. After having done so I get an error message 'SQL Error'. Funny is that I get this error only every second time the Function Module is processed. Every other time it works perfectly.
    How can I get rid of those error messages?
    PLEASE - can anybody help me?
    Many thanks in advance,
    Thomas

    Hi,
    you have something like:
    end_of_data = ' '.
    first_call  = 'X'.
      WHILE end_of_data = ' '.
            CALL FUNCTION 'RSDRI_INFOPROV_READ'
              EXPORTING  i_infoprov             = ....
                         i_th_sfc               = ...
                         i_th_sfk               = ...
                         i_t_range              = ...
                         i_reference_date       = ...
                         i_save_in_table        = ....
                         i_save_in_file         = ....
                         I_USE_DB_AGGREGATION   = ...
                         i_packagesize          = 100000
                         i_authority_check      = ...
              IMPORTING  e_t_data               = .....
                         e_end_of_data          = end_of_data
              CHANGING   c_first_call           = first_call
              EXCEPTIONS illegal_input          = 1
                         illegal_input_sfc      = 2
                         illegal_input_sfk      = 3
                         illegal_input_range    = 4
                         illegal_input_tablesel = 5
                         no_authorization       = 6
                         ncum_not_supported     = 7
                         illegal_download       = 8
                         illegal_tablename      = 9
                         OTHERS                 = 11.
      ENDWHILE.
    hope this helps...
    Olivier.

  • Remote Function Call (RFC) within a BAdI in ECC to CRM

    I've a remote enabled FM in a CRM system which I want to call within a BAdI implementation of a ECC system. As a result, the CRM system is the RFC server and the ECC system is the RFC client.
    The FM in CRM simply gets the relevant rows of a Z table which, of course, only exists in CRM and passes these rows to the calling program as per parameter supplied by the calling program.
    Now the BAdI in ECC is for changing 'Contracts' data in SAP (transactional data) before posting the contracts in the ECC database. The business uses a transaction where a large number of contracts are processed and documents posted in the system - and when this happens the system runs through (calls) the BAdI one contract at a time.
    If I call the RFC enabled FM anywhere within this BAdI, it gets the data for one contract only so it reduces a great deal of performance in regards to memory consumption, network load etc. So I want to avoid this and call the RFC FM once instead, if possible.
    Is it possible to call this RFC FM once only (to load the CRM Z table data for all contracts) and store it in a global table/area within the instantiated BAdI class (visibility public) so that when the BAdI is called the second time onwards it can read the global table/area by READ TABLE WITH KEY statement and avoid the RFC call for each BAdI call?
    I was also thinking about may be using ABAP Shared Memory if this is a possibility in order to avoid the repeated RFC call? But this table on the RFC server changes frequently....so it might not be a good idea? or....??
    I would greatly appreciate your inputs and thoughts regarding this; it would be great to hear if someone had had a similar experience.
    Cheers,
    Sougata.

    As the Z table is only updated via a particular program in CRM - we developed and called a RFC enabled FM in that report when its updating the Z table to update the Z table in ECC to keep it in sync.
    Short term benefit but might be long term pain if the Z table in CRM is updated by another program/process/application in the future! Not to mention any table field changes in CRM has to be also made in ECC everytime which is again a pain.
    This is a workaround and definitely not a full-proof solution - but I guess these days one has to shut up and deliver whatever the customer wants!

  • How to call a (catalog) stored procedure directly in a xsodata file with in/output parameters

    I am new to XS but i managed to enable a table through xsodata:
    service namespace "sap.hana.democontent.epm" { 
      "AA465342"."TMP_HENK" as "TMP_HENK"; 
    But now i am looking for code that can call a stored procedure that has 2 input- and 3 output parameters.... who can help me out with this?

    Hi Vivek, thanks for the quick response!
    I already found that blog, but it does not completely answer my question. i am struggling to get my content procedure working. call the R (catalog) stored procedure:
    the code
    /********* Begin Procedure Script ************/
    BEGIN
        call "AA465342"."MO_PP_SENTIMENT"(SP_IN,SP_OUT) with overview;
    END;
    /********* End Procedure Script ************/
    where it goes wrong:
    : Only table variable is allowed in input parameter in a nested call
    I have defined SP_IN and SP_OUT....
    Can someone give me a clue what i have to change?

  • Write-Behind Caching and Re-entrant Calls

    Support Team -
         The Coherence User Guide states that:
         "The CacheStore implementation must not call back into the hosting cache service. This includes OR/M solutions that may internally reference Coherence cache services. Note that calling into another cache service instance is allowed, though care should be taken to avoid deeply nested calls (as each call will "consume" a cache service thread and could result in deadlock if a cache service threadpool is exhausted)."
         I have Load-tested a use case wherein I have two caches: ABCache and BACache. ABCache is accessed by the application for write operation, BACache is accessed by the application for read operation. ABCache is a write-behind cache whose CacheStore populates BACache by reversing key and value of each cache entry stored in the ABCache.
         The solution worked under load with no issues.
         But can I use it? Or is it too dangerous?
         My write-behind thread-count setting is left at default (0). The documentation states that
         "If zero, all relevant tasks are performed on the service thread."
         What does this mean? Can I re-enter the caching service if my thread-count is zero?
         Thank you,
         Denis.

    Dimitri -
         I am not sure I fully understand your answer:
         1. "Your test worked because write-behing backing map invokes CacheStore methods asynchronously, on a write-behind thread." In my configuration, I have default value for thread-count, which is zero. According to the documentation, that means that CacheStore methods would be executed by the service thread and not by the write-behind thread. Do I understand this correctly?
         2. "If will fail if CacheStore method will need to be invoked synchronously on a service thread." I am not sure what is the purpose of the "service thread". In which scenarios the "CacheStore method will need to be invoked synchronously on a service thread"?
         Thank you,
         Denis.

  • Nested perform on commit error

    hi all,happy new year 2006
    in my custom transaction upon save,
    iam calling a Func module in update task passing all the internal tables which contain the update data.
    inside this FM iam doing table updates without commit and also calling change document funcs ( open,single/multiple case/close) to update the CDHDR and CDPOS tables.
    iam also calling BAPI_SALESORDER_CHANGE inside this update task FM. after the call iam calling BAPI_TRANSACTION_COMMIT.
    Iam getting an update task termination message saying that there are nested perform on commit statements happenening in some some SAP prog call and therefore it causes a dump. i have seen that the fm 'CHANGEDOCUMENT_CLOSE' calls a 'perform on commit'.
    but not able to figure out where exactly is the problem.
    any suggestions.
    thanks a lot.

    Hi KP!
    I'm sure you can't call BAPI_TRANSACTION_COMMIT in an update task - there a commit is a forbidden statement.
    I had a short look at CHANGEDOCUMENT_CLOSE:
    *    don't call this form on COMMIT when you are already in a form on
    *    commit
        IF sy-oncom = 'P'.
          PERFORM swe_event_create_changedocumnt.
        ELSE.
          PERFORM swe_event_create_changedocumnt ON COMMIT.
        ENDIF.
    At least here (and on release 640, ERP 5.0) a different coding for update tasks is executed.
    Do you have a shortdump, where you can check exact place of the nested call? Or is this a generation error -> again try to check exact place.
    Regards,
    Christian

  • Problem in Call Selection Screen

    Hi,
    I am facing a problem on the call selection screen. The no. of nested screens that can be called by using call selection screen is 50. When the count reaches to 51 it is going to short dump. How can i avoid the dump. What is the system field that captures the nested screens count.
    Thanx in advance,

    Maximum number of nested CALL SCREEN is 50, I think you cannot call 51th screen in a row.
    To avoid short dump you can handle exception <b>DYNP_TOO_MANY_CALL_SCREENS</b> and give error (or information) message 'Maximum number of nested sccreen level is 50' .
      TRY .
          CALL SCREEN 100.
        CATCH cx_root .
          MESSAGE e100(00).
      ENDTRY.

  • Calling Forms

    Hi,
    How to hide the Query Find window?
    I have 2 forms(XX, YY) . I'm calling YY from XX. Both forms having Query Find window.
    While calling from XX, how to hide YY's query find window.
    I have given like this
    CALL_FORM('YY');
    hide_view('QUERY_FIND');
    set_view_property('QUERY_FIND',visible, property_false);
    show_view('XX_CAN');
    go_block('XX_BLK');
    set_view_property('XX_CAN',visible, property_true);
    GO_ITEM(':XX_BLK.field1');
    It is calling 'YY' form. But is it not hiding the query find window. After closing the 'YY', it shows Invalid Canvas id.
    How to hide the query find window.
    Pl. help.
    Thanks in ADvance.
    Kavi

    HI
    create a procedure something like this.
    PROCEDURE Close_Win_With_Children( parent_win VARCHAR2 ) IS
    the_child VARCHAR2(40);
    the_parent VARCHAR2(40);
    BEGIN
    FOR j IN 1..the_Rowcount LOOP
    the_parent := Get_Group_Char_Cell(gc_parent,j);
    /* If we find a matching parent in the table */
    IF UPPER(the_parent) = UPPER(parent_win) THEN
    the_child := Get_Group_Char_Cell(gc_child,j);
    ** Close this child and any of its children
    Close_Win_With_Children( the_child );
    END IF;
    END LOOP;
    ** Close the Parent
    Hide_Window( parent_win );
    END;
    BEGIN
    ** Setup
    rg_id := Find_Group(’WINDOW_HIERARCHY’);
    gc_parent := Find_Column(’WINDOW_HIERARCHY.PARENT_WINDOW’);
    gc_child := Find_Column(’WINDOW_HIERARCHY.CHILD_WINDOW’);
    the_Rowcount := Get_Group_Row_Count(rg_id);
    /* Close all the child windows of ’wn_name’ */
    Close_Win_With_Children( wn_name );
    /* Navigate to the Destination Item supplied by the caller */
    Go_Item( dest_item );
    END;
    sarah

  • Making 'local' service calls from within services

    WARNING! I realise that this will seem a strange set of conditions, but if people
    could bear
    with it that would be great.
    We are integrating a number of existing 'legacy' systems. A number of these systems
    are
    Tuxedo based, with existing services available. We are required to 'orchestrate'
    a number of
    calls to these services. Therefore we are to write a 'Top Level' service which
    will co-ordinate the
    calls to the existing services. Ideally we would like to reduce the number of
    server-to-server calls made by this new service and make direct/inline calls to
    the existing services. We could make changes to the existing services and get
    them to expose a 'local' interface (i.e. a sidedoor into the application). But
    . . . we could do a direct call to the 'tpservice' API for each service. However,
    we do perceive one problem here, in that the service we call will eventually call
    tpreturn, and this will 'shoot' straight past out 'Top Level' service, not allowing
    us to see and handle the response buffer.
    The question arising form the strange setup is - Can the jump performed by tpreturn
    be 'interrupted? Can we catch the tpreturn before it gets back to the Tuxedo runtime?
    Can we use TRY/CATCH somehow to CATCH all tpreturn within the block?(I have had
    a quick look at this, but was a tad confued by it)?
    Or does anyone have any thoughts on what we are doing - with the obvious ideal
    of minimal if not NO impact on existing services?
    By the way the existing services are 'C' based, generated by a third party toolset.
    The 'Top Level' would be in-house 'C'.
    Thanks
    Simon

    What if the output buffer used by the service is the input buffer?
    "Simon McDonald" <[email protected]> wrote:
    Anthony
    In the function which 'catches' the tpreturn, after it has done its
    processing and before tpreturn-ing itself, it will free the return buffer
    that it was given. It is just a normal Tux buffer and tpfree works fine
    (even though the app run within the tpservice routine tpalloc-ed the
    buffer)
    Thanks for the interest - if you have any more thoughts, let me know.
    Simon
    "Anthony Fryer" <[email protected]> wrote in message
    news:[email protected]...
    How do you deal with memory management of tuxedo buffers? I mean thetuxedo tpreturn
    will automatically free the output buffer. If you're overridding tpreturnwhat
    happens to the output buffer? Just curious.
    "Simon McDonald" <[email protected]> wrote:
    Scott,
    Thanks for the reply. Since jotting the memo I have been having a
    play.
    I have created a shared library (we are on UNIX boxes), with a function
    called tpreturn in it. This tpreturn checks to see it there has been
    a
    current jump point created by us - if not, it gets (and retains) ahandle
    to
    the Tuxedo tpreturn (using shload/dlopen etc), and calls that. Ifa jump
    point has been created by us then it longjumps to that (retainingthe
    info
    supplied in the call).
    To force our tpreturn to be invoked in preference, we have/can either
    archive the objects for our version into the main executable or linked
    our
    shared in such a position that the loader finds it before Tuxedoswhen
    looking for the symbol.
    Therefore, before we call the tpservice routine locally/inline, weset
    a
    jump point, and when this existing service calls tpreturn, it returns
    to our
    jump point (based on the above), we then do our extra processing.And
    when
    we call tpreturn, there is no current jump point and so it calls the
    real
    tpreturn.
    A bit convoluted maybe!!, but at the moment it seems to hang together
    not
    too bad.
    Thanks for any input
    Simon
    "Scott Orshan" <[email protected]> wrote in message
    news:[email protected]...
    The tpreturn is done with longjmp, so I don't think you'd be able
    to
    intercept it.
    For now, you'll have to change the existing service code so thatit
    knows whether it should 'return' or 'tpreturn'.
    Scott
    Simon wrote:
    WARNING! I realise that this will seem a strange set of conditions,
    but
    if people
    could bear
    with it that would be great.
    We are integrating a number of existing 'legacy' systems. A numberof
    these systems
    are
    Tuxedo based, with existing services available. We are required
    to
    'orchestrate'
    a number of
    calls to these services. Therefore we are to write a 'Top Level'service
    which
    will co-ordinate the
    calls to the existing services. Ideally we would like to reduce
    the
    number of
    server-to-server calls made by this new service and make
    direct/inline
    calls to
    the existing services. We could make changes to the existing servicesand get
    them to expose a 'local' interface (i.e. a sidedoor into theapplication). But
    . . we could do a direct call to the 'tpservice' API for each
    service.
    However,
    we do perceive one problem here, in that the service we call willeventually call
    tpreturn, and this will 'shoot' straight past out 'Top Level'
    service,
    not allowing
    us to see and handle the response buffer.
    The question arising form the strange setup is - Can the jump
    performed
    by tpreturn
    be 'interrupted? Can we catch the tpreturn before it gets back
    to
    the
    Tuxedo runtime?
    Can we use TRY/CATCH somehow to CATCH all tpreturn within the
    block?(I
    have had
    a quick look at this, but was a tad confued by it)?
    Or does anyone have any thoughts on what we are doing - with theobvious
    ideal
    of minimal if not NO impact on existing services?
    By the way the existing services are 'C' based, generated by a
    third
    party toolset.
    The 'Top Level' would be in-house 'C'.
    Thanks
    Simon

  • When a context node use non-singleton, how to invoke the supply funtion eve

    when a context node use non-singleton, how to invoke the supply funtion everytime the lead selection is changed ?

    Hi wei,
    <b>Non-singleton nodes:</b>
    Web Dynpro allows you to define non-singleton nodes. Each non-singleton node has one node instance for each node element of the parent collection at runtime. The advantage is that each instance can be accessed directly. When using non-singleton nodes, the nodes are only created when the node values are retrieved. This can save resources that otherwise would slow down the performance of the application.
    <b>Supply function:</b>
    The Web Dynpro tools also automatically enhance the corresponding controller class with a supply function including the user coding area contained in it
    Supply functions are implemented as methods of type
    <b>public void supplyChildNodeElements(SomeChildNode node,
                                        SomeParentNodeElement)</b>
    in a Web Dynpro controller (view controller or custom controller). Supply functions and context nodes have a 1..1 relationship, that is, supply functions are specific for individual context nodes. Under certain conditions, supply functions are called by pages in the Web Dynpro runtime environment.
    Hope this helps u,
    Regards,
    Nagarajan.

Maybe you are looking for