Filling data into same itab based on condition.

hi to all
my problem is that i have a itab which has matner and mtart now i want to post the stock in the same itab  .my query is as below
data : begin of it5 occurs 0,
      matnrfg like stpox-idnrk,
      matnrsf like stpox-idnrk,
      mtart like stpox-mtart,
      labst like mard-labst,
      lbkum like mbew-lbkum,
      labst_final like mard-labst,
       end of it5.
if t_stb1-mtart = 'HALB'.
         move t_stb1-idnrk to it5-matnrsf.
         append it5.
SELECT labst FROM mard INTO
         corresponding fields of table it5
         WHERE matnr = it5-matnrsf and
               lgort = 'A400'.
        SELECT lbkum FROM mbew INTO
        corresponding fields of table it5
         WHERE matnr = it5-matnrsf.
   it5-labst_final = it5-lbkum - it5-labst.
but it is not working can anybody help ,it is urgent plz .pointe will be rewarded
Message was edited by:
        sarabjit kaur

Hi,
Create a temperory table as same as IT5 as IT5_temp.
data : begin of it5 occurs 0,
matnrfg like stpox-idnrk,
matnrsf like stpox-idnrk,
mtart like stpox-mtart,
labst like mard-labst,
lbkum like mbew-lbkum,
labst_final like mard-labst,
end of it5.
data : begin of it5_temp occurs 0,
matnrfg like stpox-idnrk,
matnrsf like stpox-idnrk,
mtart like stpox-mtart,
labst like mard-labst,
lbkum like mbew-lbkum,
labst_final like mard-labst,
end of it5_temp.
if t_stb1-mtart = 'HALB'.
move t_stb1-idnrk to it5-matnrsf.
append it5.
data : v_labst like mard-labst.
data : v_lbkum like mbew-lbkum.
SELECT single labst FROM mard INTO v_labst
WHERE matnr = it5-matnrsf and
lgort = 'A400'.
it5-labst = v_labst.
SELECT single lbkum FROM mbew INTO v_lbkum
WHERE matnr = it5-matnrsf.
it5-lbkum = v_lbkum.
it5-labst_final = it5-lbkum - it5-labst.
move it5 to it5_temp.
append it5_temp.
clear it5.       "<<<<<<<< clear it5
All further needs you can use it5_temp.

Similar Messages

  • Header data and item data into same internal table

    Hi Experts,
    I WANT TO KNOW THE LOGIC TO POPULATE HEADER DATA AND ITEM DATA INTO SAME INTERNAL TABLE AND AGAIN DOWNLOAD THE SAME TO EXCEL FILE .Output file should be displayed like this format
    Header1  rectyp ,hdnum ,sbank ,bankl ,accnr , paytp , crda ,iso.
    Item1  : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
    Item2  : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
    Header2: rectyp ,hdnum ,sbank ,bankl ,accnr , paytp , crda ,iso.
    Item1  : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
    Thanks
    Moderator message: Please do not use all upper case in the future.
    Edited by: Thomas Zloch on May 12, 2010 3:10 PM

    Hi,
    for example we have 3 internal tables 
    1> it_header  2>it_items   3>it_final (which contains all the header and item fields)
    once  it_header   it_items  are filled
    loop at it_items.
    read table it_header with key xyz = it_item-xyz.
    if sy-subrc = 0.
      here move all the header fields to it_final like below.
    it_final -xfield  = it_header-xfield.
    endif.
      here move all the item fields to it_final like below.
    it_final -yfield  = it_item-yfield.
    append it_final.
    clear it_final.
    endloop.
    now header and item fileds will be fillled in it_item

  • Insert data in same table based on some condition

    Hi. I am new to this forum.
    I have to write a stored procedure to Insert Data into a table say MYTABLE ,having structure as:
    Col1 Col2 Col3 ................ TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data as it is in the same table(MYTABLE) except changing some fields on basis of some conditions:
    1. if PaidAmount>0 && CurrentInstallment<TotalInstallment then
    CurrentInstallment=CurrentInstallment+1
    2. In the MonthYear field I am having data in formate(month/year)ex. 01/2012, 11/2012 ....
    So I have to insert data by incrementing month and year. for example:
    if currentdata is 11/2012 then next data will be 12/2012
    But next will be 01/2013
    I have to select all the records which belongs to previous month(through MonthYear field ) and put checking & changes on each record of the selected data and then insert them into same table(MYTABLE).
    How to achive that?
    Thanks.

    978184 wrote:
    Every thing is working fine but some strange result as:
    when i run my Procedure TRANSFERDATATONEXTMONTH
    1. by Passing Value as : CUSTOMERID_var ='ABX101' and MONTHYEAR_var='12/2012' it insurts 5 rows
    which is correct , since I have 5 records where CUSTOMERID='ABX101' and MONTHYEAR='12/2012' and
    new 5 rows has CUSTOMERID='ABX101' and MONTHYEAR='01/2013' (all other values are as expected)
    2. now when i again run by passing values: CUSTOMERID='ABX101' and MONTHYEAR='01/2013' it inserts 10 records(just double )
    and new records has value CUSTOMERID='ABX101' and MONTHYEAR='02/2013' (while on the basis of condition CUSTOMERID='ABX101' and MONTHYEAR='01/2013' i have in my table only 5 records)
    and all records are duplicate. Some times it inserts three times , while on condition basis it should no. What is happening?Probably, meanwhile you were trying to Insert the First time and the second time, someone did run the procedure that Inserted 5 More records for 01/2013. And, hence your Second run inserted 10 records instead of 5.
    >
    Why it is inserting double of records while i have only 5 records on given condition? Am I missing some thing?Yes, you are. You are missing your Tables, Your Dummy/Sample Data, Working Procedure/Function that can be replicated.
    Without this, we cannot simply believe on assertions that Oracle is behaving incorrectly.
    In addition to this, the GetMonthYear function, should be scrapped. It is un-necessary, when the same logic can be achieved using Oracle ADD_MONTHS function (See my previous post). And you are storing the MonthYear in a Varchar field, which ideally should be a Date field. This eradicates the un-wanted need to cast from VARCHAR - DATE - VARCHAR.
    Please do make some time to read {message:id=9360002} and mentioned relevant details.
    And notice, the code difference in my previous post and in your code.
    Please use
    {noformat}
    (exactly as shown) above and below your code, that indents the code properly for better readability.
    {noformat}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Loading data into csv file based on the count of data in table in ODI

    Hi,
    I have a requirement like i have data in table and need to be loaded in csv file.
    If the count of the data in the table exceeds the csv data limit then i need to call the same procedure again to
    generate one more csv file and load the remaining data into it.my data in the table may vary all the time.
    I am new to this ODI.Can anyone tell any ways to do it in ODI or tell me any logic to do this?
    Thanks in advance..
    Edited by: 883410 on May 22, 2012 12:01 AM

    What limit on the csv file are you talking about. There isn't a limit (unless you are on Unix where the filesize is limit is 2GB). Are you talking about opening it in earlier versions of Excel where the display limit is 60,000 rows as this is irrelevant for your operation?

  • Does anybody have a TableView example where a controller fills data into?

    I'm looking for an example about initially filling data on application start up into a TableView defined in FXML. I do not understand how to bind the table in the FXML with the data I have got to provide in the controller class. Do I have to use the CellValueFactories and create new Callbacks? Can anybody please provide some sample code in order to enlighten me? Thank you very much.
    Edited by: mwalter on 26.03.2012 12:25

    This post blog post has examples of FXML with a List and Controllers: http://www.zenjava.com/2011/12/11/javafx-and-mvp-a-smorgasbord-of-design-patterns/
    The usage for Table is quite similar.
    In particular check out 'Option 4' and this class:
    http://code.google.com/p/jfxee/source/browse/trunk/first-contact/first-contact-mvp-fxml/src/main/java/com/zenjava/firstcontact/gui/search/ContactSearchPresenter.java
    If you need more info, post back some more questions here on the specific areas you are struggling with. Ideally include some example code of what you've managed to achieve so we can add the missing bits.
    Cheers,
    zonski

  • Fill data into a form programmatically and print the form afterwards

    Folks,
    until recently a lab assistant took measurements and filled the data into a paper form (see attached pdf). Now we are building a test stand that does the measurement semiautomatically. The software of the test stand will be programmed in LabVIEW, of course. The test stand shall generate a printed protocol very similar to the attached pdf in future as well.
    What's the best way to fill the acquired data into the form and to print the form afterwards? The form can be read by our code in either pdf or html. There is no Microsoft Office installed on the computer.
    Modifying the html code? Converting the pdf to a picture and fill the data into the picture? Any hint will be highly appreciated.
    Thanks,
    Peter
    Attachments:
    Form.pdf ‏121 KB

    Hmmm... must have misunderstood what you were saying.
    XSL is a language that allows you to generate an HTML document. The XSL basically defines the style, and the XML specifies the data. HTML is the combination. You can find out more here.
    Unfortunately, since you don't have Office, you won't be able to use the ActiveX interface to control Word, so that's out.
    With the template in HTML format you could use the DOM for an HTML file to set the value of the HTML elements. The easiest way to do this is to use IE (I'm assuming you're on Windows here) to open the HTML template and then you can use the DOM from there. As for how feasible this is, it would depend on your HTML format. Can you post the template in HTML format?
    With the template in PDF format I know that some PDF files that are forms can be generated in such a way that they still act like forms when you open them in, say, Acrobat Reader. Acrobat has an ActiveX interface so you should be able to programmatically do this, but I can't say for sure. You can check the Adobe site for more info. You just need to make sure it doesn't require the full version of Acrobat.

  • Data download in excel based on conditions

    Hi ,
    I need to download data in excel for selected months from report .
    These are the following examples:
    A. If on selection screen month is given 4 to 5, then data for 4 and 5 month should be downloaded in
        excel and rest other month should'nt downloaded.
    B. If on selection screen month is given 1 to 12, then data for 1 to 12 month should be downloaded in
        excel( means all month data should be downloaded).
    Please suggest me any logic.
    Thanks in advance.
    Have a good day!
    Gaurav

    Hi,
    As far as my knowledge, below are the Suggestions.
    1. You need to declare a special Excel download button(New) in the GUI status of your report.
    2. handle the above Button Functionality in the User command of your ALV report.
    3. For handling the data: In the User command,,,
        Loop at the Final Output table, Inside the Loop, check for the entries in the Selection screen Month Entry & Filter the data into another Table.
    4. Download the above data in to the Excel file by using custom Download FM's.
    Ex:  FM:  GUI_DOWNLOAD
    Note: Also use F4_FILENAME for asking the user for the Path to download excel file.
    If this way of solution is Ok for you, Please revert me for any more Help.
    Chaitanya...

  • Data Loading from one table to another in the Same Database based on conditions .

    Hi ALL ,
    I have 2 tables Products and Product_info .
    Product_info table Product_id is Primary key but not an identity column so auto increment of number needs to be performed from the Package only .
    Requirement is :
    IF the Product_ID is = 20 and Date lies in the previous month not the current month in the Products table then 
    insert into the Product_info table based on below mentioned information .
    1.If the Name  has tap then ignore it completely don't perform any insert for it.
    2.If the Name has Zork in it then perform 2 inserts in the Product_info table having Product_info_id's 1 and 2 .
    3.If the Name doesn't contains Zork or tap insert it in the Product_info table having Product_info_id 4.
    Very new to SSIS package development it will be helpful if you can provide detailed information .
    Source Table (Products table )
    ID
    NAME
    Product_ID
    Date 
    Area_ID
    1
    P_tap_rus
    20
    13-01-2014
    3
    2
    Enc_sap_top
    10
    15-01-2014
    4
    3
    Yorl
    20
    05-02-2014
    5
    4
    zork
    20
    20-01-2014
    6
    5
    fadbt
    10
    22-01-2014
    6
    6
    xyzzz_oprt
    20
    28-01-2014
    5
    7
    def_type_ru
    20
    06-02-2014
    2
    8
    acd_inc_tup
    10
    07-02-2014
    3
    9
    bnf_dlk_fbg
    20
    03-02-2014
    4
    10
    rtyui_vnmghj_sfdl
    10
    12-01-2014
    5
    11
    wlwf_10103_123
    10
    04-02-2014
    9
    Destination table  (Product_info)
    Porduct_ID
    ID
    Area_ID 
    Product_info_ID
    Column1
    1
    3
    5
    4
    As NameString doesn’t contain Zork or Tap 
    2
    4
    3
    1
    As Id is 4 so 2 inserts one for 1 and other for 2 in the Product_info_id column
    3
    4
    3
    2
    4
    6
    5
    4
    5
    10
    5
    4
    6
    11
    9
    4
    Please let me know if any other information is required .
    Thanks
    Priya

    Hi Priya,
    You mentioned this was coming from two tables right? I believe I would try to perform the transformations with T-SQL in my source (If this is a possibility for you). Below is an example of something you could do.
    WITH CTE
    AS
    SELECT ID, Product_ID, [Date], Area_ID,
    CASE
    WHEN Name like '%Zork%' THEN 1
    ELSE 4
    END AS Product_Info_ID
    FROM [YourTable]
    WHERE Product_ID = 20 and MONTH([DATE]) = MONTH(DATEADD(MM, -1, GETDATE())) AND NAME NOT LIKE '%tap%'
    SELECT *
    FROM CTE
    UNION
    SELECT ID, Product_ID, [Date], Area_ID, '2' AS Product_Info_ID
    FROM CTE WHERE Product_Info_ID = 1
    I hope this helps, Regards.

  • How to call or not call a Trigger in same table based on condition?

    Hi
    How to call or not call a Trigger in below situations..
    If a table contains a record of same value i.e,
    [i[u]]ID
    1
    1
    3
    In above ID 1 is repeated for two times.
    In this situations i don't want to call a trigger..
    But, the value ID is for 3, now i want to fire a trigger.
    Based on this i want to delete in another table.
    How can I check it?
    Thanks

    Thanks for ur reply..
    The below is my scnario..
    I am having two table
    employee
    Id empcol
    101 111
    101 222
    102 444
    Department
    id deptcol
    101 457
    101 678
    102 543
    The above is my table structure no one column is PK, so i m not able create FK.
    When I am deleting from employee where id =101 and empcol=111,
    the above record is deleted.
    At present I am using After Update Trigger..
    So trigger is called and delete the id 101 in Department table.
    In my scenario i can't delete a record in Department table
    bcoz i am having id morethan 101 in employee table.
    If employee table contains one ID like 102 the Trigger should works.
    How can I check the condition After delete on employee table it contains morethan same employee id?
    The below is my Trigger..
    CREATE OR REPLACE TRIGGER CALL_TRIGGER
    AFTER DELETE ON Employee
    FOR EACH ROW
    DECLARE
    count_id pls_integer;
    BEGIN
    SELECT COUNT(*) INTO count_id from Employee WHERE ID <>:new.ID;
    IF( count_id >1) THEN
    DELETE FROM Depratment where ID=:old.ID;
    END IF;
    END;
    I am geting an error ORA-04091 table is mutuating, trigger cannot seen it.
    I had tried with package and package body also.. But no luck.
    Thanks

  • How to: Create a master form that auto-fills data into other pdf forms?

    I hope someone can please help me.  I have about 15 PDF forms that all require similar data entry (name, address etc). Can I create a master form that we fill in once per client, and then auto-fill in the matching data on the 15 forms? 
    I am not looking for an online solution as the information is highly sensitive. 
    I have already created a form in Acrobat X Pro with the 'master data', and created the (15) forms with identically named fields.  How I link the forms now to the master, I cannot figure out (after much searching).
    I have read similar questions on the same topic but have not found any answers.   I hope this time someone can please help.
    Many thanks in advance.

    Thank you!  I had just figured out how to export the data from the master as an FDF file and then import it to the other files.  I'm afraid I don't understand scripting to automate the process across multiple files.  To you mean with java script? 
    I've also thought about combining the forms, once we know which ones the particular client will need.  I have to see how it works in practice for my colleagues who will be using them.
    Thank you again.

  • How to auto-fill data into Acrobat 9 PDF created from scanned paper form/document

    Hello,
    I am new to Adobe Acrobat Pro 9.  I have scanned a paper form/document that
    originally  had various data lines to be written on using an ink pen.  I saved
    the scanned PDF as an Acrobat 9 PDF.  I have added various pertinent text fields
    and checkboxs to PDF form and saved it with appropriate extended setting to
    allow end-user to type on PDF and save a copy.  At the bottom form there is a
    name/signature text field for end-user name to be typed and a calendar text date
    when name/signature text field is entered .
    I need to send this PDF form to various end-users using (Groupwise/Novell) email
    to have them sign or type their name and date at bottom of form.  Is there a way
    that Adobe Acrobat 9/PDF will recognize the email sender and allow the
    name/signature field to automatically fill-in signature/name textbox.  Are there
    tools like javascript, etc. that will help me accomplish this task?
    I don't know where to begin. I am a newbie.  Please help!

    You are on the Connect forum   Try the Acrobat Pro forum for your question.  Thanks
    matt rock  |  Technical Response Team, Connect

  • How to auto-fill data into scanned paper form converted to Acrobat 9 PDF

    Hello,
    I am new to Adobe Acrobat Pro 9.  I have scanned a paper form/document that originally  had various data lines to be written on using an ink pen.  I saved the scanned PDF as an Acrobat 9 PDF.  I have added various pertinent text fields and checkboxs to PDF form and saved it with appropriate extended setting to allow end-user to type on PDF and save a copy.  At the bottom form there is a name/signature text field for end-user name to be typed and a calendar text date when name/signature text field is entered .
    I need to send this PDF form to various end-users using (Groupwise/Novell) email to have them sign or type their name and date at bottom of form.  Is there a way that Adobe Acrobat 9/PDF will recognize the email sender and allow the name/signature field to automatically fill-in signature/name textbox.  Are there tools like javascript, etc. that will help me accomplish this task?
    I don't know where to begin. I am a newbie.  Please help!

    You are on the Connect forum   Try the Acrobat Pro forum for your question.  Thanks
    matt rock  |  Technical Response Team, Connect

  • Converting standard date into GMT Format based on Zone

    Hi,
    I want to get GMT date based on the current date and Zone information i enter.
    For example.
    inputs are
    current date : 11/11/2006 15:35:37
    Zone information : PDT (i.e. America/Los_Angeles)
    out should be
    GMT date : Saturday, November 11, 2006 2:05:16 AM PST
    I need it immediately.
    Thank you.

    Let me code it. Then you can advance me $100 through PayPal, I'll post the code, and then if it does what you want, you can send me the other $900.

  • RFC data  into WebDynpro Table based on Page selected by user in Portal

    Hi All
    I am new to webdynpro. we are developing an application in which we are supposed sent two parameters to RFC to retrive data. Two parameters are Role (plant) and page names(Sub - plant).
    Finally there should only one RFC for whole application which takes parameters when user selects a role and page inside a role.
    How can I do this. Please help me.

    Hi,
    1. Develop an RFC at the backend SAP system, which takes in 2 input ( plant and sub-plant) and gives the list of results as a table.
    2. Create a model in the WD Java application to call the RFC.
    3. call the rfc, get the output and print the result in a table designed in the view.
    There is a sample application which can be found here
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/creating%20a%20web%20dynpro%20application%20accessing%20abap%20functions.pdf
    This does a similar application which you are trying to do. This takes in 2 input parameters from the user 'Departure city' and 'Arrival city' and prints the list if flights. If you go thru this sample application, you can develop urs very easily.
    You can even get the source code of this project in the following link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#15 [original link is broken]
    Click 'download from SDN' in the link above.
    Hope this helps you
    Regards,
    Sharadha

  • Inserting millions of records into new table based on condition

    Hi All,
    We have a range partitioned table that contains 950,000,000 records (since from 2004) which is again list sub-partitioned on status. Possible values of stauts are 0,1,2,3 and 4.
    The requirement is to get all the rows with status 1 and date less than 24-Aug 2011. (Oracle 11g R2).
    I trying below code
    CREATE TABLE RECONCILIATION_TAB PARALLEL 3 NOLOGGING  
    AS SELECT /*+ INDEX(CARDS_TAB STATUS_IDX) */ ID,STATUS,DATE_D
    FROM CARDS_TAB
    WHERE DATE_D < TO_DATE('24-AUG-2011','DD-MON-YYYY')
    AND STATUS=1; CARDS_TAB has tow global indexes one on status and another on date_d.
    Above query is running for last 28Hrs! Is this the right approach?
    With Regards,
    Farooq Abdulla

    You said the table was range partitioned but you didn't say by what. I'm guessing the table is range partitioned by DATE_D. Is that a valid assumption?
    You said that the table was subpartitioned by status. If the table is subpartitioned by status, what do you mean that the data is randomly distributed? Surely it's confined to particular subpartitions, right?
    What is the query plan without the hint?
    What is the query plan with the hint?
    Why do you believe that adding the hint will be beneficial?
    Justin

Maybe you are looking for