Comment regarding new statement of direction

Hi all,
I've just read the new statement of direction regarding Oracle Workflow (http://www.oracle.com/technology/products/ias/workflow/workflow_sod.html). Especially regarding the standalone version it is a great pitty that Oracle will kick such a good and stable product into the garbage can.
I'm not convinced that BPEL can replace Oracle Workflow. Also I'm missing a real migration path. It's not only Workflow that needs to be re-implemented. For example our custom application would have be to re-implemented as well because Workflow is one of the central components.
So if I read "In addition, Oracle are now recommending that customers who have Oracle Workflow workflows in development or production that they plan to continue to enhance in the future should begin re-implementing those in BPEL." or "While there will be some development costs associated with the migration of existing processes from Oracle Workflow to Oracle BPEL Process Manager..." this brings me to some critical thaughts about the future of our custom application.
What are your thaughts and comments?
Best regards
Matthias

They also removed the entry about charting (Charting - Provide for chart rendering without using Flash (to enable display on mobile devices).)... Guess this will be in the next release (4.2) or next MAJOR release (5.0??)..
Thank you,
Tony Miller
Webster, TX
On the road of life...There are 'windshields', and there are 'bugs'
(splat!)
"Squeegees Wanted"
If this question is answered, please mark the thread as closed and assign points where earned..

Similar Messages

  • Oracle Workflow - Statement of Direction and BPEL

    Hi,
    I am starting to study Oracle BPEL and other people at my company are studying Oracle Workflow.
    Recently I found the following article at the OTN, regarding the Statement of Direction of Oracle Workflow:
    http://www.oracle.com/technology/products/ias/workflow/workflow_sod.html
    It finishes saying:
    "As Oracle BPEL Process Manager provides out-of-the-box features for building human-based workflows, rules-based process automation, and integration style business processes, further development on OW4J will not continue and OW4J will not be released.
    Any new or existing customers who wish to build business processes in the middle tier are recommended to use Oracle BPEL Process Manager."
    So my question is: Does Oracle BPEL provides (or will provide) all the functionality implemented in Oracle Workflow ? If not what are the main differences ?
    I will be waiting for your thoughts
    Thanks,
    Claudio.

    Site mentioned above is an internal site. External site is http://otn.oracle.com/bpel
    I think the above highlighted SOD is about Oracle initiative to re-write current pl/sql based Workflow engine in Java so that it can ported to middle-tier. Since the acuisition of Collaxa they seems to be dumped that idea and positioning Oracle BPEL as the middle-tier process orchestration (BPM) solution.
    Having said that let me take a shot at comparing Oracle Workflow and BPEL products....
    Oracle Workflow
    * No way getting dropped as Oracle EBS has huge investments in it
    * Oracle Fusion Applications has plans to use the Oracle Workflow BES functionality extensively
    * Good for modeling business processes within a single DB/application instances. It's possible to integrate with external apps but not an elegant solution
    * Web Services can be a functional activity with in the work flow but again not an elegant solution. Requires DB java, queues and a listener
    * Doensn't provide sophisticated modeling artifacts like TaskManager, Faults, sensors etc out of the box. It's possible to build your own library.
    * Better performanent if the entire process interaction is within a single instance like Oracle EBS account generators, approval flows etc.
    * Based on proprietary technology
    Oracle BPEL
    * Based on standards like BPEL, WSDL and WSIF
    * What ever you can do in workflow can be done in BPEL but not the otherway round
    * Has adapters to interact with various transports like JDBC, AQ, JMS, JCA, HTTP. That means integration with existing workflows is very easy
    * Interation with Oracle AQs seem to be trivial as there is a native JCA based adapter for it
    * You may get performance hit because of the multiple connection points. You may be loosing performance but gaining in flexibility
    Overall Oracle BPEL seems to be the way to go if your business process involves multiple applications.
    HTH
    Rajesh

  • New Stat requirement

    Hi,
    We have a stat requirement wherein one of our cocds for which the functional currency is USD (though it's in MX), the amounts to the stat ledger (account) should be posted only in PESOs and not in USD and shouldn 't be revalued. We are looking at 2 options:
    1. Create a new cocd with stat accounts and functional currency as PESO. The documents posted in original cocd should flow into this new cocd as well but converted into PESO. Is it possible via std SAP to have monthly feed from one CoCd to another and have transactional currency changed using the conversion rate or do I have to go for a custom program?
    2. Mirror the GL accounts in the orignal cocd and mass upload all the transactions from original account to these new stat accounts using PESO currency. But this shouldn't be revalued at month end? Is that possible?
    Is there any other solution? We don't have New GL implemented to go in the direction of parallel ledgers. Please advise
    Thanks!
    N
    All answers will be duly rewarded.

    Hi Nandita,
    Are the GL Accounts balance sheet or PL accounts?
    Because if they are of the second type, that means they should reflect data to CO (Controlling) module. And in this case, you should use a Cost Object (like Cost Center or Internal Order) to post in FI (Financials) module.
    Added to that, you could use CO module to have the information in the desired currency. See, in CO we have three currency types: Controlling Area Currency, Object Currency and Transactional Currency. During the posting from FI to CO, SAP R/3 automatically converts the currencies by using the existing exchange rates into the system. So, if your cost objects currencies are in PESO (see KO03 transaction for Internal Orders or KS03 for Cost Centers), then I think it is just a matter of choosing the best report (CO report) that fulfills your requirement. But if they are not, one of the solutions you could think about is to create a new Controlling Area and define as the Controlling Area currency the PESO one. Then it is also just a matter of choosing the best report (CO report) that fulfills your requirement.
    Hope it helps you a little.
    Kind Regards,
    Daniel

  • Adding new line item directly to PO

    Hi,
    We have a requirement for adding a new line item directly within the Purchase Order in SRM (without using the shopping cart). We are using the FM BBP_PD_PO_UPDATE for this purpose. However, we are getting the following error while updating. " BUFFER TABLE NOT UP-TO-DATE". Please provide assistance in order to resolve this issue.
    Regards,
    Arun

    We achieved  based on the Security roles to identify if the user is Requester or Purchaser or Manager and Webdynpro changes by the portal team to activate the Change and Order button based on the required business rules.
    Transaction Code for PO Change to be added to the security role.
    Requisitioner:  Any user with out any existing A012 relationship with any existing Organizational units on the current date:
    Manager:  Any user having A012 relationship with any existing Organizational units on the current date.
    If the Authorization object checked programmatically results the value of "PUR" then the standard SAP code for "Purchaser" has to be executed.
    Some additional Info :
    Control list of PO using BADI BBP_WF_LIST - Change Work lists and Search Results Lists   Method:  BBP_WF_LIST
    Badi -BBP_AUTHORITY_CHECK for any additional authorisation checks
    Hope this helps.
    Thanks
    Balaji

  • At new Statement

    dear all,
    My problem is that , in the following code
    at new matnr.
    write: itab-matnr, itab-maktx.
    end at.
    It is displaying matnr properly .. but for maktx its is showing '****' . Can anybody tell why this happens .. How to solve that ? I have given enough spaces for displaying maktx.. Still its showing ''. Why ?
    please help me to solve my problem ..
    Thanking you ..
    Shankar

    Hi Shankar,
    This is a very common problem for most first-time users of the AT NEW statement. But there's a way to overcome the problem : use field-symbols.
    Consider the following simple code-snippet which will solve your problem very efficiently.
    ========================================
    data t_mara type table of mara.
    field-symbols: <fs_mara> type mara.
    select * from mara into table t_mara.
    sort t_mara by matnr.
    loop at t_mara assigning <fs_mara>.
      at new matnr.
        write: / <fs_mara>-matnr,
               <fs_mara>-mtart,
               <fs_mara>-matkl.
      endat.
    endloop.
    ========================================
    Normally, you will not be able to use the fields MTART and MATKL within the AT NEW....ENDAT block. But as you can see here, if you use field-symbols, there's no problem at all. Moreover, though most people have some resistance to using field-symbols, it offers the best performance and the highest degree of flexibility.
    Hope this solution can be satisfactorily applied in your case.
    Regards,
    Anand Mandalika.
    P.S: FYI, when you use field symbols, the system does not have to transfer the contents of the current line into the work area. As the number of entries (as well as the record-length) in the internal table increases, this can sometimes become a major performance overhead.

  • At New statement problem

    Hello experts,
    I am currently having a problem with my At New statement. It is treating every field of the itab as a new record even though it is the same.
    For example,
          on the first loop the field matnr has a value of mat-A then the at new will trigger.
         then on the second loop matnr has a value of mat-B then again, At New will trigger.that is correct.
        But on the third loop, the field matnr will have a value again of mat-B or Mat-A- the same as that of the second or first loop. So it must not trigger the At New statement but it does.
               Any solutions?
       MY CODING.....
    SORT IT_FINAL BY MATNR.
    LOOP AT IT_FINAL.
    wa_final = it_final.
       at new matnr.
             it_final1-matnr = wa_final-matnr.
              it_final1-maktx = wa_final-maktx.
              it_final1-bdmng = VAL1.
              APPEND it_final1.
              clear : it_final, it_final1, wa_final.
              endat.
    ENDLOOP.
                                          Thanks!
    REGARDS,
    NAVANEETH.

    Hi navaneethan,
    it is important to understand SAP's concept of Control Level Processing using statements AT NEW f and AT END OF f.
    Originally this was defined for the obsolete technique of extracts and that is where the documentation can be found.
    [<a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db9f1f35c111d1829f0000e829fbfe/content.htm">Control Level Processing</a>]
    The documentation for extract datasets applies exactly to internal tables:
    The table mus be sorted to get control levels defined. A control break occurs when the value of the field f or a superior field in the current record has a different value from the previous record (AT NEW) or the subsequent record (AT END). Field f must be part of the header field group.
    If the internal table is not sorted, the AT - ENDAT block is never executed.
    Please have a look at the graphical demonstration of Control level processing in this document: <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/fc/eb381a358411d1829f0000e829fbfe/content.htm">Processing Table Entries in Loops</a>
    Regards,
    Clemens
    BTW: Too bad we have anonymous MOD

  • Issue with : Stateful BSP Applications: New State Management Option

    Reference:weblog by Thomas Jung -  /people/thomas.jung3/blog/2004/11/09/updated-stateful-bsp-applications-new-state-management-option
    I see a comment by one user to send the complete code... I am not sure what else can be sent   - try it out rather than getting spoon-fed. - getting offline - sorry...
    I had two issues with this ITSM way of session handling.
    First - if you are using an SP42 environment, check CL_BSP_RUNTIME=>ON_SESSION_CMD() to see if CANCEL is defined as an option. If not make sure that you use &sap-sessioncmd=CLOSE" instead of the &sap-sessioncmd=CANCEL" . If CANCEL is not defined , it will give you shortdumps...
    Second - when I closed the window, the session was not terminated. I used onbeforeUnLoad="exitBSPApplication(); instead of onUnLoad="exitBSPApplication(); and it worked fine. Not sure if it has any other issues.
    But now I am facing a new issue... all but one application is not ending... I have no clue on why this is happening.. I am still checking..
    Thanks Thomas, you are the best, as always...

    Thanks for checking the code in your system.
    After some investigation, I found the behavior as explained below.
    If the actual url has any fields passed as parameters, e.g.. /default.htm?var1=a&var2=2 ...
    - if I use CANCEL as the option, a shortdump is created and the session is not closed. if I use CLOSE, Session is terminated and no shortdump happens.
    If the actual url does not have any parameters, e.g.. /default.htm ...
    - CANCEL does the work, but CLOSE does not exit the session.
    In my applications I used request->get_form_fields to see if there are any parameters, and if there are, then I use CLOSE as the option and else, I use CANCEL. So now, the session
    management works beautifully...
    There is a good chance that I am doing something wrong here too.

  • What is the use of at new statement?

    What is the use of at new statement?

    Hi,
    AT - itab
    Syntax
    LOOP AT itab result ...
      [AT FIRST.
       ENDAT.]
        [AT NEW comp1.
         ENDAT.
           [AT NEW comp2.
           ENDAT.
           AT END OF comp2.
           ENDAT.]
         AT END OF comp1.
         ENDAT.]
      [AT LAST.
      ENDAT.]
    ENDLOOP.
    Extras:
    1. ...  FIRST
    2. ... |{END OF} compi
    3. ...  LAST
    Effect
    The statement block of a LOOP loop can contain control structures for control level processing. The respective control statement is AT. The statements AT and ENDAT define statement blocks that are executed at control breaks, that is, when the control structure is changed. The additions to the AT statements determine the control break at which their statement blocks are executed. Within these statement blocks, the statement SUM can be specified to add together the numeric components of a control level. For the output behavior result, the same applies as for LOOP AT.
    The prerequisite for control level processing is that the internal table is sorted in exactly the same sequence as the component of its line type - that is, first in accordance with the first component, then in accordance with the second component, and so on. The line structure and the corresponding sorting sequence gives a group structure of the content of the internal table, whose levels can be evaluated using AT statements. The AT- ENDAT control structures must be aligned one after the other, in accordance with the group structure.
    The statement blocks within the AT- ENDAT control structures are listed if an appropriate control break is made in the current table line. Statements in the LOOP- ENDLOOP control structure that are not executed within an AT- ENDAT control structure are executed in each pass of the loop.
    In order that control level processing is carried out properly, the following rules must be observed:
    After LOOP, a restricting condition cond can only be specified if this selects a consecutive line block of the internal table. Otherwise, the behavior of control level processing is undefined.
    The internal table cannot be modified within the LOOP loop.
    A work area wa specified in the LOOP statement after the addition INTO must be compatible with the line type of the table.
    The content of a work area wa specified after the addition INTO in the LOOP statement must not be modified.
    If the INTO addition is used in the LOOP statement to assign the content of the current line to a work area wa, its content is changed upon entry into the AT-ENDAT control structure as follows:
    The components of the current control key remain unchanged.
    All components with a character-type, flat data type to the right of the current control key are set to character "*" in every position.
    All the other components to the right of the current control key are set to their initial value.
    When the AT-ENDAT control structure is exited, the content of the current table line is assigned to the entire work area wa.
    Addition 1
    ... FIRST
    Effect
    The control level is defined by the first line of the internal table. The control break takes place when this line is read.
    Note
    In the group level AT FIRST, the current group key contains no components and all character-type components of the work area wa are filled with "*" and all remaining components are set to their initial value.
    Addition 2
    ... |{END OF} compi/>
    Effect
    : Control levels are defined by the beginning or end of a group of lines with the same content in the component compi (where i = 1, 2, and so on) and in the components to the left of compi. The control breaks take place when the content of the component compi or another component to the left of compi changes.
    The compi components can be specified as described in Specification of Components, with the limitation that access to object attributes is not possible here.
    Note
    If the INTO or ASSIGNING additions are used in the LOOP statement, a field symbol can be entered after AT |{END OF} outside classes, to which the corresponding component of the work area wa or the field symbol <fs> is assigned. This form of dynamic component specification is obsolete and has been replaced by specification in the format (name).
    Addition 3
    ... LAST
    Effect
    : The control level is defined by the last line of the internal table. The control break takes place when this line is read.
    Note
    In the group level AT LAST, the current group key contains no components and all character-type components of the work area wa are filled with "*" and all remaining components are set to their initial value.
    Regards,
    Prashant

  • Designer dead - statement of direction

    Just stumbled across the document "Oracle Forms, Oracle Reports, Oracle Designer Statement of Direction."
    Didn't particularly like what I read:
    "....Oracle Designer will not include new features...."
    The way I read it, Oracle will seize further development of the generators (web plsql/forms/reports etc.)
    Designer will still be supported, but new features will not be introduced as from now.
    I hope I have read this wrong?
    Jens
    PS: The document can be found here:
    http://www.oracle.com/technology/products/forms/pdf/10g/ToolsSOD.pdf
    DS.

    I actually posted this today september 7.th, not August 20.th as the topics date says. This Forum application reaylly suck big time...
    Jens

  • Regarding new Reminder app in Mountain Lion:  is there a away to sort reminders by due date in the same fashion you can in the iCloud version of Reminders?

    Regarding new Reminder app in Mountain Lion:  is there a way to sort reminders in due date order in the same fashion as you can in the iCloud version of Reminders?

    So true! I have to agree: "It appears Reminders in 10.8 did not get a whole lot of thought put into it regarding how folks actually use reminders."
    With Mountain Lion, Reminders no longer resembles a task-management (to-do) app in any way. I used to be able to limp along using it for my to-dos (although it never did accommodate this need well). This upgrade has made Reminders completely unusable for task management.
    Once I got over my disappointment, I did some research and decided to try "Things." This application has all the functionality I've been wanting all along. It has a Mac version, an iPhone version, and an iPad version (among others)--and it keeps all devices synched via the Cloud (just not the iCloud ... but who needs the i ?). I wish I'd discovered it years ago. I'm glad now that Mountain Lion put Reminders over the edge; otherwise, I would not have made this discovery.
    "Things" (oddly named though it is) comes close to the old Franklin planner software I used to love and haven't been able to find a substitute for. It can import items from Reminders, and it works with Siri. It's a joy to use, and it does everything I want it to do plus some things I never thought of and will use all the time. I downloaded the free trial version last night and within an hour paid for it with gratitude.

  • Regarding case statement and decode function

    Hi Experts,
    I have question.....regarding case statement and decode statement....
    Can you please explain me that which one will be efficient,to place in insert statement...
    insert statement(
    (case when ........then
                         case when ....then
                         else
                         end)
      else
    end)
    or
    insert statement(
    case when.....then
    decode(....)
    else
    end)
    Can you people explain me which one is more efficient method?
    Thanks in advance.......

    The are major differences to talk about in case of CASE vs DECODE, but performance wise both are pretty much the same.
    Have a look at Tom's thread
    Ask Tom &amp;quot;better performance - case or decode&amp;quot;
    I would suggest to use CASE whenever possible. Don't worry about the performance part.

  • Use of AT NEW  statement

    Hi,
      In my program have written the code as
        SORT gt_bsik BY lifnr belnr  gjahr buzei.
        DATA : gv_count TYPE i VALUE 0.
        IF sy-subrc = 0.
          LOOP AT gt_bsik.
        AT NEW lifnr .
              READ TABLE gt_lfb1 WITH KEY lifnr = gt_bsik-lifnr BINARY
              SEARCH.
              CLEAR lt_vendors.
              lt_vendors-lifnr = gt_lfb1-lifnr.
            ENDAT.
            AT NEW belnr.
              gv_new_invoice_ind = 'X'.
              gt_bsik_copy-lifnr = gt_bsik-lifnr.
              gt_bsik_copy-belnr = gt_bsik-belnr.
           gt_bsik_copy-gjahr = gt_bsik-gjahr.
              gt_bsik_copy-buzei = gt_bsik-buzei.
              gv_count = gv_count + gt_bsik-buzei .
            ENDAT.
    the value of gt_bsik-buzei is coming as *** after passing tho AT NEW belnr stmt.Before that the value is correct only after passing tho it showing wrong value but the other fields are showing  correct value .Whats the reason for this?

    HI,
    Between AT NEW and endat statements you would have the field contents as **** after the field for which you have used in AT NEW statement. For example if you have used the 3rd field in AT NEW statement then between AT NEW and ENDAT statements you can access the first 3 fields contents only.If you want  to access any field after 3rd field then you have  to take  a Back Up of those fields before you enter in to AT statement. In your case declare a WA_BSIK of type GT_BSIK.
    Data : wa_bsik LIKE gt_bsik.
    Before you enter in to AT NEW statement transfer contents of gt_bsik to wa_bsik.
    WA_BSIK = GT_BSIK.
    Between AT NEW and  ENDAT use the field contents of wa_bsik and not gt_bsik.
    AT NEW belnr.
    gv_new_invoice_ind = 'X'.
    wa_bsik_copy-lifnr = wa_bsik-lifnr.
    wa_bsik_copy-belnr = wa_bsik-belnr.
    wa_bsik_copy-gjahr = wa_bsik-gjahr.
    wa_bsik_copy-buzei = wa_bsik-buzei.
    gv_count = gv_count + wa_bsik-buzei .
    ENDAT.

  • Refining AT NEW statements

    I've been assigned to make some modification to an incomplete program written by another ABAPer. I have managed to fulfill most of what is required by the specification document, however, i'm having difficulty with a particular AT NEW statement that will WRITE a new PR Doc Type whenever the next line of output belongs to a different PR Doc Type than the previous line.
    Currently, the PR Doc Type is always being written at each new line, no matter whether the current like is the same or different from the previous line's PR Doc Type.
    Could you guys have a look what i have done so far?
    NOTE: The original coding that i removed from the program were not deleted, i just * it
    REPORT ZRMME006 NO STANDARD PAGE HEADING
                    MESSAGE-ID 38
                    LINE-SIZE 255
                    LINE-COUNT 65.
    TABLES: EBAN,        "Purchase Requisition
            EBKN,        "Purchase Requisition Account Assignment
            EKKO,        "Purchasing Document Header
            EKPO,        "Purchasing Document Item
            EKBE,        "History of Purchasing Document
            EKET,        "Scheduling Agreement Delivery Schedules
            CDPOS,       "Change document items
            CDHDR,       "Change document header
            PRPS,        "WBS (Work Breakdown Structure) Element Master Data
            T161T.       "Text for Purchasing Document Types
    *    DATA DECLARATION
    DATA: BEGIN OF T_PR OCCURS 0,
            KNTTP        LIKE EBAN-KNTTP,      "Account assignment category
            KOSTL        LIKE EBKN-KOSTL,      "Cost center
            POSID        LIKE PRPS-POSID,      "Project code name
            PS_PSP_PNR   LIKE EBKN-PS_PSP_PNR, "WBS element
            ERNAM        LIKE EBAN-ERNAM,      "User ID
            BANFN        LIKE EBAN-BANFN,      "PR number
            BNFPO        LIKE EBAN-BNFPO,      "PR item number
            MATNR        LIKE EBAN-MATNR,      "Material number
            TXZ01        LIKE EBAN-TXZ01,      "Material description
            BSART        LIKE EBAN-BSART,      "PR document type
            BATXT        LIKE T161T-BATXT,     "Desc of purchasing doc type
            EBELN        LIKE EBAN-EBELN,      "PO number - eban
            EKKO_EBELN   LIKE EKKO-EBELN,      "PO number - ekko
            EKET_EBELN   LIKE EKET-EBELN,      "PO number - eket
            EBELP        LIKE EBAN-EBELP,      "PO item number - eban
            EKPO_EBELP   LIKE EKPO-EBELP,      "PO item number - ekpo
            EKET_EBELP   LIKE EKET-EBELP,      "PO item number - eket
            BADAT        LIKE EBAN-BADAT,      "PR creation date
            CHANGENR_PR  LIKE CDPOS-CHANGENR,  "PR changenr
            UDATE_PR     LIKE CDHDR-UDATE,     "PR approval date
            ANFNR        LIKE EKPO-ANFNR,      "RFQ number
            ANFPS        LIKE EKPO-ANFPS,      "RFQ item number
            CHANGENR_RFQ LIKE CDPOS-CHANGENR,  "RFQ changenr
            UDATE_RFQ    LIKE CDHDR-UDATE,     "RFQ maintained date
            AEDAT        LIKE EKPO-AEDAT,      "PO creation date
            EINDT        LIKE EKET-EINDT,      "PO required (dev date)
            CHANGENR_PO  LIKE CDPOS-CHANGENR,  "PO changenr
            UDATE_PO     LIKE CDHDR-UDATE,     "PO approval date
            DATVR_PO     LIKE NAST-DATVR,      "PO printed date
            CPUDT        LIKE EKBE-CPUDT,      "GRN delivered date
            FRGZU        LIKE EBAN-FRGZU,      "Release status
            EKKO_FRGZU   LIKE EKKO-FRGZU,      "Release status
            RFQ_AEDAT    LIKE EKPO-AEDAT,      "RFQ creation date
            VSTAT        LIKE NAST-VSTAT,      "Processing status of message
            EKGRP        LIKE EBAN-EKGRP,      "Purchasing group
          END OF T_PR.
    DATA: BEGIN OF T_DATE OCCURS 0,
            CPUDT LIKE EKBE-CPUDT,
            EBELN LIKE EKKO-EBELN,
            EBELP LIKE EKPO-EBELP,
          END OF T_DATE.
    DATA: BEGIN OF T_PUR OCCURS 0.
          INCLUDE STRUCTURE T_PR.
    DATA: END OF T_PUR.
    DATA: V_PRDAY(10)  TYPE C,           "PR days
          V_RFQDAY(10) TYPE C,           "RFQ days
          V_PODAY(10)  TYPE C,           "PO days
          V_GRNDAY(10) TYPE C,           "GRN days
          V_STADAY     TYPE I,           "Standard days
          V_ACTDAY     TYPE I,           "Actual days
          V_VARDAY(10) TYPE C,           "Variance
          V_RELPR      TYPE I,           "Release pr days
          V_RELPO      TYPE I,           "Release po days
          V_PRTEMP(10),
          V_RFQTEMP(10),
          V_POTEMP(10),
          V_GRNTEMP(10),
          V_FLAG(1)    TYPE C,
          V_FLAG2(1)   TYPE C,
          V_FLAG3(1)   TYPE C,
          V_COUNT      TYPE I,
          V_COUNT_MOD  TYPE I,
          V_SDATE      LIKE SY-DATUM,
          V_EDATE      LIKE SY-DATUM,
          V_LEN        TYPE I,
          V_LEN2       TYPE I.
    DATA: CHECK(1) TYPE C.                                       "DEVK951017
    * selection screen                                                     *
    SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_WERKS  FOR EBAN-WERKS DEFAULT '6001' to '6002', "Plant
                    S_EKORG  FOR EBAN-EKORG DEFAULT '6001' NO INTERVALS,
                    "Purch Org
                    S_BSART  FOR EBAN-BSART,
                    "PR type
                    S_BANFN  FOR EBAN-BANFN,
                    "PR number
                    S_BADAT  FOR EBAN-BADAT.
                    "PR date
    SELECTION-SCREEN END OF BLOCK BLK1.
    SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-002.
    SELECT-OPTIONS: S_KOSTL  FOR EBKN-KOSTL,                   "Cost ctr
                    S_PS_PNR FOR EBKN-PS_PSP_PNR NO-DISPLAY,   "Project code
                    S_ERNAM  FOR EBAN-ERNAM.                   "User ID
    PARAMETERS:     P_ASSET AS CHECKBOX DEFAULT 'X',  "Acct Assign - A
                    P_KOSTL AS CHECKBOX DEFAULT 'X',  "Acct Assign - K
                    P_ERNAM AS CHECKBOX DEFAULT 'X',  "Acct Assign - Z
                    P_BSI AS CHECKBOX DEFAULT 'X',    "Acct Assign - H
                    P_MOI AS CHECKBOX DEFAULT 'X',    "Acct Assign - F
                    P_STA AS CHECKBOX DEFAULT 'X'.    "Acct Assign - <blank>
    SELECTION-SCREEN END OF BLOCK BLK2.
    SELECTION-SCREEN BEGIN OF BLOCK BLK3 WITH FRAME TITLE TEXT-003.
    PARAMETERS:     P_CON RADIOBUTTON GROUP PGRP,               "Overseas
                    P_LCL RADIOBUTTON GROUP PGRP,               "Local
                    P_ALL RADIOBUTTON GROUP PGRP DEFAULT 'X'.   "All
    SELECTION-SCREEN END OF BLOCK BLK3.
    *--> range of knttp that the report will only select
    RANGES: S_KNTTP FOR EBAN-KNTTP,
    *--> range of tcode that approval obtained from
            S_TCODE FOR CDHDR-TCODE.
    TOP-OF-PAGE.
    *  perform write_rpttop using sy-title v_sdate v_edate.      "DEVK951017
    *PERFORM WRITE_RPTTOP USING SY-TITLE S_BADAT-LOW S_BADAT-
    *HIGH."DEVK951017
    *    START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM INITIALISATION.
      IF P_ASSET IS INITIAL AND
         P_KOSTL IS INITIAL AND
         P_ERNAM IS INITIAL AND
         P_BSI IS INITIAL AND
         P_MOI IS INITIAL AND
         P_STA IS INITIAL.
        MESSAGE S000 WITH TEXT-E02.
        EXIT.
      ELSE.
        PERFORM SELECT_DATA.
        IF V_FLAG NE 'X'.
          PERFORM WRITE_REPORT.
    *      PERFORM GET_TPAGENO.
    *      PERFORM WRITE_RPTEND.
        ELSE.
          MESSAGE S000 WITH TEXT-E01.
        ENDIF.
      ENDIF.
    *&      Form  SELECT_DATA
    FORM SELECT_DATA.
    IF P_CON EQ 'X'.
      SELECT X~KNTTP Y~KOSTL X~ERNAM X~BANFN X~BNFPO X~MATNR
             X~TXZ01 X~BSART X~EBELN X~EBELP X~BADAT X~FRGZU
        FROM ( EBAN AS X
                 INNER JOIN EBKN AS Y
                   ON X~BANFN EQ Y~BANFN AND
                      X~BNFPO EQ Y~BNFPO )
      APPENDING CORRESPONDING FIELDS OF TABLE T_PR
        WHERE X~BANFN IN S_BANFN AND
              X~LOEKZ EQ '' AND
              X~KNTTP IN S_KNTTP AND
              X~WERKS IN S_WERKS AND
              X~BADAT IN S_BADAT AND
              X~ERNAM IN S_ERNAM AND
              X~BSART IN S_BSART AND
              X~EKORG IN S_EKORG AND
              Y~KOSTL IN S_KOSTL AND
              EKGRP = 'OVS' AND
              EKGRP = 'CON'.
    ELSEIF P_LCL EQ 'X'.
      SELECT X~KNTTP Y~KOSTL X~ERNAM X~BANFN X~BNFPO X~MATNR
             X~TXZ01 X~BSART X~EBELN X~EBELP X~BADAT X~FRGZU
        FROM ( EBAN AS X
                 INNER JOIN EBKN AS Y
                   ON X~BANFN EQ Y~BANFN AND
                      X~BNFPO EQ Y~BNFPO )
      APPENDING CORRESPONDING FIELDS OF TABLE T_PR
        WHERE X~BANFN IN S_BANFN AND
              X~LOEKZ EQ '' AND
              X~KNTTP IN S_KNTTP AND
              X~WERKS IN S_WERKS AND
              X~BADAT IN S_BADAT AND
              X~ERNAM IN S_ERNAM AND
              X~BSART IN S_BSART AND
              X~EKORG IN S_EKORG AND
              Y~KOSTL IN S_KOSTL AND
              EKGRP = 'LCL'.
    ELSE.
      SELECT X~KNTTP Y~KOSTL X~ERNAM X~BANFN X~BNFPO X~MATNR
             X~TXZ01 X~BSART X~EBELN X~EBELP X~BADAT X~FRGZU
        FROM ( EBAN AS X
                 INNER JOIN EBKN AS Y
                   ON X~BANFN EQ Y~BANFN AND
                      X~BNFPO EQ Y~BNFPO )
      APPENDING CORRESPONDING FIELDS OF TABLE T_PR
        WHERE X~BANFN IN S_BANFN AND
              X~LOEKZ EQ '' AND
              X~KNTTP IN S_KNTTP AND
              X~WERKS IN S_WERKS AND
              X~BADAT IN S_BADAT AND
              X~ERNAM IN S_ERNAM AND
              X~BSART IN S_BSART AND
              X~EKORG IN S_EKORG AND
              Y~KOSTL IN S_KOSTL.
    ENDIF.
    *  SELECT * FROM ZEPURDAY INTO T_PRDAY.
    *  APPEND T_PRDAY.
    *  ENDSELECT.
      READ TABLE T_PR INDEX 1.
      IF SY-SUBRC NE 0.
        V_FLAG = 'X'.
      ENDIF.
    ENDFORM.                    " SELECT_DATA
    *&      Form  WRITE_REPORT
    FORM WRITE_REPORT.
    DATA: V_ERNAM LIKE EBKN-ERNAM,
          V_KOSTL LIKE EBKN-KOSTL.
    *--> get from and to date for report header
      PERFORM GET_TITLE_DATE.
    *--> get header and line item data
      PERFORM GET_HEADER_ITEM.
    *--> check data entries of table zepurday.
    *  PERFORM CHECK_TZEPURDAY.
    *--> identify sort key for sorting
      PERFORM SORT.
      CLEAR T_PUR.
      LOOP AT T_PUR.
    *--> get further data from tables against t_pr
        PERFORM PROCESS_DATA.
    *--> get standard day
        PERFORM GET_STAND_DAY.
    *--> get latest grn date
        PERFORM GET_LATEST_GRNDATE.
    *--> get actual day = GRN date - PR creation date
        PERFORM GET_ACT_DAY.
    *--> get variance days = Standard days - Actual days
        PERFORM GET_VAR_DAY.
        V_COUNT = V_COUNT + 1.
        MOVE: T_PUR-ERNAM TO V_ERNAM,
              T_PUR-KOSTL TO V_KOSTL.
        AT NEW KNTTP.
          IF V_FLAG3 NE 'X'.
    *        NEW-PAGE.
          ENDIF.
          V_FLAG3 = 'X'.
          SKIP 1.
         WRITE:/2 'Account Assignment:', 22(10) T_PUR-KNTTP COLOR COL_GROUP.
        ENDAT.
    *--> This is the part i am having trouble <--*
    IF T_PUR-KNTTP EQ 'Z' OR
       T_PUR-KNTTP EQ 'A' OR
       T_PUR-KNTTP EQ 'K' OR
       T_PUR-KNTTP EQ 'H' OR
       T_PUR-KNTTP EQ 'F'.
    AT NEW BSART.
        SELECT SINGLE * FROM T161T
        WHERE SPRAS = 'EN' AND
              BSART = T_PUR-BSART AND
              BSTYP = 'B'.
        T_PUR-BATXT = T161T-BATXT.
      IF V_FLAG3 NE 'X'.
      ENDIF.
      V_FLAG3 = 'X'.
      WRITE:/2 'PR Doc Type Desc:',
             22(3) T_PUR-BSART COLOR COL_GROUP.
      WRITE: 26 T_PUR-BATXT NO-GAP COLOR COL_GROUP.
      PERFORM WRITE_HEADER.
    ENDAT.
    ELSE.
      AT NEW BSART.
        SELECT SINGLE * FROM T161T
        WHERE SPRAS = 'EN' AND
              BSART = T_PUR-BSART AND
              BSTYP = 'B'.
        T_PUR-BATXT = T161T-BATXT.
      IF V_FLAG3 NE 'X'.
      ENDIF.
      V_FLAG3 = 'X'.
      WRITE:/2 'PR Doc Type Desc:',
             22(3) T_PUR-BSART COLOR COL_GROUP.
      WRITE: 26 T_PUR-BATXT NO-GAP COLOR COL_GROUP.
      PERFORM WRITE_HEADER.
    ENDAT.
    ENDIF.
    *    IF T_PUR-KNTTP EQ 'Z'.
    *      AT NEW ERNAM.
    *        IF SY-LINNO >= 60.
    *          NEW-PAGE.
    *        ENDIF.
    *         WRITE:/2 'User ID:', 22(10) V_ERNAM COLOR COL_GROUP.
    *          PERFORM WRITE_HEADER. "write contents header
    *      ENDAT.
    *    ELSEIF T_PUR-KNTTP EQ 'A' OR T_PUR-KNTTP EQ 'K'.
    *      AT NEW KOSTL.
    *        IF SY-LINNO >= 60.
    *          NEW-PAGE.
    *        ENDIF.
    *         WRITE:/2 'Cost Center:', 22(10) V_KOSTL COLOR COL_GROUP.
    *          PERFORM WRITE_HEADER. "write contents header
    *      ENDAT.
    *    ELSEIF T_PUR-KNTTP EQ 'P'.
    *      AT NEW POSID.
    *        IF SY-LINNO >= 60.
    *          NEW-PAGE.
    *        ENDIF.
    *     WRITE:/2 'Project Code:', 22(10) T_PUR-POSID COLOR COL_GROUP.
    *          PERFORM WRITE_HEADER. "write contents header
    *      ENDAT.
    *    ENDIF.
    *--> write report details
        IF SY-LINNO >= 60.
          ULINE (255).
          NEW-PAGE.
          PERFORM WRITE_HEADER.
        ENDIF.
          PERFORM INVERT_LINE_ITEMS_COLOR.
          PERFORM WRITE_DETAILS.
    *--> display data ordered by User ID/Cost Center/Project ID.
        IF T_PUR-KNTTP EQ 'Z'.
          AT END OF ERNAM.
            ULINE (236).
            SKIP 1.
            FORMAT COLOR COL_BACKGROUND INTENSIFIED.
            CLEAR: V_COUNT_MOD, V_COUNT.
          ENDAT.
        ELSEIF T_PUR-KNTTP EQ 'A' OR T_PUR-KNTTP EQ 'K'.
          AT END OF KOSTL.
            ULINE (236).
            SKIP 1.
            FORMAT COLOR COL_BACKGROUND INTENSIFIED.
            CLEAR: V_COUNT_MOD, V_COUNT.
        ENDAT.
        ELSEIF T_PUR-KNTTP EQ 'H'.
          AT END OF KOSTL.
            ULINE (236).
            SKIP 1.
            FORMAT COLOR COL_BACKGROUND INTENSIFIED.
            CLEAR: V_COUNT_MOD, V_COUNT.
          ENDAT.
        ELSEIF T_PUR-KNTTP EQ 'F'.
          AT END OF KOSTL.
            ULINE (236).
            SKIP 1.
            FORMAT COLOR COL_BACKGROUND INTENSIFIED.
            CLEAR: V_COUNT_MOD, V_COUNT.
          ENDAT.
        ELSEIF T_PUR-KNTTP EQ ' '.
          AT END OF KOSTL.
            ULINE (236).
            SKIP 1.
            FORMAT COLOR COL_BACKGROUND INTENSIFIED.
            CLEAR: V_COUNT_MOD, V_COUNT.
          ENDAT.
        ENDIF.
      CLEAR: V_PRDAY,
             V_PRTEMP,
             V_RFQDAY,
             V_RFQTEMP,
             V_PODAY,
             V_POTEMP,
             V_GRNDAY,
             V_GRNTEMP,
             V_ACTDAY,
             V_STADAY,
             V_RELPR,
             V_RELPO,
             V_FLAG3.
      ENDLOOP.
    ENDFORM.                    " WRITE_REPORT
    *&    FORM INITIALISATION
    *&      Initialize value for s_knttp                                   *
    FORM INITIALISATION.
    S_KNTTP-SIGN = 'I'.
    S_KNTTP-OPTION = 'EQ'.
    *--> BUDGETED ASSET
    IF P_ASSET = 'X'.
      S_KNTTP-LOW = 'A'.
      APPEND S_KNTTP.
    ENDIF.
    *--> COST CENTER
    IF P_KOSTL = 'X'.
      S_KNTTP-LOW = 'K'.
      APPEND S_KNTTP.
    ENDIF.
    *--> Project
    *IF P_PCODE = 'X'.
    *  S_KNTTP-LOW = 'P'.
    *  APPEND S_KNTTP.f
    *ENDIF.
    *--> NON-BUDGETED ASSET
    IF P_ERNAM = 'X'.
      S_KNTTP-LOW = 'Z'.
      APPEND S_KNTTP.
    ENDIF.
    *--> BALANCE SHEET ITEM
    IF P_BSI = 'X'.
      S_KNTTP-LOW = 'H'.
      APPEND S_KNTTP.
    ENDIF.
    *--> MO ITEM
    IF P_MOI = 'X'.
      S_KNTTP-LOW = 'F'.
      APPEND S_KNTTP.
    ENDIF.
    *--> STANDARD
    IF P_STA = 'X'.
      S_KNTTP-LOW = ' '.
      APPEND S_KNTTP.
    ENDIF.
    S_TCODE-SIGN = 'I'.
    S_TCODE-OPTION = 'EQ'.
    S_TCODE-LOW = 'ZME55'.
      APPEND S_TCODE.
    S_TCODE-LOW = 'ME54'.
      APPEND S_TCODE.
    S_TCODE-LOW = 'ME28'.
      APPEND S_TCODE.
    S_TCODE-LOW = 'ME47'.
      APPEND S_TCODE.
    ENDFORM.
    *&    FORM SORT
    FORM SORT.
    CLEAR T_PUR.
    LOOP AT T_PUR.
      IF T_PUR-KNTTP EQ 'A' OR
         T_PUR-KNTTP EQ 'K' OR
         T_PUR-KNTTP EQ 'Z' OR
         T_PUR-KNTTP EQ 'H' OR
         T_PUR-KNTTP EQ 'F' OR
         T_PUR-KNTTP EQ ' '.
        SORT T_PUR BY BSART EBELN EBELP.
        EXIT.
      ENDIF.
    ENDLOOP.
    ENDFORM.
    *&    FORM PROCESS_DATA
    FORM PROCESS_DATA.
    DATA: V_TABKEY  LIKE CDPOS-TABKEY,
          V_TABKEY2 LIKE CDPOS-TABKEY,
          V_TABKEY3 LIKE CDPOS-TABKEY.
      CONCATENATE SY-MANDT T_PUR-BANFN T_PUR-BNFPO INTO V_TABKEY.
      CONCATENATE SY-MANDT T_PUR-EBELN INTO V_TABKEY2.
      CONCATENATE SY-MANDT T_PUR-ANFNR T_PUR-EKPO_EBELP INTO V_TABKEY3.
    *--> get po history data
      REFRESH T_DATE.
      SELECT CPUDT EBELN EBELP
        INTO CORRESPONDING FIELDS OF T_DATE
        FROM EKBE
        WHERE EBELN EQ T_PUR-EBELN AND EBELP EQ T_PUR-EBELP
          AND BEWTP EQ 'E' AND BWART EQ '101'.
      APPEND T_DATE.
      ENDSELECT.
    *-->get scheduling agreement delivery schedules data
      SELECT EINDT INTO T_PUR-EINDT FROM EKET
        WHERE EBELN EQ T_PUR-EBELN AND EBELP EQ T_PUR-EBELP.
      MODIFY T_PUR TRANSPORTING EINDT
             WHERE EBELN EQ T_PUR-EBELN AND EBELP EQ T_PUR-EBELP.
      ENDSELECT.
    *--> PR approval date
      SELECT CHANGENR INTO T_PUR-CHANGENR_PR
             FROM CDPOS
             WHERE OBJECTCLAS EQ 'BANF' AND OBJECTID EQ T_PUR-BANFN
               AND TABNAME EQ 'EBAN' AND TABKEY EQ V_TABKEY
               AND FNAME EQ 'FRGKZ' AND CHNGIND EQ 'U'
               AND VALUE_NEW EQ '2'.
      MODIFY T_PUR TRANSPORTING CHANGENR_PR WHERE BANFN EQ T_PUR-BANFN.
      ENDSELECT.
      SELECT UDATE INTO T_PUR-UDATE_PR
             FROM CDHDR
             WHERE OBJECTCLAS EQ 'BANF' AND OBJECTID EQ T_PUR-BANFN
             AND TCODE IN S_TCODE AND CHANGE_IND EQ 'U'
             AND CHANGENR EQ T_PUR-CHANGENR_PR.
      MODIFY T_PUR TRANSPORTING UDATE_PR WHERE BANFN EQ T_PUR-BANFN.
      ENDSELECT.
    *--> PO approval date
      SELECT CHANGENR INTO T_PUR-CHANGENR_PO
             FROM CDPOS
             WHERE OBJECTCLAS EQ 'EINKBELEG' AND OBJECTID EQ T_PUR-EBELN
               AND TABNAME EQ 'EKKO' AND TABKEY EQ V_TABKEY2
               AND FNAME EQ 'FRGKE' AND CHNGIND EQ 'U'
               AND VALUE_NEW EQ 'A'.
      MODIFY T_PUR TRANSPORTING CHANGENR_PO WHERE EBELN EQ T_PUR-EBELN.
      ENDSELECT.
      SELECT UDATE INTO T_PUR-UDATE_PO
             FROM CDHDR
             WHERE OBJECTCLAS EQ 'EINKBELEG' AND OBJECTID EQ T_PUR-EBELN
             AND TCODE IN S_TCODE AND CHANGE_IND EQ 'U'
             AND CHANGENR EQ T_PUR-CHANGENR_PO.
      MODIFY T_PUR TRANSPORTING UDATE_PO WHERE EBELN EQ T_PUR-EBELN.
      ENDSELECT.
    *--> PO printed date
      SELECT DATVR VSTAT INTO (T_PUR-DATVR_PO, T_PUR-VSTAT)
             FROM NAST
             WHERE KAPPL EQ 'EF' AND OBJKY EQ T_PUR-EBELN.
    *           and vstat eq '1'.
      MODIFY T_PUR TRANSPORTING DATVR_PO VSTAT
                                         WHERE EBELN EQ T_PUR-EBELN.
      ENDSELECT.
    *--> RFQ maintained date
      IF NOT T_PUR-ANFNR IS INITIAL.
        SELECT CHANGENR INTO T_PUR-CHANGENR_RFQ
               FROM CDPOS
               WHERE OBJECTCLAS EQ 'EINKBELEG' AND OBJECTID EQ T_PUR-ANFNR
                 AND TABNAME EQ 'EKPO' AND TABKEY EQ V_TABKEY3
                 AND FNAME EQ 'NETPR' AND CHNGIND EQ 'U'.
        MODIFY T_PUR TRANSPORTING CHANGENR_RFQ WHERE ANFNR EQ T_PUR-ANFNR.
        ENDSELECT.
        SELECT UDATE INTO T_PUR-UDATE_RFQ
               FROM CDHDR
               WHERE OBJECTCLAS EQ 'EINKBELEG' AND OBJECTID EQ T_PUR-ANFNR
                 AND TCODE IN S_TCODE AND CHANGE_IND EQ 'U'
                 AND CHANGENR EQ T_PUR-CHANGENR_RFQ.
        MODIFY T_PUR TRANSPORTING UDATE_RFQ WHERE ANFNR EQ T_PUR-ANFNR.
        ENDSELECT.
      ELSE.
        T_PUR-UDATE_RFQ = '00000000'.
      ENDIF.
    *--> get RFQ creation date
      SELECT AEDAT INTO T_PUR-RFQ_AEDAT FROM EKPO
        WHERE EBELN EQ T_PUR-ANFNR.
      MODIFY T_PUR TRANSPORTING RFQ_AEDAT.
      ENDSELECT.
    *--> PR Days = PR release date - PR creation date
      IF T_PUR-UDATE_PR IS INITIAL OR T_PUR-BADAT IS INITIAL.
        V_PRDAY = '0'.
      ELSE.
    *    v_prday = t_pur-udate_pr - t_pur-badat.
    *    v_prtemp = t_pur-udate_pr - t_pur-badat.               " DEVK951017
        PERFORM CALC_ACT_WORKDAY                                 "DEVK951017
               USING T_PUR-BADAT T_PUR-UDATE_PR V_PRTEMP.        "DEVK951017
        PERFORM CONVERT_NEG_TO_BRACKET USING V_PRTEMP
                                       CHANGING V_PRDAY.
      ENDIF.
    *--> RFQ Days = RFQ quotation date - PR release date
    * if t_pur-rfq_aedat is initial or t_pur-udate_pr is initial."DEVK951017
      IF T_PUR-UDATE_RFQ IS INITIAL OR T_PUR-UDATE_PR IS INITIAL."DEVK951017
       V_RFQDAY = '0'.
      ELSE.
    *    v_rfqday = t_pur-rfq_aedat - t_pur-udate_pr.
    *    v_rfqtemp = t_pur-rfq_aedat - t_pur-udate_pr.           "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-UDATE_PR T_PUR-UDATE_RFQ V_RFQTEMP.      "DEVK951017
    PERFORM CONVERT_NEG_TO_BRACKET USING V_RFQTEMP
                                       CHANGING V_RFQDAY.
      ENDIF.
    *--> PO days
    *--> RFQ number not exist (PO Days = PO printed date - PR released date)
      IF T_PUR-ANFNR IS INITIAL.
    *    if t_pur-datvr_po is initial or t_pur-udate_pr is initial.
    *      v_poday = '0'.u
    *    else.
          IF T_PUR-VSTAT = 1.
            IF T_PUR-DATVR_PO IS INITIAL OR T_PUR-UDATE_PR IS INITIAL.
              V_PODAY = '0'.
            ELSE.
    *          v_poday = t_pur-datvr_po - t_pur-udate_pr.
    *         v_potemp = t_pur-datvr_po - t_pur-udate_pr.        "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-UDATE_PR T_PUR-DATVR_PO V_POTEMP.        "DEVK951017
              PERFORM CONVERT_NEG_TO_BRACKET USING V_POTEMP
                                             CHANGING V_PODAY.
            ENDIF.
          ELSEIF T_PUR-VSTAT = 2 OR T_PUR-VSTAT = 0.
            IF T_PUR-AEDAT IS INITIAL OR T_PUR-UDATE_PR IS INITIAL.
              V_PODAY = '0'.
            ELSE.
    *          v_poday = t_pur-aedat - t_pur-udate_pr.
    *          v_potemp = t_pur-aedat - t_pur-udate_pr.          "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-UDATE_PR T_PUR-AEDAT V_POTEMP.           "DEVK951017
              PERFORM CONVERT_NEG_TO_BRACKET USING V_POTEMP
                                             CHANGING V_PODAY.
            ENDIF.
          ELSEIF T_PUR-VSTAT IS INITIAL.
            V_PODAY = '0'.
          ENDIF.
    *    endif.
      ELSE.
    *--> RFQ number exist (PO Days = PO printed date - Quotation date)
    *    if t_pur-datvr_po is initial or t_pur-rfq_aedat is initial.
    *      v_poday = '0'.
    *    else.
        IF T_PUR-VSTAT = 1.
          IF T_PUR-DATVR_PO IS INITIAL OR T_PUR-RFQ_AEDAT IS INITIAL.
            V_PODAY = '0'.
          ELSE.
    *        v_poday = t_pur-datvr_po - t_pur-rfq_aedat.
    *       v_potemp = t_pur-datvr_po - t_pur-rfq_aedat.         "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-RFQ_AEDAT T_PUR-DATVR_PO V_POTEMP.       "DEVK951017
            PERFORM CONVERT_NEG_TO_BRACKET USING V_POTEMP
                                           CHANGING V_PODAY.
          ENDIF.
        ELSEIF T_PUR-VSTAT = 2 OR T_PUR-VSTAT = 0.
          IF T_PUR-AEDAT IS INITIAL OR T_PUR-RFQ_AEDAT IS INITIAL.
            V_PODAY = '0'.
          ELSE.
    *        v_poday = t_pur-aedat - t_pur-rfq_aedat.
    *        v_potemp = t_pur-aedat - t_pur-rfq_aedat.           "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-RFQ_AEDAT T_PUR-AEDAT V_POTEMP.          "DEVK951017
            PERFORM CONVERT_NEG_TO_BRACKET USING V_POTEMP
                                           CHANGING V_PODAY.
          ENDIF.
        ELSEIF T_PUR-VSTAT IS INITIAL.
          V_PODAY = '0'.
        ENDIF.
      ENDIF.
      CLEAR: V_TABKEY,
             V_TABKEY2,
             V_TABKEY3.
    ENDFORM.
    *&    FORM WRITE_HEADER
    FORM WRITE_HEADER.
      ULINE (255).
      FORMAT COLOR COL_HEADING INTENSIFIED ON.
      WRITE:/    '|', 9   'PR',
             21  '|', 48  'Material',
             83  '|', 92  'PO',
             103 '|', 107 'Purchase Requisition',
             131 '|', 143 'RFQ',
             159 '|', 176 'Purchase Order',
             209 '|', 210 'S',
             211 '|', 217 'GRN',
             228 '|', 229 'Standard',
             237 '|', 238 'Actual',
             244 '|', 255 '|'.
      ULINE (228).
      FORMAT COLOR OFF.
      WRITE: 237 '|', 244 '|', 255 '|'.
      FORMAT COLOR COL_HEADING INTENSIFIED ON.
      WRITE:/    '|', 2   'Number',
             12  '|', 13  'Item No.',
             21  '|', 22  'Number',
             41  '|', 42  'Description',
             83  '|', 84  'Number',
             94  '|', 95  'Item No.',
             103 '|', 104 'Created',
             114 '|', 115 'Released',
             125 '|', 126 'Days',
             131 '|', 132 'Created',
             142 '|', 143 'Maintained',
             153 '|', 154 'Days',
             159 '|', 160 'Created',
             170 '|', 171 'Required',
             181 '|', 182 'Approved',
             192 '|', 193 'Printed',
             203 '|', 204 'Days',
             209 '|',
             211 '|', 212 'Delivered',
             222 '|', 223 'Days',
             228 '|', 229 'Days',
             237 '|', 238 'Days',
             244 '|', 245 'Variance',
             255 '|'.
      FORMAT COLOR OFF.
      ULINE (255).
    ENDFORM.                    " WRITE_HEADER
    *&      Form  INVERT_LINE_ITEMS_COLOR
    FORM INVERT_LINE_ITEMS_COLOR.
      V_COUNT_MOD = V_COUNT MOD 2.
      IF V_COUNT_MOD EQ '0'.
        FORMAT COLOR COL_KEY INTENSIFIED OFF.
      ELSE.
        FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
      ENDIF.
    ENDFORM.                    " INVERT_LINE_ITEMS_COLOR
    *&      Form  GET_TITLE_DATE
    FORM GET_TITLE_DATE.
      IF NOT S_BADAT-LOW IS INITIAL AND NOT S_BADAT-HIGH IS INITIAL.
        V_SDATE = S_BADAT-LOW.
        V_EDATE = S_BADAT-HIGH.
      ELSE.
        SORT T_PR BY BADAT ASCENDING.
        READ TABLE T_PR INDEX 1.
        V_SDATE = T_PR-BADAT.
        SORT T_PR BY BADAT DESCENDING.
        READ TABLE T_PR INDEX 1.
        V_EDATE = T_PR-BADAT.
      ENDIF.
    ENDFORM.                    " GET_TITLE_DATE
    *&      Form  GET_LATEST_GRNDATE
    FORM GET_LATEST_GRNDATE.
    DATA: D_LINES TYPE I.
      CLEAR T_DATE.
      DESCRIBE TABLE T_DATE LINES D_LINES.
      IF D_LINES GT 0.
        SORT T_DATE BY CPUDT EBELN EBELP DESCENDING.
        READ TABLE T_DATE WITH KEY EBELN = T_PUR-EBELN.
        IF SY-SUBRC = 0.
          READ TABLE T_DATE INDEX 1.
          MOVE: T_DATE-CPUDT TO T_PUR-CPUDT.
          MODIFY T_PUR TRANSPORTING CPUDT
                 WHERE EBELN = T_PUR-EBELN AND EBELP = T_PUR-EBELP.
        ENDIF.
      ENDIF.
    *--> GRN Days = GRN date - PO printed date
      IF T_PUR-VSTAT = 1.
        IF T_PUR-CPUDT IS INITIAL OR T_PUR-DATVR_PO IS INITIAL.
          V_GRNDAY = '0'.
        ELSE.
    *    v_grnday = t_pur-cpudt - t_pur-datvr_po.
    *    v_grntemp = t_pur-cpudt - t_pur-datvr_po.               "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-DATVR_PO T_PUR-CPUDT V_GRNTEMP.          "DEVK951017
          PERFORM CONVERT_NEG_TO_BRACKET USING V_GRNTEMP
                                         CHANGING V_GRNDAY.
        ENDIF.
      ELSEIF T_PUR-VSTAT = 2 OR T_PUR-VSTAT = 0.
        IF T_PUR-CPUDT IS INITIAL OR T_PUR-AEDAT IS INITIAL.
          V_GRNDAY = '0'.
        ELSE.
    *    v_grnday = t_pur-cpudt - t_pur-datvr_po.
    *     v_grntemp = t_pur-cpudt - v_grntemp.                   "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-AEDAT T_PUR-CPUDT V_GRNTEMP.             "DEVK951017
          PERFORM CONVERT_NEG_TO_BRACKET USING V_GRNTEMP
                                         CHANGING V_GRNDAY.
        ENDIF.
      ENDIF.
    ENDFORM.                    " GET_LATEST_GRNDATE
    *&      Form  GET_HEADER_ITEM
    FORM GET_HEADER_ITEM.
    DATA: V_OBJNR   LIKE PRPS-OBJNR,
          V_TEMP(4) TYPE C.
      clear t_pr.
      loop at t_pr.
        SELECT EBELN EBELP FROM EKET
               INTO (EKET-EBELN, EKET-EBELP)
               WHERE BANFN EQ T_PR-BANFN AND BNFPO EQ T_PR-BNFPO.
          SELECT EBELN FRGZU FROM EKKO
                 INTO (EKKO-EBELN, EKKO-FRGZU)
                 WHERE EBELN EQ EKET-EBELN.
            SELECT EBELP ANFNR ANFPS AEDAT FROM EKPO
                   INTO (EKPO-EBELP, EKPO-ANFNR, EKPO-ANFPS, EKPO-AEDAT)
                   WHERE EBELN EQ EKET-EBELN AND EBELP EQ EKET-EBELP
                   AND BSTYP EQ 'F'.
              MOVE-CORRESPONDING T_PR TO T_PUR.
              MOVE: EKET-EBELN TO T_PUR-EKET_EBELN,
                    EKET-EBELP TO T_PUR-EKET_EBELP,
                    EKKO-EBELN TO T_PUR-EKKO_EBELN,
                    EKKO-FRGZU TO T_PUR-EKKO_FRGZU,
                    EKPO-EBELP TO T_PUR-EKPO_EBELP,
                    EKPO-ANFNR TO T_PUR-ANFNR,
                    EKPO-ANFPS TO T_PUR-ANFPS,
                    EKPO-AEDAT TO T_PUR-AEDAT.
              V_FLAG2 = 'Y'.
              APPEND T_PUR.
            ENDSELECT.
          ENDSELECT.
        ENDSELECT.
      IF V_FLAG2 NE 'Y'.
        MOVE-CORRESPONDING T_PR TO T_PUR.
        APPEND T_PUR.
      ENDIF.
    *--> get project code name
      CONCATENATE 'PR' T_PR-PS_PSP_PNR INTO V_OBJNR.
      SELECT SINGLE POSID INTO T_PR-POSID FROM PRPS WHERE OBJNR EQ V_OBJNR.
      SPLIT T_PR-POSID AT '/' INTO T_PUR-POSID V_TEMP.
      MODIFY T_PUR TRANSPORTING POSID WHERE PS_PSP_PNR EQ T_PR-PS_PSP_PNR.
    CLEAR V_FLAG2.
      ENDLOOP.
    ENDFORM.                    " GET_HEADER_ITEM
    *&      Form  WRITE_DETAILS
    FORM WRITE_DETAILS.
      WRITE:/   '|', 2   T_PUR-BANFN,                "PR no
             12 '|', 13  T_PUR-BNFPO,                "item no
             41 '|', 42  T_PUR-TXZ01,                "mat description
            103 '|', 104 T_PUR-BADAT,                "PR creation date
            125 '|', 126 V_PRDAY LEFT-JUSTIFIED,     "PR days
            131 '|',
            153 '|', 154 V_RFQDAY LEFT-JUSTIFIED,    "RFQ days
            203 '|', 204 V_PODAY LEFT-JUSTIFIED,     "PO days
            209 '|', 210 T_PUR-VSTAT,
            222 '|', 223 V_GRNDAY LEFT-JUSTIFIED,    "GRN days
            228 '|', 229 V_STADAY LEFT-JUSTIFIED,    "Standard days
            237 '|', 238 V_ACTDAY LEFT-JUSTIFIED,    "Actual days
            244 '|', 245 V_VARDAY LEFT-JUSTIFIED,    "Variance days
            255 '|'.
      IF T_PUR-MATNR IS INITIAL.
        WRITE: 21 '|', 22 '-'.
      ELSE.
        WRITE: 21 '|', 22  T_PUR-MATNR.              "mat no
      ENDIF.
      IF T_PUR-EKKO_EBELN IS INITIAL.
        WRITE: 83 '|', 84 '-'.
      ELSE.
        WRITE: 83 '|', 84  T_PUR-EKKO_EBELN.         "PO number
      ENDIF.
      IF T_PUR-EKPO_EBELP EQ '00000' OR T_PUR-EKPO_EBELP IS INITIAL.
        WRITE: 94 '|', 95 '-'.
      ELSE.
        WRITE: 94 '|', 95  T_PUR-EKPO_EBELP.         "PO item no
      ENDIF.
      IF T_PUR-UDATE_PR EQ '00000000'.
        WRITE:  114 '|', 115 '-'.
      ELSE.
        WRITE: 114 '|', 115 T_PUR-UDATE_PR.          "PR released date
      ENDIF.
      IF T_PUR-RFQ_AEDAT EQ '00000000'.
        WRITE: 132 '-', 142 '|'.
      ELSE.
        WRITE: 132 T_PUR-RFQ_AEDAT, 142 '|'.  "RFQ creation date
      ENDIF.
      IF T_PUR-UDATE_RFQ EQ '00000000'.
        WRITE: 143 '-'.
      ELSE.
        WRITE: 143 T_PUR-UDATE_RFQ.           "RFQ maintained date
      ENDIF.
      IF T_PUR-AEDAT EQ '00000000'.
        WRITE: 159 '|', 160 '-'.
      ELSE.
        WRITE: 159 '|', 160 T_PUR-AEDAT.      "PO creation date
      ENDIF.
      IF T_PUR-EINDT EQ '00000000'.
        WRITE: 170 '|', 171 '-'.
      ELSE.
        WRITE: 170 '|', 171 T_PUR-EINDT.       "PO required date
      ENDIF.
      IF T_PUR-UDATE_PO EQ '00000000'.
        WRITE: 181 '|', 182 '-'.
      ELSE.
        WRITE: 181 '|', 182 T_PUR-UDATE_PO.    "PO released date
      ENDIF.
      IF T_PUR-VSTAT = 1.
    *    if t_pur-datvr_po eq '00000000'.
    *      write: 192 '|', 193 '-'.
    *    else.
          WRITE: 192 '|', 193 T_PUR-DATVR_PO.    "PO printed date
    *    endif.
    *  elseif t_pur-vstat = 2 or t_pur-vstat = 0.                "DEVK951017
       ELSEIF T_PUR-VSTAT = 2.                                   "DEVK951017
        WRITE: 192 '|', 193 T_PUR-AEDAT.         "PO creation date
       ELSEIF T_PUR-VSTAT = 0.                                   "DEVK951017
        WRITE: 192 '|', 193 '-'.     "PO printed date not shown  "DEVK951017
      ENDIF.
      IF T_PUR-CPUDT EQ '00000000'.
        WRITE: 211 '|', 212 '-'.
      ELSE.
        WRITE: 211 '|', 212 T_PUR-CPUDT.        "GRN delivered date
      ENDIF.
    ENDFORM.                    " WRITE_DETAILS
    *&      Form  CHECK_TZEPURDAY
    FORM CHECK_TZEPURDAY.
    *  CLEAR T_PRDAY.
    *  READ TABLE T_PRDAY INDEX 1.
    *  IF SY-SUBRC NE 0.
    *    FORMAT COLOR COL_NEGATIVE ON.
    *    WRITE:/ '*** No Table Entries Found in Table ZEPURDAY ***'.
    *    FORMAT COLOR OFF.
    *  ENDIF.
    ENDFORM.                    " CHECK_TZEPURDAY
    *&      Form  GET_STAND_DAY
    FORM GET_STAND_DAY.
    *--> PR release days
    *  CLEAR T_PRDAY.
    *  READ TABLE T_PRDAY WITH KEY PR_TYPE = T_PUR-BSART.
    *  IF SY-SUBRC EQ 0.
    *    CLEAR V_LEN.
    *    CONDENSE T_PUR-FRGZU.
    *    V_LEN = STRLEN( T_PUR-FRGZU ).
    *    IF V_LEN EQ 0.
    *      V_RELPR = 0.
    *    ELSEIF V_LEN EQ '1'.
    *      V_RELPR = T_PRDAY-PR_RE1.
    *    ELSEIF V_LEN EQ '2'.
    *      V_RELPR = T_PRDAY-PR_RE1 + T_PRDAY-PR_RE2.
    *    ELSEIF V_LEN EQ '3'.
    *      V_RELPR = T_PRDAY-PR_RE1 + T_PRDAY-PR_RE2 + T_PRDAY-PR_RE3.
    *    ELSE.
    *      V_RELPR = T_PRDAY-PR_RE1 + T_PRDAY-PR_RE2 +
    *                T_PRDAY-PR_RE3 + T_PRDAY-PR_RE4.
    *    ENDIF.
    *--> PO release days
    *    CLEAR V_LEN2.
    *    CONDENSE T_PUR-EKKO_FRGZU.
    *    V_LEN2 = STRLEN( T_PUR-EKKO_FRGZU ).
    *    IF V_LEN2 EQ 0.
    *      V_RELPO = 0.
    *    ELSEIF V_LEN2 EQ '1'.
    *      V_RELPO = T_PRDAY-PO_RE1.
    *    ELSEIF V_LEN2 EQ '2'.
    *      V_RELPO = T_PRDAY-PO_RE1 + T_PRDAY-PO_RE2.
    *    ELSEIF V_LEN2 EQ '3'.
    *      V_RELPO = T_PRDAY-PO_RE1 + T_PRDAY-PO_RE2 + T_PRDAY-PO_RE3.
    *    ELSE.
    *      V_RELPO = T_PRDAY-PO_RE1 + T_PRDAY-PO_RE2 +
    *                T_PRDAY-PO_RE3 + T_PRDAY-PO_RE4.
    *    ENDIF.
    CHECK = ' '.                                                 "DEVK951017
    IF NOT ( T_PUR-EKKO_EBELN IS INITIAL ) AND                   "DEVK951017
       T_PUR-ANFNR IS INITIAL AND T_PUR-KNTTP = 'P'.
       PERFORM CHECK_RFQ.                                        "DEVK951017
    **   IF CHECK = 'X'.
    **      V_STADAY = T_PRDAY-PR_CRT + V_RELPR + T_PRDAY-PO_CRT +
    *"DEVK951017
    **      V_RELPO + T_PRDAY-PO_PRN + T_PRDAY-GRN_CRT.
    **   ENDIF.
    *ELSE.
    **--> Standard Days
    *    V_STADAY = T_PRDAY-PR_CRT + V_RELPR + T_PRDAY-RFQ_CRT +
    *               T_PRDAY-RFQ_MAN + T_PRDAY-PO_CRT +
    *               V_RELPO + T_PRDAY-PO_PRN + T_PRDAY-GRN_CRT.
    **              + t_prday-pay_crt + t_prday-inv_crt.
    "DEVK951017
    *ENDIF.
      ENDIF.                                                     "DEVK951017
    ENDFORM.                    " GET_STAND_DAY
    *&      Form  GET_ACT_DAY
    FORM GET_ACT_DAY.
    DATA: V_CPUDT LIKE SY-DATUM.
    *  IF T_PUR-CPUDT IS INITIAL OR T_PUR-BADAT IS INITIAL.
    *    V_ACTDAY = '0'.
    *  ELSE.
    *    V_ACTDAY = T_PUR-CPUDT - T_PUR-BADAT.
    *  ENDIF.
      V_CPUDT = SY-DATUM.
      IF T_PUR-CPUDT IS INITIAL.
    *   v_actday = v_cpudt - t_pur-badat.                        "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-BADAT V_CPUDT V_ACTDAY.
      ELSEIF T_PUR-BADAT IS INITIAL.
        V_ACTDAY = '0'.
      ELSE.
    *   v_actday = t_pur-cpudt - t_pur-badat.                    "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-BADAT T_PUR-CPUDT V_ACTDAY.
      ENDIF.
    ENDFORM.                    " GET_ACT_DAY
    *&      Form  GET_VAR_DAY
    FORM GET_VAR_DAY.
    DATA: V_TEMP2(8).
      V_TEMP2 = V_STADAY - V_ACTDAY.
      PERFORM CONVERT_NEG_TO_BRACKET USING V_TEMP2
                                     CHANGING V_VARDAY.
    ENDFORM.                    " GET_VAR_DAY
    *&      Form  CONVERT_NEG_TO_BRACKET
    FORM CONVERT_NEG_TO_BRACKET USING    P_V_TEMP
                                CHANGING P_V_DAY.
      SEARCH P_V_TEMP FOR '-'.
      IF SY-SUBRC = 0.
        SHIFT P_V_TEMP RIGHT BY 1 PLACES.
        SHIFT P_V_TEMP LEFT DELETING LEADING SPACE.
        CONCATENATE '(' P_V_TEMP ')' INTO P_V_DAY.
      ELSE.
        SHIFT P_V_TEMP LEFT DELETING LEADING SPACE.
        MOVE P_V_TEMP TO P_V_DAY.
      ENDIF.
    ENDFORM.                    " CONVERT_NEG_TO_BRACKET
    *&      Form  CALC_ACT_WORKDAY                            -DEVK951017
    *      -->lowdt  -Low Date                                             *
    *      -->Highdt -High Date                                            *
    *      -->days   -Total Days                                           *
    FORM CALC_ACT_WORKDAY USING LOWDT HIGHDT DAYS.
      DATA: DAT LIKE SY-DATUM.
      DAYS = 0.
      DAT = LOWDT.
      DO.
    CALL FUNCTION 'DATE_CHECK_WORKINGDAY'
         EXPORTING
              DATE                       = DAT
              FACTORY_CALENDAR_ID        = 'MY'
              MESSAGE_TYPE               = 'I'
         EXCEPTIONS
              DATE_AFTER_RANGE           = 1
              DATE_BEFORE_RANGE          = 2
              DATE_INVALID               = 3
              DATE_NO_WORKINGDAY         = 4
              FACTORY_CALENDAR_NOT_FOUND = 5
              MESSAGE_TYPE_INVALID       = 6
              OTHERS                     = 7.
        IF SY-SUBRC = 0.
          DAYS = DAYS + 1.
        ENDIF.
        DAT = DAT + 1.
        IF DAT GE HIGHDT.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.                    " CALC_ACT_WORKDAY
    *&      Form  CHECK_RFQ
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM CHECK_RFQ.
    DATA: KONNR LIKE EKPO-KONNR,
          AEDAT LIKE EKKO-AEDAT.
    SELECT SINGLE P~KONNR K~AEDAT INTO (KONNR, AEDAT)
    FROM EKPO AS P INNER JOIN EKKO AS K
    ON P~EBELN = K~EBELN WHERE P~EBELN = T_PUR-EKKO_EBELN
    AND P~EBELP = T_PUR-EKPO_EBELP AND K~BSTYP = 'K'
    AND P~KONNR = K~KONNR.
    IF SY-SUBRC = 0.
    IF AEDAT < T_PUR-BADAT.
      CHECK = 'X'.
    ENDIF.
    ENDIF.
    ENDFORM.                    " CHECK_RFQ
    By the way, it's my first time trying to modify other people's codes, is there a proper way to do this. I find it more difficult to modify people's code than to write my own. Perhaps you guys could give me some advice, so i'll know what to do when i'm assigned to do it again next time?

    Even though you think AT NEW will work on just the field that you mentioned, it is not. Your field BSART is about 6th or 7th field in your internal table. So any change in any of the field values before BSART will trigger this AT NEW BSART code.
    You have to declare your own variables to keep track of the current value of BSART and previous value of the same. Also, remember that it may not have been sorted by BSART. So your logic may not work and if you change the sort, then your previous AT NEW may not work. So be sure of what you want to do there.
    Srinivas

  • SOME FIELDS OF WORK AREA ARE CONVERTED TO ***** AT AT NEW STATEMENT

    HELLO
    SOME OF THE FIELDS OF WORK AREA ARE CONVERTED INTO *********** AT AT NEW STATEMENT .FIND BELOW THE CODE
    *& Report  YTEST_OBJECTS7
    REPORT  YTEST_OBJECTS7.
    Program Description
    Author.........: Jitendra Dash                                       *
    Creation date..: 17/09/2010                                                    *
    GAP ID/FS Id...:                                                     *
    Transport......:                                                     *
    Description u2026..:                                                     *
    CHANGE HISTORY u2013 Should be completed in reverse date order           *
    Revised by........: <Developer name>                                 *
    Change date.......: Date of creation>                                *
    CR/Defect No......:  <Change Request No>/ <Defect#<xxx>              *
    Transport.........: <Request No>                                     *
    Description.......: Description about modification                   *
    Data Declaration
    TYPES: BEGIN OF gx_input,
             NEMI      TYPE EXT_UI,
             DIVISION  TYPE SPARTE ,
             DATE      TYPE ERDAT,
             DATE1     TYPE ERDAT,
           END OF gx_input.
    TYPES: BEGIN OF gx_input1,
             NEMI      TYPE EXT_UI,
             DIVISION  TYPE SPARTE ,
             DATE      TYPE ERDAT,
             DATE1     TYPE ERDAT,
             int_ui    TYPE INT_UI,
             ANlage    type   anlage,
             SERVICE   TYPE SERCODE,
             SERVICEID TYPE SERVICE_PROV,
             SPARTE    TYPE SPARTE,
            END OF gx_input1.
    TYPES : BEGIN OF gx_euitrans,
            INT_UI TYPE INT_UI,
            EXT_UI type EXT_UI,
            END OF gx_euitrans.
    TYPES : BEGIN OF gx_eservice,
            INT_UI TYPE INT_UI,
            SERVICE TYPE SERCODE,
            SERVICEID TYPE SERVICE_PROV,
            SPARTE    TYPE SPARTE,
            END OF gx_eservice.
    TYPES : BEGIN OF gx_inst,
            int_ui TYPE INT_UI,
            ANlage type   anlage,
            END OF gx_inst.
    TYPES : BEGIN OF gx_ever,
            ANLAGE TYPE anlage,
            EINZDAT TYPE EINZDAT,
            AUSZDAT TYPE AUSZDAT,
            VERTRAG type VERTRAG,
            vkonto TYPE VKONT_KK,
            END OF gx_ever .
    TYPES : BEGIN OF gx_fkkvkp,
            VKONT type VKONT_KK,
            GPART type GPART_KK,
            END OF gx_fkkvkp.
    DATA : GIT_INPUT TYPE STANDARD TABLE OF GX_INPUT,
           git_euitrans TYPE STANDARD TABLE OF gx_euitrans,
           git_eservice TYPE STANDARD TABLE OF gx_eservice,
           git_inst TYPE STANDARD TABLE OF gx_inst,
           git_ever TYPE STANDARD TABLE OF  gx_ever,
           GIT_INPUT1 TYPE STANDARD TABLE OF GX_INPUT1,
           GIT_fkkvkp TYPE STANDARD TABLE OF GX_fkkvkp,
           WA_INPUT TYPE gx_input,
           wa_euitrans LIKE LINE OF git_euitrans,
           wa_eservice like LINE OF git_eservice,
           WA_inst LIKE LINE OF git_inst,
           wa_ever LIKE LINE OF git_ever,
           wa_INPUT1 like LINE OF git_INPUT1,
           wa_fkkvkp like LINE OF GIT_fkkvkp.
    DATA: gv_v_localfile TYPE localfile,
          gv_g_localfile type string,
          gv_g_alocalfile type string,
          gv_g_sender type SERVICE_PROV,
          gv_g_reciever type SERVICE_PROV.
    CONSTANTS : GC_AINP TYPE c LENGTH 50 VALUE '/tmp'.
    ************Selection screen for input *********************
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE t1.
    PARAMETERS : p_rad1 RADIOBUTTON GROUP grp DEFAULT 'X' USER-COMMAND chk,
                 p_rad2 RADIOBUTTON GROUP grp,
                 p_file TYPE file_table-filename MODIF ID m1,
                 p_afile TYPE file_table-filename MODIF ID m2.
    SELECTION-SCREEN END OF BLOCK b1.
    ***************Initialization*****************************
    INITIALIZATION.
      t1 = text-001.
    ***Selection of Appl ser and Presen ser for I/P file******
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF p_rad1 = 'X'.
          IF screen-group1 = 'M2'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ELSEIF p_rad2 = 'X'.
          IF screen-group1 = 'M1'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    **F4 help for inputting the Filename from presentation Ser*
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          program_name  = sy-repid
          dynpro_number = sy-dynnr
          field_name    = p_file
        CHANGING
          file_name     = gv_v_localfile
        EXCEPTIONS
          mask_too_long = 1
          OTHERS        = 2.
      IF sy-subrc = 0.
        MOVE gv_v_localfile TO p_file.
        move gv_v_localfile to gv_g_localfile.
      ENDIF.
    ***F4 help for file on Application Server*******************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_afile.
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = GC_AINP
          filemask         = ' '
        IMPORTING
          serverfile       = p_afile
        EXCEPTIONS
          canceled_by_user = 1
          OTHERS           = 2.
      IF sy-subrc = 0.
        move p_afile to gv_g_alocalfile.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    START-OF-SELECTION.
      IF p_rad1 = 'X'.
    *************Upload file into Itab from pres server*********
        CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
             FILENAME                      = gv_g_localfile
      FILETYPE                      = 'ASC'
            HAS_FIELD_SEPARATOR           = '|'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
           TABLES
             DATA_TAB                      = GIT_INPUT
        EXCEPTIONS
          FILE_OPEN_ERROR               = 1
          FILE_READ_ERROR               = 2
          NO_BATCH                      = 3
          GUI_REFUSE_FILETRANSFER       = 4
          INVALID_TYPE                  = 5
          NO_AUTHORITY                  = 6
          UNKNOWN_ERROR                 = 7
          BAD_DATA_FORMAT               = 8
          HEADER_NOT_ALLOWED            = 9
          SEPARATOR_NOT_ALLOWED         = 10
          HEADER_TOO_LONG               = 11
          UNKNOWN_DP_ERROR              = 12
          ACCESS_DENIED                 = 13
          DP_OUT_OF_MEMORY              = 14
          DISK_FULL                     = 15
          DP_TIMEOUT                    = 16
          OTHERS                        = 17
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ELSEIF p_rad2 = 'X'.
    *************Upload file into Itab from Applic server*********
    ************file should be ; seperated and not tab seper******
       TRANSLATE gv_g_alocalfile USING '\/'.
       OPEN DATASET gv_g_alocalfile FOR INPUT MESSAGE gv_LC_MESSAGE in TEXT MODE ENCODING DEFAULT.
       IF sy-subrc = 0.
         DO.
           READ DATASET gv_g_alocalfile INTO wa_xls.
           IF sy-subrc IS NOT INITIAL.
             EXIT.
           ELSE.
             APPEND wa_xls TO git_xls.
           ENDIF.
         ENDDO.
       ENDIF.
       close DATASET gv_g_alocalfile.
      ENDIF.
      SELECT INT_UI EXT_UI from EUITRANS
                           into CORRESPONDING FIELDS OF TABLE git_euitrans
                           for ALL ENTRIES IN  GIT_INPUT
                           WHERE ext_ui = GIT_INPUT-NEMI.
      SElect INT_UI
             SERVICE
             SERVICEID
             SPARTE    from ESERVICE
                       into CORRESPONDING FIELDS OF TABLE git_eservice
                       FOR ALL ENTRIES IN git_euitrans
                       where INT_UI = git_euitrans-INT_UI .
      SELECT INT_UI
             ANLAGE from euiinstln
                    into CORRESPONDING FIELDS OF TABLE GIT_INST
                    FOR ALL ENTRIES IN  git_eservice
                    WHERE INT_UI = git_eservice-INT_UI.
      LOOP AT git_eservice into wa_eservice.
        READ TABLE git_euitrans into wa_euitrans
                                with KEY int_ui = wa_eservice-int_ui.
        IF SY-SUBRC = 0.
          READ TABLE git_input into wa_input
                               WITH key NEMI = wa_euitrans-EXT_UI.
          IF SY-SUBRC = 0.
            READ TABLE  GIT_INST into WA_INST
                                     with key int_ui = wa_eservice-int_ui.
             IF Sy-subrc = 0.
                  wa_input1-NEMI = wa_input-NEMI      .
                  wa_input1-DIVISION = wa_input-DIVISION.
                  wa_input1-DATE = wa_input-DATE.
                  wa_input1-DATE1 = wa_input-DATE1.
                  wa_input1-int_ui = wa_eservice-int_ui.
                  wa_input1-anlage = WA_INST-anlage.
                  wa_input1-SERVICE = wa_eservice-service.
                  wa_input1-SERVICEID = wa_eservice-serviceid.
                  wa_input1-SPARTE  = wa_eservice-sparte.
            Append wa_input1 to git_input1.
             ENDIF.
          ENDIF.
        ENDIF.
        clear : wa_eservice,wa_input,WA_INST,wa_euitrans,wa_input1 .
      ENDLOOP.
      SELECT anlage
             EINZDAT
             AUSZDAT
             VERTRAG
             VKONTO  from ever
                     into CORRESPONDING FIELDS OF TABLE git_ever
                     FOR ALL ENTRIES IN git_input1
                     WHERE anlage = git_input1-ANLAGE
                       and EINZDAT = git_input1-DATE
                       or  AUSZDAT = git_input1-DATE1.
      Select Vkont Gpart from fkkvkp
                         into CORRESPONDING FIELDS OF TABLE git_fkkvkp
                         for ALL ENTRIES IN git_ever
                         where  Vkont = git_ever-Vkonto.
    LOOP AT  git_input1 INTO wa_input1 .
    IF wa_input1-SPARTE = 01  .
    CASE wa_input1-SERVICE.
      WHEN 'FRMP'.
        gv_g_sender = wa_input1-SERVICEID.
      WHEN 'LNSP'.
        gv_g_reciever = wa_input1-SERVICEID.
    ENDCASE.
    ELSEIF wa_input1-SPARTE = 02 .
    CASE wa_input1-SERVICE.
      WHEN 'FRO'.
        gv_g_sender = wa_input1-SERVICEID.
      WHEN 'DB'.
        gv_g_reciever = wa_input1-SERVICEID.
    ENDCASE.
    ENDIF.
    data : int_ui TYPE INT_UI.
    *int_ui = wa_input1-int_ui .
    AT NEW int_ui .
    READ TABLE git_ever into wa_ever with key  anlage = wa_input1-anlage.
    READ TABLE git_fkkvkp INTO wa_fkkvkp with key Vkont = wa_ever-Vkonto.
    CALL FUNCTION 'ZIN_COMEV_CUSTDETAILNOTIF_OUT'
      EXPORTING
        Y_SENDER              = gv_g_sender
        Y_RECEIVER            = gv_g_reciever
        Y_PARTNER             = wa_fkkvkp-gpart
        Y_BASIC_PROCESS       = 'ZCDNO'
      Y_SWITCHNUM           =
      Y_SEN_LOAD            =
        Y_INTUI               = wa_input1-int_ui
      Y_TRANSACTIONID       =
        Y_DATE                = wa_input1-DATE
    IMPORTING
      X_TASK_ID             =
    TABLES
       IDOC_STATUS           =
       IDOC_CONTRL           =
       XYT_ERROR             =
    EXCEPTIONS
      GENERAL_FAULT         = 1
      NOT_FOUND             = 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.
    ENDAT.
    ENDLOOP.
    IN THIS PROGRAM AT AT NEW STATEMENT IN LOOP SOME OF THE FIELDS OF wa_input1 IS CONVERTED TO ***** E.G  wa_input1-anlage.
    pLEASE HELP ME OUT

    HELLO
    My Q is some fields at AT NEW statement turns into *****.Please help me out
    TYPES: BEGIN OF gx_input1,
             NEMI      TYPE EXT_UI,
             DIVISION  TYPE SPARTE ,
             DATE      TYPE ERDAT,
             DATE1     TYPE ERDAT,
             int_ui    TYPE INT_UI,
             ANlage    type   anlage,
             SERVICE   TYPE SERCODE,
             SERVICEID TYPE SERVICE_PROV,
             SPARTE    TYPE SPARTE,
            END OF gx_input1.
    GIT_INPUT1 TYPE  gx_input1.
    LOOP AT  git_input1 INTO wa_input1 .
    AT NEW int_ui .----
    >hERE FIELDS OF wa_input1 ARE TURNED INTO *                                                                               
    EX: wa_input1-ANLAGE =******** AFTER AT IN COMMAND.
    END AT
    eNDLOOP

  • Using a Datagrid in a New State

    Is it possible to put a datagrid in a new state? Everytime I
    try I get a parser error in the code. I am trying to have the
    datagrid pop onto the scren after a selection is made which is why
    I am putting it into another state.
    Thanks.
    Dave

    I think this should work. Can you post simplified sample
    code.

Maybe you are looking for