Screen query (very urgent)

Hi,
I have a requirement to hide the selection screen inside of that program in which the selection screen is defined. It is to be done instead of calling or submitting this program into any other program. Even if we use the At Selection-screen output then only we can hide the parameters or select-options but the screen remains. my requirement is to hide the entire screen? is it possible? Please reply

I don't think it is possible hide the standard selection screen.
But you can achieve this by declaring user defined selection screen.
ex:
selection-screen: begin of screen 100.
selection-screen: end of screen 100.
The above screen will be displayed only if it is called in the program using the statement
call selection-screen 100.
If it is not called then it will not be displayed.

Similar Messages

  • Tuning the query : Very Urgent

    Hi
    We have query wich needs tuning.when we are putting REGULAR EXPRESSION query is running fine but whne we put like LIKE stmt it is taking time.Here is the query below.Please help on tuning.
    SELECT a.order_number, b.last_update_date,TO_CHAR( b.split_percent,'FM99999.009') SPLIT_PERCENTAGE,
    rs.NAME " SALES_PERSON_NAME ", rs.salesrep_number, b.effective_date,
    b.creation_date "CREATION_DATE", rt.NAME "TERRITORY_NAME",
    rt.segment1 "ERP_CODE", a.booked_date "DATE_BOOKED",
    TO_CHAR(ROUND((( (SELECT SUM (ordered_quantity * unit_selling_price)
    FROM apps.oe_order_lines_all ol
    WHERE ol.header_id = a.header_id)
    * b.split_percent
    / 100
    ) , 2),'FM99999999999999999999.009') order_total ,
    (SELECT user_name
    FROM fnd_user
    WHERE user_id = b.last_updated_by) requested_by,
    b.obsolete_date
    FROM oe_order_headers_all a,
    apps.csm_header_sales_cr_hist b,
    jtf_rs_salesreps rs,
    ra_territories rt
    WHERE 1 = 1
    AND a.header_id = b.source_header_id
    AND b.territory_id = rt.territory_id
    AND b.salesrep_id = rs.salesrep_id
    AND b.source_type = 'O'
    AND a.order_number IN (
    SELECT a.order_number
    FROM oe_order_headers_all a,
    apps.csm_header_sales_cr_hist b,
    jtf_rs_salesreps rs,
    ra_territories rt
    WHERE 1 = 1
    AND a.header_id = b.source_header_id
    AND b.territory_id = rt.territory_id
    AND b.salesrep_id = rs.salesrep_id
    AND b.source_type = 'O'
    -- AND b.obsolete_date IS NULL --ommented by andondap as per TD#9648 Changes
    AND  REGEXP_LIKE ( rs.name , '(svc)|(Muti.*Y)|(Multi.*Y)|(._MY)')  Commented by andondap as per TD#9648 Changes
    AND b.last_update_date BETWEEN TO_DATE ('2012/11/25', 'YYYY/MM/DD') AND TO_DATE ('2013/03/23', 'YYYY/MM/DD')+ 0.9999
    AND REGEXP_LIKE ( rs.name,'(.MY)|(Muti.*Y))|(Multi.*Y)|(._MY) |(mlti)')
    AND rs.name LIKE '%SVC%MULTI%' OR rs.name NOT LIKE '%DUMMY%' OR rs.name LIKE 'Svc%Multi%' OR rs.name LIKE 'Svc%MY%'
    OR rs.name LIKE 'Service%Multi%' OR rs.name LIKE '%MY_SHARE_TM' OR rs.name LIKE '%MY_SHARE_T')
    ORDER BY a.order_number, b.creation_date
    Thanks
    Hibin

    Hmmm, let's see...
    1. OP provided formatted code using {noformat}{noformat} tags.... - FAILED
    2. OP provided database version in full... - FAILED
    3. OP provided table structures and index information... - FAILED
    4. OP provided cardinality and selectivity information... - FAILED
    5. OP provided explain plans... - FAILED
    6. OP provided execution traces... - FAILED
    7. OP is a new member and can be excused for above failures... - FAILED
    8. OP has asked previous questions and followed forum etiquette by marking them as answered... - FAILED
    9. OP has respected volunteers and other questioners by not marking his question as Urgent... - FAILED
    10. OP has read the forum FAQ ({message:id=9360002}) for posting his question...  - FAILED
    11. OP has read the forum FAQ ({message:id=9360003}) for posting a tuning question... - FAILED
    It's a good job you're not a computer program, you wouldn't have even compiled.
    so, points to note:
    This is a forum of volunteers.  There's no such thing as an Urgent question here, and it's considered rude to suggest your question is urgent, as that indicates you want immediate attention from the people who are giving up their own time to help, and who have their own jobs to do.  It's also rude for the other people who are asking questions, as everyone would like an answer to their problem as soon as possible, so what makes you any more special?  An urgent issue is one where a live system is down potentially putting people's lives at risk or causing a company to lose money, or somehow damage their services.  Such issues should be logged with Oracle Support, not on the free OTN forums.
    Next, when you post your question, ensure you provide all the information that is needed for people to be able to help you.  Read the FAQ posts which point to useful threads indicating what information is required, especially for tuning requests.
    Finally, when your questions have been answered, it is common courtesy to mark them as answered (and award points if appropriate), otherwise it indicates that you have no respect for the people who are helping you.
    If you follow all the advice above, you will end up creating a good question that people will be willing to help you with.   If you don't follow the advice above, such as in this question you've posted, you will find that few experts will bother to help (or if they post it will not likely be helpful advise you receive).  The choice is yours.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • BW statistics cube and query Very Urgent!!

    Hi Everyone,
    I want to find out the query performance of all our customized infocubes in the bw system.
    But I am not able to find our infocubes in 0BWTC_C02, 0BWTC_C03 etc. even in the queries 0BWTC_C10_Q014, 0BWTC_C10_Q507 I cannot find out queries which were created for our customized i.e Zinfocubes.
    What could be the problem?
    Is some installation missing or do we have to update. How can I find out this information.
    Its really urgents can anyone please let me know.
    Thanks,
    Prashant.

    Hi,
    I requested the delta update as you have specified. But it is still in yellow and I get these messages.
    <b>Request still running
    Diagnosis
    No errors could be found. The current process has probably not finished yet.
    System response
    The ALE inbox of the SAP BW is identical to the ALE outbox of the source system
    and/or
    the maximum wait time for this request has not yet run out
    and/or
    the batch job in the source system has not yet ended.
    Current status
    The processing of the data was not finished.</b>
    <b>
    Transfer (IDocs and TRFC): Errors occurred
    Data Package 1 : arrived in BW ; Processing : Data packet not yet processed
    Processing (data packet): Errors occurred
    Data Package 1 ( 7917 Records ) : Missing messages
    Update ( 0 new / 0 changed ) : Missing messages
    Processing end : Missing messages
    </b>
    These are the messages when i press the details button in the monitor window.
    What could be the problem.
    Can anyone please help with this.
    Thanks,
    Prashant.

  • How to display current day(13-nov-06) in selection screen-its very urgent

    hi all,
    iam sending code to change the date from mm/dd/yyyy to dd-mon-yy(10-nov-06).my requirement is i have to keep a parameter and when iam executing thid report say p_text1 is a parameter when iam executing this report in selection screen it has to show 12-nov-06 say current date.any body can suggest me how to do and please send me the sample code.
    iam sending the code to change the date format as below.
    data: begin of itab occurs 0,
    SPRAS type SPRAS,
    MNR LIKE T247-MNR,
    KTX LIKE T247-KTX,
    LTX LIKE T247-LTX,
    end of itab.
    DATA : month LIKE T247-MNR.
    DATA: YEAR(4).
    DATA: FINAL(18).
    DATA: DAY(2).
    DAY = sy-datum+6(2).
    MONTH = sy-datum+4(2).
    YEAR = sy-datum+0(4).
    DAY = sy-datum+6(2).
    YEAR = sy-datum+0(4).
    select SINGLE * from t247 into itab where mnr = month
    AND SPRAS = 'E'.
    APPEND ITAB.
    CONCATENATE DAY ITAB-KTX YEAR+2(2)
    INTO FINAL SEPARATED BY '-'.
    WRITE: FINAL.
    thanks,
    maheedhar.T

    keep this entire code in INITIALIZATION EVENT.
    data: begin of itab occurs 0,
    SPRAS type SPRAS,
    MNR LIKE T247-MNR,
    KTX LIKE T247-KTX,
    LTX LIKE T247-LTX,
    end of itab.
    DATA : month LIKE T247-MNR.
    DATA: YEAR(4).
    DATA: FINAL(18).
    DATA: DAY(2).
    parameters: p_date type char15.
    initialization.
    DAY = sy-datum+6(2).
    MONTH = sy-datum+4(2).
    YEAR = sy-datum+0(4).
    DAY = sy-datum+6(2).
    YEAR = sy-datum+0(4).
    select SINGLE * from t247 into itab where mnr = month
    AND SPRAS = 'E'.
    APPEND ITAB.
    CONCATENATE DAY ITAB-KTX YEAR+2(2)
    INTO P_DATE SEPARATED BY '-'.

  • Please find this query very urgent

    Query-->select value from mytable where value is not null
         union all
    select value from mytable where value is null
    Ex: table name::mytable
    In this table i have one column called 'value' and this column values shold be like this
    12
    null
    13
    null
    11
    null
    ....i executed above query the result will be like this
    12
    13
    11
    null
    null
    null
    the above query executes on the table it's effect only one column result
    but i need multiple columns to be effected same as above one only....Anyone please help me on it and give the query.

    I have a table..MyTable(value number(10))
    select * from Mytable;value
    12
    null
    13
    null
    11
    null
    This is the table i have and the records i have...... and i need output like this
    value
    12
    13
    11
    null
    null
    null ..............>ike this i need output for this i use this query i.e
    Query-->select value from mytable where value is not null
    union all
    select value from mytable where value is null
    ------------>and this query gives only one column result i need multiple results like below: i have table with 2 columns like below
    MyTable2(value1 number(10),value2 number(10))
    select * fromMyTable2value1 value2
    111 null
    null 201
    112 null
    null 200
    110 null
    this is the table i have......... and i need output like below
    value1 value2
    111 201
    112 200
    110 null
    null null
    null null
    NOTE:: If we use ORDER BY table records order must change, i don't want to change any order....please what is the query for that

  • Bex Query : Very Urgent

    HI Experts,
                      In a Bex Query , I have 2 Columns 1) Material , 2) Netprice.  Now in the query i need a third column, which shud be derived from  the existiing 2 columns,
    ex:
    Mat no                                       Price                                   
    12345                                               100   
    I need this column
    Exact Cost
                                                                         ( IF MatNo is 12345 then 25 * 100,
                                                                                    if MatNo is other than 12345 then 50 * 100) .
    I need to develop this, how to address this, I want to do this in query level. I have considered the option of writing a routine while data is populated in data target, but that doesnt help, cos later the value can be changed from 25 to 200 etc. Kindly suggest
    Regards,
    Tarak
    Edited by: TARAK on Mar 25, 2008 5:33 PM

    Dear ,
    Plz check Nag's reply in :
    https://forums.sdn.sap.com/click.jspa?searchID=10061863&messageID=3743877
    See if you can tweak that logic a little bit to suit you...
    Thanks

  • Idoc query(very urgent)

    Hi Folks,
    i want to insert a record into the EDIDD table ,please let me know if i need to modify the sequence numbering which is kept by the fields  SEGNUM and PSGNUM for the records whcih are beneath the new insert record.
    regards,
    Nagaraj

    Hello
    Yes, fields SEGNUM is a secuential number.
    The other one im not sure but try to assign the same value for both fields.
    Gabriel

  • SQL SELECT Query Help   ..Please its very Urgent!!

    Hi All,
    I am having Oracle Database whice is storing 1000's of records daily.
    I need to select some information based on date and time.
    I am having two coloumns for Date and time. The first column(testDate) of type Date stores date as MM/DD/YY format and the second column(testTime)of type Numeric stores the time in seconds.
    The Example data is :
    testDate ------=-- testTime
    11/12/2002 --- 35000
    11/12/2002 --- 43000
    11/12/2002 --- 45000
    11/12/2002 --- 75000
    11/13/2002 --- 2000
    11/13/2002 --- 3500
    11/13/2002 --- 4300
    11/13/2002 --- 9800
    11/13/2002 --- 23000
    11/14/2002 --- 5000
    11/14/2002 --- 10000
    11/14/2002 --- 15000
    How can i write a SELECT Query to get the records of specific date and seconds to next day specific date and seconds.I mean i want all the records between 11/12/2002 --- 43000 seconds to 11/14/2002 --- 1000 seconds.
    If any one helps me in this regard iam very thank full to them.Its very urgent for me.
    Thanks

    Hi m7nra,
    I used the query as
    SELECT * FROM table
    WHERE testDate + (testTime/(24*60*60)) BETWEEN TO_DATE('MM/DD/YYYY','12.11.2002') AND TO_DATE('MM/DD/YYYY','14.11.2002')
    its giving DATE FORMAT NOT RECOGNIZED error.
    The Example data is :
    testDate ------=-- testTime
    11/12/2002 --- 35000
    11/12/2002 --- 43000
    11/12/2002 --- 45000
    11/12/2002 --- 75000
    11/13/2002 --- 2000
    11/13/2002 --- 3500
    11/13/2002 --- 4300
    11/13/2002 --- 9800
    11/13/2002 --- 23000
    11/14/2002 --- 5000
    11/14/2002 --- 10000
    11/14/2002 --- 15000
    infact i need all the records between 11/12/2002 --- 43000 seconds to 11/14/2002 --- 1000 seconds.
    Please help me to find a full query beacuse iam very new to Oracle.
    Thanks,
    S R Mannava

  • Very Urgent Help , ABAP SQL Query

    Guys,
    Please suggest.I have a table(custom_table1) with a field say A which is of date type = c and length = 9. And i want to query this table.Following is the query.
    Select substr(A,0,5) B C into itab From table custom_table1
    where b = ( select b from cusstom_table2 )
    and substr(A,0,5) = Input_A.
    That is i want to equate an Input_A (which is of 5 character length) with field A (only first 5 character of the 9 length). But it seems the query is wrong. Kindly help ,very urgent
    Thanks

    Thanks guys, U have helped me to fill up the where condition as
    but what about the column A in the select query ?I need only 5 characters from the field populated into Itab.
    CONCATENATE  srch_str '%' INTO srch_str.  -- bcos i want it to be 'InputA%'
    Select Substr(A,0,5) , B C Into Itab From CustomTable 1 where B = (Select B from customtable2) and A Like SrchStr
    Is there any means i can populate only the 5 characters from the select field A into Itab without using Substr (becos it doesnt work) ? Please help.

  • Query Tuning-very Urgent

    Beloq query is taking time to execute and cost is 934.
    The db in which it is run has lesser volume of data compared to that of prod.
    There is a full table scan on psd
    inspite of a pk present on table psd columns (psd_id,psd_serial_no)
    also a pk present on table ltc_iss_rec columns(ltc_iss_rec_id,psd_serial_num)
    Pl help to optimize the query.
    select a.psd_id,a.psd_serial_no,a.sys_id,a.cosmos_ref_no,a.src_sys_asgn_ref_no,
    a.bank_id,b.lc_expr_dt
    from psd a,ltc_iss_rec b
    where ((b.ltc_iss_rec_id >= 'T200203140731163') and (b.ltc_iss_rec_id <= 'T200606224485207'))
    and a.psd_id = b.ltc_iss_rec_id
    and a.psd_serial_no = b.psd_serial_num
    and a.psd_typ_cod = 'ISS'
    and b.lc_expr_dt <= '13-Mar-07'
    and a.psd_serial_no =
    select nvl(max(link_psd_ser_no),'000') from psd_link c,psd_lcs d
    where c.psd_id = d.psd_id
    and c.psd_serial_no = d.psd_serial_num
    and c.link_psd_id = a.psd_id
    and c.link_psd_id >= 'T200203140731163' and c.link_psd_id <= 'T200606224485207'
    and d.update_serial_num = (
    select max(update_serial_num) from psd_lcs e
    where e.psd_id = d.psd_id
    order by a.psd_id
    Explain plan for the query :
    Operation     Object Name     Rows     Bytes     Cost     Object Node     In/Out     PStart     PStop
    SELECT STATEMENT Optimizer Mode=CHOOSE          1           934                     
    SORT ORDER BY          1      96      900                     
    FILTER                                        
    NESTED LOOPS          1      96      898                     
    PARTITION RANGE ALL                                   1     2
    TABLE ACCESS FULL     IWH_OWNER.PSD     61      4 K     837                1     2
    TABLE ACCESS BY GLOBAL INDEX ROWID     IWH_OWNER.LTC_ISS_REC     1      26      1                1     1
    INDEX UNIQUE SCAN     IWH_OWNER.XPKLTC_ISS_REC     1                               
    SORT AGGREGATE          1      112                          
    HASH JOIN          1      112      34                     
    TABLE ACCESS BY GLOBAL INDEX ROWID     IWH_OWNER.PSD_LCS     1      40      2                ROWID     ROW L
    NESTED LOOPS          1      82      5                     
    TABLE ACCESS BY GLOBAL INDEX ROWID     IWH_OWNER.PSD_LINK     1      42      3                ROWID     ROW L
    INDEX RANGE SCAN     IWH_OWNER.XIE1PSD_LINK     1           2                     
    INDEX RANGE SCAN     IWH_OWNER.XIE1PSD_LCS     2           1                     
    VIEW     SYS.VW_SQ_1     134 K     3 M     26                     
    SORT GROUP BY          134 K     4 M     26                     
    INDEX FULL SCAN     IWH_OWNER.XIE1PSD_LCS     217 K     7 M     26

    Read this link.
    When your query takes too long ...
    If you really need help from any of the forum members then you should avoid using the word "urgent" and give more useful information (check the above link what I meant by useful information) rather than simply saying it's very urgent please help me. It's of no use to anybody.
    Regards
    Raj

  • Query Issue(Very Urgent)

    Hi,
         I have issue with select statement to pull the records from two tables. Here I have two tables one is with Billing Document Items and Service Order Operations.
    I have service order as unique field in both tables, When I execute select statement with one service order I got 10 records like
    S Ord Oper                           Billing Document Items
    Oper    Repair Code                 Item    Oper    Repair Code
    10        AD01                           1         10        AD01
    20        AD01                           2         20        AD01  
    30        OT01                           3         10        AD01
    40        RE01                           4         20        AD01
    50        RP01                           5         20        AD01
                                                   6        20         AD01
                                                    7        30         OT01
                                                    8        40         RE01  
                                                    9        50         RP01
                                                   10      50         RP01
                 This are the records with same Service order number, and my select statement giving data like
    O/P
    Service Order =  60001212
    OPER    ITEM    REPAIR TYPE
    10         1           AD01
    20         1           AD01
    10         2           AD01
    20         2           AD01
    10         3           AD01
    20         3           AD01
    10         4           AD01
    20         4           AD01
    10         5           AD01
    20         5           AD01
    10         6           AD01
    20         6           AD01
    30         7           OT01
    40         8           RE01
    50         9           RP01
    50         10         RP01
    But I need output like this
    Item  Oper                   Rep Code
    1      10                      AD01
    2      20                      AD01
    3      10                      AD01
    4      20                      AD01
    5      20                      AD01
    6      20                      AD01
    7      30                      AD01
    8      40                      RE01
    9      50                      RP01
    10    50                      RP01
             Please give me the select statement which gives the above output. I need very urgent please....
    Thanks
    Robbie

    hi robert,
    The ouput u want is just a little away from the one u r actually getting. it is the two fields OPER and ITEM interchangeably..
    U just have to use GROUP BY ITEM..........if u want the desired output with ITEM as first field.
    <group-by-clause> &#8594; GROUP BY [<column-ref>,*]<column-ref>
    if it helps please reward points.
    thanks

  • SQL Query, please help very urgent

    I am a newbie is sql.
    I have two tables called test_master and test_detail.
    Both tables contains pos_id as common field.
    In test_detail got sub_id and to get the people under a given pos_id, I join with pos_id of test_master.
    In the where condition, when I give the pos_id, it's returning only
    the first level. How can I get the second level and get all the levels?
    Any help is highly appreciable.It's very urgent.
    Looking forward to hear from you.
    Thanks
    Newbie

    Ok, I am pasting the description of the master and detail in the order.
    Master
    EMPLOYEE_NO VARCHAR2(30)
    ORGANIZATION_ID NUMBER(15)
    ORGANIZATION_NAME VARCHAR2(240)
    POSITION_ID NUMBER(15)
    POSITION_NAME VARCHAR2(240)
    Detail
    POSITION_ID NUMBER(15)
    SUBORDINATE_ID NUMBER(15)
    ORGANIZATION_ID NUMBER(15)
    POSITION_NAME VARCHAR2(50)
    Here is the sql, I want to get all the subordinates under a given position_id of the master.
    Looking forward to hear from you.
    select a.employee_no,a.POSITION_ID,a.POSITION_NAME,a.EMPLOYEE_NAME,
    b.position_id,b.subordinate_id from portal_employee_master_test a,
    portal_structure_test b
    where a.POSITION_ID = b.POSITION_ID and a.POSITION_ID='xyz'
    and b.position_ID=a.POSITION_ID

  • Very Urgent, files, threads, and swing !!!!

    Dear friends, i have a swing application, in that application i have a class that extends a thread, that thread will do nothing but read the contents of my data file and puts them in an array, but i am getting a NullpointerException in my thread, could any friend help me please, it is very urgent, i will post my code below.
    import java.awt.*;
    import java.awt.event.*;
    import java.text.DateFormat;
    import java.util.*;
    import javax.swing.*;
    import java.sql.*;
    import java.net.URL;
    import java.io.*;
    public class FinalMachine extends JFrame
    private JPanel MainPanel, ThicknessPanel, MainManager,fieldsPanel, sub_panel;
    private Container c;
    private CardLayout CardManager;
    private String timezone;
    private static final int ONE_SECOND = 1000;
    private JLabel welcome_label, label1, label2, label3,field_label;
    private JTextField data_entry;
    private Connection connection;
    public JPanel thick_figure;
    public int num_of_hits, next_index, recCount;
    public int dataBuffer[];
    public FileReader data_file;
    public BufferedReader b_data_file;
    public File tem_file;
    final int num_of_rec = 20;
    public FinalMachine()
    super("PHOENIX MACHINERY s.a.l");
    /* Start all threads */
    /* Start filling data file in global array */
         loadData dataFile = new loadData();
         dataFile.start();          
    /* Adding control to window application */
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent windowevent)
    // setDefaultCloseOperation(0);
              System.exit(0);
    public void windowDeiconified(WindowEvent eve)
    setState(0);
    addComponentListener(new ComponentAdapter() {
    public void componentResized(ComponentEvent componentevent)
    setSize(500, 500);
    Dimension dimension1 = Toolkit.getDefaultToolkit().getScreenSize();
    if(dimension1.width == 800 && dimension1.height == 600)
    setLocation(150, 25);
    else
    if(dimension1.width == 1024 && dimension1.height == 768)
    setLocation(200, 100);
    /* Setting the location of the application on the screen */
    Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
    if(dimension.width == 800 && dimension.height == 600)
    setLocation(150, 25);
    else
    if(dimension.width == 1024 && dimension.height == 768)
    setLocation(200, 100);
    /* Constructing the main menu */
         JMenuBar bar = new JMenuBar();
         setJMenuBar( bar );
         JMenu fileMenu = new JMenu( "File");
         fileMenu.setMnemonic( 'F' );
         JMenuItem mainItem = new JMenuItem( "Main page" );
         mainItem.setMnemonic( 'M' );
         mainItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   CardManager.show(MainManager, "main");
         fileMenu.add( mainItem );
         JMenuItem dataItem = new JMenuItem( "Database page" );
         dataItem.setMnemonic( 'D' );
         dataItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   CardManager.show(MainManager, "data_base");
         fileMenu.add( dataItem );
         JMenuItem printItem = new JMenuItem( "Print" );
         printItem.setMnemonic( 'P' );
         printItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   PrintUtilities.printComponent(MainManager);
         fileMenu.add( printItem );
         JMenuItem exitItem = new JMenuItem( "Exit" );
         exitItem.setMnemonic( 'P' );
         exitItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                        System.exit(0);
         fileMenu.add( exitItem );
         bar.add( fileMenu );
         JMenu figureMenu = new JMenu( "Figures");
         figureMenu.setMnemonic( 'G' );
         JMenuItem thicknessItem = new JMenuItem( "Thickness" );
         thicknessItem.setMnemonic( 'T' );
         thicknessItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   CardManager.show(MainManager, "thickness");
         figureMenu.add( thicknessItem );
         bar.add( figureMenu );
         JMenu helpMenu = new JMenu( "Help");
         helpMenu.setMnemonic( 'H' );
         JMenuItem aboutItem = new JMenuItem( "About us" );
         aboutItem.setMnemonic( 'A' );
         aboutItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   JOptionPane.showMessageDialog(null, "Engineer Bilal Haidar (Computer & "+                     "Communication Engineering)\n\n All Rights Reserevd. @ 2002",
                        "About me...", JOptionPane.PLAIN_MESSAGE);
         helpMenu.add( aboutItem );
         bar.add( helpMenu );
    /* Intializing global values */
    dataBuffer = new int[60];
    /* Initializing the panels */
    c = getContentPane();
    c.setLayout(new FlowLayout());
    CardManager = new CardLayout();
    MainManager = new JPanel(false);
    MainManager.setLayout(CardManager);
    c.add(MainManager);
    javax.swing.border.Border border = BorderFactory.createEmptyBorder(10, 10, 5, 10);
    MainPanel = new JPanel(false);
    MainPanel.setLayout(new BoxLayout(MainPanel, 1));
    MainPanel.setBorder(border);
    ThicknessPanel = new JPanel(false);
    ThicknessPanel.setLayout(new BoxLayout(ThicknessPanel, 1));
    ThicknessPanel.setBorder(border);
    fieldsPanel = new JPanel(false);
    fieldsPanel.setLayout( new BoxLayout( fieldsPanel,1));
    fieldsPanel.setBorder(border);
    sub_panel = new JPanel(false);
    sub_panel.setLayout( new BoxLayout(sub_panel,0) );
    sub_panel.setBorder(border);
    thick_figure = new JPanel(false);
    thick_figure.setBorder(border);
    /* Filling the main panel */
    JLabel jlmain = new JLabel("Main Page");
    MainPanel.add(jlmain);
    timezone = showTime(new Locale("en", "US"));
    JLabel jltime = new JLabel(" " + timezone);
    MainPanel.add(jltime);
    MainManager.add(MainPanel, "main");
    /* Filling the thickness panel */
    num_of_hits = 0;
    next_index = 0;
    /* fill in with ero values for everything*/
    /*display the figure*/
    ThicknessPanel.add(thick_figure);
    JLabel blanklabel = new JLabel(" ");
    ThicknessPanel.add(blanklabel);
    JButton build_fig = new JButton("Draw Figure");
    build_fig.addActionListener(
         new ActionListener() {  // anonymous inner class
         public void actionPerformed( ActionEvent e )
    if ( num_of_hits == 0 )
    /* draw figure based on first 20 points in the array */
    next_index = num_of_rec;
    else
    if ( num_of_hits > 3 )
    JOptionPane.showMessageDialog(null,"No more data to draw","Error Drawing",JOptionPane.ERROR_MESSAGE);
    else
    /* draw the figure starting the data from index 20*/
    next_index = next_index + num_of_rec;
    num_of_hits += 1;
    ThicknessPanel.add(build_fig);
    MainManager.add(ThicknessPanel, "thickness");
    /* filling the database panel */
    label1 = new JLabel(" ",SwingConstants.CENTER);
    welcome_label = new JLabel(" Database Page ",SwingConstants.CENTER);
    label2 = new JLabel(" ",SwingConstants.CENTER);
    fieldsPanel.add( label1 );
    fieldsPanel.add( welcome_label );
    fieldsPanel.add( label2 );
    field_label = new JLabel(" Enter your name: ");
    data_entry = new JTextField( 10 );
    sub_panel.add( field_label );
    sub_panel.add( data_entry );
    fieldsPanel.add( sub_panel );
    JButton add_data = new JButton( "Add me" );
    add_data.addActionListener(
         new ActionListener() {  // anonymous inner class
         public void actionPerformed( ActionEvent e )
    // try {
    //          url = "jdbc:odbc:DataEntry";
    //          Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
    //          connection = DriverManager.getConnection( url );
    //               System.out.println( "Connection Suucessfull");
    // Statement statement = connection.createStatement();
    //                String get_field;
    //               get_field = data_entry.getText();
    //               String query = "INSERT INTO data (anyField) VALUES ('get_field')";
    //                int result1 = statement.executeUpdate( query );
    //           if ( result1 == 1 )
    // JOptionPane.showMessageDialog(null, "Thanks for the info..."," Data Entry Success",JOptionPane.INFORMATION_MESSAGE);
    //                else
    //                     JOptionPane.showMessageDialog(null, "Sorry, your name was not added...","Data entry error",JOptionPane.ERROR_MESSAGE);
    //     catch ( ClassNotFoundException cnfex ) {
    //          // process ClassNotFoundExceptions here
    //          cnfex.printStackTrace();
    //               System.out.println( "Connection UN Suucessfull");
    //          catch ( SQLException sqlex ) {
    //     // process SQLExceptions here
    //          sqlex.printStackTrace();
    //                System.out.println( "Connection UN Suucessfull");
    //          catch ( Exception ex ) {
    //          // process remaining Exceptions here
    //          ex.printStackTrace();
    //               System.out.println( "Connection UN Suucessfull");
    fieldsPanel.add(add_data);
    MainManager.add(fieldsPanel, "data_base");
    /* display time */
    Timer timer = new Timer(1000, new ActionListener() {
    public void actionPerformed(ActionEvent actionevent)
    timezone = showTime(new Locale("en", "US"));
    setTitle("PHOENIX MACHINERY s.a.l " + timezone);
    timer.start();
    public static void main(String args[])
    FinalMachine finalmachine = new FinalMachine();
    finalmachine.setSize(500, 500);
    ImageIcon imageicon = new ImageIcon("images/pc.gif");
    finalmachine.setIconImage(imageicon.getImage());
    finalmachine.show();
    public static String showTime(Locale locale)
    java.util.Date date = new java.util.Date();
    byte byte0 = 2;
    DateFormat dateformat = DateFormat.getTimeInstance(byte0, locale);
    String s = dateformat.format(date);
    return s;
    /* Thread loadData starts here */
    class loadData extends Thread
    public void run()
    try {
              readMyFile();
    catch( Exception x )
    System.out.println("The following error occured in LoadData thread : "+x.toString() ); }
    } // run() ends here
    /* method read file inside thread loadData */
    void readMyFile() {
    String record = " ";
    recCount = 0;
    try {
              tem_file = new File("mydata.dat");
              data_file = new FileReader(tem_file);
              b_data_file = new BufferedReader( data_file );
              record = new String();
              while ( (record = b_data_file.readLine()) != null ) {
              dataBuffer[recCount] = Integer.parseInt(record);
              recCount += 1; }
         b_data_file.close();     
              catch (IOException e) {
         System.out.println("Uh oh, got an IOException error!");
         e.printStackTrace();
         } // end of readMyFile()
    } // thread loadData ends
    mydata.dat
    2
    4
    3
    1
    2
    3
    5
    2
    4
    1
    6
    3
    2
    5
    4
    1
    2
    5
    8
    2
    6
    9
    7
    4
    2
    1
    0
    2
    5
    4
    8
    7
    5
    6
    3
    2
    1
    4
    3
    0
    2
    3
    6
    5
    2
    1
    4
    5
    6
    9
    8
    5
    2
    1
    6
    8
    3
    1
    7
    5

    Thank you Mr. jobuck, you helped me a lot, i wonder if you can provide me with a tutorial on how threads work and how runnables work too. i fixed the error ut old me about but still when i try to add another thread to my program i got an error saying that, i must decalre the new thread in a seperate file please can u have a look on what i have:
    import java.awt.*;
    import java.awt.event.*;
    import java.text.DateFormat;
    import java.util.*;
    import javax.swing.*;
    import java.sql.*;
    import java.net.URL;
    import java.io.*;
    public class FinalMachine extends JFrame
    private JPanel MainPanel, ThicknessPanel, MainManager,fieldsPanel, sub_panel;
    private Container c;
    private CardLayout CardManager;
    private String timezone;
    private static final int ONE_SECOND = 1000;
    private JLabel welcome_label, label1, label2, label3,field_label;
    private JTextField data_entry;
    private JPanel thick_figure;
    private int num_of_hits, next_index, recCount, read_flag;
    private int dataBuffer[];
    private FileReader data_file;
    private BufferedReader b_data_file;
    private File tem_file;
    private Connection connection;     
    final int num_of_rec = 20;
    public FinalMachine()
    super("PHOENIX MACHINERY s.a.l");
    /* load JDBC drivers */
    try {
    String url = "jdbc:odbc:DataEntry";
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
         connection = DriverManager.getConnection( url );
         System.out.println( "Connection Suucessfull");
    catch ( ClassNotFoundException cnfex ) {
    // process ClassNotFoundExceptions here
    cnfex.printStackTrace();
         System.out.println( "Connection UN Suucessfull");
    catch ( SQLException sqlex ) {
    // process SQLExceptions here
    sqlex.printStackTrace();
         System.out.println( "Connection UN Suucessfull");
    catch ( Exception ex ) {
    // process remaining Exceptions here
    ex.printStackTrace();
         System.out.println( "Connection UN Suucessfull");
    /* Intializing global values */
    dataBuffer = new int[60];
    /* Start all threads */
    /* Start filling data file in global array */
         loadData dataFile = new loadData();
         dataFile.start();          
         setData setdata = new setData();
         setdata.start();          
    /* Adding control to window application */
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent windowevent)
    // setDefaultCloseOperation(0);
              System.exit(0);
    public void windowDeiconified(WindowEvent eve)
    setState(0);
    addComponentListener(new ComponentAdapter() {
    public void componentResized(ComponentEvent componentevent)
    setSize(500, 500);
    Dimension dimension1 = Toolkit.getDefaultToolkit().getScreenSize();
    if(dimension1.width == 800 && dimension1.height == 600)
    setLocation(150, 25);
    else
    if(dimension1.width == 1024 && dimension1.height == 768)
    setLocation(200, 100);
    /* Setting the location of the application on the screen */
    Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
    if(dimension.width == 800 && dimension.height == 600)
    setLocation(150, 25);
    else
    if(dimension.width == 1024 && dimension.height == 768)
    setLocation(200, 100);
    /* Constructing the main menu */
         JMenuBar bar = new JMenuBar();
         setJMenuBar( bar );
         JMenu fileMenu = new JMenu( "File");
         fileMenu.setMnemonic( 'F' );
         JMenuItem mainItem = new JMenuItem( "Main page" );
         mainItem.setMnemonic( 'M' );
         mainItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   CardManager.show(MainManager, "main");
         fileMenu.add( mainItem );
         JMenuItem dataItem = new JMenuItem( "Database page" );
         dataItem.setMnemonic( 'D' );
         dataItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   CardManager.show(MainManager, "data_base");
         fileMenu.add( dataItem );
         JMenuItem printItem = new JMenuItem( "Print" );
         printItem.setMnemonic( 'P' );
         printItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   PrintUtilities.printComponent(MainManager);
         fileMenu.add( printItem );
         JMenuItem exitItem = new JMenuItem( "Exit" );
         exitItem.setMnemonic( 'P' );
         exitItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                        System.exit(0);
         fileMenu.add( exitItem );
         bar.add( fileMenu );
         JMenu figureMenu = new JMenu( "Figures");
         figureMenu.setMnemonic( 'G' );
         JMenuItem thicknessItem = new JMenuItem( "Thickness" );
         thicknessItem.setMnemonic( 'T' );
         thicknessItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   CardManager.show(MainManager, "thickness");
         figureMenu.add( thicknessItem );
         bar.add( figureMenu );
         JMenu helpMenu = new JMenu( "Help");
         helpMenu.setMnemonic( 'H' );
         JMenuItem aboutItem = new JMenuItem( "About us" );
         aboutItem.setMnemonic( 'A' );
         aboutItem.addActionListener (
              new ActionListener() {
                   public void actionPerformed( ActionEvent e )
                   JOptionPane.showMessageDialog(null, "Engineer Bilal Haidar (Computer & "+                     "Communication Engineering)\n\n All Rights Reserevd. @ 2002",
                        "About me...", JOptionPane.PLAIN_MESSAGE);
         helpMenu.add( aboutItem );
         bar.add( helpMenu );
    /* Initializing the panels */
    c = getContentPane();
    c.setLayout(new FlowLayout());
    CardManager = new CardLayout();
    MainManager = new JPanel(false);
    MainManager.setLayout(CardManager);
    c.add(MainManager);
    javax.swing.border.Border border = BorderFactory.createEmptyBorder(10, 10, 5, 10);
    MainPanel = new JPanel(false);
    MainPanel.setLayout(new BoxLayout(MainPanel, 1));
    MainPanel.setBorder(border);
    ThicknessPanel = new JPanel(false);
    ThicknessPanel.setLayout(new BoxLayout(ThicknessPanel, 1));
    ThicknessPanel.setBorder(border);
    fieldsPanel = new JPanel(false);
    fieldsPanel.setLayout( new BoxLayout( fieldsPanel,1));
    fieldsPanel.setBorder(border);
    sub_panel = new JPanel(false);
    sub_panel.setLayout( new BoxLayout(sub_panel,0) );
    sub_panel.setBorder(border);
    thick_figure = new JPanel(false);
    thick_figure.setBorder(border);
    /* Filling the main panel */
    JLabel jlmain = new JLabel("Main Page");
    MainPanel.add(jlmain);
    timezone = showTime(new Locale("en", "US"));
    JLabel jltime = new JLabel(" " + timezone);
    MainPanel.add(jltime);
    MainManager.add(MainPanel, "main");
    /* Filling the thickness panel */
    num_of_hits = 0;
    next_index = 0;
    /* fill in with ero values for everything*/
    /*display the figure*/
    ThicknessPanel.add(thick_figure);
    JLabel blanklabel = new JLabel(" ");
    ThicknessPanel.add(blanklabel);
    JButton build_fig = new JButton("Draw Figure");
    build_fig.addActionListener(
         new ActionListener() {  // anonymous inner class
         public void actionPerformed( ActionEvent e )
    if ( num_of_hits == 0 )
    /* draw figure based on first 20 points in the array */
    next_index = num_of_rec;
    else
    if ( num_of_hits > 3 )
    JOptionPane.showMessageDialog(null,"No more data to draw","Error Drawing",JOptionPane.ERROR_MESSAGE);
    else
    /* draw the figure starting the data from index 20*/
    next_index = next_index + num_of_rec;
    num_of_hits += 1;
    ThicknessPanel.add(build_fig);
    MainManager.add(ThicknessPanel, "thickness");
    /* filling the database panel */
    label1 = new JLabel(" ",SwingConstants.CENTER);
    welcome_label = new JLabel(" Database Page ",SwingConstants.CENTER);
    label2 = new JLabel(" ",SwingConstants.CENTER);
    fieldsPanel.add( label1 );
    fieldsPanel.add( welcome_label );
    fieldsPanel.add( label2 );
    field_label = new JLabel(" Enter your name: ");
    data_entry = new JTextField( 10 );
    sub_panel.add( field_label );
    sub_panel.add( data_entry );
    fieldsPanel.add( sub_panel );
    JButton add_data = new JButton( "Add me" );
    add_data.addActionListener(
         new ActionListener() {  // anonymous inner class
         public void actionPerformed( ActionEvent e )
              try {
    Statement statement = connection.createStatement();
                   String get_field;
              get_field = data_entry.getText();
              String query = "INSERT INTO data (anyField) VALUES ('"+get_field+"')";
              int result1 = statement.executeUpdate( query );
              if ( result1 == 1 )
              JOptionPane.showMessageDialog(null, "Thanks for the info..."," Data Entry Success",JOptionPane.INFORMATION_MESSAGE);
                        data_entry.setText(" ");     
              else
                        JOptionPane.showMessageDialog(null, "Sorry, your name was not added...","Data entry error",JOptionPane.ERROR_MESSAGE);
         catch ( SQLException sqlex ) {
         // process SQLExceptions here
              sqlex.printStackTrace();
                   System.out.println( "Connection UN Suucessfull");
              catch ( Exception ex ) {
              // process remaining Exceptions here
              ex.printStackTrace();
                   System.out.println( "Connection UN Suucessfull");
    fieldsPanel.add(add_data);
    MainManager.add(fieldsPanel, "data_base");
    /* display time */
    Timer timer = new Timer(1000, new ActionListener() {
    public void actionPerformed(ActionEvent actionevent)
    timezone = showTime(new Locale("en", "US"));
    setTitle("PHOENIX MACHINERY s.a.l " + timezone);
    timer.start();
    public static void main(String args[])
    FinalMachine finalmachine = new FinalMachine();
    finalmachine.setSize(500, 500);
    ImageIcon imageicon = new ImageIcon("images/pc.gif");
    finalmachine.setIconImage(imageicon.getImage());
    finalmachine.show();
    public static String showTime(Locale locale)
    java.util.Date date = new java.util.Date();
    byte byte0 = 2;
    DateFormat dateformat = DateFormat.getTimeInstance(byte0, locale);
    String s = dateformat.format(date);
    return s;
    /* Thread loadData starts here */
    public class loadData extends Thread
    public void run()
    try {
              readMyFile();
              read_flag = 1;
              notify();
    catch( Exception x )
    System.out.println("The following error occured in LoadData thread : "+x.toString() );
    } // run() ends here
    /* method read file inside thread loadData */
    void readMyFile() {
    String record = " ";
    recCount = 0;
    try {
              tem_file = new File("mydata.dat");
              data_file = new FileReader(tem_file);
              b_data_file = new BufferedReader( data_file );
              record = new String();
              while ( (record = b_data_file.readLine()) != null ) {
              dataBuffer[recCount] = Integer.parseInt(record);
              recCount += 1; }
         b_data_file.close();     
              catch (IOException e) {
         System.out.println("Uh oh, got an IOException error!");
         e.printStackTrace();
         } // end of readMyFile()
    } // thread loadData ends
    public class setData extends Thread {
    public void run()
    try {
              while ( !read_flag ) {
                   try {     wait(); }
                   catch( InterruptedException e ) {
                        e.printStackTrace();
              } // end while
              for(int index = 0; index < 60; index++)
              System.out.println("Array["+index+"] = "+dataBuffer[index]);
    catch( Exception x )
    System.out.println("The following error occured in LoadData thread : "+x.toString() );
    } // run() ends here
    the only added thing is the setData thread, i want this thread to start printing out the array whenever, loadData thread has finished filling the data inside the array please i need ur help.

  • Error while opening a module. plz help me, very urgent.

    when i try to open a module, the following error message appears on my screen.
              " no j2ee component found in d:\krisp\programs\servlets".
              i've installed bea in c: drive and my servlet program is in d: drive.
              plz help me, it's very urgent.

    Can you provide some more information? What were you doing when this happened?
              Can you post the entire error message?
              -- Rob
              WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • Error during GR(very very urgent)

    Hi all,
    i am using a developed program for GR.i used this program before.there was no error.but now i am facing error like
    <b>PO ordered quqntity exceeded by 18,000 EA.</b>.i am using <b>BAPI_GOODSMVT_CREATE</b> for goods transfer.
    In the selection screen, i am putting
    PO number- PO1
    material number- MAT
    GR quantity- 18,000
    delivery order-111
    i want to receive the material MAT of quantity 18,000 from that PO.initially i have ordered PO quntity as 1 lakh. Till now i have received 42,000 materials,now i try to receive 18,000 materials.but it is showing this type of error.
    This error is fired from the return parameter of that BAPI only.error having message class-M7 & error no-022
    is comming.
    i am giving my coding below.plz suggest where is the problem.it is very very urgent.recently my company has added some patches to update the SAP.is this the cause for that error.plz suggest.
    any idea will be highly appreaciated.
    Regards
    REPORT zmui001
           LINE-SIZE 140
           LINE-COUNT 65
           NO STANDARD PAGE HEADING.
    *-- DATA DECLARATION--
    *-- tables
    TABLES : ekpo,
                ekbe,
             marv.
    *--Includes
    INCLUDE : <icon>.                   " Include for Icons
    *-- Types
    TYPES : BEGIN OF t_mseg,
              ebeln LIKE ekko-ebeln,
              name1 LIKE lfa1-name1,
              lifnr LIKE lfa1-lifnr,
              eknam LIKE t024-eknam,
              mblnr LIKE mkpf-mblnr,
              matnr LIKE ekpo-matnr,
              maktx LIKE makt-maktx,
              lgort LIKE mseg-lgort,
              charg LIKE mseg-charg, "chg: 10/17/2005
              menge LIKE mseg-menge,
              budat LIKE mkpf-budat,
              bldat LIKE mkpf-bldat, " chg : 08/18/2003
              xblnr LIKE mkpf-xblnr,
              END OF t_mseg.
    DATA:  BEGIN OF t_ekbe,
              ebeln LIKE ekbe-ebeln,
              ebelp LIKE ekbe-ebelp,
              bwart LIKE ekbe-bwart,
              matnr LIKE ekbe-matnr,
              menge LIKE ekbe-menge,
              END OF t_ekbe,
              BEGIN OF t_ekpo,
              ebeln LIKE ekpo-ebeln,
              ebelp LIKE ekpo-ebelp,
              matnr LIKE ekpo-matnr,
              menge LIKE ekpo-menge,
              END OF t_ekpo.
    TYPES : BEGIN OF t_options.
            INCLUDE STRUCTURE itcpo.
    TYPES : END OF t_options.
    *--Internal tables
    DATA: BEGIN OF i_item OCCURS 50.    "Create Material Document Item
            INCLUDE STRUCTURE bapi2017_gm_item_create.
    DATA: END OF i_item .
    DATA: BEGIN OF i_return OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF i_return.
    DATA: BEGIN OF i_part OCCURS 0,     " Internal table for split data
            part(20),
          END OF i_part.
    DATA: BEGIN OF i_return1 OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE bapiret1.
    DATA: END OF i_return1.
    *-- Work areas
    DATA: BEGIN OF wa_header .       "Material Document Header Data
            INCLUDE STRUCTURE bapi2017_gm_head_01.
    DATA: END OF wa_header .
    DATA: BEGIN OF wa_return .       "Output Structure
            INCLUDE STRUCTURE bapi2017_gm_head_ret.
    DATA: END OF wa_return .
    *-- Work areas
    DATA: wa_mseg TYPE t_mseg,
             wa_ekbe LIKE t_ekbe,
             wa_ekpo  LIKE t_ekpo,
          wa_options TYPE t_options,
           i_ekbe LIKE STANDARD TABLE OF  t_ekbe,
            i_ekbe2 LIKE STANDARD TABLE OF  t_ekbe,
           i_ekpo  LIKE STANDARD TABLE OF  t_ekpo.
    *---Variables
    DATA: v_first,         " variable to get first digit
          v_set TYPE c,
          v_found TYPE p,
          v_menge TYPE p,
          v_ebeln LIKE ekko-ebeln,
          v_lifnr LIKE ekko-lifnr,
          v_belnr LIKE ekbe-belnr,
          v_postdate LIKE mkpf-budat,
          v_bukrs LIKE marv-bukrs,
          v_datum LIKE sy-datum,
          v_lgort LIKE mard-lgort,   " Stge. location
          v_bwart LIKE mseg-bwart,   " Movement type
          v_infnr LIKE eina-infnr,   " Info record no.
          v_ltsnr LIKE eina-ltsnr.
    *---Constants
    CONSTANTS: c_comma TYPE c VALUE ',',   " For splitting data at commas
               c_01(2) TYPE c VALUE '01',  " For movement code in Bapi
               c_b     TYPE c VALUE 'B',   " For mvt. Indicator in Bapi
               c_save(4) TYPE c VALUE 'SAVE', " For button text
               c_clear(5) TYPE c VALUE 'CLEAR', " For clear button
               c_mvmt(4) TYPE c VALUE 'MVMT',
               c_ok(2)   TYPE c VALUE 'OK',
               c_error(5) TYPE c VALUE 'Error'.
    *--SELECTION SCREEN DESIGN--
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
    PARAMETERS:     p_bar(75) ,  " Scanned data from barcode
                p_ebeln LIKE ekko-ebeln, " PO number
                p_matnr LIKE ekpo-matnr, " Material number
                p_menge LIKE ekpo-menge, " Quantity
               p_lifnr LIKE ekko-lifnr, " Vendor code
                p_frbnr LIKE mkpf-frbnr, " Reference doc for goods mvt
                p_status(5) TYPE c.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN PUSHBUTTON 15(10) v_save USER-COMMAND mvmt.
    SELECTION-SCREEN PUSHBUTTON 40(10) v_clear USER-COMMAND clear.
      INITIALIZATION -
    INITIALIZATION.
      v_save = c_save .
      v_clear = c_clear.
    *--AT SELECTION_SCREEN--
    AT SELECTION-SCREEN .
      IF sy-ucomm = c_clear.
        PERFORM f_clear.
      ELSE.
        IF sy-ucomm <> c_mvmt.
           if not  sy-tabix is initial and  sy-ucomm <> c_mvmt.
    *--- Extracting the data by splitting the scanned values.
          PERFORM f_get_split_data.
    *--- Validating the input data.
          PERFORM f_check_inputs.
        ELSE .
    *--- Validating the input data.
          PERFORM f_check_inputs.
    *-- Determining the posting date and period check.
          PERFORM f_get_posting_date.
    *---Post goods movement
          PERFORM f_post_receipt.
        ENDIF.
      ENDIF.
               SUBROUTINES                                               *
    *&      Form  f_check_inputs
        Validating the input parameters
    FORM f_check_inputs.
    *-- Validating material no.
      SELECT SINGLE matnr INTO p_matnr
        FROM mara
          WHERE matnr = p_matnr.
      IF sy-subrc = 4.
        p_status =  c_error.
        MESSAGE e003(zm) WITH 'Material no.'.
      ENDIF.
    *-- Validating JHT reference no.
      SELECT SINGLE ebeln
                    lifnr
                    bukrs
                    INTO (p_ebeln, v_lifnr , v_bukrs)
                    FROM ekko
            where unsez = p_unsez. chg:07072003
              WHERE ebeln = p_ebeln.
      IF sy-subrc = 4.
        p_status =  c_error.
        MESSAGE e003(zm) WITH 'Purchase order no.'.
      ENDIF.
    *-- Validating material po combination
      SELECT SINGLE *
           FROM ekpo
             WHERE ebeln = p_ebeln
               AND matnr = p_matnr.
      IF sy-subrc = 4.
        p_status =  c_error.
        MESSAGE e003(zm) WITH 'Purchase order no.' ' and Material no.'.
      ENDIF.
    *--- Checking for DO entry . (chng : 30/06/2003)
      IF  p_frbnr IS INITIAL.
        MESSAGE e018(m7) WITH 'Delivery no.'.
        p_status =  c_error.
        PERFORM f_clear.
      ENDIF.
    *-- Validating material po do combination
      SELECT SINGLE a~belnr
                    INTO v_belnr
                    FROM ekbe AS a
                      INNER JOIN mkpf AS b
                       ON   abelnr = bmblnr
                       AND agjahr = bmjahr
                      WHERE a~ebeln = ekpo-ebeln
                        AND  a~ebelp = ekpo-ebelp
                        AND  b~xblnr = p_frbnr.
      IF sy-subrc = 0.
        MESSAGE e019(zm) WITH v_belnr.
        p_status = c_error.
        PERFORM f_clear.
      ENDIF.
      p_status =  c_ok.
    ENDFORM.                    " f_check_inputs
    *&      Form  f_get_split_data
       Extracting the data by splitting the Scanned data
    FORM f_get_split_data.
    *-- Splitting the data at commas
      SPLIT p_bar AT c_comma INTO TABLE i_part.
    *-- Assigning the parts to variables.
      LOOP AT i_part.
        v_first = i_part-part+0(1).
        TRANSLATE  v_first TO UPPER CASE.
        CASE v_first .
         WHEN 'V'.
           p_lifnr =  i_part-part+1(10).
          WHEN 'P'.
            p_matnr = i_part-part+1(18).
          WHEN 'Q'.
            p_menge = i_part-part+1(13).
          WHEN 'K'.
            p_ebeln = i_part-part+1(10).
          WHEN 'D'.
            p_frbnr = i_part-part+2(16).
          WHEN OTHERS.
            CONTINUE.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    " f_get_split_data
    *&      Form  f_get_posting_date
    Determing the posting date for document
    FORM f_get_posting_date.
    *-- get the current period for todays date.
      DATA: l_period LIKE t009b-poper.
      CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
        EXPORTING
          i_date               = sy-datum
          i_periv              = 'K4'
       IMPORTING
         e_buper               = l_period
      E_GJAHR              =
       EXCEPTIONS
         input_false          = 1
         t009_notfound        = 2
         t009b_notfound       = 3
         OTHERS               = 4
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    *-- Determining whether the open period
      SELECT SINGLE *
                    FROM marv
                    WHERE bukrs = v_bukrs.
      IF sy-subrc = 0.
        IF l_period = marv-lfmon .
          v_postdate = sy-datum.
        ELSE.
          CALL FUNCTION 'BAPI_CCODE_GET_FIRSTDAY_PERIOD'
               EXPORTING
                    companycodeid       = v_bukrs
                    fiscal_period       = marv-lfmon
                    fiscal_year         = marv-lfgja
               IMPORTING
                    first_day_of_period = v_postdate
                    return              = i_return1.
          IF NOT i_return[] IS INITIAL.
            LOOP AT i_return1.
              MESSAGE i016(zm) WITH i_return-message.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " f_get_posting_date
    *&      Form  f_post_receipt
    Post the goods receipt for entered data.
    FORM f_post_receipt.
      PERFORM f_fill_item.
      PERFORM f_fill_header.
      PERFORM f_execute_transfer.
      PERFORM f_clear.
    ENDFORM.                    " f_post_receipt
    *&      Form  f_fill_item
      Updating the item data for the GR
    FORM f_fill_item.
    Checking for IQC cycle is done here.(chng : 23/07/2003)
      PERFORM f_check_iqc.
    *---- Assigning movement type as per IQC cycle.(chng : 23/07/2003)
      IF v_lgort IS INITIAL.
        MOVE '101'   TO i_item-move_type.
        SELECT SINGLE lgort INTO i_item-stge_loc
        FROM ekpo
         where ebeln  = v_ebeln and  " chg :07/07/2003
           WHERE ebeln  = p_ebeln AND
               matnr = p_matnr .
      ELSE.
        MOVE v_lgort TO i_item-stge_loc.
        MOVE v_bwart TO i_item-move_type.
      ENDIF.
      MOVE p_matnr TO i_item-material.
      MOVE p_menge TO i_item-entry_qnt.
    move v_ebeln to i_item-po_number. " 07/07/2003
      MOVE p_ebeln TO i_item-po_number.
      MOVE v_lifnr TO i_item-vendor.
      MOVE c_b TO i_item-mvt_ind.
    select single ebelp into i_item-po_item " chg :29/07/2003
       from ekpo
          where ebeln  = p_ebeln
            and   matnr = p_matnr
           and elikz = ''.
      SELECT ebeln
                ebelp
                matnr
                menge
                INTO CORRESPONDING FIELDS OF TABLE i_ekpo
                FROM ekpo
                WHERE ebeln = p_ebeln
                   AND matnr = p_matnr
                   AND loekz = '' .
      SORT i_ekpo BY ebeln ebelp matnr.
      LOOP AT i_ekpo INTO wa_ekpo.
        IF v_found = 0.
          SELECT ebeln  ebelp
                bwart  menge
                INTO CORRESPONDING FIELDS OF TABLE i_ekbe
                FROM ekbe
                WHERE ebeln = p_ebeln
                AND ebelp = wa_ekpo-ebelp
                AND matnr = p_matnr.
                          and elikz = '' .  CHG -- 03/19/2004
          IF sy-subrc = 0.
            LOOP AT i_ekbe INTO wa_ekbe .
              IF wa_ekbe-bwart = '101'.
                v_menge = v_menge + wa_ekbe-menge.
              ENDIF.
              IF wa_ekbe-bwart = '102'.
                v_menge = v_menge - wa_ekbe-menge.
              ENDIF.
              IF wa_ekbe-bwart = '122'.
                v_menge = v_menge - wa_ekbe-menge.
              ENDIF.
            ENDLOOP.
    chng: 03/19/2004 compare po qty against receipt
            v_menge = v_menge + p_menge .
            IF wa_ekpo-menge >= v_menge .
              v_found = 1.
              MOVE wa_ekpo-ebelp TO i_item-po_item.
            ENDIF.
          ELSE .
            v_found = 1.
            MOVE wa_ekpo-ebelp TO i_item-po_item.
          ENDIF.
        ENDIF.
        CLEAR : wa_ekbe, i_ekbe, v_menge.
      ENDLOOP.
      IF v_found = 0 .
        MESSAGE e003(zm) WITH ' delivery items'.
      ENDIF.
      APPEND i_item.
      CLEAR : i_item, v_found .
    ENDFORM.                    " f_fill_item
    *&      Form  f_check_iqc
    Checking the storage location for the (chng : 23/07/2003)
    FORM f_check_iqc.
      CALL FUNCTION 'Z_M_GET_IQC_STATUS'
           EXPORTING
                matnr          = p_matnr
                lifnr          = v_lifnr
           IMPORTING
                lgort          = v_lgort
                bwart          = v_bwart
                ltsnr          = v_ltsnr
                infnr          = v_infnr
           EXCEPTIONS
                non_iqc_vendor = 1
                OTHERS         = 2.
      IF sy-subrc <> 0.
        CLEAR : v_lgort , v_bwart , v_ltsnr.
      ENDIF.
    ENDFORM.                    " f_check_iqc
    *&      Form  f_fill_header
      Updating data in the header
    FORM f_fill_header.
      MOVE v_postdate TO wa_header-pstng_date.
      MOVE sy-datum TO wa_header-doc_date.
      MOVE p_frbnr TO wa_header-ref_doc_no.
    ENDFORM.                    " f_fill_header
    *&      Form  f_execute_transfer
          Executing the goods movement.
    FORM f_execute_transfer.
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
           EXPORTING
                goodsmvt_header  = wa_header
                goodsmvt_code    = c_01
           IMPORTING
                goodsmvt_headret = wa_return
           TABLES
                goodsmvt_item    = i_item
                return           = i_return.
      IF i_return[] IS INITIAL .
        COMMIT WORK.
    *---  UPdating Info record for IQC cycle ind.(chng : 23/07/2003)
        IF NOT v_ltsnr IS INITIAL.
          UPDATE eina SET ltsnr = v_ltsnr
          WHERE infnr = v_infnr.
        ENDIF.
        REFRESH : i_item.
        CLEAR : wa_header,v_ltsnr , v_infnr,v_bwart,v_lifnr.
        MESSAGE i012(migo) WITH wa_return-mat_doc.
        PERFORM f_do_print.
      ELSE.
        REFRESH : i_item.
        CLEAR : wa_header,v_ltsnr , v_infnr,v_bwart,v_lifnr.
        PERFORM write_errors.
      ENDIF.
    ENDFORM.                    " f_execute_transfer
    FORM write_errors.
      WRITE: 0(90) sy-uline ,
             /0'|',
              3 'System messages for GR posting',
              90 '|',
             /0(90) sy-uline .
      LOOP AT i_return.
        CASE  i_return-type.
          WHEN 'E'.
            MESSAGE i016(zm) WITH i_return-message.
          WHEN 'W'.
            MESSAGE i017(zm) WITH i_return-message.
          WHEN 'I'.
           WRITE: /0'|',
                  icon_yellow_light AS ICON ,
                  '|',
                  10 i_return-message,
                  90 '|'.
            MESSAGE i018(zm) WITH i_return-message.
          WHEN 'S'.
           WRITE: /0'|',
                  icon_green_light AS ICON ,
                  '|',
                  10 i_return-message,
                  90 '|'.
            MESSAGE i018(zm) WITH i_return-message.
          WHEN OTHERS.
           WRITE: /0'|',
                  icon_red_light AS ICON ,
                  '|',
                  10 i_return-message,
                  90 '|'.
            MESSAGE e016(zm) WITH i_return-message.
        ENDCASE.
       AT LAST .
         WRITE:/0(90) sy-uline .
       ENDAT.
      ENDLOOP.
    ENDFORM.                    " write_errors
    *&      Form  f_clear
    Clearing the input parameters
    FORM f_clear.
      CLEAR : p_ebeln ,
              p_bar,
              p_matnr,
              p_frbnr,
              v_lifnr,
              p_menge,
              p_status.

    Hi all,
    can anyone suggest any idea?
    Regrds
    pabitra

Maybe you are looking for