Problem in Refreshing data

Hi Gurus,
i have added a new column in MD04.
Here my problem is while populating
the data in New column standard program
is Refreshing my data.
say ....
Avl Qty      USEX1 (new column)
   2                     2
   1                     3(sum of 2 +1)
   1                     4(sum of 3 + 1)
the above is expected output,
But currently my output is
Avl Qty      USEX1 (new column)
   2                     2
   1                     1
   1                     1
sample Code
FZ_PROD = EMDEZX_USEX1 + IMDEZEXIT-MNG01(avl qty).
MOVE FZ_PROD TO EMDEZX_USEX1(new column)
for first loop it is fine but during second loop
EMDEZX_USEX1  was refreshed by standard program.
how can i achieve the above Plz Advice.
Thanks & Regards,
Vijaya.

I guess u r clearing the new column befor the code.
In that case the problem specified occurs.
Ex:
clear new.
FZ_PROD = new + IMDEZEXIT-MNG01(avl qty).
MOVE FZ_PROD TO EMDEZX_USEX1(new column)
output:
X = 0 + 2.       O/P is 2.
X = 0 + 1 = 1  O/P is 1.
X = 0 + 1 = 1  O/P is 1.
U check by giving a value other than 1, i.e, 5 or 6 to Avl Qty , it gives the same value as o/p.
dont clear the new column.
This is my guess.
Regards,
Veeranji Reddy P.

Similar Messages

  • Problem in refreshing data model

    Hi,
    I am struggling in solving this issue for quite some time. I am developing a fusion web application using Jdeveloper 11.1.2.
    I have 3 view objects groups,employees and dependents. All the three view objects have binding variables and view criteria. The three view objects are linked using view links. The following shows the structure of the application module.
    Groups--------- binding variables: GrpID, GrpName
    ------Employees ---------- binding variables: EmpID,EmpName
    ---------Dependents---------------binding variables: DepID and DepName
    Now Groups and Employees are linked using GrpEmpViewLnk. Employees and Dependents are linked using EmpDepViewLink.
    I have a page which acts like a search form which has fields like GroupID, EmpId and DepID with corresponding buttons named "find" to look up information.
    When I try to set the GrpId at Groups VO, the data model is populating correctly with the rite employees and dependents.
    When I try to set the EmpID at Employees VO, the data model has incorrect data. I looked at the query to see whats happening. Along with setting the bind variables EmpID,EmpName for Employees VO, a bind variable from the view link EmpDepViewLink is also being passed. I don't have any idea of how to control the value that's being passed through the view link.
    Could someone please help me in resolving this issue. I can provide more info on this issue.
    Thanks!
    Shai.

    If you want to query Ephraim without dependency on a specific group, then you need to have it as an idependent go in your data model and not nested under group. Right now you'll be querying the empty in a specific group.

  • Problem in refreshing the data of the UI element Table

    Hi Experts,
    I am having a problem.
    I have a screen which displays list of variants in table ( variant name , variant desc )
    I am binding the entries of table in WDDOINIT method.
    but when i go back to selection screen view and come back to display variants view, WDDOINIT is not triggering.
    Now if i move the code written in WDDOINIT method to WDDOMODIFYVIEW method, its not retaining the lead selection as the binding happens on every server round trip. if i check with First_time = 'X'. its same as that of having it in WDDOINIT method.
    How do i overcome this problem of refreshing the table data.
    any clue is highly appreciated.
    Regards,
    Ajay

    hi Ajay ,
    create a custom controller for this and when u want to move from selection screen view to display variant ,
    call method of this custom controller
    DATA lo_edit TYPE REF TO ig_edit .
    lo_edit =   wd_this->get_edit_ctr( ).
      lo_edit->edit1(
    here I am calling the edit1 method of my custom controller named EDIT.
    try to move code of ur WDDOINIT here.
    it shud help
    rgds,
    amit

  • Problem in scheduling data refresh of excel file that uses PowerPivot

    I think I have successfully created and enabled the gateway and data sources for refresh - they are both seeming to connect.  However, when I try to schedule a data refresh to occur in the PowerBI site for the Excel file I receive an error message
    that the connection could not be established and receive error message "Correlation ID: d118ab93-436d-44a9-8c09-564f64fe0c58".  Appreciate any assistance in figuring out how to resolve.  Thanks a lotl

    Let's track it here: https://social.technet.microsoft.com/Forums/en-US/42c806dc-2d82-4bcf-ab6e-c279e2692a68/problem-in-scheduling-data-refresh-of-excel-file-that-uses-powerquery-and-powerquery?forum=powerbiforoffice365 
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Problem in submitting data while refresh in web application

    Hi all,
    I have problem in submitting data while refreshing the page.
    In my application voucher number is generated automatically and as soon as number is genereated voucher detail is inserted in database for newly generated voucher number.
    Both of these activity done on the same page as my client want so.
    Now I have problem that while refreshing the page, the same data for incremented voucher number stored in database that should not be done.
    If there is any solution for this situation other than 1) Generating number in one page and inserting on another 2) block refresh activity, then please reply me.
    It's urgent. Your help will help me a lot.
    regards,
    Deepalee

    Hi
    <u>You can use either of the BADIs depending on your requirement.</u>
    BAdI Definition Name Description                                                                               
    BBP_PGRP_ASSIGN_BADI EBP Purchasing Documents: Assign Purchasing Group(s)       
    BBP_PGRP_FIND        Shopping Cart: Determine Responsible Purchasing Group(s)                                                                               
    BBP_DOC_CHANGE_BADI
    BAdI for Changing EBP Purchasing Documents
    <b>Please read the Standard documetation available with them using SE18 transaction in SRM system.</b>
    Which SRM version you are using ?
    Hope this will help.
    Please reward suitable points.
    Regards
    - Atul

  • Problem in "Save & refresh data" in epm ribbion

    Hi Experts,
                     I got a problem in Save data option .
    I had a report with values but now i changed it into input-form to enter values . After entering my values i'm clicking on SAVE DATA button in epm tab but my problem is it is showing success but the data in the input-form is not changing...
    can anyone provide me solution please................

    Thanks for reply, but my problem is that it is not saving the data in the cube dimension, must apply the notice specified above.
    Greetings and Thanks

  • Cannot refresh data in Excel Services with SQL Azure databases

    I am using Excel Services on a SharePoint Online.
    I get my data from a SQL Azure. When i create my Excel repor with Excel 2013 pro I have no problem. So I upload my file on my Sharepoint and try to refresh data.
    Connexion : Power Query - RPT_Event_ByEventType 
    Erreur : Erreur sur site (OnPremise) : Sorry, the data source for this data connection isn't registered for Power BI. Ask your Power BI
    admin to register the data source in the Power BI admin center. 
    I do not understad why I get that error because my data source is on Azure why It told me "OnPremise" ?

    hi,
    >> this button of excel gets just address of web and have button for import it
         i test it by rest API project , but doesn't work, do you know how it is work?
    Do you mean that you don't know how to get the table? You may input the site address into the address box, and then click go button nearby, select the table you want to import into the Excel. Then click import button.That also works for  rest API,
    and your rest API should get the data that you want
    By the way, this is the forum for discussions about Excel develop(VBA ,customization), better to go to TechNet forum for Excel for Excel features question, so that you could get more professional help.
    Best Regards
    Lan
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Report prints Saved Data not Refreshed Data

    We were running VS 2005 and using the Basic CR 2005 Basic that comes with it.  We upgraded to use CR 2008 and found MANY issues after we went live in production that were apparent in the development.  This has caused a lot of stress with us as well as our users.  Iu2019ll summarize everything we found, possible workarounds and the open issues including the Printing/Loading of Saved Data.
    First, it was reported that printing changed.  It turns out when PrintMode = u2018PDFu2019 (default setting) it now asks after you choose u2018EXPORTu2019 (use to be u2018OKu2019) that it asks to Open or Save the Adobe.  When our customers were running 20 some reports at a time and we had hundreds of users, this became a nuisance for the heavy reporting users and a training issue in general for us.  With research, I found that we can change the PrintMode to be u2018ActiveXu2019.  This was much better when we were testing.  However, in Production it became a nightmare.  If the user is on a Domain that disallows itu2019s user from installing software or if the user has tight security settings, this became a nightmare.
    The second thing reported was that it was exporting to the wrong format.  It was exporting into RPT format.  It turns out with CR2008, it automatically defaults to RPT and the new pop-up, doesnu2019t isnu2019t clear to the user they even have a choice (the pop-up is much prettier, but it doesnu2019t look like a dropdown anymore).  In addition, they reported it was taking twice as long to export (we think it was related to export file type now).  With CR2005 Basic, it would have no default selection and if the user didnu2019t pick one, it would remind them they need to pick one.  After much research, I found there is no way to customize the operation of the export without writing my own export.  My users 90% of the time want to export to PDF and Excel the rest of the time.  Since we arenu2019t using a CR Server like product, they NEVER will do RPT.  There is no way with CR2008 to limit this list or to default the File Format.  So now, if they forget to select the type, they get the wrong file format instead of being reminded to select one.  Since the new pop-upu2019s dropdown selection isnu2019t easily apparent, this was a BIG issue for us.  Since I have close to 300 reports on 7 websites, this will be a lot of work for me to write my own code and change all the ASPX page to use my own control.
    The third thing reported was that the default name on Exporting was changed.  Export uses the ID property of the Crystal Report Viewer as the default name of a file on export.  When it replaced the viewer on all our pages, it set the ID to CrystalReportViewer1 instead of preserving the original ID.  We now have to go back and change them to what we wanted manually.  BEAWRE of this!  For our power users who wanted to export 40 reports they now have type the name in manually on all of them.  What took minutes now takes over an hour for them to do, until we can fix all the pages.
    Now it was reported that some reports are showing OLD data.  It turns out there shows Saved Data from design time.  In our site, we have a parameter page which getu2019s user selected parameters, save to a session and then load the report page using the session variables, and then redirect them to the report page which on page load we set the reports parameters.  We use the CrystalReportSource using ODBC.  The report has all the connection information.  Well if the user happens to select the same parameters I used at design time, it wonu2019t pull the data from the database.  They see our test data instead which is garbage.  If they select different parameters, display the report and then go back and select the original parameters, they will get the correct data.  This can be catastrophic for us!  So I added at the beginning of the Page Load before setting parameters the following:
         If Not Page.IsPostBack Then
                CRSServiceAlertsReport.ReportDocument.Refresh()
         End If
    This seemed to work.  A pain to add on every report page though when it wasnu2019t necessary before.  But then I just got called this morning and they say when they print, it prited the OLD data.  It seems the refresh pulled new data and updated the display in the viewer but the ActiveX print still used the original Saved Data!  I couldnu2019t find a solution for this.  I found switching PrintMode back to u2018Pdfu2019 worked but now I have the extra click issue again, which I described above.  I tried setting the reports u2018Discard Saved Datau2019 option but it still had the data!
    In the end, had I known about all these issues I would have NEVER upgraded to CR2008.  Iu2019m still looking for help on getting by the following:
    u2022     Stop using Saved Data at runtime (either on Display or Print)
    u2022     Getting the PrintMode=u2019Pdfu2019 to just pull up Adobe in Open mode without prompting the user.
    u2022     Remove File Type options from Export
    u2022     Set the default File Type options to nothing or something I want.
    Another nice feature to have would be the ActiveX control for printing to be part of the .NET Framework so users donu2019t need to download it.  Come on BO is a big company Iu2019m sure they can work with MS.  

    What is that method to clear Saved Data; I looked and couldn't find it.  I never had to call one in the prior version of CR 2005 Basic in .Net.  With the .NET controls, it always refreshed the data before.  This is a change in behavior for me.
    As for the Print using Adobe, with CR2005 Basic, it didn't prompt the user to Open or Save before.  This is new behavior.  It used to just open the report in Adobe in memory before without this specific prompt (it did have the first prompt for All or specific pages, but it would just open after that).  This is a change in behavior from prior versions and it has caused me several issues. 
    Many users don't like change and I didn't know to communicate this to them.  They were taken by surprise.  We'll learn to live it I guess, but I would ask you just to consider, why have an option to "Save" to PDF when you choose to print?  I would think you would use Export if you want to save.  It would never hurt to add an option to allow alternatives either.
    As for including with .NET Framework, it was just an idea.  I know how hard it can be working with third parties.  However, given that CR Basic comes with it, I thought it may be possible to work with them.  The better the integration the better the product is for the developers.  I was thinking the button could call JavaScript/Java to print instead of an ActiveX, or some other method.  Since I donu2019t know how the Control works, I couldnu2019t say.  It just would be nice.  I had a smiley face after that request, it didn't come out right when I saved the post.
    I still don't understand why .Refresh will update the data in the viewer but printing using the ActiveX Control will still print the saved data instead of refreshed data.  Since I never used this in the prior version I don't know what it would of done or not, but it just doesn't seem right it shows one set of data, and prints another.
    In addition, why the designer still saves data with the report when you state not to, I think may be a problem still.
    Edited by: Thomas Johnson on Nov 21, 2008 12:26 PM

  • Help needed with refreshing data

    hello OTN!!
    i am having a problem in refreshing the data each time i update it.
    the problem is that i have a tabular layout of my forms . i have made them all display items and whenever a user wants to update the data and he can click on a link on any row and a small pop up window comes up displaying the data in text boxes user can update an individual row of data but after updating the data when user come back on the tabulary laypout form the data does not refreshes it self and same old(not updated) row of data is displayed.
    i have passed parameters between the popup and tabular forms.plz help me urgently and tell me what should i do to refresh my data or behind what trigger i should write the code for refreshing the data. plus so far i have managed to make a button refresh which refreshes the things gaian by execute_query.but i wana do it automatically without pressing button and such .

    Well - you could reformat your drive to FAT32 using Disk Utility. Probably not the ideal solution, but it could work if you save the data first. I'd recommend using a different external drive formatted in FAT32, or maybe a large USB flash drive (or memory cards) if you've got one.
    I have several external drives and a drive enclosure. One (from SimpleTech) was automatically formatted as an NTFS drive (didn't see that notice before I plugged it into my PC at work). It wouldn't read on my iBook G4 but is OK on my MacBook. I think now that it mounts, I could probably reformat it if necessary. Another Western Digital drive came FAT32 formatted.

  • Error when Refresh Data on Webi from Infoview with Preferred viewing locale

    Hi,
    I am getting an error -"An internal error occured while calling 'processDPCommands' API. (Error:ERR_WIS_30270).
    All the universes are translated to German using Translation Manager. I get the above error only when ' Preferred viewing locale' is set to 'German' otherwise the Refresh Data button works fine when the Preferred vieiwng locale is 'Use browser locale'.
    As per the note 1352299 the settings on the Webintelligenceprocessingserver from CMC is adjusted and the heapsize is also adjusted but still the issue is coming up.
    Could anyone please help to resolve this error.
    Thank you & Regards,
    Anima

    hi,
    I have faced this problem earlier and took lot of time for Root Cause Analysis and fixed the issue.
    Root Cause for some of the objects not being translated is provided below:
    If two objects has same translation in German, obviously Universe will not progress further for translation.
    for e.g.
    Objects in English and German
    1.Country  -> de county
    2.Land -> de county
    from the above example, two distinct objects in English have same German translation which makes Universe not accepting the duplicate objects within the same class.
    Similarly, you need to figure out these duplicates at Class/Object/Condition/Hierarchy levels in translated XLIFF file.
    Duplicates can be identified by opening XLIFF file in Excel and use Data Filters etc... This is a manual task.
    Then for identified duplicates provide Other names in XLIFF file such that Universe accepts them.
    For e.g. the above scenario can be solved by adding a trailing space to the 2nd translated object. Adding space is best option because meaning will not be changed w.r.t end user there by eliminating duplicates.
    Regards,
    Vamsee

  • Problem: new entered data is saved but I am facing one error message --- no

    This is a module program for gate entry of materials(miro). This is a simple entry form which updates z tables with data entered. I have to send the new record details automatically through mail to the particular vendor email  id from where the material has been purchased.
    Problem: new entered data is saved but I am facing one error message --- no authorization to unpack list with rfc when the program is sending list through mail.
    PROGRAM  ZMMI001_GRN_ENTRY_BARCODE  MESSAGE-ID ZMM .
    *Table Declaration
    TABLES : EKKO , EKPO , LFA1 , MARC ,
             MARD , J_1IMTCHID , EKET , MSEG,
             MKPF , ZMMT001_GRN_GATE,
             ZMMT002_GRN_ITEM.
    TABLES: ADR6.
    *Table Control Declaration
    CONTROLS : TC1 TYPE TABLEVIEW USING SCREEN 1000.
    DATA: COLS LIKE LINE OF TC1-COLS.
    *Internal Table Declaration
    DATA : BEGIN OF IT_TC1 OCCURS 0,
            SEL,
            SNO(2) TYPE C,
            ITEMCODE(18) TYPE C,
            ITEMNAME(40) TYPE C,
            QUANTITY TYPE P DECIMALS 2,
            EXCISE(13) TYPE P DECIMALS 2,
           END OF IT_TC1.
    DATA : IT_TEMP_TC1 LIKE IT_TC1 OCCURS 0  WITH HEADER LINE.
    DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE.
    DATA : IT_EKPO LIKE EKPO OCCURS 0 WITH HEADER LINE.
    DATA : IT_EKKO LIKE EKKO OCCURS 0 WITH HEADER LINE.
    DATA : IT_EKET LIKE EKET OCCURS 0 WITH HEADER LINE.
    DATA : WK_ZMMT01 LIKE ZMMT001_GRN_GATE.
    DATA : IT_ZMMT01 LIKE ZMMT001_GRN_GATE OCCURS 0 WITH HEADER LINE.
    DATA : IT_ZMMT02 LIKE ZMMT002_GRN_ITEM OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF IT_TEMP_EKPO OCCURS 0,
            EBELN LIKE EKPO-EBELN,
            EBELP LIKE EKPO-EBELP,
            MATNR LIKE EKPO-MATNR,
           END OF IT_TEMP_EKPO.
    DATA : BEGIN OF IT_MSEG OCCURS 0,
             MBLNR LIKE MSEG-MBLNR,
             MJAHR LIKE MSEG-MJAHR,
             ZEILE LIKE MSEG-ZEILE,
             BWART LIKE MSEG-BWART,
             MATNR LIKE MSEG-MATNR,
             EBELN LIKE MSEG-EBELN,
             EBELP LIKE MSEG-EBELP,
             BUDAT LIKE MKPF-BUDAT,
             MENGE LIKE MSEG-MENGE,
            END OF IT_MSEG.
    DATA : BEGIN OF IT_TEMP_MSEG OCCURS 0,
            MBLNR LIKE MSEG-MBLNR,
            MJAHR LIKE MSEG-MJAHR,
            ZEILE LIKE MSEG-ZEILE,
            BWART LIKE MSEG-BWART,
            EBELN LIKE MSEG-EBELN,
           END OF IT_TEMP_MSEG.
    DATA : BEGIN OF IT_TEMP_MKPF OCCURS 0,
            MBLNR LIKE MKPF-MBLNR,
            MJAHR LIKE MKPF-MJAHR,
            BUDAT LIKE MKPF-BUDAT,
            BKTXT LIKE MKPF-BKTXT,
           END OF IT_TEMP_MKPF.
    *Data Declaration
    DATA : WK_SNO TYPE I,
           WK_LIFNR LIKE LFA1-LIFNR,
           WK_EBELN(10) TYPE C,
           WK_VBELN(10) TYPE C,
           WK_FKDAT TYPE D,
           WK_NAME LIKE LFA1-NAME1,
           WK_SCHNO(10) TYPE C,
           WK_CHALNO(10) TYPE C,
           WK_CHALDATE(10) TYPE C,
           WK_GRNO(10) TYPE C,
           WK_GRDATE(10) TYPE C,
           WK_VEHICLE(10) TYPE C,
           WK_CARRIER(10) TYPE C,
           WK_FREIGHT(13) TYPE P DECIMALS 2,
           WK_MDOC(3) TYPE C,
           WK_DEPT(7) TYPE C,
           WK_MODE(7) TYPE C,
           WK_BASIC(13) TYPE P DECIMALS 2,
           WK_EXCISE(13) TYPE P DECIMALS 2,
           WK_TAX(13) TYPE P DECIMALS 2,
           WK_APPVAL(13) TYPE P DECIMALS 2,
           WK_CHAL(2) TYPE C,
           WK_FORM38(9) TYPE C,
           WK_COMMENT(30) TYPE C,
           WK_MAKTX(40) TYPE C,
           WK_LINES TYPE I,
           WK_TOTAL LIKE MARD-LABST,
           WK_LGORT LIKE MARD-LGORT,
           WK_EXCISE_IND,
           WK_TOT_EXCISE LIKE EKPO-NETWR,
           WK_DIFF LIKE EKPO-NETWR,
           WK_BSTYP LIKE EKKO-BSTYP,
           WK_BSART LIKE EKKO-BSART,
           WK_DIFF_QTY LIKE EKET-MENGE,
           WK_101_QTY LIKE EKET-MENGE,
           WK_102_QTY LIKE EKET-MENGE,
           WK_122_QTY LIKE EKET-MENGE,
           WK_WERKS LIKE EKPO-WERKS,
           WK_CHAR_SNO TYPE STRING,
           WK_DATE LIKE SY-DATUM,
           WK_TIME LIKE SY-UZEIT.
    DATA : WK_DATE1 LIKE SY-DATUM,
           WK_DATE2 LIKE SY-DATUM,
           WK_FISYEAR TYPE I,
           WK_CHAR_YEAR(20) TYPE C.
    DATA : V_UCOMM TYPE SY-UCOMM,
           V_INDEX(10) TYPE   C,
           V_QUANTITY(8) TYPE C.
    **DECLARATION FOR INPUT HELP*
    TYPES : BEGIN OF VALUES,
             TXZ01 LIKE EKPO-TXZ01,
             MENGE LIKE EKPO-MENGE,
             MATNR LIKE EKPO-MATNR,
            END OF VALUES.
    TYPES : BEGIN OF VALUES1,
             EBELN LIKE EKKO-EBELN,
            END OF VALUES1.
    TYPES : BEGIN OF VALUES2,
             NAME1 LIKE LFA1-NAME1,
             LIFNR LIKE LFA1-LIFNR,
            END OF VALUES2.
    DATA: PROGNAME LIKE SY-REPID,
          DYNNUM   LIKE SY-DYNNR,
          DYNPRO_VALUES TYPE TABLE OF DYNPREAD,
          FIELD_VALUE LIKE LINE OF DYNPRO_VALUES,
          VALUES_TAB TYPE TABLE OF VALUES WITH HEADER LINE,
          VALUES_TAB1 TYPE TABLE OF VALUES1,
          VALUE_EBELN TYPE TABLE OF VALUES1.
         VALUES_TAB2 TYPE TABLE OF VALUES2.
    DATA : VALUES_TAB2 TYPE VALUES2 OCCURS 0 WITH HEADER LINE.
    DATA : RETURN_TAB  LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.
    *nidhi
    DATA: BEGIN OF IT_LFA1 OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    ADRNR LIKE LFA1-ADRNR,
    END OF IT_LFA1.
    DATA: BEGIN OF IT_ADR6 OCCURS 0,
          ADDRNUMBER TYPE ADR6-ADDRNUMBER,
          SMTP_ADDR  TYPE ADR6-SMTP_ADDR,
                   END OF IT_ADR6.
    *nidhi
    *&      Module  FILL_TABLE_CONTROL  OUTPUT
          text
    MODULE FILL_TABLE_CONTROL OUTPUT.
      READ TABLE IT_TEMP_TC1 INTO IT_TC1 INDEX TC1-CURRENT_LINE.
    ENDMODULE.                 " FILL_TABLE_CONTROL  OUTPUT
    *&      Module  READ_TABLE_CONTROL  INPUT
          text
    MODULE READ_TABLE_CONTROL INPUT.
    *Validation for Item code
      CLEAR : EKPO-MATNR,
              EKPO-WERKS.
    IF sy-uname = 'GATE1020'.
      IF ( SY-UNAME = 'GATE1010' OR  SY-UNAME = 'GATE1020' OR
           SY-UNAME = 'GATE1030' OR  SY-UNAME = 'GATE1040' OR
           SY-UNAME = 'GATE1050' OR  SY-UNAME = 'GATE1060' OR
           SY-UNAME = 'GATE1070' OR  SY-UNAME = 'GATE1080' OR
           SY-UNAME = 'ABAP'  ).
    **SELECT SINGLE bstyp  FROM EKKO INTO WK_BSTYP  WHERE ebeln = wk_ebeln.
    **SELECT SINGLE bsart FROM EKKO INTO WK_BSART WHERE ebeln = wk_ebeln.
        READ TABLE VALUES_TAB WITH KEY MATNR = IT_TC1-ITEMCODE.
    **ELSE.
        SELECT SINGLE MATNR WERKS
                  FROM EKPO CLIENT SPECIFIED
                  INTO (EKPO-MATNR , EKPO-WERKS )
                  WHERE MANDT = SY-MANDT AND
                  EBELN = WK_EBELN AND
                  MATNR EQ IT_TC1-ITEMCODE.
    ENDIF.
        IF SY-SUBRC NE 0 AND NOT IT_TC1-ITEMCODE IS INITIAL.
      CLEAR it_tc1.
          MESSAGE E003 WITH TEXT-002.
        ELSE.
          SELECT SINGLE MAKTX FROM MAKT
                       CLIENT SPECIFIED
                       INTO WK_MAKTX WHERE
                       MANDT = SY-MANDT AND
                       MATNR = IT_TC1-ITEMCODE AND SPRAS = SY-LANGU.
        ENDIF.
      ENDIF.
    **SELECT SINGLE bstyp  FROM EKKO INTO WK_BSTYP  WHERE ebeln = wk_ebeln.
    **SELECT SINGLE bsart FROM EKKO INTO WK_BSART WHERE ebeln = wk_ebeln.
      IF ( SY-UNAME = 'GATE1010' OR  SY-UNAME = 'GATE1020' OR
           SY-UNAME = 'GATE1030' OR  SY-UNAME = 'GATE1040' OR
           SY-UNAME = 'GATE1050' OR  SY-UNAME = 'GATE1060' OR
           SY-UNAME = 'GATE1070' OR  SY-UNAME = 'GATE1080' OR  SY-UNAME =
           'ABAP'  ).
        IF WK_BSART = 'ZLR' .
    Validation for Quantity.
          IF NOT IT_TC1-QUANTITY IS INITIAL.
            READ TABLE VALUES_TAB WITH KEY MATNR = IT_TC1-ITEMCODE.
            IF SY-SUBRC EQ 0 AND IT_TC1-QUANTITY GT VALUES_TAB-MENGE.
              MESSAGE E003 WITH TEXT-013.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    *Validation for Max.Stock Level
      CLEAR : MARC-MABST.
      SELECT SINGLE MABST FROM MARC
              CLIENT SPECIFIED
              INTO MARC-MABST
              WHERE MANDT = SY-MANDT AND
              MATNR = IT_TC1-ITEMCODE AND
              WERKS = EKPO-WERKS.
      CLEAR : MARD-LABST ,
              MARD-INSME .
    SELECT SINGLE labst insme FROM mard
              CLIENT SPECIFIED
              INTO (mard-labst , mard-insme )
              WHERE MANDT = SY-MANDT AND
              matnr = it_tc1-itemcode
              AND werks = ekpo-werks.
      SELECT  SUM( LABST ) SUM( INSME ) FROM MARD
               CLIENT SPECIFIED
               INTO (MARD-LABST , MARD-INSME )
               WHERE MANDT = SY-MANDT AND
               MATNR = IT_TC1-ITEMCODE
               AND WERKS = EKPO-WERKS.
      CLEAR : WK_TOTAL.
      WK_TOTAL = MARD-LABST + MARD-INSME + IT_TC1-QUANTITY.
      IF WK_BSART = 'ZLR'.
        IF WK_TOTAL GT MARC-MABST.
          MESSAGE E001 WITH IT_TC1-ITEMCODE.
        ENDIF.
      ENDIF.
    Appending the table control data to Internal table
      READ TABLE IT_TEMP_TC1 INDEX TC1-CURRENT_LINE.
      IT_TC1-SNO = TC1-CURRENT_LINE.
      IF SY-SUBRC EQ 0.
        MODIFY IT_TEMP_TC1 FROM IT_TC1 INDEX TC1-CURRENT_LINE.
      ELSE.
        READ TABLE IT_TEMP_TC1 WITH KEY ITEMCODE = IT_TC1-ITEMCODE.
        IF SY-SUBRC NE 0.
          IT_TC1-ITEMNAME = WK_MAKTX.
          IF IT_TC1-ITEMCODE IS INITIAL.
            CLEAR IT_TC1.
          ELSE.
            APPEND IT_TC1 TO IT_TEMP_TC1.
          ENDIF.
        ELSE.
          MESSAGE E003 WITH TEXT-004.
        ENDIF.
      ENDIF.
      CLEAR : J_1IMTCHID-J_1ICAPIND.
      SELECT SINGLE J_1ICAPIND FROM J_1IMTCHID
                    CLIENT SPECIFIED
                    INTO  J_1IMTCHID-J_1ICAPIND
                    WHERE MANDT = SY-MANDT AND
                    MATNR = IT_TC1-ITEMCODE AND
                    WERKS = EKPO-WERKS.
      IF SY-SUBRC EQ 0.
        IF J_1IMTCHID-J_1ICAPIND = 'N'.
          WK_EXCISE_IND = 'N'.
        ELSE.
          WK_EXCISE_IND = 'E'.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " READ_TABLE_CONTROL  INPUT
    *&      Module  USER_COMMAND_1000  INPUT
          text
    MODULE USER_COMMAND_1000 INPUT.
      V_UCOMM = SY-UCOMM.
      CASE V_UCOMM.
        WHEN 'WK_SAVE'.
          IF WK_APPVAL > 0.
            IF ( SY-UNAME = 'STORE1010'  OR SY-UNAME = 'STORE1020' OR
                 SY-UNAME = 'STORE1030'  OR SY-UNAME = 'STORE1040' OR
                 SY-UNAME = 'STORE1050'  OR SY-UNAME = 'STORE1060' OR
                 SY-UNAME = 'STORE1070'  OR SY-UNAME = 'STORE1080'  ).
              CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
                EXPORTING
                  INPUT  = WK_VBELN
                IMPORTING
                  OUTPUT = WK_VBELN.
              SELECT * FROM EKKO INTO TABLE IT_EKKO WHERE EBELN = WK_EBELN
              AND
                                                          LOEKZ NE 'X'.
              IF SY-SUBRC EQ 0.
                READ TABLE IT_EKKO INDEX 1.
                WK_BSTYP = IT_EKKO-BSTYP.
              ENDIF.
              SELECT * FROM EKPO CLIENT SPECIFIED
              INTO TABLE IT_EKPO WHERE
              MANDT = SY-MANDT AND
              EBELN = WK_EBELN AND LOEKZ NE 'X'.
              SORT IT_EKPO BY EBELN EBELP.
              IF WK_BSTYP = 'L'.
                SELECT * FROM EKET CLIENT SPECIFIED
                INTO TABLE IT_EKET WHERE
                MANDT = SY-MANDT AND
                EBELN = WK_EBELN.
                IF SY-SUBRC EQ 0.
                  SORT IT_EKET BY EBELN EBELP ETENR.
                  LOOP AT IT_EKPO.
                    CLEAR WK_DIFF_QTY.
                    LOOP AT IT_EKET WHERE EBELN = IT_EKPO-EBELN
                                      AND EBELP = IT_EKPO-EBELP
                                      AND EINDT LE SY-DATUM.
                      WK_DIFF_QTY = WK_DIFF_QTY + IT_EKET-MENGE -
                      IT_EKET-WEMNG.
                    ENDLOOP.
                    IF WK_DIFF_QTY GT 0.
                      IT_TEMP_EKPO-EBELN = IT_EKET-EBELN.
                      IT_TEMP_EKPO-EBELP = IT_EKET-EBELP.
                      IT_TEMP_EKPO-MATNR = IT_EKPO-MATNR.
                      APPEND IT_TEMP_EKPO.
                    ENDIF.
                  ENDLOOP.
                ENDIF.
              ELSEIF WK_BSTYP = 'F'.
                SELECT * FROM EKET
                CLIENT SPECIFIED
                INTO TABLE IT_EKET
                WHERE MANDT = SY-MANDT AND
                EBELN = IT_EKPO-EBELN.
                LOOP AT IT_EKPO.
                  CLEAR : WK_DIFF_QTY.
                  READ TABLE IT_EKET WITH KEY EBELN = IT_EKPO-EBELN
                                              EBELP = IT_EKPO-EBELP.
                  IF SY-SUBRC EQ 0.
                    WK_DIFF_QTY = IT_EKPO-MENGE - IT_EKET-WEMNG.
                  ENDIF.
                  IF WK_DIFF_QTY GT 0.
                    IT_TEMP_EKPO-EBELN = IT_EKET-EBELN.
                    IT_TEMP_EKPO-EBELP = IT_EKET-EBELP.
                    IT_TEMP_EKPO-MATNR = IT_EKPO-MATNR.
                    APPEND IT_TEMP_EKPO.
                  ENDIF.
                ENDLOOP.
              ENDIF.
              SORT IT_TEMP_EKPO BY EBELN EBELP.
              PERFORM BDC_DYNPRO      USING 'SAPLMIGO' '0001'.
              PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                       '=OK_GO'.
              PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                       'GODYNPRO-PO_NUMBER'.
              PERFORM BDC_FIELD       USING 'GODYNPRO-PO_NUMBER'
                                       WK_EBELN.
              PERFORM BDC_DYNPRO      USING 'SAPLMIGO' '0001'.
              PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                       '=OK_GO'.
              IF WK_EXCISE_IND = 'E'.
                PERFORM BDC_FIELD       USING 'J_1IEXHEAD-EXNUM'
                                         WK_VBELN.
                PERFORM BDC_FIELD       USING 'J_1IEXHEAD-EXDAT'
                                        WK_FKDAT.
                PERFORM BDC_FIELD       USING 'GOHEAD-LFSNR'
                                         WK_VBELN.
              ELSE.
                PERFORM BDC_FIELD       USING 'GOHEAD-LFSNR'
                                         WK_VBELN.
              ENDIF.
              CLEAR : WK_CHAR_SNO.
              WK_CHAR_SNO = WK_SNO.
              CONDENSE WK_CHAR_SNO NO-GAPS.
              PERFORM BDC_FIELD       USING 'GOHEAD-BKTXT'
                                       WK_CHAR_SNO.
              LOOP AT IT_TEMP_TC1.
                READ TABLE IT_TEMP_EKPO WITH KEY MATNR =
                IT_TEMP_TC1-ITEMCODE.
                IF SY-SUBRC EQ 0.
                  CLEAR V_INDEX.
                  V_INDEX = SY-TABIX.
                  CONDENSE V_INDEX NO-GAPS.
                  PERFORM BDC_DYNPRO      USING 'SAPLMIGO' '0001'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                           '=OK_GO'.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                           'GODYNPRO-DETAIL_ZEILE'.
                  PERFORM BDC_FIELD       USING 'GODYNPRO-DETAIL_ZEILE'
                  PERFORM BDC_FIELD       USING 'GODYNPRO-DETAIL_ZEILE'
                                           V_INDEX.
                  PERFORM BDC_DYNPRO      USING 'SAPLMIGO' '0001'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                           '=OK_GO'.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                           'GOITEM-ERFMG'.
                  PERFORM BDC_FIELD       USING 'GOITEM-ERFMG'
                  CLEAR V_QUANTITY.
                  V_QUANTITY = IT_TEMP_TC1-QUANTITY.
                  CONDENSE V_QUANTITY NO-GAPS.
                  PERFORM BDC_FIELD       USING 'GOITEM-ERFMG'
                                           V_QUANTITY.
                  PERFORM BDC_FIELD       USING 'GOITEM-LSMNG'
                                          V_QUANTITY.
                perform bdc_field       using 'GOITEM-LGOBE'
                                        WK_LGORT.
                ENDIF.
              ENDLOOP.
              CALL TRANSACTION 'MIGO' USING BDCDATA
                              MODE   'E'
                              UPDATE 'L'.
              IF SY-SUBRC NE 0.
                MESSAGE E003 WITH TEXT-003.
                LOOP AT SCREEN.
                  SCREEN-INPUT = 1.
                  MODIFY SCREEN.
                ENDLOOP.
              ENDIF.
              LEAVE PROGRAM.
            ELSE.
              CLEAR : WK_TOT_EXCISE.
              IF NOT WK_EXCISE IS INITIAL.
                LOOP AT IT_TEMP_TC1.
                  READ TABLE IT_EKPO WITH KEY MATNR = IT_TEMP_TC1-ITEMCODE.
                  IF SY-SUBRC EQ 0.
                    WK_TOT_EXCISE = WK_TOT_EXCISE +
               ( ( ( IT_EKPO-NETWR / IT_EKPO-MENGE ) * 16  / 100 )
    IT_TEMP_TC1-QUANTITY ).
                  ENDIF.
                ENDLOOP.
                WK_DIFF = WK_EXCISE - WK_TOT_EXCISE.
                IF WK_DIFF LE 0.
                  WK_DIFF = -1 * WK_DIFF.
                ENDIF.
                IF WK_DIFF GE 1.
                  WK_COMMENT = 'Difference in Excise. Please Check!'.
                ENDIF.
              ENDIF.
              SELECT * FROM EKPO CLIENT SPECIFIED
              INTO TABLE IT_EKPO WHERE
              MANDT = SY-MANDT AND
              EBELN = WK_EBELN.
              IF SY-SUBRC EQ 0.
                READ TABLE IT_EKPO INDEX 1.
                WK_WERKS = IT_EKPO-WERKS.
              ENDIF.
              SELECT * FROM ZMMT001_GRN_GATE
              CLIENT SPECIFIED
              INTO TABLE IT_ZMMT01
              WHERE MANDT = SY-MANDT AND
              WERKS = WK_WERKS.
              IF SY-SUBRC EQ 0.
                SORT IT_ZMMT01 BY SERIAL DESCENDING.
                READ TABLE IT_ZMMT01 INDEX 1.
                WK_SNO = IT_ZMMT01-SERIAL + 1.
              ELSE.
                WK_SNO = 1.
              ENDIF.
              CLEAR WK_ZMMT01.
              WK_ZMMT01-MANDT = SY-MANDT.
              WK_ZMMT01-SERIAL = WK_SNO.
              WK_ZMMT01-WERKS = WK_WERKS.
              WK_ZMMT01-EBELN = WK_EBELN.
              WK_ZMMT01-LIFNR = WK_LIFNR.
              WK_ZMMT01-CHALNO = WK_CHALNO.
              WK_ZMMT01-CHALDATE = WK_CHALDATE.
              WK_ZMMT01-BILLNO = WK_VBELN.
              WK_ZMMT01-BILLDATE = WK_FKDAT.
              WK_ZMMT01-GRNUMBER = WK_GRNO.
              WK_ZMMT01-GRDATE = WK_GRDATE.
              WK_ZMMT01-VEHICLE = WK_VEHICLE.
              WK_ZMMT01-CARRIER = WK_CARRIER.
              WK_ZMMT01-FREIGHT = WK_FREIGHT.
              WK_ZMMT01-MDOC = WK_MDOC.
              WK_ZMMT01-DEPT = WK_DEPT.
              WK_ZMMT01-PAYMODE = WK_MODE.
              WK_ZMMT01-BASIC = WK_BASIC.
              WK_ZMMT01-EXCISE = WK_EXCISE.
              WK_ZMMT01-TAXAMT = WK_TAX.
              WK_ZMMT01-APPVAL = WK_APPVAL.
              WK_ZMMT01-CHALINV = WK_CHAL.
              WK_ZMMT01-FORM38 = WK_FORM38.
              WK_ZMMT01-COMMENTS = WK_COMMENT.
              WK_ZMMT01-CDATE    = SY-DATUM.
              WK_ZMMT01-CTIME    = SY-UZEIT.
              WK_ZMMT01-PERSON   = SY-UNAME.
              IF WK_FKDAT+4(2) = '04' OR
                 WK_FKDAT+4(2) = '05' OR
                 WK_FKDAT+4(2) = '06' OR
                 WK_FKDAT+4(2) = '07' OR
                 WK_FKDAT+4(2) = '08' OR
                 WK_FKDAT+4(2) = '09' OR
                 WK_FKDAT+4(2) = '10' OR
                 WK_FKDAT+4(2) = '11' OR
                 WK_FKDAT+4(2) = '12'.
                WK_DATE10(4) = WK_FKDAT0(4).
                WK_DATE1+4(2) = '04'.
                WK_DATE1+6(2) = '01'.
              ELSEIF
                 WK_FKDAT+4(2) = '01' OR
                 WK_FKDAT+4(2) = '02' OR
                 WK_FKDAT+4(2) = '03'.
                WK_FISYEAR = WK_FKDAT+0(4).
                WK_FISYEAR = WK_FISYEAR - 1.
                WK_CHAR_YEAR = WK_FISYEAR.
                CONDENSE WK_CHAR_YEAR NO-GAPS.
                WK_DATE1+0(4) = WK_CHAR_YEAR.
                WK_DATE1+4(2) = '04'.
                WK_DATE1+6(2) = '01'.
              ELSE.
              ENDIF.
    nidhi
              SELECT LIFNR ADRNR FROM LFA1 INTO TABLE IT_LFA1 WHERE LIFNR =
              WK_ZMMT01-LIFNR.
              SELECT ADDRNUMBER SMTP_ADDR FROM ADR6 INTO TABLE IT_ADR6 FOR
    ALL ENTRIES IN IT_LFA1 WHERE ADDRNUMBER = IT_LFA1-ADRNR.
              SELECT SINGLE * FROM ZMMT001_GRN_GATE
              CLIENT SPECIFIED
              WHERE MANDT = SY-MANDT AND
              WERKS = WK_WERKS AND
              LIFNR = WK_LIFNR AND
              BILLNO = WK_VBELN AND
              BILLDATE GE WK_DATE1.
              IF SY-SUBRC EQ 0.
                MESSAGE E003 WITH TEXT-006.
              ENDIF.
              CLEAR IT_ZMMT02.
              REFRESH IT_ZMMT02.
              LOOP AT IT_TEMP_TC1.
                IT_ZMMT02-MANDT = SY-MANDT.
                IT_ZMMT02-SERIAL = WK_SNO.
                IT_ZMMT02-WERKS = WK_WERKS.
                IT_ZMMT02-EBELN = WK_EBELN.
                IT_ZMMT02-ITEMCODE = IT_TEMP_TC1-ITEMCODE.
                IT_ZMMT02-DESCRIPTION = IT_TEMP_TC1-ITEMNAME.
                IT_ZMMT02-QUANTITY = IT_TEMP_TC1-QUANTITY.
                IT_ZMMT02-EXCISE = IT_TEMP_TC1-EXCISE.
                APPEND IT_ZMMT02.
                CLEAR IT_ZMMT02.
              ENDLOOP.
              IF IT_ZMMT02[] IS INITIAL.
                MESSAGE E003 WITH TEXT-007.
              ENDIF.
              IF SY-UNAME = 'GATE1010' AND WK_WERKS NE '1010'.
                MESSAGE E003 WITH TEXT-008.
              ELSEIF SY-UNAME = 'GATE1020' AND WK_WERKS NE '1020'.
                MESSAGE E003 WITH TEXT-008.
              ELSEIF SY-UNAME = 'GATE1030' AND WK_WERKS NE '1030'.
                MESSAGE E003 WITH TEXT-008.
              ELSEIF SY-UNAME = 'GATE1040' AND WK_WERKS NE '1040'.
                MESSAGE E003 WITH TEXT-008.
              ELSEIF SY-UNAME = 'GATE1050' AND WK_WERKS NE '1050'.
                MESSAGE E003 WITH TEXT-008.
              ELSEIF SY-UNAME = 'GATE1060' AND WK_WERKS NE '1060'.
                MESSAGE E003 WITH TEXT-008.
              ELSEIF SY-UNAME = 'ABAP' AND WK_WERKS NE 'ABAP'.
                MESSAGE E003 WITH TEXT-008.
              ELSEIF SY-UNAME = 'GATE1070' AND WK_WERKS NE '1070'.
                MESSAGE E003 WITH TEXT-008.
              ELSEIF SY-UNAME = 'GATE1080' AND WK_WERKS NE '1080'.
                MESSAGE E003 WITH TEXT-008.
              ENDIF.
              INSERT ZMMT001_GRN_GATE FROM WK_ZMMT01.
              INSERT ZMMT002_GRN_ITEM FROM TABLE IT_ZMMT02.
              IF SY-SUBRC EQ 0.
                COMMIT WORK.
                MESSAGE I002 WITH WK_SNO.
    ********nidhi*******************************************************
                CALL SCREEN 1001.
                CLEAR WK_LIFNR.
                CLEAR WK_EBELN.
                CLEAR WK_NAME.
                CLEAR WK_SCHNO.
                CLEAR WK_CHALNO.
                CLEAR WK_CHALDATE.
                CLEAR WK_VBELN.
                CLEAR WK_FKDAT.
                CLEAR WK_GRNO.
                CLEAR WK_GRDATE.
                CLEAR WK_VEHICLE.
                CLEAR WK_CARRIER.
                CLEAR WK_FREIGHT.
                CLEAR WK_MDOC.
                CLEAR WK_DEPT.
                CLEAR WK_MODE.
                CLEAR WK_BASIC.
                CLEAR WK_EXCISE.
                CLEAR WK_TAX.
                CLEAR WK_APPVAL.
                CLEAR WK_CHAL.
                CLEAR WK_FORM38.
                REFRESH IT_TEMP_TC1.
                CLEAR WK_FISYEAR.
                CLEAR WK_DATE1.
                CLEAR WK_CHAR_YEAR.
             CALL TRANSACTION 'ZMMI001'.
              ELSE.
                ROLLBACK WORK.
                MESSAGE E003 WITH TEXT-006.
              ENDIF.
            ENDIF.
          ELSE.
            MESSAGE E009 WITH TEXT-014.
          ENDIF.
        WHEN 'WK_EXIT'.
        WHEN 'WK_CLEAR'.
          CLEAR WK_LIFNR.
          CLEAR WK_EBELN.
          CLEAR WK_NAME.
          CLEAR WK_SCHNO.
          CLEAR WK_CHALNO.
          CLEAR WK_CHALDATE.
          CLEAR WK_VBELN.
          CLEAR WK_FKDAT.
          CLEAR WK_GRNO.
          CLEAR WK_GRDATE.
          CLEAR WK_VEHICLE.
          CLEAR WK_CARRIER.
          CLEAR WK_FREIGHT.
          CLEAR WK_MDOC.
          CLEAR WK_DEPT.
          CLEAR WK_MODE.
          CLEAR WK_BASIC.
          CLEAR WK_EXCISE.
          CLEAR WK_TAX.
          CLEAR WK_APPVAL.
          CLEAR WK_CHAL.
          CLEAR WK_FORM38.
          REFRESH IT_TEMP_TC1 .
          CLEAR WK_FISYEAR.
          CLEAR WK_DATE1.
          CLEAR WK_CHAR_YEAR.
        WHEN 'DELETE'.
          DELETE IT_TEMP_TC1 WHERE SEL = 'X'.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_1000  INPUT
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.                    "BDC_DYNPRO
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
    IF FVAL <> NODATA.
      CLEAR BDCDATA.
      BDCDATA-FNAM = FNAM.
      BDCDATA-FVAL = FVAL.
      APPEND BDCDATA.
    ENDIF.
    ENDFORM.                    "BDC_FIELD
    *&      Module  STATUS_1000  OUTPUT
          text
    MODULE STATUS_1000 OUTPUT.
      SET PF-STATUS 'GRN'.
      SET TITLEBAR 'GRN'.
      PROGNAME = SY-REPID.
      DYNNUM   = SY-DYNNR.
      CLEAR: FIELD_VALUE, DYNPRO_VALUES.
      FIELD_VALUE-FIELDNAME = 'IT_TC1-ITEMCODE'.
      APPEND FIELD_VALUE TO DYNPRO_VALUES.
      FIELD_VALUE-FIELDNAME = 'WK_EBELN'.
      APPEND FIELD_VALUE TO DYNPRO_VALUES.
      FIELD_VALUE-FIELDNAME = 'WK_LIFNR'.
      APPEND FIELD_VALUE TO DYNPRO_VALUES.
      LOOP AT SCREEN.
        IF SCREEN-NAME NE 'WK_COMMENT'.
          SCREEN-INPUT = 1.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
      IF ( SY-UNAME = 'GATE1010' OR SY-UNAME = 'GATE1020' OR
           SY-UNAME = 'GATE1030' OR SY-UNAME = 'GATE1040' OR
           SY-UNAME = 'GATE1050' OR SY-UNAME = 'GATE1060' OR
           SY-UNAME = 'GATE1070' OR SY-UNAME = 'GATE1080' OR  SY-UNAME =
           'ABAP' ).
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'WK_SNO' OR
             SCREEN-NAME = 'SNO' OR
             SCREEN-NAME = 'WK_COMMENT' .
            SCREEN-INVISIBLE = 1.
            SCREEN-ACTIVE = 0.
            SCREEN-INPUT = 0.
            SCREEN-OUTPUT = 0.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
        IF WK_LIFNR IS INITIAL.
          SET CURSOR FIELD 'WK_LIFNR'.
        ELSEIF WK_EBELN IS INITIAL.
          SET CURSOR FIELD 'WK_EBELN'.
        ELSEIF WK_VBELN IS INITIAL.
          SET CURSOR FIELD 'WK_VBELN'.
        ELSEIF WK_FKDAT IS INITIAL.
          SET CURSOR FIELD 'WK_FKDAT'.
        ENDIF.
      ELSE.
        IF NOT WK_SNO IS INITIAL.
          IF SY-UNAME = 'STORE1010'.
            WK_WERKS = '1010'.
          ELSEIF SY-UNAME = 'STORE1020'.
            WK_WERKS = '1020'.
          ELSEIF SY-UNAME = 'STORE1030'.
            WK_WERKS = '1030'.
          ELSEIF SY-UNAME = 'STORE1040'.
            WK_WERKS = '1040'.
          ELSEIF SY-UNAME = 'STORE1050'.
            WK_WERKS = '1050'.
          ELSEIF SY-UNAME = 'STORE1060'.
            WK_WERKS = '1060'.
          ELSEIF SY-UNAME = 'STORE1070'.
            WK_WERKS = '1070'.
          ELSEIF SY-UNAME = 'STORE1080'.
            WK_WERKS = '1080'.
          ENDIF.
          SELECT SINGLE * FROM ZMMT001_GRN_GATE INTO WK_ZMMT01
                       WHERE SERIAL = WK_SNO AND
                       WERKS = WK_WERKS.
          IF SY-SUBRC EQ 0.
            WK_WERKS = WK_ZMMT01-WERKS.
            WK_EBELN = WK_ZMMT01-EBELN.
            WK_LIFNR = WK_ZMMT01-LIFNR.
            WK_CHALNO = WK_ZMMT01-CHALNO.
            WK_CHALDATE = WK_ZMMT01-CHALDATE.
            WK_VBELN = WK_ZMMT01-BILLNO.
            WK_FKDAT = WK_ZMMT01-BILLDATE.
            WK_GRNO = WK_ZMMT01-GRNUMBER.
            WK_GRDATE = WK_ZMMT01-GRDATE.
            WK_VEHICLE = WK_ZMMT01-VEHICLE.
            WK_CARRIER = WK_ZMMT01-CARRIER.
            WK_FREIGHT = WK_ZMMT01-FREIGHT.
            WK_MDOC = WK_ZMMT01-MDOC.
            WK_DEPT = WK_ZMMT01-DEPT.
            WK_MODE = WK_ZMMT01-PAYMODE.
            WK_BASIC = WK_ZMMT01-BASIC.
            WK_EXCISE = WK_ZMMT01-EXCISE.
            WK_TAX = WK_ZMMT01-TAXAMT.
            WK_APPVAL = WK_ZMMT01-APPVAL.
            WK_CHAL = WK_ZMMT01-CHALINV.
            WK_FORM38 = WK_ZMMT01-FORM38.
            WK_COMMENT = WK_ZMMT01-COMMENTS.
            SELECT * FROM ZMMT002_GRN_ITEM INTO TABLE IT_ZMMT02
                            WHERE SERIAL = WK_SNO AND
                            WERKS = WK_WERKS.
            IF SY-SUBRC EQ 0.
              CLEAR IT_TEMP_TC1.
              REFRESH IT_TEMP_TC1.
              LOOP AT IT_ZMMT02.
                IT_TEMP_TC1-SNO = SY-TABIX.
                IT_TEMP_TC1-ITEMCODE = IT_ZMMT02-ITEMCODE.
                IT_TEMP_TC1-ITEMNAME = IT_ZMMT02-DESCRIPTION.
                IT_TEMP_TC1-QUANTITY = IT_ZMMT02-QUANTITY.
                APPEND IT_TEMP_TC1.
                CLEAR IT_TEMP_TC1.
              ENDLOOP.
            ENDIF.
          ENDIF.
          LOOP AT SCREEN.
            IF ( SCREEN-NAME NE 'WK_SNO' ) AND
               ( SCREEN-NAME NE 'WK_SAVE' ) AND
               ( SCREEN-NAME NE 'WK_CLEAR' ) AND
               ( SCREEN-NAME NE 'WK_EXIT' ).
              SCREEN-INPUT = 0.
            ENDIF.
            MODIFY SCREEN.
          ENDLOOP.
          LOOP AT TC1-COLS INTO COLS WHERE INDEX GT 0.
            COLS-SCREEN-INPUT = '0'.
            MODIFY TC1-COLS FROM COLS INDEX SY-TABIX.
          ENDLOOP.
        ENDIF.
      ENDIF.
      WK_DATE = SY-DATUM.
      WK_TIME = SY-UZEIT.
      TC1-LINES = 20.
    ENDMODULE.                 " STATUS_1000  OUTPUT
    *&      Module  EXIT_1000  INPUT
          text
    MODULE EXIT_1000 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK' OR 'CANCEL' OR 'EXIT' OR 'WK_EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                 " EXIT_1000  INPUT
    *&      Module  ITEM_CODE  INPUT
          text
    MODULE ITEM_CODE INPUT.
      REFRESH : VALUES_TAB.
      CLEAR : VALUES_TAB.
      IF ( SY-UNAME = 'GATE1020' OR
    SY-UNAME = 'GATE1010' OR
    SY-UNAME = 'GATE1030' OR
    SY-UNAME = 'GATE1040' OR
    SY-UNAME = 'GATE1050' OR
    SY-UNAME = 'GATE1060' OR
    SY-UNAME = 'GATE1070' OR
    SY-UNAME = 'STORE1020' OR
    SY-UNAME = 'STORE1030' OR
    SY-UNAME = 'STORE1040' OR
    SY-UNAME = 'STORE1050' OR
    SY-UNAME = 'STORE1060' OR
    SY-UNAME = 'STORE1070' OR
    SY-UNAME = 'STORE1010' OR
           SY-UNAME = 'ABAP'  ).
        SELECT * FROM EKKO CLIENT SPECIFIED
        INTO TABLE IT_EKKO WHERE
        MANDT = SY-MANDT AND
        EBELN = WK_EBELN AND
        LOEKZ NE 'X'.
        IF SY-SUBRC EQ 0.
          READ TABLE IT_EKKO INDEX 1.
          WK_BSTYP = IT_EKKO-BSTYP.
          WK_BSART = IT_EKKO-BSART.
        ENDIF.
          if wk_bsart = 'ZLR'.
        SELECT * FROM EKPO CLIENT SPECIFIED
        INTO TABLE IT_EKPO WHERE
        MANDT = SY-MANDT AND
        EBELN = WK_EBELN AND
        LOEKZ NE 'X'.
        SORT IT_EKPO BY EBELN EBELP.
        IF WK_BSTYP = 'L' AND WK_BSART = 'ZLR'.
          SELECT * FROM EKET CLIENT SPECIFIED
          INTO TABLE IT_EKET WHERE
          MANDT = SY-MANDT AND
          EBELN = WK_EBELN.
          IF SY-SUBRC EQ 0.
            SORT IT_EKET BY EBELN EBELP ETENR.
            LOOP AT IT_EKPO.
              CLEAR WK_DIFF_QTY.
              LOOP AT IT_EKET WHERE EBELN = IT_EKPO-EBELN
                                AND EBELP = IT_EKPO-EBELP
                                AND EINDT LE SY-DATUM.
                WK_DIFF_QTY = WK_DIFF_QTY + IT_EKET-MENGE - IT_EKET-WEMNG.
              ENDLOOP.
              IF WK_DIFF_QTY GT 0.
                VALUES_TAB-TXZ01 = IT_EKPO-TXZ01.
                VALUES_TAB-MENGE = WK_DIFF_QTY.
                VALUES_TAB-MATNR = IT_EKPO-MATNR.
                APPEND VALUES_TAB.
              ENDIF.
            ENDLOOP.
          ENDIF.
        ELSEIF WK_BSTYP = 'F'.
         SELECT mseg~mblnr
                mseg~mjahr
                mseg~zeile
                mseg~bwart
                mseg~matnr
                mseg~ebeln
                mseg~ebelp
                mkpf~budat
                mseg~menge INTO TABLE it_mseg
                FROM mkpf INNER JOIN mseg
                ON mkpfmblnr EQ msegmblnr
                AND mkpfmjahr EQ msegmjahr
    FOR ALL entries IN it_ekpo
    WHERE bwart IN ('101','122','102')
    AND werks = it_ekpo-werks
    AND ebeln = it_ekpo-ebeln
    AND ebelp = it_ekpo-ebelp.
          SELECT * FROM EKET CLIENT SPECIFIED
          INTO TABLE IT_EKET
          WHERE MANDT = SY-MANDT AND
          EBELN = IT_EKPO-EBELN.
          LOOP AT IT_EKPO.
            CLEAR : WK_DIFF_QTY.
                   wk_101_qty,
                   wk_102_qty,
                   wk_122_qty.
           LOOP AT it_mseg WHERE ebeln = it_ekpo-ebeln AND
                                 ebelp = it_ekpo-ebelp.
             IF it_mseg-bwart = '101'.
               wk_101_qty = wk_101_qty + it_mseg-menge.
             ENDIF.
             IF it_mseg-bwart = '102'.
               wk_102_qty = wk_102_qty + it_mseg-menge.
             ENDIF.
             IF it_mseg-bwart = '122'.
               wk_122_qty = wk_122_qty + it_mseg-menge.
             ENDIF.
           ENDLOOP.
           if not it_mseg[] is initial.
           wk_diff_qty = it_ekpo-menge - wk_101_qty
                                 - wk_102_qty - wk_122_qty.
           else.
            wk_diff_qty = it_ekpo-menge.
           endif.
            READ TABLE IT_EKET WITH KEY EBELN = IT_EKPO-EBELN
                                        EBELP = IT_EKPO-EBELP.
            IF SY-SUBRC EQ 0.
              WK_DIFF_QTY = IT_EKPO-MENGE - IT_EKET-WEMNG.
            ENDIF.
           IF wk_diff_qty LE it_ekpo-menge.
            IF WK_DIFF_QTY GT 0.
              VALUES_TAB-TXZ01 = IT_EKPO-TXZ01.
              VALUES_TAB-MENGE = WK_DIFF_QTY.
              VALUES_TAB-MATNR = IT_EKPO-MATNR.
              APPEND VALUES_TAB.
            ENDIF.
          ENDLOOP.
           ENDIF.
        ELSE.
          SELECT TXZ01
          MATNR FROM EKPO CLIENT SPECIFIED
          INTO CORRESPONDING FIELDS OF TABLE VALUES_TAB
          WHERE MANDT = SY-MANDT AND
          EBELN = WK_EBELN AND
          LOEKZ NE 'X'.
        ENDIF.
      ELSE.
        SELECT TXZ01
              MATNR FROM EKPO CLIENT SPECIFIED
              INTO CORRESPONDING FIELDS OF TABLE VALUES_TAB
               WHERE MANDT = SY-MANDT AND
               EBELN = WK_EBELN AND
               LOEKZ NE 'X'.
      ENDIF.
      SORT VALUES_TAB BY TXZ01.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD        = 'IT_TC1-ITEMCODE'
          DYNPPROG        = PROGNAME
          DYNPNR          = DYNNUM
          DYNPROFIELD     = 'IT_TC1-ITEMCODE'
          VALUE_ORG       = 'S'
        TABLES
          VALUE_TAB       = VALUES_TAB
          RETURN_TAB      = RETURN_TAB
        EXCEPTIONS
          PARAMETER_ERROR = 1
          NO_VALUES_FOUND = 2
          OTHERS          = 3.
    *BREAK-POINT.
      IF SY-SUBRC = 0.
        READ TABLE RETURN_TAB INDEX 1.
        SELECT SINGLE MAKTX FROM MAKT CLIENT SPECIFIED
        INTO WK_MAKTX WHERE
        MANDT = SY-MANDT AND
        MATNR = RETURN_TAB-FIELDVAL AND SPRAS = SY-LANGU.
      ENDIF.
    ENDMODULE.                 " ITEM_CODE  INPUT
    *&      Module  CHECK_INPUT  INPUT
          text
    MODULE CHECK_INPUT INPUT.
      CLEAR : EKKO-EBELN , EKKO-LIFNR.
      SELECT SINGLE EBELN LIFNR FROM EKKO CLIENT SPECIFIED
      INTO (EKKO-EBELN , EKKO-LIFNR )  WHERE
      MANDT = SY-MANDT AND
      EBELN = WK_EBELN.
      IF SY-SUBRC NE 0 AND ( SY-UNAME = 'GATE1010' OR
                             SY-UNAME = 'GATE1020' OR
                             SY-UNAME = 'GATE1030' OR
                             SY-UNAME = 'GATE1040' OR
                             SY-UNAME = 'GATE1050' OR
                             SY-UNAME = 'GATE1060' OR
                             SY-UNAME = 'GATE1070' OR
                             SY-UNAME = 'GATE1080' OR  SY-UNAME = 'ABAP' ).
        IF WK_EBELN NE SPACE.
          MESSAGE E003 WITH TEXT-001.
        ENDIF.
      ELSE.
        WK_LIFNR = EKKO-LIFNR.
        CLEAR : LFA1-NAME1.
        SELECT SINGLE NAME1 FROM LFA1 CLIENT SPECIFIED
        INTO LFA1-NAME1 WHERE
        MANDT = SY-MANDT AND
        LIFNR = WK_LIFNR.
        IF SY-SUBRC EQ 0.
          WK_NAME = LFA1-NAME1.
        ENDIF.
      ENDIF.
      IF ( SY-UNAME = 'GATE1010' OR SY-UNAME = 'GATE1020' OR
           SY-UNAME = 'GATE1030' OR SY-UNAME = 'GATE1040' OR
           SY-UNAME = 'GATE1050' OR SY-UNAME = 'GATE1060' OR
           SY-UNAME = 'GATE1070' OR SY-UNAME = 'GATE1080' OR  SY-UNAME =
           'ABAP' ).
       IF wk_vbeln IS INITIAL.
         set cursor field wk_vbeln.
         MESSAGE E003 WITH text-009.
       ENDIF.
       IF wk_fkdat IS INITIAL.
         MESSAGE E003 WITH text-010.
       ENDIF.
      ENDIF.
      IF ( SY-UNAME = 'STORE1010' OR SY-UNAME = 'STORE1020' OR
           SY-UNAME = 'STORE1030' OR SY-UNAME = 'STORE1040' OR
           SY-UNAME = 'STORE1050' OR SY-UNAME = 'STORE1060' OR
           SY-UNAME = 'STORE1070' OR SY-UNAME = 'STORE1080' ).
        CLEAR : ZMMT001_GRN_GATE.
        SELECT SINGLE EBELN CDATE FROM ZMMT001_GRN_GATE
        CLIENT SPECIFIED
        INTO (ZMMT001_GRN_GATE-EBELN ,
        ZMMT001_GRN_GATE-CDATE )
        WHERE MANDT = SY-MANDT AND
        SERIAL = WK_SNO AND WERKS = WK_WERKS.
        IF SY-SUBRC EQ 0.
          SELECT MBLNR
                 MJAHR
                 BUDAT
                 BKTXT FROM MKPF CLIENT SPECIFIED
                 INTO TABLE IT_TEMP_MKPF
                 WHERE MANDT = SY-MANDT AND
                 BUDAT = ZMMT001_GRN_GATE-CDATE
                 AND BKTXT = WK_SNO.
          IF

    Hi,
    after calling you programm and get the message call transaction su53. That willl display the authorization that you need.
    Hope this helps.
    Regards
    Bernd

  • CR 2008/VS 2005/Winform : HOW TO REFRESH DATA ONLY ?

    Hi,
      I display a report in a CrystalReportViewer (Windows Form).
      This report have NO Saved data, use some parameters, use a formula, and connect to a SQL Server via OLE DB.
      I would like to REFRESH THE REPORT after some data has been modified in the Database. (just the DATA in the report, NOT the parameters, NOT their values, and NOT the formula).
      PROBLEM : this SIMPLE TASK seems to be IMPOSSIBLE to do !!! (I can't beleive this !)
      If I call Refresh() or  ReportRefresh(), in the Viewer or in the ReportDocument, the formula AND the report Parameters have no more effects.
       "ReuseParameterValuesOnRefresh = true " : DON'T WORK  !!! 
       QUESTION : Is there a way to refresh DATA in a report without completely reload the entire report file & params & formulas & Data & ... ???   
      Thanks a lot for your help.
      Steph

    I have had a similar issues with report parameters.
    The solution for me was to set the parameter value in the RefreshReport event of the ReportDocument not the crystalReportViewer.

  • Crystal Reports - Works in FireFox...Not in IE...Need to Refresh Data

    I am using a servlet and beans to fill a series of JSP pages. On the final page, the data is displayed in reports with a print button for each report. The user is supposed to be able to click on the indivudual button and print only the one report they request. The button part is working fine, and the code is as follows:
    <input type="button" value="Print Report" title="Print Report # <%= headerId %>" onClick=location.href="jrs_set_parameters.jsp?headerId=<%= headerId %>">
    The problem is the data in the Crystal Report is not being refreshed in IE, until I click the refresh icon. It works fine in FireFox. I have tried all sorts of things in my code to refresh the data in IE, but nothing seems to be working. I have found other suggestions on this site, and contacted Crystal Reports Support, but I'm getting nowhere with this.
    I did find that if I changed my IE settings as follows:
    IE, Tools, Internet Options, Connections, LAN Settings, Advanced, and under Exceptions added javadev*, which is the first part of my link, it will pull the correct report every time. The only problem is that I can't ask all of the users to make this change, just to get this to work right.
    I am about to start pullin my hair out soon! Does anybody know what has to be done in this situation? Please help!

    Problem solved! It had to do with the way our network people were caching Internet Explorer on the server.

  • Problem in refreshing

    Hi ,
    i am facing a problem of refreshing a query.
    my query is using a user inputn variable for fiscal yr and on the basis of fiscal year it return a variable say 01.04.2007-30.04.200 .
    but the problemm is wen i first enter the value of fiscal year in query it shows perfect data but as soon as i change the value of variable let say if i make it 2006 from 2007 it gives me the same data its not refreshing the data plz letme know y is it happning,
    thnks

    hi m refreshing it ..still
    WHEN 'ZC00000N25'. " variable
        LOOP AT i_t_var_range INTO loc_var_range
          WHERE vnam = '0P_FYEAR'. " fiscal variable
          CLEAR l_s_range.
          l_s_range-low(4) = loc_var_range-low(4) + 1  .
          l_s_range-low+4(4) = '0101'   .
          l_s_range-sign = 'I'.
          l_s_range-opt =  'BT'.
          l_s_range-high(4) = loc_var_range-low(4) + 1.
          l_s_range-high+4(4) = '0331'.
          APPEND l_s_range TO e_t_range.
           CLEAR : l_s_range , i_t_var_range.
          EXIT .
        ENDLOOP .

  • Analyzing tables refresh date DAC issue

    Hi all,
    I'm new with DAC so probably this is a silly question but I think is how we learn
    So I have an execution plan in DAC that without any changes from 8h is taking 12h to run. My last execution was on the 02-Aug and the execution that was ok was on the 26th of July.
    After checking the tasks I realized that for one of the workflows the query to the source is now taking 4h instead of the usual 1h.
    I've spoken to the DBA's and they told me that the table should be analyzed. I've checked in DAC and the analyze option is checked for that table in tab Task --> Target Tables.
    I checked DAC log file for that task and it says it was done with success (log file from 02-Aug), I also checked that table in the database and it seems it was analyzed with in the right date (it says 02-Aug, I used SQL Developer to check this) but in DAC --> Setup --> Physical Data Sources --> Refreshed Dates, for that specific table the value for the Analyze Date is before I've started getting the performance issue (it has 26-July).
    Any ideas why this date is not being updated here? Anyway if the database has the right date so the table is being analyzed right? And this is only a DAC refresh problem and the DBA's need to search more to find out what is wrong in the database right?
    Thank you,
    Carla

    As I understand it, the refresh date goes hand in hand with the physical data source for the datawarehouse.
    After each batch the refresh_date gets set to the cutoff timestamp of the current run, i.e. it in effect indicates for the destination database what date the data goes up to.
    The next batch run will take this date and then only load data after that date.
    So if you switch your destination DB but leave your refresh_date untouched then you're going to get incomplete data because so far as the DAC's concerned you've already loaded the data.
    I could have misunderstood your question so please don't take this as gospel. But it does sound like you need to manually update the refresh dates and set them to whatever timestamp your desired destination DB was last successfully loaded.
    BTW you might want to post future queries in this forum: Business Intelligence Applications

Maybe you are looking for