Bezei select query in smartform

Hi all ,
i need to pick bezei from v_tonc and the logic given is like this
"Access table LIKP with VBELN and get INCO1 then
access table v_TINC with LIKP-INCO1 and get BEZEI"
and wrote the query
if wa_likp-inco1 is not initial.
select single bezei from v_tinc into wa_v_tinc
                                where inco1 = wa_likp-inco1.
its throughing error as Global Definitions :     Field " BEZEI" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement . . . . . . . . . .
I defined it but still....................
please answer

Hi,
i guess the select single query is wrong:
it suppose to be either of the below 2:
1st Method:
data : wa_v_tinc TYPE v_tinc.
*select single * from v_tinc into wa_v_tinc*
where inco1 = wa_likp-inco1.
OR
2nd Method:
data : gv_bezei TYPE v_tinc-bezei.
select single bezei from v_tinc into gv_bezei
where inco1 = wa_likp-inco1.
U should either get all the columns of V_TINC into a Work Area/Structure (wa_v_tinc) like 1st method or get the single column value (BEZEI) into gv_bezei (global variable) from V_TINC like 2nd method...
but its not possible to get a single column into a structure like:
data : wa_v_tinc TYPE v_tinc.
select *single * from v_tinc into wa_v_tinc*
where inco1 = wa_likp-inco1
Hope it helps!!
Rgds,
Pavan

Similar Messages

  • Select query in smartforms

    hi everyone,
    iam new to smartforms and have a  query regarding select st  in smartforms,
    i have created a table in the main window, in that i have 7 cols,in which the 5th and 6th cols are Quantity(VBRP-FKIMG) and Condition Value (KONV-KWERT) respectively.Now i want the product of these 5th and 6th cols and want the result to be displayed in 7th col. How can i do this and where i have to write the code?
    if i want more than 1 row then how can i use the loop for this.
    i have written the code to display the 1st  6 cols in the program lines of main window,,,but iam unable to  write the code for the product of FKIMG and KWERT.
    Plz help me if anyone knows the answer,,its urgent
    <b>Points will be rewarded</b>,
    u can also mail the answer to this id [email protected]
    thnx in adv
    Zia

    Hi,
       you can calculate the your 7th column in the program lines.
    After creating a table right click > create>program lines.
    in this you need to pass the 5th , 6th and 7th column as input parameters and 7th column  in the out put parameters.
    make the calculation in the program lines as necessary.
    Now in the Main area display the 7th coulmn value which is calculated in the program lines.
    Another alternative is before the table . create a program lines.
    modify the internal table accordingly and then call the table with the modified internal table.
    For eg:
    Program lines  -- zprog
    input paramers : itab and output parameters : itab.
    loop at itab.
    it_tab-colum 7 = it_tab-column 6 * it_tab - column 6.
    modify it_tab.
    endloop.
    In the table under data table pass your modified internal table with workarea.
    in the 7th column give &it_tab-column7&. that's it.
    Br,
    Laxmi

  • Smartforms select query

    Hi,
    I am new to ABAP HR.
    I am designing a smartform. I want to populate the fields T513S-STLTX, T528T-PLSTX, T001P-BTEXT in the form. How do I write the select query for it in my driver program?

    Hi Anita,
    You may declare these tables using
    <b>Tables:</b> statement
    Or you may declare your <b>Internal Table</b> and <b>WorkArea</b> using
    <b>Data</b> statement
    Data: it_tab type table of T513S, "Internal table
            wa_tab like line of it_tab.    "Workarea
    Data: it_tab1 type table of T528T, "Internal table
            wa_tab2 like line of it_tab.    "Workarea
    <i><b>OR</b></i>
    If you are using logical database PNP or PNPCE then you may also use macros.
    <i><b>OR</b></i>
    You may write this select query within Smartform.
    ~Bhawanidutt.

  • How to truncate a field in a Select Query

    Hello Gurus,
    I am new in SAP, i have a question i am making an appointment letter in SMARTFORMS , in global declaration (initialization) i am using a select query
    SELECT SINGLE BET01 FROM PA0008 INTO G_BET01 WHERE PERNR = WA_PERNR.
    where BET01 is the Amount field which is getting printed in the smart form but its takes 5 to 6 character blank spaces in the printing time, i want to truncate this space (remove this space ) in the print time , please tell me how to remove this space , the field size is 13 , how can i reduce the field size in my smartform query. please help . G_BET01 is a variable

    Maybe you can use this.
    DATA: d_char(15).
    WRITE G_BET01 TO d_char CURRENCY 'XXX'.
    'Then you can remove the spaces using :
    CONDENSE d_char no-gaps.

  • Select Query for smart form-invoice

    Hi Folks,
    I have to fetch the following fields as per the requirement for desiging a invoice smartform.I had copied lb_bill_invoice smartform into z format.
    Can anyone here please give me the select query for the same.
    fields to fetched are as follows:-
    1.vbrp-arktx,
    2.vbrp-fkimg,
    3.konv-kbetr with respect to vbrk-knumv
    4.konv-kwert.
    And also what all I have to give in format interface and global definitions of the smartform.
    please help  me in this regard.
    Points will be given.
    K.Kiran.

    Hi,
    declare the variables V_arktx(40) and v_Qty like vbrp-fkimp  and other varaibles for Kbetr, kwert, knumv on the global definitions.
    select  single arktx fkimg into (v_arktx, v_qty) from vbrp
    where vbeln = LBBIL_IT_REFPURORD-BIL_NUMBER.
    select single knumv into v_knumv from vbrk where where vbeln = LBBIL_IT_REFPURORD-BIL_NUMBER.
    this select has to fire in the item level and in the loop.
    so have to write in the correct place.
    select kbetr kwert into (v_kbetr, v_kwert) from konv
    where where knumv = v_knumv and kposn = LBBIL_IT_REFPURORD-ITM_NUMBER.
    regards,
    anji

  • Select-options in Smartform

    Hi all,
            Is't possible to use Select-options in smartforms, If so how to use.
    Regards
    Suprith

    Hi,
    yes it is possible
    1 Create a Structure ZSELECTION in SE11 with following fields
    SIGN
    OPTION
    LOW
    HIGH
    This structure is similar to the selection-option internal table. 
    2 In smart form u2018ZSELECT_FORMu2019, create an entry in to TABLES in the Form Interface. 
    3 Define Structures in TYPES tabs in GLOBAL DEFINITIONS
    4. Do the global declartation
    5 go to mainwindow
    create-->Flow logic -
    > program lines
    The PERNRS given in the select-option in the driver program is captured in T_SELECT. In program lines, T_SELECT is input to SELECT query and the results are captured in internal table T_0002. We have to mention resulted internal table T_0002 in output parameters for further use. 
    loop the internal table
    wite the printporam
    Thanks & Regards
    Ramakrishna Pathi
    then provide the input and output parameters

  • Select option in smartforms

    Hiiiii,
    I am new to smartforms and i need to show range of dates in smartforms.
    I am trying in driver prog. n i got correct data in final internal table but cant
    fetch correct data using fm in driver prog.
    Thank You...

    Hi,
    1 Create a Structure ZSELECTION in SE11 with following fields
    SIGN
    OPTION
    LOW
    HIGH
    This structure is similar to the selection-option internal table.
    2 In smart form u2018ZSELECT_FORMu2019, create an entry in to TABLES in the Form Interface.
    3 Define Structures in TYPES tabs in GLOBAL DEFINITIONS
    4. Do the global declartation
    5 go to mainwindow
    create-->Flow logic -
    > program lines
    The PERNRS given in the select-option in the driver program is captured in T_SELECT. In program lines, T_SELECT is input to SELECT query and the results are captured in internal table T_0002. We have to mention resulted internal table T_0002 in output parameters for further use.
    loop the internal table
    wite the printporam
    Regards,
    DHina..

  • Select query (HR ABAP)

    Hi ..
    i am writing a driver program for smartform.
    I have a field DATEDEM (date of demise)
    The condition is that DATEDEM = P0041-DAT01 for P0041-DAR01 .
    Please help me how to write the select query to get DATEDEM from infotype 0041.
    Here P0041-DAR01 = Date type & 
            P0041-DAT01 = Date for date type.
    Please help.
    Thanks & Regards,
    Preeti

    This is a raw form of the query that needs to be used, please note that some more fields may need to be qualified in the where clause if you want a consistent result.
    SELECT SINGLE DAT01 from PA0041 INTO (DATEDEM)
        WHERE PERNR = PPERNR     'Replace with the current PERNR
              AND DAR01 = 'P0'.      'P0 is Date Type for Date of Death
    <i>This is just indicative of the logic to be used and does not contain important things like checking the validity of the infotype record etc., which you will need to add according to your needs to the where clause of the query.</i>
    Nevertheless, hope this puts you on the right track...
    Regards,
    Dushyant Shetty

  • Optimization of select query

    How to optimize the below select query
      SELECT mvke~matnr                     "Material Number
             mbew~bwkey                     "Plant
             mvke~mvgr1                     "Line of Business
             mara~meins                     "Unit of measure
             mara~ntgew                     "Net weight
             mara~mhdrz                     "Remaining shelf life
             mara~zzmax_exp_days            "Max expiry days
             makt~maktx                     "Material Description
             tvm1t~bezei                    "Line of Business description
             mbew~stprs                     "Standard price
             mbew~vprsv                     "Price control (S/V)
             mbew~verpr                     "Variable Price
        FROM mvke INNER JOIN mara
          ON maramatnr EQ mvkematnr
        INNER JOIN makt
          ON maktmatnr EQ mvkematnr
        INNER JOIN tvm1t
          ON tvm1tmvgr1 EQ mvkemvgr1
        INNER JOIN mbew
          ON mbewmatnr EQ maramatnr
         AND
            mbewbwkey EQ mvkevkorg
        INTO TABLE gt_matdata
        WHERE mbew~matnr IN s_matnr  AND
              mbew~bwkey IN s_werks  AND
              mvke~mvgr1 IN s_mvgr1  AND
              makt~spras EQ sy-langu AND
              tvm1t~spras EQ sy-langu.
    Please advice.
    Thanks and Regards
    Syed Samdani

    Hi,
    You are taking different fields of data from five different tables it seems.
    Well you can take separate internal tables and fire five separate select queries using the 'For All Entries' condition after the first select stmnt, so that u get all the related data. Then take your final internal table and merge all data from all these five internal tables into you final table.
    Regards,
    Jayadeep

  • Select Query Problem

    Hi Experts,
    I am having a select query in which I am using a variable in the where condition but it is giving error. Please suggest how to use variable in the select query.
    The query I am using is a s below.
    select * from zexc_rec into table it_ZEXC_REC
          where
           LIFNR in S_LIFNR and
          DOCNO in S_DOCNO and
          DOCTYP in doc_typ and
          DATE1 in S_DATE1 and
          MATNR in S_MATNR.
    Here doc_typ is a variable.
    Thanks.

    Rahul,
    use RANGES type variable instead of variable . It acts as a select-options variable. Thn use this variable in SELECT query with IN.
    Eg :
    RANGES r_t510 FOR t510-lgart.
        r_t510-low = '1600'. 
        APPEND r_t510.
        r_t510-low = '3190'. 
        APPEND r_t510.
    Note  : can be use SIGN, OPTIONS properties too in RANGES type.
    More deatils go through on HELP of RANGES
    Rgds,
    Ranjith

  • Oracle 11g :SELECT query blocked..??

    Hi Experts,
    could you please explain why the below SQL query is blocked?
    SELECT 1 FROM DUAL is blocking the SQL statement on GTTAPPUSR@gttccuatcriba04 ( SID=469 ) blocked SQL -> DELETE FROM GTTDB.PURCHASE_ENTRY_ID=:1
    SELECT 1 FROM DUAL is blocking the SQL statement on GTTAPPUSR@gttccuatcriba04 ( SID=367 ) blocked SQL -> DELETE FROM GTTDB.PURCHASE_ENTRY_ID=:1
    I am scratching my head without any solution when I had a look at the db today. Thanks in advance for your help.
    Regards,
    Boris
    Edited by: user12075620 on Dec 4, 2012 8:58 AM

    The SELECT statement is not blocking the UPDATE. As I said in the previous reply, the string that this query produces does not match the logic.
    This query is (at least on the surface) correctly identifying that session 1 is blocking session 2. Session 1 holds some lock that session 2 is waiting on. So far, so good. Since session 2 is waiting on the lock, we can easily enough see what session 2 is running (the UPDATE statement). But since session 1 is not blocked, it is potentially off running a ton of other SQL statements (or no SQL statement at all). The query is looking to see what session 1 is running currently. It has no way of determining what session 1 ran at some point in the past to acquire the lock in the first place.
    Going back to my KING example,
    At noon, session 1 runs
    UPDATE emp
       SET sal = sal * 2
    WHERE ename = 'KING'Session 1 now has a lock on the KING row in the EMP table. But session 1 neither commits nor rolls back, it is still in a transaction. Session 1 might not have any more activity for a long time-- the user might go off to lunch, for example (obviously, applications should not be designed to allow users to maintain open transactions indefinitely, but not all applications are designed correctly). Or it might start running other queries. Let's say that session 1 now runs a query that is going to go for an hour
    SELECT *
      FROM giant_view_with_lots_of_computationsNow, at 12:45, session 2 comes in and runs
    UPDATE emp
       SET bonus = 100
    WHERE ename = 'KING'Session 2 is blocked. Session 2 is running the UPDATE statement. Session 1 still holds the lock but it is running some completely unrelated SQL statement.
    If we run the query you posted, the query will correctly report that session 1 is running the query against the GIANT_VIEW_WITH_LOTS_OF_COMPUTATIONS but incorrectly imply that this SELECT query is the source of the lock. It is not. It simply happens to be the query that the session that does hold the lock happens to be executing at the current moment (why the application seems to be running a lot of queries that select a constant from dual is a separate question).
    Justin

  • Oracle SQL Select query takes long time than expected.

    Hi,
    I am facing a problem in SQL select query statement. There is a long time taken in select query from the Database.
    The query is as follows.
    select /*+rule */ f1.id,f1.fdn,p1.attr_name,p1.attr_value from fdnmappingtable f1,parametertable p1 where p1.id = f1.id and ((f1.object_type ='ne_sub_type.780' )) and ( (f1.id in(select id from fdnmappingtable where fdn like '0=#1#/14=#S0058-3#/17=#S0058-3#/18=#1#/780=#5#%')))order by f1.id asc
    This query is taking more than 4 seconds to get the results in a system where the DB is running for more than 1 month.
    The same query is taking very few milliseconds (50-100ms) in a system where the DB is freshly installed and the data in the tables are same in both the systems.
    Kindly advice what is going wrong??
    Regards,
    Purushotham

    SQL> @/alcatel/omc1/data/query.sql
    2 ;
    9 rows selected.
    Execution Plan
    Plan hash value: 3745571015
    | Id | Operation | Name |
    | 0 | SELECT STATEMENT | |
    | 1 | SORT ORDER BY | |
    | 2 | NESTED LOOPS | |
    | 3 | NESTED LOOPS | |
    | 4 | TABLE ACCESS FULL | PARAMETERTABLE |
    |* 5 | TABLE ACCESS BY INDEX ROWID| FDNMAPPINGTABLE |
    |* 6 | INDEX UNIQUE SCAN | PRIMARY_KY_FDNMAPPINGTABLE |
    |* 7 | TABLE ACCESS BY INDEX ROWID | FDNMAPPINGTABLE |
    |* 8 | INDEX UNIQUE SCAN | PRIMARY_KY_FDNMAPPINGTABLE |
    Predicate Information (identified by operation id):
    5 - filter("F1"."OBJECT_TYPE"='ne_sub_type.780')
    6 - access("P1"."ID"="F1"."ID")
    7 - filter("FDN" LIKE '0=#1#/14=#S0058-3#/17=#S0058-3#/18=#1#/780=#5#
    8 - access("F1"."ID"="ID")
    Note
    - rule based optimizer used (consider using cbo)
    Statistics
    0 recursive calls
    0 db block gets
    0 consistent gets
    0 physical reads
    0 redo size
    0 bytes sent via SQL*Net to client
    0 bytes received via SQL*Net from client
    0 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    9 rows processed
    SQL>

  • Select query differences between oracle 9 and oracle 8.

    Hi,
    I have a problem using the select query between oracle 7 and oracle 9i I don't have the same result :
    ex:
    With oracle7
    SQL> select 'champ1','champ2' from DUAL;
    'CHAMP 'CHAMP
    champ1 champ2
    With Oracle 9
    SQL> select 'champ1','champ2' from DUAL;
    'CHAMP1' 'CHAMP2'
    champ1 champ2
    So Can someone tell me how to solve this problem ? Is there a parameter in oracle 9 to set?
    Thanx.

    Whenever you are posting anything over internet forums like this - you should be very careful about not just posting the details which requires to solve the problem - also should be sensible about your question.
    This is not at all desired when you are posting such question. It may be because - you may not well aware of the fact.
    My suggestion is -> First Go through the basics Of SQL in general.
    Then go for any specific product like Oracle/ SQL Server/ Sybase etc.
    And, finally learn the advanced commands of that DB.
    You asked it - may be you thought the difference in output in terms of lines. But, that is not your actual output. That is the graphical display part only.
    Anyway,
    You can get the quite familier output by first type the following command ->
    set lin 310Regards.
    Satyaki De.

  • Select Query resulting in Scientific Notation

    Hello all,
    I am running a Select query through a batch file that extracts data from an Oracle database. Several of the fields that I am extracting from contain numbers that are up to 38 digits long. When I extract the data, it converts the numbers into scientific notation and it is important for me to have the entire field. Is there something I can change to my query that will pull the data in its entire form? This is what I'm running now:
    select * FROM ML.APPT where APPTDATE >= to_date('01/1/2010','mm/dd/yyyy'
    I apologize in advance if this has been answered already.
    Thanks!

    >
    When the extractor finishes, it returns the data into a flat file.
    don't quite understand the TO_CHAR function. Does this function mean I need to say something like this: select "TO_CHAR('column name', 99999999999999999999999999999999999999" FROM ML.APPT where APPTDATE >= to_date('01/1/2010','mm/dd/yyyy')
    >
    Yes- if the tool you use to extract the data (your 'extractor') is converting the numeric data to a string then it is responsible for creating the string in the proper format. If the number is an integer that can have as many digits as you have '9's in your sample format string then that is what you need to do.
    Here is how sql*plus (Oracle's tool) will display the data using default settings
    SQL> select 12345678901234567890123456789012345678 no_format,
      2  to_char(12345678901234567890123456789012345678, '99999999999999999999999999
    999999999999') with_format
      3   from dual;
    NO_FORMAT WITH_FORMAT
    1.2346E+37  12345678901234567890123456789012345678
    SQL>
    ----- TOAD will display something similiar but the default uses more decimal digits in the scientific notation data
    NO_FORMAT,WITH_FORMAT
    1.23456789012346E37, 12345678901234567890123456789012345678You can either format the numeric data in the query using TO_CHAR or the 'extractor' can do it when it converts the data to a string.

  • Select-options in SELECT query - syntax error

    Hi all,
      I get the error below when I try to use the select options in a SELECT query . Please help me.
    "The IN operator with "SO_AWART" is followed neither by an internal
    table nor by a value list."
    The code i have used(Logical database  PNP is used):
    TABLES: pernr,
            catsdb.
    INCLUDE ztime_cwtr_top.    " global Data
    INCLUDE ztime_cwtr_f01.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    SELECT-OPTIONS SO_AWART FOR CATSDB-AWART.
    PARAMETERS P_THRES TYPE I.
    SELECTION-SCREEN END OF BLOCK B1.
    Get data from CATSDB table. Workdates within the date interval are considered.
      SELECT pernr workdate awart catsquantity beguz enduz status
      FROM catsdb
      INTO TABLE it_catsdb
      WHERE pernr  = pernr-pernr    AND
           workdate GE pn-begda     AND
           workdate LE pn-endda     AND
           status   IN ('20', '30') AND
           awart    IN  so_awart .
          awart    IN ('1100', '1137', '1138', '1139', '1140',
                      '1147', '1148', '1149', '1157', '2003' ).
    when I give the values directly i do not get any syntax error, but when I use select options in the where condition I get the syntax error.
    I have tried different options like using only the select-options in the where condition.
    Thanks in advance.....
    Madhu

    Solved.
    Code with syntax error:
    include z...top .
    include z...fo1.
    select-options: xxxxxxx
    Code  with no syntax error:
    select-options: xxxxxxx
    include z...top .
    include z...fo1.
    Thanks for all your help,
    Madhu

Maybe you are looking for