Regarding leave program statement.

Because of using LEAVE PROGRAM statement in LOAD-OF-PROGRAM event the BDC report is going to dump can any one tell me the alternation for LEAVE PROGRAM statement its urgent please?

You're technically not allowed to do anything that would cause the program to exit in the LOAD-OF-PROGRAM event, STOP is also not allowed.
The best way I know to make sure the program exits completely is to set a flag in the LOAD-OF-PROGRAM event, and then use "RETURN" or something similar to leave the event.  The next event to run will be INITIALIZATION, from which you can check the flag and call "LEAVE PROGRAM". With no problems.
(You can also sometimes move everything to the INITIALIZATION event, depending upon your needs.)

Similar Messages

  • Differnece between EXIT and LEAVE TO SCREEN or LEAVE PROGRAM?

    HI Experts,
    Differnece between EXIT and LEAVE TO SCREEN or LEAVE PROGRAM?
    thanks in advance

    Syntax
    EXIT.
    Effect
    If the EXIT statement is executed outside of a loop, it will immediately terminate the current processing block.
    After the prodessing block has been executed, the runtime environment behaves in such a way that it follows with the exception Reporting Event Blocks START-OF-SELECTION and GET the schema from Leave Processing Blocks.
    After the Reporting Processing Blocks START-OF-SELECTION and GET have been exited using EXIT, the runtime environment does not trigger any further reporting events. Instead, it directly calls the list processor for displaying the basic list.
    Note
    We recommend using EXIT only within loops (see EXIT (loops) ). Instead, use RETURN to leave processing blocks.
    LEAVE [TO] SCREEN
    Syntax
    LEAVE { SCREEN | {TO SCREEN dynnr} }.
    Variants:
    1. LEAVE SCREEN.
    2. LEAVE TO SCREEN dynnr.
    Effect
    This statement ends the processing of the current screen. The current processing block of the ABAP program and the current processing block of the dynpro are left immediately.
    Variant 1
    LEAVE SCREEN.
    Effect
    The variant LEAVE SCREEN calls the current next screen. This is either statically specified in the properties of the current screen or has been set before using the statement SET SCREEN.
    Variant 2
    LEAVE TO SCREEN dynnr.
    Effect
    The variant LEAVE TO SCREEN calls the screen with the number dynnr as the next screen. A data object of the type n of the length 4 is expected for dynnr. It must contain either the screen number of a screen in the main program of the current program group or the value 0. Otherwise, an exception that cannot be handled is raised. This statement is a short form of the statements SET SCREEN dynnr and LEAVE SCREEN.
    Note
    This statement does not terminate the entire dynpro sequence; it branches to an additional screen in the same sequence. Only if the number 0 is used to branch to the next screen, LEAVE SCREEN terminates the screen sequence.
    LEAVE PROGRAM
    Syntax
    LEAVE PROGRAM.
    Effect
    This statement immediately ends the current main program and deletes its internal session - including all loaded programs, instances, and their data .
    The LEAVE PROGRAM statement can appear anywhere within any processing blocks. It ends the program regardless of the program/object or the program group of the internal session in which it is executed.
    Regards,
    Pavan P.

  • Difference between exit and leave program

    Hi,
    what is the difference between exit and leave program.
    I want to come to sap screen which one have to use.?
    Thanks,
    srii.

    Hi,
    EXIT is used to end the Further processing after The EXIT Statement if the condition does not meet.
    The output before EXIT is then Displayed.
    But LEAVE PROGRAM is used to Leave the defined program just after the the Statement.
    Generally if to Coming Back to Calling Program after the Processing of Called Program it is used.Or After a Certain Statement if you want to Leave the program.
    Follow the link-
    http://help.sap.com/saphelp_nw2004s/helpdata/en/71/9f893f17493c17e10000000a114084/content.htm
    http://www.sapbrainsonline.com/ARTICLES/TECHNICAL/ABAP/CALL%20ANOTHER%20PROGRAM%20FROM%20LIST.html
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba50035c111d1829f0000e829fbfe/content.htm
    Regards,
    Sujit

  • REPORT/PROGRAM statement missing, or program type is INCLUDE error upgrade.

    Hi Experts,
    I have done the recording for FK05 and created functionmodule for the same. But when I use that function module in my custom program or if I try directly execute the FM, I am getting dump like syntax error. So I did syntax check and tried to activate, I am getting "REPORT/PROGRAM statement missing, or program type is INCLUDE error upgrade" error.
    Please help me soon to resolve this issue.
    Thanks in advance.
    Shreyansh

    Hi
    Goto main function group include name attributes tab and double click.
    once the include is opened, try to activate it. if shows errors then fix.
    regards
    Shiva

  • Error: REPORT/PROGRAM statement missing , program type is I (include).

    Hi,
    I have created a REPORT Program (Z Program) and also created a TOP INCLUDE. I am NOT using Function module. When I tried to syntex check the INCLUDE, system is giving
    following error:
    REPORT/PROGRAM statement missing, program type I (Include).
    Can you help me in resolving this error.
    Currently TOP include has only one statement to declare a Constant.
    Thanks,

    hi,
    take your program in se80.
    double click on the program name. Right click on it and press Activate. All the include will get activated and the problem will get solved.
    Regards,
    Renjith Michael.
    http://www.sourceveda.com/

  • REPORT/PROGRAM statement missing.

    Hi,
    I have a report with two includes. In both the Include Programs,i am getting a error message 'REPORT/PROGRAM statement missing, or program type is I (INCLUDE).'
    Eg.
    Report reportname.  " program type Report
    include program1.    " program type Inlude
    include program2.    " program type Inlude
    start-of-selection.
    Please Help.
    Thanks & Regards,
    Jayapal.

    Hi ,
    This will not be any problem Jay. Since it is a Non executable program it will always show that error. You can activate the program.
    Do one thing create a test report program and call this include program in that report and execute. It will show you the result.
    I've created an example program for this, please have a look
      My Report Program :
    REPORT ZTEST.
    INCLUDE ZTESTINCLUDE.
    My Include Program :
    *&  Include           ZTESTINCLUDE
    data : a type i,
           b type i,
           c type i.
    a = 3.
    b = 2.
    c = a + b.
    write : / 'Result is :' , c.
    Try executing the Report it will show you the result 5. Tell the client this is not a problem. Check in the attributes of your Include program ( program1 ) if it is of type Include.
    Regards,
    Sai

  • Can we write leave program syntax in RFC function module.

    hello friends,
       can we write leave program syntax in RFC function module. Iam developing RFC Function module .
    useful answers will be awarded..
    Regards
    Kanth
    Edited by: Kanth on Mar 30, 2008 11:38 PM

    Don't use leave program in RFC function module. You can better use EXIT or RETURN. But when developing RFC modules you should use the return structure BAPIRET2 to store message generated in the calling system. So when you use EXIT or RETURN, first give a message so the calling program knows why the RFC module was exited.

  • Message class defined as part of report/program statement

    Hi,
    This is a very general question but I am not sure to what this refers to.
    "Message class defined as part of report/program statement"
    What does this mean or what is this referenced to?
    Thanks
    Edited by: David Rivera on Feb 3, 2010 10:36 PM

    Hello,
    it means when you are creating a report / program you can assign one message class to that...
    like:
    report Ztest message-id <message class>
    then you can access all the messages defined in that message class...
    Thanks
    K.

  • LEAVE PROGRAM, no commit?

      DELETE FROM zvfnvrd.
    * Check if delete ís OK
      SELECT COUNT(*)
             FROM zvfnvrd.
      IF sy-subrc = 0.
        WRITE:/ 'Try again'.
    <<<<<<<HERE>>>>>>>>>>>
      ENDIF.
    Hi,
    How to leave program without COMMIT WORK.
    If I use LEAVE PROGRAM, commit work is stil done.
    Adibo.

    Hi,
    ROLLBACK WORK before LEAVE PROGRAM is not working.
    So if I have database table with lets say 20 records.
    When calling DELETE FROM table, if 10 record have been deleted and 10 have NOT been deleted I can't ROLLBACK?
    Its strange.
    When I'am in DEBUGGING MODE and have called DELETE FROM table an then I execute program bij simply closing the window, I get all the records back. So nothing is deleted!!
    Adibo

  • Leave Program or leave to transction from subscreen

    Hi All,
    I am doing some validation in my subscreen and if i want to move out of subscreen ie i want to navigate to the other transaction or leave to screen 0 means how to make it?? i am getting sme error like in subscreen submit to screen is not allowed.
    Tnx,
    joe

    Hi Joe,
    The flow logic of a subscreen screen may not contain any dialog modules containing the statements
    SET TITLEBAR, SET PF-STATUS, SET SCREEN, LEAVE SCREEN, or LEAVE TO SCREEN.
    Any of these statements causes a runtime error.
    You cannot change the GUI status of a main screen in a subscreen screen.
    The flow logic of a subscreen screen may not contain a MODULE ... AT EXIT-COMMAND statement. Type E functions may only be handled in the main screen.
    Subscreens cannot have their own OK_CODE field. Function codes linked to user actions on subscreens are placed in the OK_CODE field of the main screen. This also applies to subscreen screens defined in a different program to the main screen.
    Regards,
    Md Ziauddin.

  • Object-oriented programming: state and behaivor

    First of all, sorry for my level english.
    In Object-Oriented programming, should an object save always some state?
    What about session stateless bean service? What is the sense?
    These objects have only behaivour and not state.
    Perhaps, the sense is that you can send a message to this object, in oposite of a static methods in utility class?
    Thanks and regards.

    I suppose you could argue that if it doesn't have any state, then it's not really an "object" in the OOP sense, but who cares, really.
    Personally, I use state and behavior as a way to help clarify the responsibilities of various classes in the system, and if I see a codebase with a lot of objects with state but no behavior or behavior but no state, then it's a a red flag that it's a messy, poorly-thought-out design (and it usually turns out to be exactly that). The whole point of OOP (IMHO) is encapsulation, and bundling state and behavior together makes things encapsulated (you can prove that state changes only in certain areas in certain circumstances). Encapsulation makes for more easily maintainable code.
    It's easy to spot the blue squares in a Mondrian. It's difficult to spot the blue bits in a Pollock. The former is well-encapsulated OOP and the latter is poorly-encapsulated spaghetti code.
    That said, it's not the end of the world if you have a static utility class here and there.

  • Regarding ABAP program to read and manipulate data from Excel file....

    Hi,
    I want to write a ABAP program which will read Excel file which has three columns viz: Col A, Col B and Col C.
    If there is no data in Col B and Col C for a given record in Column A, then progam should print all those records on screen with write statement.
    Regards,
    Rajesh.

    Hi
    Check
    PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01,
    begcol TYPE i DEFAULT 1 NO-DISPLAY,
    begrow TYPE i DEFAULT 1 NO-DISPLAY,
    endcol TYPE i DEFAULT 100 NO-DISPLAY,
    endrow TYPE i DEFAULT 32000 NO-DISPLAY.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = filename
    i_begin_col = begcol
    i_begin_row = begrow
    i_end_col = endcol
    i_end_row = endrow
    TABLES
    intern = intern
    EXCEPTIONS
    inconsistent_parameters = 1
    upload_ole = 2
    OTHERS = 3.
    After getting Records in INTERN TABLE  You can loop it to check where columns B & C are empty  and store them in another table .
    LOOP AT intern.
    IF INTERN  B and C has value  .
    CONTINUE
    ELSE .
    MOVE THEM INTO ANOTHER TABLE ITAB .
    ENDIF .
    ENDLOOP.
    THEN LOOP ITAB .
    WRITE : ' '
    ENDLOP .
    Hope this Helps .
    Praveen

  • Questions on BDC program statements.....

    Hi,
    Currently i am checking below BDC program for packing material use.
    But there is a statement that i am not very clear what it is for...
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'V51VE-EXIDV(01)'.
    For the  'V51VE-EXIDV(01)', here why need to add an (01) at the end.  What does the (01) means??
    Thanks!!!!
      LOOP AT i_lips.
        CLEAR: i_bdc_tab,i_msg_tab.
        REFRESH: i_bdc_tab,i_msg_tab.
        PERFORM bdc_dynpro      USING 'SAPMV50A' '4004'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LIKP-VBELN'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'LIKP-VBELN'
                                      i_lips-vbeln.
        PERFORM bdc_dynpro      USING 'SAPMV50A' '1000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=VERP_T'.
    *perform bdc_field       using 'LIKP-BLDAT'
    *                              record-BLDAT_002.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LIPS-POSNR(01)'.
    *perform bdc_field       using 'LIKP-WADAT'
    *                              record-WADAT_003.
    *perform bdc_field       using 'LIKP-WAUHR'
    *                              record-WAUHR_004.
    *perform bdc_field       using 'LIKP-BTGEW'
    *                              record-BTGEW_005.
    *perform bdc_field       using 'LIKP-GEWEI'
    *                              record-GEWEI_006.
        PERFORM bdc_dynpro      USING 'SAPLV51G' '6000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'V51VE-VHILM(01)'.
        PERFORM bdc_field       USING 'V51VE-VHILM(01)'
                                      'BOX'.
    *Select all materails
        PERFORM bdc_dynpro      USING 'SAPLV51G' '6000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=HU_MARKA'.
    *Select all Boxes
        PERFORM bdc_dynpro      USING 'SAPLV51G' '6000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=HUMARKHU'.
    *perform bdc_field       using 'V51VE-SELKZ(01)'
    *                              record-SELKZ_01_008.
        PERFORM bdc_dynpro      USING 'SAPLV51G' '6000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=HU_VERP'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'V51VE-EXIDV(01)'.
        PERFORM bdc_dynpro      USING 'SAPLV51G' '6000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=SICH'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'V51VE-EXIDV(01)'.
        CALL TRANSACTION 'VL02N' USING i_bdc_tab
                          MODE p_mode
                          MESSAGES INTO i_msg_tab.
    Message was edited by:
            Hoo Laa

    And if this is a BDC running in background, or a call transaction, then placing the cursor on a given field has no effect unless it is needed for navigation to the next screen. 
    When you record a BDC using SHDB there are a lot of statements like this that are added in but are not needed for the BDC to work. 
    Another example is the "BDC_SUBSCR" field name - this does not in most cases appear to have any effect on how the BDC is processed.
    Also, the recording will include fields which have default values on the screen that you do not need to overwrite with the same value from the BDC.
    I often delete these statements from the recording, taking care that I understand what the impact is.  You can try commenting out the line and see what difference it makes to processing. 
    When using a BDC for updating a lot of records, having less of these types of lines in the BDCDATA table will speed performance a bit.
    Andrew

  • Help needed regarding Dynamic Programming

    Hi,
    While doing dynamic programming , we bind the context variable with two types of
    values .
    1 . ddic
    2 . extern
    My doubt is in which case we should use ddic and where to use extern .
    Can anybody help me out regarding this.
    Thanks a lot.

    Hi Ki,
    Predefined, Web Dynpro UI-specific, and user-defined Dictionary types all have the
    prefix ddic:.
    wdContext.getNodeInfo()
    .addAttribute(
    "Visibility",
    "ddic:com.sap.ide.webdynpro.uielementdefinitions.Visbility")
    •&#61472;Logical Dictionary types from Adaptive RFC models have the prefix extern:.
    Check this links
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9214b1e5-0601-0010-fdb0-ec32d43b06e0
    /people/dipankar.saha3/blog/2007/05/31/how-to-create-dynamic-approval-process-using-conditional-loop-block-in-guided-procedure
    Regards,
    Mithu

  • Regarding a select statement

    hi,
    i got a select statement in my program as shown below
    select * from ce4e001 where bukrs eq s_bukrs-low.
    check s_kndnr.
    check s_prctr.
    move-corresponding ce4e001 to v_ce4e001.
    append v_ce4e001.
    endselect.
    now i want to rewrite this select statement with using  into table like
    select * from ce4e001 into table v_ce4e001 where bukrs eq s_bukrs-low.
    but my problem is
    in the initial select statement they have used two check statements before appending
    now how can i incorporate those two check statements in my new select statement
    thanks
    ram

    Hi Ram,
    Not sure why the check keywords where embedded within the select statments...it will have no impact if the selection variable where outside.
    You could rewrite your new code as:
    check s_kndnr.
    check s_prctr.
    select * from ce4e001 into table v_ce4e001 where bukrs eq s_bukrs-low.
    Assign points if it works.
    Thanks
    -Saif

Maybe you are looking for

  • Open Error 5

    My macbook recently went through a hard drive upgrade. Mac Unibody mid 2009, 2.26 GHz, originally 160 GB HD and 2 GB RAM. My mac now has a 1 TB HD. I had it installed about 2 months ago and it has been working fine. All off a sudden my mac would not

  • Auto-email Acrobat x standard form

    A page on my web site will be a fillable Acrobat X Standard .pdf.   How can I have a "button" for the user to press to email the completed form to me?   I can't afford the $499 Pro version, which I know will do this...have to use X Standard.   Thanks

  • Error while runinning OWB map.

    Hi all, I have installed OWB 10G. I am trying to run a simple map to load data from EMP table scott schema to another table(emp_test) in test_tgt schema. No transformations or expressions used. But at the time of deploying I get following error. ORA-

  • Strange errors in session replication

              I get following errors in session replication :           weblogic.utils.NestedError: Tried to update secondary, but it thought           it was the primary           - with nested exception:           [weblogic.cluster.replication.BadStatu

  • My safari is crashing immediately the V 8.0.2

    i cant even see the problem issue my safari is crashing immediately the V 8.0.2