Budget Amount Restore for adjustment entries....

Hi All,
I have a scenario on hand, a PR and PO was created on GL/CI which commited budget correctly, the commitment was converted to actuals with service entry sheet and the vendor also is also honored with payment. After the payment was made we realized the expense is booked to a wrong GL code which mean wrong commitment item. now we need restore the budget back to the GL code which consumed budget incorrectly. In order to do so, i posted a journal entry by Dr..Correct GL code and Cr Incorrect GL code ( which was used in the PO cycle). but the budget is not restored.
In the funds management document the field "Amount Type" is 100 for the above entry and the field "Value Type" is 66 for the above entry.
Please advice.
Regards
Abishay Solomon

Hi Alex,
There are 2 line items in the FM document and both are value type "66".
Hi Eli,
The FM document generate is not statistical. There are 2 line items and both are (Real-Budget Relevenat).
What should I check further, please advice.
Regards
Abishay Solomon

Similar Messages

  • How to set up Approval or Alter for Budget amount.

    Hi,
    We need to set Approval based on monthly Budget amount wise
    ex: We set up budget amount Total year is 60000 based on GL Account (Service Charges)wise in Budget scenario set up per month is i.e., April 5000
    May = 5000
    June = 5000
    July = 5000
    Aug = 5000
    Sep= 5000
    Oct = 5000
    Nov = 5000
    Dec = 5000
    Jan = 5000
    Feb = 5000
    Mar = 5000. when user is adding more than 5000 for the month April though this service charges general ledger account in AP Invoice or Manual Journal entries or Out going payment we need to give alter like you need get approval, after getting approval only he need add these documents. Here we have taken example he got approval for 6000 for the month April. next month he may added 2000 through service charges acct here remaining 3000 we need to carry forward to next month and we need to show in alter when he using service charges general ledger account available budget balance for June is 8000 but here also if he using more than 5000 for the June month same Approval we need to show like You need to get approval. How we can set up for this? This is my query below
    SELECT T0.BudgId, T0.Line_ID, T0.DebLTotal, T0.DebSTotal, T0.DebRLTotal, T0.FtrIDRSSum, T0.FtrODRLSum, T0.FtrODRSSum, T0.MonthPrcnt, T0.AcctCode FROM BGT1 T0 WHERE T0.DebLTotal >5000 and T0.Acctcode=4110101001 this query I added in terms under Approval template set up for AP Invoice but when am adding Ap invoice through Service charges GL account itu2019s not showing approval message. Please guide me how to solve this?
    And Case 2. I tried though SP also to block if Budget amount exceed in AP and Manual Je but it's not blocking documents. Below SP
    Begin
    set @check1 = ((select inv1.linetotal from bgt1
    cross join  inv1
    WHERE  bgt1.acctcode=inv1.acctcode and inv1.Docentry=@list_of_cols_val_tab_del))
    set @check2 = ((select bgt1.debLtotal from bgt1
    cross join  inv1
    WHERE  bgt1.acctcode=inv1.acctcode and inv1.Docentry=@list_of_cols_val_tab_del))
    If (@check1 >@check2 )
    begin
    SET @error = 10
    SET @error_message = N'You Need take Approval from Finance Head, please forward mail to FH....'
    end
    end
    Please guide how to setup Alters or Approval or SP for these requirements.
    Regds,
    Sampath Kumar.

    Hi,
    the above requirement we are going develop add on.below code is there. in this code how we can set for line level amount instead of document total amount
    Private Function GetCondition(ByVal sCondition As String) As ApprovalTemplateConditionTypeEnum
            Try
                Select Case sCondition
                    Case "Deviation from Credit Limit"
                        Return (ApprovalTemplateConditionTypeEnum.atctDeviationFromCreditLine)
                    Case "Deviation from Commitment"
                        Return (ApprovalTemplateConditionTypeEnum.atctDeviationFromObligo)
                    Case "Gross Profit %"
                        Return (ApprovalTemplateConditionTypeEnum.atctGrossProfitPercent)
                    Case "Discount %"
                        Return (ApprovalTemplateConditionTypeEnum.atctDiscountPercent)
                    Case "Deviation from Budget"
                        Return (ApprovalTemplateConditionTypeEnum.atctDeviationFromBudget)
                    Case "Total Document"
                        Return (ApprovalTemplateConditionTypeEnum.atctTotalDocument)
                End Select
            Catch ex As Exception
                MsgBox(ex.Message())
            End Try
        End Function
    Please guide me.
    Regds,
    Samapth Kumar.

  • TDS adjustment entries for incorrect section code

    Hi,
    I would like to do the adjustment entry for the incorrectly captured TDS amounts on the downpayment request. While creating the down payment request the TDS code was incorrectly captured in section code 194I instead of 194J. The downpayment was also done incorrectly and hence the TDS has been captured with section code 194I. I am not sure how to make the adjustment entries for the above scenerio
    Thanks,
    Leena

    Hi Leena,
    The below link might be of some help to you:
    http://scn.sap.com/thread/2075629
    Please check and let me know.
    Regards,
    Chetan Shetty

  • For display budgeted amount in cost center what is table in sap?

    For display budgeted amount in cost center what is table in sap?

    Hi,
    Is it budget or planning ? Budget is in BPJA; while planning is mainly in COSS, but also in COSP.
    Regards,
    Eli

  • The budget amount is not sufficient for release

    Dear All,
    Fund Management: Error. when posting budgeting document with transaction code  FMBB and FMBBC, I am getting error massage " The budget amount is not sufficient for release.
    Message no. FMKU083
    The budget amount is not sufficient for release
    Diagnosis
    The Eligible released budget is greater than the Eligible consumable budget for FM account assignment QPCP/Q001/QP-ADMINEXPENSES/QPIL.
    Please note that the absolute value of the amount is specified. Even if the actual amount is negative, the comparison will always be made with the positive value.
    Total released budget  = Release Budget to be posted by the current document +  Release Budget already in the Database.
    Total budget  = Budget to be posted by the current document +  Budget already in the Database.
    u2022     (Absolute) Total Eligible released budget  = 200,000.00
    u2022     (Absolute) Total Eligible consumable budget  = 0.00
    Important remark concerning the release on period:
    The document to be created includes the amount on the period. But  the check  "Release against Budget" will nevertheless involve the amounts of the whole fiscal year.
    Example:
    Released budget on period 10 = 100
    Budget on period 10 = 600
    So, unreleased budget on period 10 = 500
    But as:
    Total Release Budget over the fiscal year =  980
    and Total Budget  over the fiscal year =  1000
    980 + 500 > 1000 so the release cannot be done. An error message FMKU083 is displayed and the values in the long text are:
    (Absolute) Total released budget  = 1480
    (Absolute) Total budget  = 1000
    System Response
    Processing stops. The error is displayed in the application log.
    Procedure
    There are two options for further processing:
    u2022     You can post a further amount to be included in the Eligible budget.
    u2022     You can decrease the amount of Eligible released budget to be posted.
    Do the Needful,
    hope for the best solution..
    Regards,
    LC..

    Hi Waman Shirwaicar
    I have applied the below Notes,
    Note 1092634 Budget Release: error FMKU 083
    Note 1328037 FMMPRELE: error FMKU083
    Total released budget = Release Budget to be posted by the current document + Release Budget already in the Database.
    Total budget = Budget to be posted by the current document + Budget already in the Database.
    u2022     (Absolute) Total Eligible released budget = 200,000.00
    u2022     (Absolute) Total Eligible consumable budget = 0.00
    Important remark concerning the release on period:
    The document to be created includes the amount on the period. But the check "Release against Budget" will nevertheless involve the amounts of the whole fiscal year.
    but still getting the " The budget amount is not sufficient for release"
    I have configured Control ledger "9H",  in settings for availability control ledger
    and unable to do Configuration for "9I"   define fitter settings for budget values -->Define Consumable budget & Define budget values as consumed amounts.
    error: FM budget value do not enter ledger "9I" as consumed amounts.
    and the difference between Control ledgers "9H & 9I" need solution for configuration of Control Ledger "9I".
    do the needful.
    your early action highly solicited.
    hope for the solution.
    Regards,
    Lucky Pandu.

  • Settlement rule amount exceeding budgetted amount

    Dear all,
    We have following scenario for our Client sytems.
    Level 1 WBS are used for orgnization.
    Level 2 WBS are used for planning & budgetting.
    It will have structure as A0**-GX-**.
    Level 3 WBS are used for actual postings.
    It will have structure as A0**GX**.
    Now under CJ03, when user selects level 2 WBS and then click on settlement rule, can he be allowed to input amount which is more than budgetted amount for this WBS.
    If yes,what is the setting we have to do? If no, please tell me why user can not be allowed to do this?
    Any pointers on this will be highly appreciated.
    Thanks
    Tushar Vhora

    Unable to understand your query.
    What is stopping you to maintain the amount settlement rule on Level 2 WBS? Settlement will only credit this sender WBS element and I don't think budget or availability control will come into picture and cause any problem. For amount settlement to happen, set the 'Amount Settlement' indicator in settlement profile.
    If your case is Level 3 WBS settling to Level 2 WBS and you've got limited budet on Level 2 WBS, you'll have issues while settling because of availability control (if active).
    To resolve this you've 2 options:
    1. Use settlement cost element (NOT By Cost Element) settlement and exempt this cost element from availability control using T Code OPTK
    2. Else adjust the budget on level 2 WBS suitably to allow settlement to happen.
    Regards
    Sreenivas

  • How do I restore an adjusted version from Time Machine?

    I use time machine.
    How do I restore an adjusted version?
    E.g. I take a 1000 pix, bring them into a project, spend a few days making adjustments.
    Client cancels project.
    I delete project.
    Month later I figure out a new market for that project.  (Yeah, I shouldn't have been so quick to delete...Work with me)
    I can restore the masters from Time Machine. (I use referenced images)
    How do I recover my adjustments, without overwriting my library?  Groveling through the .aplibrary they are stored as xml files, but there is a chane of references and set of encoding that is not transparent.
    At this point the ONLY way I can see is to:
    *  Rename my present library
    *  Restore the entire library, whcih if I have lots of images can take hours.
    *  Find the project.
    *  Export the project.
    *  Delete extra library.
    *  Rename my original library.
    While this gets my adjustments back, it does NOT get them back in an editable form.  they are now locked in.
    Is there a way to export versions as version info?  E.g. as an xml file that sits in the same directory as the master?
    Spin the question differently.  How can I send YOU a set of versions of a particular master, WITHOUT copying the data of the master for each version.
    Say we have referenced files on a network server.  I want to send you a version, but NOT the master.
    E.g.  I send you ONE master, and 6 versions of it.  In YOUR version of aperture how can you load the 6 versions to continue tweeking them.

    There is another, huge thread on TM backups on this forum and exactly this issue has come up. Sadly, no one has a perfect answer. I do not have a spare drive available to test this myself, but I would try something along these lines.
    -- Ask TM to restore your full Library and the Masters, if Referenced. I believe that TM will give you the option to not overwriting your current Library, but be careful. However you do, stick this "Recovery Library" out somewhere. (Yes, this is gonna take some time, run it overnight.)
    -- Open "Recovery" with Aperture and select the Project(s) that contain the images you want. Export these "Projects as New Library."  (Don't export as either Versions or Masters.) I would select the box "Consolidate Masters" and I would probably discard the Previews. Stick this somewhere.
    -- Now open "Original Library" and import the "Library" that you exported back into your Original Library as something like "Stupid Lost Project."
    -- You should now have a Project full of adjusted, and adjustable images. (N.B. this is basically the technique I use with my laptop. I shoot, load into AP3 on the laptop, noodle, and then export/import into AP3 on the MacPro when I get home.)
    -- Clean up. (Delete "Recovery", convert the recovered Project back to Referenced Masters, if you wish, etc.)
    One good argument for never throwing those old USB drives away.
    I have missed some of the details in the process, so be careful, but I believe that this will work until Apple lets us run Aperture inside Time Machine.
    Best wishes.

  • Performance issue with select query and for all entries.

    hi,
    i have a report to be performance tuned.
    the database table has around 20 million entries and 25 fields.
    so, the report fetches the distinct values of two fields using one select query.
    so, the first select query fetches around 150 entries from the table for 2 fields.
    then it applies some logic and eliminates some entries and makes entries around 80-90...
    and then it again applies the select query on the same table using for all entries applied on the internal table with 80-90 entries...
    in short,
    it accesses the same database table twice.
    so, i tried to get the database table in internal table and apply the logic on internal table and delete the unwanted entries.. but it gave me memory dump, and it wont take that huge amount of data into abap memory...
    is around 80-90 entries too much for using "for all entries"?
    the logic that is applied to eliminate the entries from internal table is too long, and hence cannot be converted into where clause to convert it into single select..
    i really cant find the way out...
    please help.

    chinmay kulkarni wrote:Chinmay,
    Even though you tried to ask the question with detailed explanation, unfortunately it is still not clear.
    It is perfectly fine to access the same database twice. If that is working for you, I don't think there is any need to change the logic. As Rob mentioned, 80 or 8000 records is not a problem in "for all entries" clause.
    >
    > so, i tried to get the database table in internal table and apply the logic on internal table and delete the unwanted entries.. but it gave me memory dump, and it wont take that huge amount of data into abap memory...
    >
    It is not clear what you tried to do here. Did you try to bring all 20 million records into an internal table? That will certainly cause the program to short dump with memory shortage.
    > the logic that is applied to eliminate the entries from internal table is too long, and hence cannot be converted into where clause to convert it into single select..
    >
    That is fine. Actually, it is better (performance wise) to do much of the work in ABAP than writing a complex WHERE clause that might bog down the database.

  • SD Flow program using For all entries.

    using simple ALV grid: I have the urgent requirement of changing the following program using 'For all entries' instead of joins and I should not use 'TABLES' -- For top-of-page I need to get dynamic fields like if I select company code in the selection screen then I need to get 'This report is base on COMPANY CODE'.
    This program is about sales flow where i shud get only those records that have ebeln in vbak, delivery, invoice.
    The original program is as follows:
    *& Report  ZSD_DOCU_FLOW                                               *
    REPORT  zsd_docu_flow  NO STANDARD PAGE HEADING                    .
    * Program     : ZCOS_SALES                                           *
    * Dev. Class  :  ZSD
    * Functional  :
    * Created on  :                                                        *
    * Project     :
    * CR Number   :
    * Transaction :  ZSDCSUT                                               *
    * Description :   * Sales document life cylce for given customer
    *                  to declaired period displaying the sales document
    *                  details ,with relevant del details and corresponding
    *                  Invocie Details
    *-----------     Tables Declaration      -----------*
    TABLES: vbak,vbap,vbfa,kna1,vbrk,vbrp,likp,lips,t001.
    TYPE-POOLS : slis.
    *-----------    Internal Tables Declaration      -----------*
    *      Internal Table for Sales Order data                   *
    DATA: BEGIN OF it_so OCCURS 0,
            vbeln LIKE vbak-vbeln,
            kunnr LIKE vbak-kunnr,
            posnr LIKE vbap-posnr,
            matnr LIKE vbap-matnr,
            kwmeng LIKE vbap-kwmeng,
            netwr LIKE vbap-netwr,
         END OF it_so.
    *      Internal Table for Delivery Order data                   *
    DATA: BEGIN OF it_del OCCURS 0,
            delnum  LIKE likp-vbeln,
            lfdat LIKE likp-lfdat,
            delitem LIKE lips-posnr,
            lfimg LIKE lips-lfimg,
          END OF it_del.
    *      Internal Table for Invoice data                          *
    DATA: BEGIN OF  it_inv OCCURS 0,
            invnum LIKE vbrk-vbeln,
            invitem LIKE vbrp-posnr,
            fkimg LIKE vbrp-fkimg,
            amount LIKE vbrp-netwr,
         END OF it_inv.
    *      Internal Table for Final data                            *
    DATA: BEGIN OF it_final OCCURS 0,
            vbeln LIKE vbak-vbeln,
            posnr LIKE vbap-posnr,
            kunnr LIKE vbak-kunnr,
            name LIKE kna1-name1,
            matnr LIKE vbap-matnr,
            kwmeng LIKE vbap-kwmeng,
            netwr LIKE vbap-netwr,
            delnum  LIKE likp-vbeln,
            lfdat LIKE likp-lfdat,
            delitem LIKE lips-posnr,
            lfimg LIKE lips-lfimg,
            invnum LIKE vbrk-vbeln,
            invitem LIKE vbrp-posnr,
            fkimg LIKE vbrp-fkimg,
            amount LIKE vbrp-netwr,
         END OF it_final.
    *-----------    Variables Declaration      -----------*
    DATA: v_name LIKE kna1-kunnr," variable for customer name
          v_delnum LIKE likp-vbeln," variable for delivery number
          v_invnum LIKE vbrk-vbeln." variable for invoce number
    DATA : ls_layout TYPE slis_layout_alv,
           it_fcat TYPE slis_t_fieldcat_alv ,
           wa_fcat TYPE slis_fieldcat_alv,
           lh TYPE slis_t_listheader,
           ls TYPE slis_listheader,
           it_events TYPE slis_t_event  ,
           ls_event TYPE slis_alv_event ,
           i_sort     TYPE slis_t_sortinfo_alv,
           w_var TYPE i.
    DATA : l_date(10).
    DATA : l_date1(20).
    DATA : l_repid LIKE trdir-name.
    l_repid = 'ZSD_DOCU_FLOW1'.
    *-----------    Select-options & parameters Declaration  ---*
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_bukrs LIKE vbak-bukrs_vf,
                 p_vkorg LIKE vbak-vkorg,
                p_vtweg LIKE vbak-vtweg,
                p_spart LIKE vbak-spart.
    SELECT-OPTIONS: s_kunnr FOR vbak-kunnr,
                    s_audat FOR vbak-audat.
    SELECTION-SCREEN END OF BLOCK b1.
    *----------- AT SELECTION-SCREEN  --------------------------*
    AT SELECTION-SCREEN.
      SELECT SINGLE * FROM  t001 INTO t001
                                WHERE bukrs = p_bukrs.
      IF sy-subrc <> 0.
        MESSAGE e000(8i) WITH 'Enter a Valid Company Code'.
      ENDIF.
      SELECT SINGLE * FROM vbak INTO vbak
                              WHERE vkorg = p_vkorg.
      IF sy-subrc <> 0.
        MESSAGE e000(8i) WITH 'Enter a Valid Sales Organization'.
      ENDIF.
      SELECT SINGLE * FROM vbak INTO vbak
                                WHERE vtweg = p_vtweg.
      IF sy-subrc <> 0.
        MESSAGE e000(8i) WITH 'Enter a Valid distribution channel'.
      ENDIF.
      SELECT SINGLE * FROM vbak INTO vbak
                                WHERE spart = p_spart.
      IF sy-subrc <> 0.
        MESSAGE e000(8i) WITH 'Enter a Valid Division'.
      ENDIF.
      SELECT SINGLE * FROM kna1 INTO kna1
                                WHERE kunnr IN s_kunnr.
      IF sy-subrc <> 0.
        MESSAGE e000(8i) WITH 'Enter a Valid Customer Number'.
      ENDIF.
    *----------- START-OF-SELECTION-----------------------------*
    START-OF-SELECTION.
      ls-typ = 'H'.
      ls-info = 'Sales Document Flow'.
      APPEND ls TO lh.
      ls-typ = 'S'.
      WRITE: sy-datum TO l_date USING EDIT MASK '__/__/____'.
      CONCATENATE 'DATE :' l_date INTO l_date1 SEPARATED BY space.
      ls-info = l_date1.
      APPEND ls TO lh.
      PERFORM field_cat.
      PERFORM t_sort_build USING i_sort.
      PERFORM get-data.
    *----------- END-OF-SELECTION-----------------------------*
    END-OF-SELECTION.
    IF it_final[] IS INITIAL.
        MESSAGE i000(8i) WITH 'No data Found'.
        EXIT.
      ENDIF.
    PERFORM print-data.
    *&      Form  get-data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get-data .
    *  Accesing Sales Data
      SELECT a~vbeln a~kunnr b~posnr b~matnr b~kwmeng b~netwr
       INTO CORRESPONDING FIELDS OF TABLE it_so
       FROM vbak AS a INNER JOIN vbap AS b
                             ON a~vbeln = b~vbeln
                              WHERE a~bukrs_vf = p_bukrs
                                 AND a~vkorg = p_vkorg
                                 AND  a~vtweg = p_vtweg
                                    AND a~spart = p_spart
                                     AND a~kunnr IN s_kunnr
                                          AND a~audat IN s_audat.
      LOOP AT it_so.
        SELECT SINGLE name1 FROM kna1 INTO v_name
                                         WHERE kunnr = it_so-kunnr.
        SELECT SINGLE vbeln FROM vbfa INTO v_delnum
                                          WHERE vbelv = it_so-vbeln
                                            AND  vbtyp_n = 'J'.
        IF sy-subrc = 0.
          SELECT SINGLE  vbeln FROM vbfa INTO v_invnum
                                WHERE vbelv = v_delnum
                                  AND  vbtyp_n = 'M'.
        ENDIF.
        MOVE-CORRESPONDING it_so TO it_final.
        it_final-name = v_name.
        it_final-delnum = v_delnum.
        it_final-invnum = v_invnum.
        APPEND it_final.
        CLEAR it_final.
        CLEAR v_delnum.
        CLEAR v_invnum.
      ENDLOOP.
      LOOP AT it_final.
        IF it_final-delnum NE ' '.
    * Reading Del Data.
          SELECT SINGLE  a~vbeln  a~lfdat b~posnr b~lfimg   INTO
                    (it_del-delnum, it_del-lfdat, it_del-delitem,
                     it_del-lfimg ) FROM
                        likp AS a INNER JOIN lips AS b ON a~vbeln = b~vbeln
                                   WHERE a~vbeln = it_final-delnum
                                   AND b~posnr = it_final-posnr.
          MOVE-CORRESPONDING it_del TO it_final.
          MODIFY it_final.
        ENDIF.
        IF it_final-invnum NE ' '.
    * Reading Invoice Data.
          SELECT SINGLE vbeln posnr fkimg netwr INTO
         (it_inv-invnum, it_inv-invitem, it_inv-fkimg, it_inv-amount )
                       FROM vbrp  WHERE vbeln = it_final-invnum
                                  AND   posnr = it_final-posnr.
          MOVE-CORRESPONDING it_inv TO it_final.
          MODIFY it_final.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " get-data
    *&      Form  print-data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM print-data .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                = ' '
    *     I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = l_repid
    *     I_CALLBACK_PF_STATUS_SET          = ' '
    *     I_CALLBACK_USER_COMMAND           = ' '
         i_callback_top_of_page            = 'TOP'
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  =
    *     I_BACKGROUND_ID                   = ' '
    *     I_GRID_TITLE                      =
    *     I_GRID_SETTINGS                   =
    *     IS_LAYOUT                         =
         it_fieldcat                       = it_fcat
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS                 =
         IT_SORT                           = i_sort[]
    *     IT_FILTER                         =
    *     IS_SEL_HIDE                       =
    *     I_DEFAULT                         = 'X'
    *     I_SAVE                            = ' '
    *     IS_VARIANT                        =
    *     IT_EVENTS                         =
    *     IT_EVENT_EXIT                     =
    *     IS_PRINT                          =
    *     IS_REPREP_ID                      =
    *     I_SCREEN_START_COLUMN             = 0
    *     I_SCREEN_START_LINE               = 0
    *     I_SCREEN_END_COLUMN               = 0
    *     I_SCREEN_END_LINE                 = 0
    *     IT_ALV_GRAPHICS                   =
    *     IT_HYPERLINK                      =
    *     IT_ADD_FIELDCAT                   =
    *     IT_EXCEPT_QINFO                   =
    *     I_HTML_HEIGHT_TOP                 =
    *     I_HTML_HEIGHT_END                 =
    *   IMPORTING
    *     E_EXIT_CAUSED_BY_CALLER           =
    *     ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it_final.
    *   EXCEPTIONS
    *     PROGRAM_ERROR                     = 1
    *     OTHERS                            = 2
    *  IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  ENDIF.
    ENDFORM.                    " print-data
    *&      Form  field_cat
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM field_cat .
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'VBELN'.
      wa_fcat-key = 'X'.
      wa_fcat-ref_fieldname = 'VBELN'.
      wa_fcat-ref_tabname = 'VBAK'.
      wa_fcat-seltext_m = 'Sales Order NO'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'POSNR'.
      wa_fcat-ref_fieldname = 'POSNR'.
      wa_fcat-ref_tabname = 'VBAP'.
      wa_fcat-seltext_m = 'SalesItemNO'.
      wa_fcat-fix_column = 'X'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'KUNNR'.
      wa_fcat-seltext_m = 'CUSTNUM'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'NAME'.
      wa_fcat-seltext_m = 'CUSTNAME'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'MATNR'.
      wa_fcat-seltext_m = 'MATNUM'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'KWMENG'.
      wa_fcat-seltext_m = 'Sales Quantity'.
      wa_fcat-do_sum = 'X'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'NETWR'.
      wa_fcat-seltext_m = 'Value'.
      wa_fcat-do_sum = 'X'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'DELNUM'.
      wa_fcat-seltext_m = 'DeloveryNum'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'DELITEM'.
      wa_fcat-seltext_m = 'DelItemNO'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'LFDAT'.
      wa_fcat-seltext_m = 'DelDate'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'LFIMG'.
      wa_fcat-seltext_m = 'DelQuantity'.
      wa_fcat-do_sum = 'X'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'INVNUM'.
      wa_fcat-seltext_m = 'InvoiceNum'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'INVITEM'.
      wa_fcat-seltext_m = 'InvoiceItem'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'FKIMG'.
      wa_fcat-seltext_m = 'INVQuantity'.
      wa_fcat-do_sum = 'X'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'AMOUNT'.
      wa_fcat-seltext_m = 'INVvalue'.
      wa_fcat-do_sum = 'X'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
    ENDFORM.     " field_cat
    *&      Form  top
    *       text
    FORM t_sort_build USING l_sort TYPE slis_t_sortinfo_alv.
      DATA: ls_sort TYPE slis_sortinfo_alv.
      ls_sort-fieldname = 'VBELN'.
      ls_sort-spos      = 1.
      ls_sort-up        = 'X'.
      ls_sort-subtot    = 'X'.
      APPEND ls_sort TO l_sort.
      ls_sort-fieldname = 'KUNNR'.
      ls_sort-spos      = 2.
      ls_sort-up        = 'X'.
      APPEND ls_sort TO l_sort.
    ENDFORM.                    "t_sort_bui
    FORM top.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = lh
    *   I_LOGO                   =
    *   I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP
    ===========================================================================
    I have started the new program but i have trouble with the final internal table. Since i'm using For all entries I have declared internal tables for each table. My incomplete new program is as follows(not sure if the logic is correct till what I have coded):
    *& Report  Z_SDFLOW                                                    *
    REPORT  Z_SDFLOW  NO STANDARD PAGE HEADING.
    ********* TABLES TO BE USED ***********************
    **** VBAK - SALES DOCUMENT HEADER
    * VBAP - SALES ITEM
    * VBFA - SALES DOCUMENT FLOW
    * KNA1- CUSTOMER MASTER
    * VBRK - BILLING DOCUMENT HEADER
    * VBRP - BLLING DOCUMENT ITEM
    * LIKP - DELIVERY HEADER
    * LIPS - DELIVERY ITEM
    * TOO1 - COMPANY CODES
    * SLIS.
    TYPE-POOLS: SLIS.
    ** STRUCTURE DECLARATIONS ********
    **STRUCTURE FOR ENQUIRY.
    **STRUCTURE FOR QUOTATION.
    **STRUCTURE FOR SALES ORDER HEADER- VBAK.
    TYPES: BEGIN OF XT_VBAK,
    VBELN TYPE VBAK-VBELN,     "SALES DOCUMENT NUMBER
    KUNNR TYPE VBAK-KUNNR,     " SOLD-TO-PARTY
    END OF XT_VBAK.
    **STRUCTURE FOR SALES ORDER  ITEM-VBAP
    TYPES: BEGIN OF XT_VBAP,
    POSNR TYPE VBAP-POSNR,     " SALES ITEM NUMBER
    MATNR TYPE VBAP-MATNR,     " MATERIAL NUMBER
    KWMENG TYPE VBAP-KWMENG,   " CUMMULATIVE ORDER QUANTITY IN SALES UNITS
    NETWR TYPE VBAP-NETWR,     " NET VALUE OF THE ORDER ITEM
    END OF XT_VBAP.
    ** STRUCTURE FOR DELIVERY HEADER -LIKP
    TYPES: BEGIN OF XT_LIKP,
    DELVBELN TYPE LIKP-VBELN,           "DELIVERY DOCUMENT NUMBER
    LFDAT TYPE LIKP-LFDAT,           " DELIVERY DATE
    END OF XT_LIKP.
    **STRUCTURE FOR DELIVERY ITEM - LIPS
    TYPES: BEGIN OF XT_LIPS,
    DELPOSNR TYPE LIPS-POSNR,           " DELIVERY ITEM NUMBER
    LFIMG TYPE LIPS-LFIMG,           " ACTUAL QUANTITY DELIVERED
    END OF XT_LIPS.
    **STRUCTURE FOR BILLING DOCUMENT HEADER -VBRK
    TYPES: BEGIN OF XT_VBRK,
    INVVBELN TYPE VBRK-VBELN,          "BILLING DOCUMENT NUMBER
    END OF XT_VBRK.
    **STRUCTURE FOR BILLING DOCUMENT ITEM - VBRP
    TYPES: BEGIN OF XT_VBRP,
    INVPOSNR TYPE VBRP-POSNR,          "BILLING ITEM NUMBER
    FKIMG TYPE VBRP-FKIMG,          "ACTUAL INVOICED QUANTITY
    INVNETWR TYPE VBRP-NETWR,          "NET VALUE OF THE BILLING ITEM
    END OF XT_VBRP.
    **STRUCTURE FOR FINAL INTERNAL TABLE.
    TYPES: BEGIN OF XT_FINAL,
    VBELN TYPE VBAK-VBELN,
    DELVBELN TYPE LIKP-VBELN,
    INVBELN TYPE VBRK-VBELN,
    KUNNR TYPE VBAK-KUNNR,
    POSNR TYPE VBAP-POSNR,
    DELPOSNT TYPE LIPS-POSNR,
    INVPOSNR TYPE VBRP-POSNR,
    MATNR TYPE VBAP-MATNR,
    KWMENG TYPE VBAP-KWMENG,
    NETWR TYPE VBAP-NETWR,
    INVNETWR TYPE VBRP-NETWR,
    LFDAT TYPE LIKP-LFDAT,
    LFIMG TYPE LIPS-LFIMG,
    FKIMG TYPE VBRP-FKIMG,
    NAME1 TYPE KNA1-NAME1,
    END OF XT_FINAL.
    **DATA DECLARATIONS
    DATA: V_NAME1 TYPE KNA1-NAME1,  "#EC *
          V_DELVBELN TYPE LIKP-VBELN,
          V_INVVBELN TYPE VBRK-VBELN,
          V_BUKRS TYPE T001-BUKRS,    "COMPANY CODE "#EC *
          V_AUDAT TYPE VBAK-AUDAT,
          V_VKORG TYPE VBAK-VKORG,
          V_VKGRP TYPE VBAK-VKGRP,
          V_SPART TYPE VBAK-SPART.
    **INTERNAL TABLE DECLARATIONS
    DATA: IT_VBAK TYPE STANDARD TABLE OF XT_VBAK,
          WA_VBAK TYPE XT_VBAK,
          IT_VBAP TYPE STANDARD TABLE OF XT_VBAP,
          WA_VBAP TYPE XT_VBAP,
          IT_LIKP TYPE STANDARD TABLE OF XT_LIKP,
          WA_LIKP TYPE XT_LIKP,
          IT_LIPS TYPE STANDARD TABLE OF XT_LIPS,
          WA_LIPS TYPE XT_LIPS,
          IT_VBRK TYPE STANDARD TABLE OF XT_VBRK,
          WA_VBRK TYPE XT_VBRK,
          IT_VBRP TYPE STANDARD TABLE OF XT_VBRP,
          WA_VBRP TYPE XT_VBRP,
          IT_FINAL TYPE STANDARD TABLE OF XT_FINAL,
          WA_FINAL TYPE XT_FINAL.
    **ALV DECLARATIONS
    DATA: IT_FLDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FLDCAT TYPE SLIS_FIELDCAT_ALV,
          IT_LSTHDR TYPE SLIS_T_LISTHEADER,
          WA_LSTHDR TYPE SLIS_LISTHEADER,
          IT_EVENTS TYPE SLIS_T_EVENT,
          WA_EVENTS TYPE SLIS_ALV_EVENT,
          IT_SORT TYPE SLIS_T_SORTINFO_ALV,
          IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: S_BUKRS FOR V_BUKRS NO INTERVALS NO-EXTENSION,
                    S_VBELN FOR WA_VBAK-VBELN,  "SALES DOCUMENT NUMBER
                    S_KUNNR FOR WA_VBAK-KUNNR,  "SOLD-TO-PARTY
                    S_AUDAT FOR V_AUDAT,      "SALES DOCUMENT DATE
                    S_VKORG FOR V_VKORG,      "SALES ORGANISATION
                    S_VKGRP FOR V_VKGRP,      "SALES GROUP
                    S_SPART FOR V_SPART.      "DIVISION
    SELECTION-SCREEN END OF BLOCK b1.
    *****************SCREEN VALIDATION***************
    AT SELECTION-SCREEN.
    SELECT SINGLE BUKRS FROM T001 INTO V_BUKRS WHERE BUKRS IN S_BUKRS."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID COMPANY CODE'.
    ENDIF.
    SELECT SINGLE VBELN FROM VBAK INTO
              CORRESPONDING FIELDS OF WA_VBAK WHERE VBELN IN S_VBELN.
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER VALID SALES DOCUMENT NUMBER'.
    ENDIF.
    SELECT SINGLE KUNNR FROM VBAK INTO
              CORRESPONDING FIELDS OF WA_VBAK WHERE KUNNR IN S_KUNNR. "EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID CUSTOMER NUMBER'.
    ENDIF.
    SELECT SINGLE AUDAT FROM VBAK INTO V_AUDAT WHERE AUDAT IN S_AUDAT."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES DOCUMENT DATE'.
    ENDIF.
    SELECT SINGLE VKORG FROM VBAK INTO V_VKORG WHERE VKORG IN S_VKORG."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES ORGANISATION'.
    ENDIF.
    SELECT SINGLE VKGRP FROM VBAK INTO V_VKGRP WHERE VKGRP IN S_VKGRP."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES GROUP'.
    ENDIF.
    SELECT SINGLE SPART FROM VBAK INTO V_SPART WHERE SPART IN S_SPART."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES DIVISION'.
    ENDIF.
    PERFORM GET_DATA.
    *&      Form  GET_DATA
    FORM GET_DATA .
    SELECT VBELN KUNNR
            INTO TABLE IT_VBAK
            FROM VBAK
            WHERE VBELN IN S_VBELN.
    *        BUKRS_VF IN S_BUKRS AND
    *        VKORG IN S_VKORG AND
    *        VKGRP IN S_VKGRP AND
    *        SPART IN S_SPART AND
    *        KUNNR IN S_KUNNR AND
    *        AUDAT IN S_AUDAT.
    IF IT_VBAK[] IS NOT INITIAL.
    SELECT POSNR MATNR KWMENG NETWR
            INTO TABLE IT_VBAP
            FROM VBAP
            FOR ALL ENTRIES IN IT_VBAK
            WHERE VBELN = IT_VBAK-VBELN.
    ENDIF.
    IF IT_VBAK[] IS NOT INITIAL.
    SELECT VBELN LFDAT
            INTO TABLE IT_LIKP
            FROM LIKP
            FOR ALL ENTRIES IN IT_VBAK
            WHERE VBELN = IT_VBAK-VBELN.
    ENDIF.
    IF IT_VBAP[] IS NOT INITIAL.
    SELECT POSNR LFIMG
            INTO TABLE IT_LIPS
            FROM LIPS
            FOR ALL ENTRIES IN IT_VBAP
            WHERE POSNR = IT_VBAP-POSNR.
    ENDIF.
    IF IT_LIKP[] IS NOT INITIAL.
    SELECT VBELN
            INTO TABLE IT_VBRK
            FROM VBRK
            FOR ALL ENTRIES IN IT_LIKP
            WHERE VBELN = IT_LIKP-DELVBELN.
    ENDIF.
    IF IT_LIPS[] IS NOT INITIAL.
    SELECT POSNR FKIMG NETWR
            INTO TABLE IT_VBRP
            FROM VBRP
            FOR ALL ENTRIES IN IT_LIPS
            WHERE POSNR = IT_LIPS-DELPOSNR.
    ENDIF.
    ENDFORM.                    " GET_DATA
    Edited by: srk s on Jan 29, 2008 7:33 PM
    Edited by: Alvaro Tejada Galindo on Jan 29, 2008 9:49 AM

    Hi Satish,
    I have started the new program but i have trouble with the final internal table. Since i'm using For all entries, I have declared internal tables for each table. My incomplete new program is as follows(not sure if the logic is correct till what I have coded):
    *& Report  Z_SDFLOW                                                    *
    REPORT  Z_SDFLOW  NO STANDARD PAGE HEADING.
    ********* TABLES TO BE USED ***********************
    **** VBAK - SALES DOCUMENT HEADER
    * VBAP - SALES ITEM
    * VBFA - SALES DOCUMENT FLOW
    * KNA1- CUSTOMER MASTER
    * VBRK - BILLING DOCUMENT HEADER
    * VBRP - BLLING DOCUMENT ITEM
    * LIKP - DELIVERY HEADER
    * LIPS - DELIVERY ITEM
    * TOO1 - COMPANY CODES
    * SLIS.
    TYPE-POOLS: SLIS.
    ** STRUCTURE DECLARATIONS ********
    **STRUCTURE FOR ENQUIRY.
    **STRUCTURE FOR QUOTATION.
    **STRUCTURE FOR SALES ORDER HEADER- VBAK.
    TYPES: BEGIN OF XT_VBAK,
    VBELN TYPE VBAK-VBELN,     "SALES DOCUMENT NUMBER
    KUNNR TYPE VBAK-KUNNR,     " SOLD-TO-PARTY
    END OF XT_VBAK.
    **STRUCTURE FOR SALES ORDER  ITEM-VBAP
    TYPES: BEGIN OF XT_VBAP,
    POSNR TYPE VBAP-POSNR,     " SALES ITEM NUMBER
    MATNR TYPE VBAP-MATNR,     " MATERIAL NUMBER
    KWMENG TYPE VBAP-KWMENG,   " CUMMULATIVE ORDER QUANTITY IN SALES UNITS
    NETWR TYPE VBAP-NETWR,     " NET VALUE OF THE ORDER ITEM
    END OF XT_VBAP.
    ** STRUCTURE FOR DELIVERY HEADER -LIKP
    TYPES: BEGIN OF XT_LIKP,
    DELVBELN TYPE LIKP-VBELN,           "DELIVERY DOCUMENT NUMBER
    LFDAT TYPE LIKP-LFDAT,           " DELIVERY DATE
    END OF XT_LIKP.
    **STRUCTURE FOR DELIVERY ITEM - LIPS
    TYPES: BEGIN OF XT_LIPS,
    DELPOSNR TYPE LIPS-POSNR,           " DELIVERY ITEM NUMBER
    LFIMG TYPE LIPS-LFIMG,           " ACTUAL QUANTITY DELIVERED
    END OF XT_LIPS.
    **STRUCTURE FOR BILLING DOCUMENT HEADER -VBRK
    TYPES: BEGIN OF XT_VBRK,
    INVVBELN TYPE VBRK-VBELN,          "BILLING DOCUMENT NUMBER
    END OF XT_VBRK.
    **STRUCTURE FOR BILLING DOCUMENT ITEM - VBRP
    TYPES: BEGIN OF XT_VBRP,
    INVPOSNR TYPE VBRP-POSNR,          "BILLING ITEM NUMBER
    FKIMG TYPE VBRP-FKIMG,          "ACTUAL INVOICED QUANTITY
    INVNETWR TYPE VBRP-NETWR,          "NET VALUE OF THE BILLING ITEM
    END OF XT_VBRP.
    **STRUCTURE FOR FINAL INTERNAL TABLE.
    TYPES: BEGIN OF XT_FINAL,
    VBELN TYPE VBAK-VBELN,
    DELVBELN TYPE LIKP-VBELN,
    INVBELN TYPE VBRK-VBELN,
    KUNNR TYPE VBAK-KUNNR,
    POSNR TYPE VBAP-POSNR,
    DELPOSNT TYPE LIPS-POSNR,
    INVPOSNR TYPE VBRP-POSNR,
    MATNR TYPE VBAP-MATNR,
    KWMENG TYPE VBAP-KWMENG,
    NETWR TYPE VBAP-NETWR,
    INVNETWR TYPE VBRP-NETWR,
    LFDAT TYPE LIKP-LFDAT,
    LFIMG TYPE LIPS-LFIMG,
    FKIMG TYPE VBRP-FKIMG,
    NAME1 TYPE KNA1-NAME1,
    END OF XT_FINAL.
    **DATA DECLARATIONS
    DATA: V_NAME1 TYPE KNA1-NAME1,  "#EC *
          V_DELVBELN TYPE LIKP-VBELN,
          V_INVVBELN TYPE VBRK-VBELN,
          V_BUKRS TYPE T001-BUKRS,    "COMPANY CODE "#EC *
          V_AUDAT TYPE VBAK-AUDAT,
          V_VKORG TYPE VBAK-VKORG,
          V_VKGRP TYPE VBAK-VKGRP,
          V_SPART TYPE VBAK-SPART.
    **INTERNAL TABLE DECLARATIONS
    DATA: IT_VBAK TYPE STANDARD TABLE OF XT_VBAK,
          WA_VBAK TYPE XT_VBAK,
          IT_VBAP TYPE STANDARD TABLE OF XT_VBAP,
          WA_VBAP TYPE XT_VBAP,
          IT_LIKP TYPE STANDARD TABLE OF XT_LIKP,
          WA_LIKP TYPE XT_LIKP,
          IT_LIPS TYPE STANDARD TABLE OF XT_LIPS,
          WA_LIPS TYPE XT_LIPS,
          IT_VBRK TYPE STANDARD TABLE OF XT_VBRK,
          WA_VBRK TYPE XT_VBRK,
          IT_VBRP TYPE STANDARD TABLE OF XT_VBRP,
          WA_VBRP TYPE XT_VBRP,
          IT_FINAL TYPE STANDARD TABLE OF XT_FINAL,
          WA_FINAL TYPE XT_FINAL.
    **ALV DECLARATIONS
    DATA: IT_FLDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FLDCAT TYPE SLIS_FIELDCAT_ALV,
          IT_LSTHDR TYPE SLIS_T_LISTHEADER,
          WA_LSTHDR TYPE SLIS_LISTHEADER,
          IT_EVENTS TYPE SLIS_T_EVENT,
          WA_EVENTS TYPE SLIS_ALV_EVENT,
          IT_SORT TYPE SLIS_T_SORTINFO_ALV,
          IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: S_BUKRS FOR V_BUKRS NO INTERVALS NO-EXTENSION,
                    S_VBELN FOR WA_VBAK-VBELN,  "SALES DOCUMENT NUMBER
                    S_KUNNR FOR WA_VBAK-KUNNR,  "SOLD-TO-PARTY
                    S_AUDAT FOR V_AUDAT,      "SALES DOCUMENT DATE
                    S_VKORG FOR V_VKORG,      "SALES ORGANISATION
                    S_VKGRP FOR V_VKGRP,      "SALES GROUP
                    S_SPART FOR V_SPART.      "DIVISION
    SELECTION-SCREEN END OF BLOCK b1.
    *****************SCREEN VALIDATION***************
    AT SELECTION-SCREEN.
    SELECT SINGLE BUKRS FROM T001 INTO V_BUKRS WHERE BUKRS IN S_BUKRS."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID COMPANY CODE'.
    ENDIF.
    SELECT SINGLE VBELN FROM VBAK INTO
              CORRESPONDING FIELDS OF WA_VBAK WHERE VBELN IN S_VBELN.
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER VALID SALES DOCUMENT NUMBER'.
    ENDIF.
    SELECT SINGLE KUNNR FROM VBAK INTO
              CORRESPONDING FIELDS OF WA_VBAK WHERE KUNNR IN S_KUNNR. "EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID CUSTOMER NUMBER'.
    ENDIF.
    SELECT SINGLE AUDAT FROM VBAK INTO V_AUDAT WHERE AUDAT IN S_AUDAT."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES DOCUMENT DATE'.
    ENDIF.
    SELECT SINGLE VKORG FROM VBAK INTO V_VKORG WHERE VKORG IN S_VKORG."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES ORGANISATION'.
    ENDIF.
    SELECT SINGLE VKGRP FROM VBAK INTO V_VKGRP WHERE VKGRP IN S_VKGRP."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES GROUP'.
    ENDIF.
    SELECT SINGLE SPART FROM VBAK INTO V_SPART WHERE SPART IN S_SPART."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES DIVISION'.
    ENDIF.
    PERFORM GET_DATA.
    *&      Form  GET_DATA
    FORM GET_DATA .
    SELECT VBELN KUNNR
            INTO TABLE IT_VBAK
            FROM VBAK
            WHERE VBELN IN S_VBELN.
    *        BUKRS_VF IN S_BUKRS AND
    *        VKORG IN S_VKORG AND
    *        VKGRP IN S_VKGRP AND
    *        SPART IN S_SPART AND
    *        KUNNR IN S_KUNNR AND
    *        AUDAT IN S_AUDAT.
    IF IT_VBAK[] IS NOT INITIAL.
    SELECT POSNR MATNR KWMENG NETWR
            INTO TABLE IT_VBAP
            FROM VBAP
            FOR ALL ENTRIES IN IT_VBAK
            WHERE VBELN = IT_VBAK-VBELN.
    ENDIF.
    IF IT_VBAK[] IS NOT INITIAL.
    SELECT VBELN LFDAT
            INTO TABLE IT_LIKP
            FROM LIKP
            FOR ALL ENTRIES IN IT_VBAK
            WHERE VBELN = IT_VBAK-VBELN.
    ENDIF.
    IF IT_VBAP[] IS NOT INITIAL.
    SELECT POSNR LFIMG
            INTO TABLE IT_LIPS
            FROM LIPS
            FOR ALL ENTRIES IN IT_VBAP
            WHERE POSNR = IT_VBAP-POSNR.
    ENDIF.
    IF IT_LIKP[] IS NOT INITIAL.
    SELECT VBELN
            INTO TABLE IT_VBRK
            FROM VBRK
            FOR ALL ENTRIES IN IT_LIKP
            WHERE VBELN = IT_LIKP-DELVBELN.
    ENDIF.
    IF IT_LIPS[] IS NOT INITIAL.
    SELECT POSNR FKIMG NETWR
            INTO TABLE IT_VBRP
            FROM VBRP
            FOR ALL ENTRIES IN IT_LIPS
            WHERE POSNR = IT_LIPS-DELPOSNR.
    ENDIF.
    ENDFORM.                    " GET_DATA
    Code Formatted by: Alvaro Tejada Galindo on Jan 29, 2008 9:48 AM

  • Performance Problems with "For all Entries" and a big internal table

    We have big Performance Problems with following Statement:
    SELECT * FROM zeedmt_zmon INTO TABLE gt_zmon_help
      FOR ALL ENTRIES IN gt_zmon_help
        WHERE
        status = 'IAI200' AND
        logdat IN gs_dat AND
        ztrack = gt_zmon_help-ztrack.
    In the internal table gt_zmon_help are over 1000000 entries.
    Anyone an Idea how to improve the Performance?
    Thank you!

    >
    Matthias Weisensel wrote:
    > We have big Performance Problems with following Statement:
    >
    >  
    SELECT * FROM zeedmt_zmon INTO TABLE gt_zmon_help
    >   FOR ALL ENTRIES IN gt_zmon_help
    >     WHERE
    >     status = 'IAI200' AND
    >     logdat IN gs_dat AND
    >     ztrack = gt_zmon_help-ztrack.
    >
    > In the internal table gt_zmon_help are over 1000000 entries.
    > Anyone an Idea how to improve the Performance?
    >
    > Thank you!
    You can't expect miracles.  With over a million entries in your itab any select is going to take a bit of time. Do you really need all these records in the itab?  How many records is the select bringing back?  I'm assuming that you have got and are using indexes on your ZEEDMT_ZMON table. 
    In this situation, I'd first of all try to think of another way of running the query and restricting the amount of data, but if this were not possible I'd just run it in the background and accept that it is going to take a long time.

  • I just upgraded to the new mobile me calendar and now all my calendar entries on iCal have been erased. As I type this the calendar entries are still on the mobile me and iphone calendars. How do I restore the calendar entries to iCal?

    I just upgraded to the new mobile me calendar and now all my calendar entries on iCal have been erased. As I type this the calendar entries are still on the mobile me and iphone calendars. How do I restore the calendar entries to iCal?

    Please always post your System details when you have a query. The upgrade to the new MobileMe calendar produces different results, and different problems, with different versions of OSX.
    Snow Leopard: during the upgrade process your iCal calendars should be moved to MobileMe (this can take some time and you have to wait for it to happen). Once done, your iCal reads the calendars from MobileMe so any changes made in either place will be visible immediately. If this has not happened then this Apple Tech Note provides instructions:
    http://support.apple.com/kb/TS3397
    Leopard: when the upgrade is completed iCal on Leopard will not be able to see the MobileMe calendars until an additional process is carried out, detailed in this Apple Tech Note:
    http://support.apple.com/kb/HT4330
    Tiger: iCal on Tiger cannot read the MobileMe calendars, period. The only workaround is to upgrade to Leopard, or Snow Leopard if possible (Intel Mac required).

  • I need to able to search for calendar entries that are over one year old.

    I am an old Palm OS user and have used the calendar on it to track my clients visits/service for the last 15 years.  By searching the customers name on the palm, it would bring up every entry I had keyed in for them, so I could immediately know how old their equipment was, what service had been done, etc.  I also used the calendar to track my daily and weekly sales.  I was disappointed to find that the ipad does not search for any entries older than one year.  Is there something that can fix this or is there an app that could be used in the way the palm was?  Thanks

    Well, that would depend on what calendar you are using.
    If you are simply relying on the calendar on the device, well, that's not very smart.  Restoring from backup should put everything back.
    If the calendar is synced with another service, like Google, iCloud, Exchange, do the entires still exist there?
    If the calendar is synced with Outlook or iCal on your computer, do the entries still exist there?

  • Creation of Budget Billing Plan for Countries with Tax Jurisdiction

    Hello Experts,
    When I create a budget billing plan for a company code with country Canada/USA and jursidiction TAXCAJ/TAXUSJ using transaction EA61, I get the message "Taxes with jurisdiction code not permitted with down payments"(Message no. >0194).  The long text for this message says "Delete your entry in the field for jurisdiction code"  Is any one aware where from this jurisdiction code should be deleted.
    Is it possible to create budget billing plan for countries with jurisdiction code at all ?
    Thanks in advance
    Venkat

    Hello Roopali,
    What I learnt in the process of exploring the functionality is that Payment PLan (BBP or AMB) is the budget billing method for countries with Tax Jurisdiction. Statistical, Partial & Payment Scheme only works when jurisdiction is not defined for tax procedure. Payment scheme is the recommend procedure for Eurpopean market
    Thanks for your clarification
    Best Regards
    Venkat

  • Move Project (Award) budget amount from one project to another

    Hi,
    As per Oracle standard functionality, in Grants Accounting (Projects)
    -- Can the budget amount for a project under an award be moved to another project
    -- Can the budget amount for a project under an award be moved to another project another award
    - In general is there a way to move the funds between projects or awards ?
    Thanks!

    Hi,
    As per Oracle standard functionality, in Grants Accounting (Projects)
    -- Can the budget amount for a project under an award be moved to another project
    -- Can the budget amount for a project under an award be moved to another project another award
    - In general is there a way to move the funds between projects or awards ?
    Thanks!

  • I want better solution for adjusting the Material stock values for the last

    my Customer  need to adjust( Decrease)  the closing stock values for the following materials / plant wise as on 31.03.2006 for meeting statuary compliance.
    Material1 :  RS: 4149599    QTY : 10181.03 Ltrs
    Material 2  : RS: 1318596     QTY:  2152.76   Ltrs
    As per my knowledge MM posting periods can open current month and Previous month only. For the reason I proposed the solution as follows:
    Step 1 : post FI Journal Entry on 31.03.2006
    Opening Balance G/L  Account Dr 4149599 + 1318596
    Closting Stock a/c                      Cr 4149599 + 1318596
    Step 2.
    Change the Material Price in MM through T.Code: MR21
    ( Posting will be allowed in current or previous months)
    This makes our CO reports accurate.
    Please  suggest the better solution if it is possible in MM for adjusting the Material stock values for the last financial year.
    WIth Best Regards,
    Rajesh
    <b></b>

    Hi Madhavan,
    Unfortunately this forum deals with migrations from non-Oracle
    environments to Oracle. You seem to be dealing with migrations in
    an Oracle environment mainly.
    I would recommend that you contact Oracle Applications and RDBMS
    support directly. They will have the most up to date
    information/advice on performing these actions.
    Regards
    John
    Madhavan (guest) wrote:
    : Hi John
    : Thanks for your reply.
    : Actually I am planning to upgrade the system.
    : 1. I Want to Upgrade Oracle Financials release 10.7 to the
    : latest version (11.x)
    : 2. Oracle 7 database to oracle 8 or 8i.
    : 3. Oracle is running on NT service pack 3. Do I need to upgrade
    : this?. If not what is the impact on Windows NT?
    : 4. Is the majority still running smart client 10.7 and database
    : 7?
    : 5. What is the necessary time to implement these upgrades? What
    : type of consulting I need to have?
    : 6. I have some employees working on it? Will these changes
    : affect them?
    : What type of precautions I need to take on the whole??
    : Thank You
    : Madhavan
    Oracle Technology Network
    http://technet.oracle.com
    null

Maybe you are looking for

  • Adding a checkbox to a form report

    Hi there, I've built a multi-item form in APEX 3.1.2, based on the following query: SELECT id,        ticker,        deal_date,        deal_type,        no_shares,        price_per_share,        commision,        stamp_duty,        DECODE( trade_grou

  • Can I do the following with sharing.

    Hi everyone. I'm a new switcher and i've bought 2 macbook pro's. I'm thinking of buying a mac mini to through over by the TV... One of the things we are looking into is can we use the mini as a main photo depot. I've played around with the sharing ab

  • SSO with Custom LDAP

    This is the landscape :- Web Application / Portal at Oracle Web Center Suite (WCS). SAP BO 4.0 Authentication using Custom LDAP & SSO with Trusted Authentication. Used OpenLDAP for authentication via RadiantOne VDS as the proxy. Activities : Authenti

  • Help needed get JSF final release running on tomcat 5

    Hi there, I know my topic seems to be a easy thing which is often discusseb but I tell you it's not. And after searching the forum an the web... it's driving me crazy I want to make some development and tests but I can' get my stuff running on tomcat

  • HT201407 Call waiting & forwarding not available on my iphone6+

    The feature call waiting and call forwarding not available on my iphone 6+ what should I do???