Incorrect Nesting, before the statement ENDFUNCTION

Hello:
I have this simple ABAP program, but I don't seem to make it work:
FUNCTION Z_SAP_GET_CREDIT.
""Interfase local
*"  IMPORTING
*"     VALUE(CLIENT_ID) TYPE  Z_CLIENT_ID OPTIONAL
*"  EXPORTING
*"     VALUE(CREDIT_LIMIT) TYPE  STRING
*"     VALUE(CONDITIONS) TYPE  STRING
*"  EXCEPTIONS
*"      USER_DOES_NOT_EXIST
TYPES: BEGIN OF credit_eq_type,
         WEBTR  TYPE string,
         ZTERM  TYPE int4,
       END OF credit_eq_type .
DATA: credit_eq TYPE credit_eq_type.
SELECT SINGLE *
FROM KNB1
INTO CORRESPONDING FIELDS OF credit_eq
WHERE KUNNR = CLIENT_ID.
*CREDIT_LIMIT = credit_eq-WEBTR.
ENDFUNCTION
I get this error:
Incorrect Nesting, before the statement "ENDFUNCTION", the structure introduced by SELECT must conclude with "END SELECT"
I've done selects before and it wasn't needed.... what is this?
Thanks
Alex

Even though you are specifying SELECT SINGLE * in your code, you are not providing the full key of KNB1 which also includes company code BUKRS. So system expects either a ENDSELECT or your INTO statement to be followed by TABLE itab instead of just INTO strcuture. That is why you got this error. So either do option 1 or 2 as follows.
<u>Option 1</u>
TYPES: BEGIN OF credit_eq_type,
         WEBTR LIKE KNB1-WEBTR,
         ZTERM LIKE KNB1-ZTERM,
       END OF credit_eq_type .
DATA: credit_eq TYPE TABLE OF credit_eq_type with header line.
SELECT SINGLE webtr zterm FROM KNB1
                          INTO TABLE credit_eq
                         WHERE KUNNR = CLIENT_ID.
*CREDIT_LIMIT = credit_eq-WEBTR.
<u>Option 2</u>
TYPES: BEGIN OF credit_eq_type,
         WEBTR LIKE KNB1-WEBTR,
         ZTERM LIKE KNB1-ZTERM,
       END OF credit_eq_type .
DATA: credit_eq TYPE credit_eq_type.
SELECT webtr zterm FROM KNB1 UP TO 1 ROWS
                   INTO credit_eq
                  WHERE KUNNR = CLIENT_ID.
ENDSELECT.
*CREDIT_LIMIT = credit_eq-WEBTR.
<u>Option 3</u>
TYPES: BEGIN OF credit_eq_type,
         WEBTR LIKE KNB1-WEBTR,
         ZTERM LIKE KNB1-ZTERM,
       END OF credit_eq_type .
DATA: credit_eq TYPE credit_eq_type.
SELECT SINGLE webtr zterm FROM KNB1
                          INTO Credit_eq
                         WHERE KUNNR = CLIENT_ID
                           AND BUKRS = <either constant
or another import parameter from the function module>.
*CREDIT_LIMIT = credit_eq-WEBTR.
3rd option is the best one if you have BUKRS. In the case where you don't have BUKRS, use the option 1. Option 2 is least efficient. <b>But in any case, please do not use SELECT * with INTO CORRESPONDING FIELDS when you need only two fields. Instead specify the fields AND yes you cannot use INTO with incompatable fields. They have to be compatible.
Srinivas
Message was edited by: Srinivas Adavi

Similar Messages

  • Error: Before the statement "FORM", conclude with "ENDFUNCTION

    Hi All,
    I'm using this exit :EXIT_SAPLVEDA_001.
    In this exit include zxvedu03 is used.
    I have written a perform in this include  zxvedu03  :
    perform abc.
    I have written the code
    form abc.
                                             endform.
    in include ZXVEDF01.
    I have called this
    includeZXVEDF01
    in the last line of include zxvedu03.
    Now i'm getting error :
    Incorrect nesting: Before the statement "FORM", the structure 
    introduced by "FUNCTION" must be concluded with "ENDFUNCTION".
    I have even tried to create include from perform statement and then inserted code and vise versa too but results are same.
    Please suggest how can i revolve this error.
    Thanks.

    Hi,
    This is my code of include ZXVEDU03:
    if ( contrl-sndsad in rl_var2 ) or ( contrl-sndsad in rl_var1 ).
    *** Uncommented below perform
      perform contract_determine using contrl-sndsad segment
                                                     dxvbak
                                                     dxvbap
                                                     dxvbadr
                                                     dd_flag_k.
    endif.
    ***statements**
    include zxvedf01.
    Code in includeZXVEDF01 :
    form contract_determine using    p_cntrl_sndsad p_segment type edidd
                                                    p_dxvbak   structure wa_dxvbak
                                                    p_dxvbap   structure wa_dxvbap
                                                    p_dxvbadr  structure wa_dxvbadr
                                                    p_d_flag_k structure wa_d_flag_k.
    *** statements**
    endform.
    Note: Include ZXVEDU03 is in EXIT_SAPLVEDA_001 and ZXVEDF01 is in ZXVEDU03.
    EXIT_SAPLVEDA_001-> ZXVEDU03->ZXVEDF01

  • Deployment connection was released before the state of deployment was known

    Hi Friends,
    I am facing deployment error on Weblogic 9.2. When I am publishing my ear after building it is giving error -->
    Deployment connection was released before the state of deployment was known.[Deployer:149034]An exception occurred for task [Deployer:149026]deploy application ear on AdminServer.: .
    Please find the error stack trace below:
    java.lang.Exception: Exception received from deployment driver. See Error Log view for more detail.
         at oracle.eclipse.tools.weblogic.server.internal.WlsJ2EEDeploymentHelper$DeploymentProgressListener.watch(WlsJ2EEDeploymentHelper.java:1558)
         at oracle.eclipse.tools.weblogic.server.internal.WlsJ2EEDeploymentHelper.deploy(WlsJ2EEDeploymentHelper.java:470)
         at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishWeblogicModules(WeblogicServerBehaviour.java:1338)
         at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishToServer(WeblogicServerBehaviour.java:795)
         at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishOnce(WeblogicServerBehaviour.java:615)
         at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publish(WeblogicServerBehaviour.java:508)
         at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:707)
         at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:2492)
         at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:270)
         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
    This same ear is working on my team member's machine. I have compared weblogic.xml and .settings files with her files and there is not any difference. I am not able to resolve this error.
    Please help me to resolve this error.
    Regards,
    Raj

    Hello.
    Is there something in WL server log?
    Regards.

  • Incorrect nesting error in user exit include

    Hi,
    In one of my requirement I had to add an additional screen using EXIT_SAPMM06E_016, this Function module exists in XM06 Function group, this exit holds an include ZXM06U41.
    This function group holds screens, so when I implement a screen and create the PBO module in this particular include, it by default includes
    MODULE STATUS_XXX OUTPUT.
    ENDMODULE.
    When i check this include it says:
    Incorrect nesting: Before the statement "MODULE", the structure introduced by "FUNCTION" must be concluded with "ENDFUNCTION".
    I have no clue where the open function is?
    Your help will be very much appreciated.
    Please help.
    Thanks,
    -Sandeep

    You cannot define a screen module in a function module code.
    Refer to available documentation how to properly implement enhancements of this kind. Enhancement name is MM06E005 (in SMOD). Screen definitions and the corresponding modules will happen in function group XM06, not in the exit function module.
    Edit: To elaborate, your PBO module will go into include ZXM06ZZZ, or better yet, into new include ZXM06O01 which should be part of ZXM06ZZZ (just to keep the usual naming convention).
    Edited by: Tamas Hoznek on Feb 28, 2012 2:51 PM

  • Incorrect nesting in smartfroms program-line

    Hi .
    when i have use code in different program it's work fine .
    but when same code use in smartforms program-lines it's give me following error.
    Incorrect nesting: Before the statement "FORM", the structure introduced by "FUNCTION" must be concluded by "ENDFUNCTION" . . .
    Regards.
    Sam.

    HI
    My code
    DATA mwsbp TYPE komp-mwsbp .
    data : p_ebeln TYPE ekpo-ebeln ,
    p_ebelp TYPE ekpo-ebelp .
    *data: p_mwsbp TYPE komp-mwsbp .
    PERFORM calculate_tax USING p_ebeln p_ebelp CHANGING mwsbp .
    FORM calculate_tax USING p_ebeln TYPE ekpo-ebeln
    p_ebelp TYPE ekpo-ebelp
    CHANGING p_mwsbp TYPE komp-mwsbp .
    CONSTANTS: bstyp_info VALUE 'I',
    bstyp_ordr VALUE 'W',
    bstyp_banf VALUE 'B',
    bstyp_best VALUE 'F',
    bstyp_anfr VALUE 'A',
    bstyp_kont VALUE 'K',
    bstyp_lfpl VALUE 'L',
    bstyp_lerf VALUE 'Q'.
    DATA : taxcom TYPE taxcom ,
    t_konv TYPE TABLE OF komv WITH HEADER LINE .
    DATA: BEGIN OF tkomv OCCURS 50.
    INCLUDE STRUCTURE komv.
    DATA: END OF tkomv.
    DATA: BEGIN OF tkomvd OCCURS 50. "Belegkonditionen
    INCLUDE STRUCTURE komvd.
    DATA: END OF tkomvd.
    DATA : BEGIN OF tkomvh OCCURS 50.
    INCLUDE STRUCTURE komv.
    DATA : vtext LIKE t685t-vtext.
    DATA : END OF tkomvh.
    SELECT SINGLE *
    INTO ekko
    FROM ekko
    WHERE ebeln = p_ebeln .
    SELECT SINGLE *
    INTO ekpo
    FROM ekpo
    WHERE ebeln = p_ebeln
    AND ebelp = p_ebelp .
    SELECT SINGLE *
    INTO t001
    FROM t001
    WHERE bukrs = ekko-bukrs .
    taxcom-bukrs = ekpo-bukrs.
    taxcom-budat = ekko-bedat.
    taxcom-waers = ekko-waers.
    taxcom-kposn = ekpo-ebelp.
    taxcom-mwskz = ekpo-mwskz.
    taxcom-txjcd = ekpo-txjcd.
    taxcom-shkzg = 'H'.
    taxcom-xmwst = 'X'.
    IF ekko-bstyp EQ bstyp_best.
    taxcom-wrbtr = ekpo-netwr.
    ELSE.
    taxcom-wrbtr = ekpo-zwert.
    ENDIF.
    taxcom-lifnr = ekko-lifnr.
    taxcom-land1 = ekko-lands.
    taxcom-ekorg = ekko-ekorg.
    taxcom-hwaer = t001-waers.
    taxcom-llief = ekko-llief.
    taxcom-bldat = ekko-bedat.
    taxcom-matnr = ekpo-ematn.
    taxcom-werks = ekpo-werks.
    taxcom-bwtar = ekpo-bwtar.
    taxcom-matkl = ekpo-matkl.
    taxcom-meins = ekpo-meins.
    IF ekko-bstyp EQ bstyp_best.
    taxcom-mglme = ekpo-menge.
    ELSE.
    IF ekko-bstyp EQ bstyp_kont AND ekpo-abmng GT 0.
    taxcom-mglme = ekpo-abmng.
    ELSE.
    taxcom-mglme = ekpo-ktmng.
    ENDIF.
    ENDIF.
    IF taxcom-mglme EQ 0.
    taxcom-mglme = 1000.
    ENDIF.
    taxcom-mtart = ekpo-mtart.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    CALL FUNCTION 'J_1BSA_COMPONENT_ACTIVE'
    EXPORTING
    bukrs = ekko-bukrs
    component = 'BR'
    EXCEPTIONS
    component_not_active = 1
    OTHERS = 2.
    *endfunction.
    IF sy-subrc IS INITIAL.
    komk-mandt = ekko-mandt.
    komk-kalsm = ekko-kalsm.
    IF ekko-kalsm = ''.
    komk-kalsm = 'RM0000'.
    ENDIF.
    komk-kappl = 'M'.
    komk-waerk = ekko-waers.
    komk-knumv = ekko-knumv.
    komk-lifnr = ekko-lifnr.
    komp-kposn = ekpo-ebelp.
    komp-matnr = ekpo-matnr.
    komp-werks = ekpo-werks.
    komp-matkl = ekpo-matkl.
    komp-infnr = ekpo-infnr.
    komp-evrtn = ekpo-konnr.
    komp-evrtp = ekpo-ktpnr.
    CALL FUNCTION 'RV_PRICE_PRINT_ITEM'
    EXPORTING
    comm_head_i = komk
    comm_item_i = komp
    language = 'E'
    TABLES
    tkomv = tkomv
    tkomvd = tkomvd.
    CALL FUNCTION 'J_1B_NF_PO_DISCOUNTS'
    EXPORTING
    i_kalsm = ekko-kalsm
    i_ekpo = ekpo
    IMPORTING
    e_ekpo = ekpo
    TABLES
    i_konv = t_konv.
    IF NOT ekko-llief IS INITIAL.
    taxcom-lifnr = ekko-llief.
    ENDIF.
    ENDIF.
    CALL FUNCTION 'FIND_TAX_SPREADSHEET'
    EXPORTING
    buchungskreis = t001-bukrs
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    CALL FUNCTION 'CALCULATE_TAX_ITEM'
    EXPORTING
    i_taxcom = taxcom
    IMPORTING
    e_taxcom = taxcom
    EXCEPTIONS
    mwskz_not_defined = 1
    mwskz_not_found = 2
    mwskz_not_valid = 3
    steuerbetrag_falsch = 4
    country_not_found = 5
    OTHERS = 6.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    p_mwsbp = taxcom-wmwst .
    WRITE:/  mwsbp .
    ENDFORM. " calculate_tax
    Regard
    Sam

  • Smartform error: Incorrect nesting

    Hi,
       I have been trying to use Spell_Amount in smartform. The code I have used is working fine in report but giving following error in smartform :
    Incorrect nesting: Before statement "Form", the structure introduced by "Function" must be concluded with "Endfunction".
    Code I have used is:
    TABLES SPELL.
    DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
    Data : S_WRBTR LIKE BSEG-WRBTR.
    SY-TITLE = 'SPELLING NUMBER'.
    PERFORM SPELL_AMOUNT USING s_wrbtr 'inr'.
    FORM spell_amount USING s_wrbtr pwaers.
      CALL FUNCTION 'SPELL_AMOUNT'
           EXPORTING
                amount    = s_wrbtr
                currency  = pwaers
                filler    = space
                language  = 'E'
           IMPORTING
                in_words  = t_spell
           EXCEPTIONS
                not_found = 1
                too_large = 2
                OTHERS    = 3.
    endform.
    Can I have some help?
    Thnx

    Try the following code:
    it worked for me.
    In Global Definitions --> Global Data Define:
    WORDS type Spell
    wt_total type tablename-fieldname " wt_total is the field you want in words.
    Create a Window Words and place it after you have the value of wt_total.
    In Window Words:
    Rt. Click--> Create --> flow Logic --> Program Lines
    Output Parameters --> wt_total,
                                         Words.
    call function 'SPELL_AMOUNT'
    exporting
       amount          = wt_total
    *   CURRENCY        = ' '
    *   FILLER          = ' '
    *   LANGUAGE        = SY-LANGU
    importing
       in_words        = words
    * EXCEPTIONS
    *   NOT_FOUND       = 1
    *   TOO_LARGE       = 2
    *   OTHERS          = 3
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    3. Create a text and put value
    &Words-word& in it.
    Let me know if it worked...
    <removed by moderator>
    Edited by: Thomas Zloch on Feb 17, 2012

  • Incorrect nesting upgrade from 4.5b to ecc 6.0

    Hi All,
    Please let me know when ever try to activate the program  i got incorrect nesting:Before start-of-selection the structure introduced by if must be concluded by endif, even if and endif exists also.
    If i removed start-of-selection it showed statement is not accessble.
    Please go through the following code and give suggestions regarding this.
    Thanks in Advance,
    Padmaja.
      INCLUDE MZF112F81RS001                                             *
    update zhotelrep_log of latest changes RS001
         tp_cchangemade = 'X'.
         IMPORT TP_CCATCH_CUR_VBAP FROM MEMORY ID 'catch'.      "RS001
         IF TP_CCATCH_CUR_VBAP = ' '.
    get all item.
           SELECT *
            FROM VBAP
            INTO CORRESPONDING FIELDS OF TABLE TA_VBAP_NEW
           WHERE VBELN EQ WA_RB_VBAK-VBELN
             AND MATKL IN RA_MATKL.
            and VGTYP eq wa_rb_vbak-vbtyp.
           PERFORM PROCESS_ACTIVITY_LOG.
           PERFORM ZHOTELREP_LOG_UPDATE.
           TP_CCATCH_CUR_VBAP = 'X'.
           EXPORT TP_CCATCH_CUR_VBAP TO MEMORY ID 'catch'.      "RS001
          perform zhotelrep_log_update.
         ENDIF.

    You will have to look for SAP Release Notes for version 4.7 (Enterprise) and also SAP ERP 5.0 + 6.0
    Yes that's a lot, but a big upgrade jump too.

  • [svn:fx-trunk] 9407: Reordering the if-statement in isMeasureFixed() exposed that hostFormat can be null when measure() is called if styles changed and measure is done before the next commitProperties .

    Revision: 9407
    Author:   [email protected]
    Date:     2009-08-19 15:11:34 -0700 (Wed, 19 Aug 2009)
    Log Message:
    Reordering the if-statement in isMeasureFixed() exposed that hostFormat can be null when measure() is called if styles changed and measure is done before the next commitProperties.  This states test exposed this.
    We should rethink if we want to clear hostFormat rather than have a hostFormatChanged flag.  If there is no hostFormat at measure then it has to be fixed because there is no line break format to check for auto-size.
    QE notes:
    Doc notes:
    Bugs: SDK-22779
    Reviewer: Gordon
    Tests run: checkintests
    Is noteworthy for integration: no
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22779
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/RichEditableText.as

    Oh my god, it is too long! You definitely check out types, casting and especially ODP.Net (it does everything for you)... etc. They can help you to simplify your code. I do not have enough time to copy paste it to Studio and understand and solve your issue, so I got title of your message as your main question.
    In Oracle, you can create an autonumber field by using sequences object. This is really useful when you need to create a unique number to act as a primary key.
    Basically you can create a sequence simply typing;
    CREATE SEQUENCE MY_SEQUENCE;
    now you have a sequence called "MY_SEQUENCE"... Then, I advice you select a number from sequence;
    select MY_SEQUENCE.nextval from dual;
    I said I advice actually kinda must, although it called sequence, I cannot be sequential. Do not even try to predict the value. You can be sure that it is unique number so you can use it.
    Then insert you record and use that number part of your primary key. I think that's it. Have fun.

  • I am trying to pay my bill online.  However, when I click the "submit" key, it tells me my "nickname" is incorrect.  What the heck is a nickname?  I have never had this trouble before.

    I am trying to pay my bill online.  However, when I click the "submit" key, it tells me my "nickname" is incorrect.  What the heck is a nickname?  I have never had this trouble before.

    Had the same problem. Here's how I sorted it out, not including yelling at my PC or ranting in my own thread (that's optional): First you want to delete your saved payment option. If you try this and it does not delete, log out and back in. It should be gone. Now re-enter your payment option (credit card number or whatever you are using) and if it asks if you want to save the data for future use, make sure you give it a nickname that doesn't include any special characters. Hope this works for you!

  • How can I fix the Runtime Error R6034 so that I can correctly install iTunes on my PC ? I get a notice that states ' An application has made an attempt to load the C runtime library incorrectly - Please contact the application's support team for more info

    How can I fix the Runtime Error R6034 so that I can correctly install iTunes on my PC ? I get a notice that states ' An application has made an attempt to load the C runtime library incorrectly - Please contact the application's support team for more info

    Hey Debbiered1,
    Follow the steps in this link to resolve the issue:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    When you uninstall, the items you uninstall and the order in which you do so are particularly important:
    Use the Control Panel to uninstall iTunes and related software components in the following order and then restart your computer:
    iTunes
    Apple Software Update
    Apple Mobile Device Support
    Bonjour
    Apple Application Support (iTunes 9 or later)
    Important: Uninstalling these components in a different order, or only uninstalling some of these components may have unintended affects.
    Let us know if following that article and uninstalling those components in that order helped the situation.
    Welcome to Apple Support Communities!
    Take care,
    Delgadoh

  • The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.

    Hello All,
    I am getting below error can you please help me
    Error:-
    The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.

    Perhaps this thread will help you out
    http://stackoverflow.com/questions/11453066/error-the-transaction-associated-with-the-current-connection-has-completed-but
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Buying a US iPad2 to Use in UK. Do I need to initialise it before I leave the States?

    Hi everyone
    I'm getting my wife an iPad2 for her birthday. I'm in the States right now, and they are about £100 cheaper here.  I kow I need to buy an AT&T version for it to work with a UK mircoSIM (Vodafone), but I am finding conflicting info on whether I need to initialise the iPad before I leave.
    Does anyone know for sure?
    Many thanks!

    The US prices that you see on the Apple website do not include local sales tax. Legally, an honest person must declare the iPad at Customs and pay import tariffs to take the iPad into the UK. After all that, you will not likely save the £100 that you expect. And if your caught sneaking the iPad into the UK you risk loss of the item.  Buy your wife's iPad in the UK when you get home.
    It should not matter which country you are in when you initiate the iPad.

  • How to write select statement before the loop and how to use read statemnt

    Hi,
    Recently our system has changed from 4.6 to ECC6.
    As its migrated its showing lots of errors like in between loop and endloop there should be no select statemnt........
    Can any one please tell how to write that coding in ECC6 , how can i change the code......
    In between loop and endloop i am having lots of select statemnts.....ple tell thye coding how can i select before the loop starts and
    how to read that internal table in loop.

    Hi Deepthi,
    You can do as per below:
    1) Select the required entries from the tables you need (VBAK, VBAP, KNA1, etc)
    SELECT VBELN ERDAT KUNNR
        into table it_vbak
        from VBAK
    where VBELN = S_VBELN. "Selection criteria
    If sy-subrc = 0.
    SELECT VBELN POSNR MATNR
        into table it_vbap
        from VBAP
    for all entries in it_vbak
    where VBELN = it_vbak-vbeln
    SELECT KUNNR NAME1
        into table it_vbak
        from VBAK
    where VBELN = it_vbak-vbeln.
    endif.
    2) Loop at the entries, and read internal table it-kna1 for customer info.
    Loop at it_vbak into wa_vbak.
    read table it_kna1 into wa_kna1 with key kunnr = wa_vbak-kunnr.
    if sy-subrc = 0.
    endif.
    loop at it_vbap into wa_vbap where vbeln = wa_vbak-vbeln.
    endloop.
    endloop.
    This is the basic idea and short example of how to extract entries and read internal table.
    Hope this helps.
    Regards,
    Patrick

  • Msg 530, Level 16, State 1, Line 4, The statement terminated. The maximum recursion 100 has been exhausted before statement completion.

    I wrote the query below to try and see id there is any day during the start and to date when there is no activity, but keep getting the problem above.
    declare
    @date_fromdatetime,@date_todatetime
    set
    @date_from=convert(datetime,'01/04/2014',103)
    set
    @date_to=convert(datetime,'31/12/2015',103)
    withdatesas(
    select@date_fromasdt
    unionall
    selectDATEADD(d,1,dt)fromdateswheredt<@date_to
    select
      d.dt,isnull(total_qty,0)astotal_qty
    from
    datesd
    left
    join(
    select  
    [arrival date],count(*)astotal_qty
    from    
    Customers
    where   
    [arrival date]between@date_fromand@date_to
    groupby[arrival
    date]
    sond.dt=s.[arrival
    date]
    order
    byd.dt

    In future when posting code, please post it in a code block (second button from the right).
    Also, please include example data and DDL (as I have at the top of my example).
    After cleaning up your code, and creating a demo object for you, I found that the statement itself is fine, and the problem is likely in your dates object.
    I used my calendar in place of your dates object:
    DECLARE @customers TABLE ([arrival date] DATETIME)
    INSERT INTO @customers ([arrival date]) VALUES
    ('2015-01-04'),('2015-01-05'),('2015-01-06'),('2015-01-07'),('2015-01-08'),('2015-01-07'),('2015-01-08'),('2015-01-11'),('2015-01-12')
    ;with dates as(
    select @date_from as dt
    union all
    select DATEADD(d,1,today)
    from calendar
    where today < @date_to
    SELECT *
    FROM dates d
    LEFT OUTER JOIN (
    SELECT [arrival date], COUNT(*) AS total_Qty
    FROM @customers
    WHERE [arrival date] between @date_from and @date_to
    GROUP BY [arrival date]
    ) s
    ON d.dt = s.[arrival date]
    You can find my calendar table here: http://social.technet.microsoft.com/wiki/contents/articles/29260.tsql-calendar-functions-and-tables.aspx
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

  • How do I unsync, restore my bookmarks, etc. to the state before the sync.

    I need to unsync my bookmarks etc. That is restore to the condition before the sync.

    See: http://support.apple.com/kb/HT4686
    Wordpress is probably the best, most popular blogging software. http://wordpress.org
    To convert iWeb to Wordpress see: http://www.ragesw.com/products/iweb-to-wordpress.html

Maybe you are looking for

  • How to deal with "Script stopped responding" in general Part 3

    OK, I have asked about this issue before, and am back because it won't go away. First, I have tried resetting Firefox. Yesterday was the most recent time. I have tried using add-on Script Blockers. The Script Blocker program worked for a while. The p

  • Custom SmartForm for Purchase Order Printing

    Hi, I need a customized smartform for purchase order, which is called after the standard transaction ME9F. I adjusted "Conditions for Output Control" by using transaction NACE  ( Erased the name of the form MEDRUCK, Entered my customized smartform's

  • Display messed up

    We have 3 G5 towers and an older g4 tower with a apple studio display. For some reason i had it on sleep and when we came into the office this morning the display was all out of wack. Does anyone know the problem. It's almost like it's trying to fit

  • How to partial stroke a valve using limit switches

    Hi there. I am trying to write a small piece of code which will allow me to perform a partial stroke on a valve from the open position. To perform this test, the valve has to be in the open position, and a partial stroke button needs to be pushed onc

  • Saving a file in iFS.

    I am looking for confirmation that I am properly adding objects to our repository through a Java application that uses the iFS API. We have an Oracle 8.17 database accessed by iFS 1.1. There is already a customization of the oracle.ifs.beans.Document