Fetching Data frm Table

SQL> create table leave (sid number(10), leave_type number(2), start_date date, end_date date, days number(3));
Table created.
SQL> insert into leave values (101, 12, '03-jan-2011', '05-jan-2011', 1);
1 row created.
SQL> insert into leave values (101, 12, '12-jan-2011', '12-Jan-2011', 1);
1 row created.
SQL> insert into leave values (101, 12, '21-jan-2011', '22-jan-2011', 2  );
1 row created.
SQL>  insert into leave values (101, 10, '26-jan-2011', '26-jan-2011', 1);
1 row created.
SQL> insert into leave values (101, 12, '14-feb-2011', '16-feb-2011', 3);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from leave;
SQL> select * from leave;
       SID LEAVE_TYPE START_DATE  END_DATE  javascript:void(0);        DAYS
       101         12 03-jan-2011 05-jan-2011          3
       101         12 12-jan-2011 12-jan-2011          1
       101         12 21-jan-2011 22-jan-2011          2
       101         10 26-jan-2011 26-jan-2011          1
       101         12 14-feb-2011 16-feb-2011          3Now, I have a date range as input for a specific SID. I would like the list the leave records in contiguous order for that date range. If date range input is between *'01-Jan-2011'* to *'31-Jan-2011'* then the result output should be :
SID     LEAVE_TYPE     ON_LEAVE
101     12          03-jan-2011
101     12          04-jan-2011
101     12          05-jan-2011
101     12          12-jan-2011
101     12          21-jan-2011
101     12          22-jan-2011
101     10          26-jan-2011Due to some restriction I can not create temporary table to implement this. Can anyone suggest me ways whether this can be achieved through SQL or I need to use PL/SQL ?

This would be the basic query to give the contiguous dates...
SQL> select sid, leave_type, start_date+rn-1 as leave_date
  2  from leave
  3       join (select rownum as rn from dual connect by rownum <= 31)
  4       on (rn <= days)
  5  order by leave_date
  6  /
       SID LEAVE_TYPE LEAVE_DATE
       101         12 03-JAN-2011
       101         12 04-JAN-2011
       101         12 05-JAN-2011
       101         12 12-JAN-2011
       101         12 21-JAN-2011
       101         12 22-JAN-2011
       101         10 26-JAN-2011
       101         12 14-FEB-2011
       101         12 15-FEB-2011
       101         12 16-FEB-2011
10 rows selected.Apply clauses to restrict to a particular date range as required.
Edit: This does assume that someone isn't going to have more than 31 days leave in any one go. If you need more, just change the 31 to whatever the maximum leave would be as appropriate.

Similar Messages

  • RFC fetching data from table which is not commited

    Hi Experts,
                   I have a query regarding commit work.Below is the RFC that i have written
    FUNCTION ZBAPI_CREATE.
    *"*"Local Interface:
    *"  TABLES
    *"      IT_ZABAP_RFC STRUCTURE  ZBAPI_RFC_STR OPTIONAL
    *"      RETURN STRUCTURE  BAPIRET2 OPTIONAL
    CALL FUNCTION 'ZBO_BAPI_CREATE'
    TABLES
       IT_ZABAP_RFC       = IT_ZABAP_RFC
       RETURN             = return
    Break-point.
    DATA lt TYPE TABLE OF ZBAPI_RFC_STR_MAIN.
    CALL FUNCTION 'ZBAPI_SEARCH_RANGE'
    * EXPORTING
    *   IS_STR        =
    TABLES
       ET_TAB        = lt
    *   RETURN        =
    ENDFUNCTION.
    here in first RFC call i am creating a record in ZTABLE , and then at break-point
    i check the ZTABLE where it does not create any record because data is not commited into ZTABLE upto this point, but just after it i have written code for fetching data from ZTABLE but i am able to get this new record in lt.
    Can anybody please explain that from where this serach RFC is providing data because inside serach i am simply selecting data from ZTABLE.
    Regards,
    Abhishek Bajpai
    Edited by: ABHISHEK BAJPAI on Jan 28, 2009 1:12 PM

    Hi Thomas,
                     Thanks for reply , i checked in ZTABLE ,before search RFC call data is not there but if i commit explicitly only then it is showing data in ZTABLE. Actually my requirement is different -
    I have two RFCs 1. Create 2. Search , Now  from web dynpro user will call first Create RFCs but at this point it should not insert record in ZTABLE and just after it user will call another search RFC and in this search he should be able to get these newly created records.
    I want to have the functionality which a user gets when working with normal database front end like SQLPLus for Oracle. In these scenarios we see that whenever user does any insert or update the data sits in the table but still it is not committed. So there he fires Select query he sees the inserted data. But if he logs off from SQL PLUS and then logs in again, and fires Select query he does not see the data as it was not committed. I want a similiar functionalty in which if user inserts the data through Create RFC and fires the Select query through Search RFC then he can see the newly Created data also even though this data is not committed.
    Although if i call create RFC in update task it will not update ZTABLE but in this situation , if user will call search RFC he will not be able to get newly created records.
    So my requirement is that i should be able to get those records which are not commited in ZTABLE .If you have still any doubt regarding my question then please let me know.
    Regards,
    Abhishek

  • Fetch data from table and generate attachment than mail it.

    Hello Experts,
    From couple of day I am searching on Google for a better database procedure that will help me to get data from tables and generate attachment and mail it but i fail.
    My Scenario is:
    I have a query that will fetch almost 5000 records from database tables. Each record has almost 75 characters
    select a.location_code,
                   a.item_code,
                   b.description item_desc,
                   to_char(a.manufact_date,'ddMonyy')mfg,
                   to_char((a.manufact_date + nvl(b.expiry_period,0)),'ddMonyy')expr,
                   to_char((a.manufact_date + nvl(b.qurantine_period,0)),'ddMonyy')qrtn,
                   round(nvl (b.qurantine_period, 0) - (sysdate - a.manufact_date)) days_elapsed,
                   a.closing_balance_posted quantity
              from wms_stock_current_balance_v a, wms_item_setup_mast b
             where a.closing_balance > 0
               and a.item_code = b.item_code
               and a.loc_type in ('RACKING','PICKING','QUICKA','BUNDLED')
               and nvl(b.qurantine_period,0) > 0
               and round(nvl (b.qurantine_period, 0) - (sysdate - a.manufact_date)) <= 0
          order by a.item_code, a.location_code;
    Sample data of above query is
    LOCATION_CODE
    ITEM_CODE
    ITEM_DESC
    MFG
    Expiry
    Quarantine
    Days Elapse
    Quantity
    13DL2
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    20-Feb-10
    31-Mar-14
    4-Jun-13
    -122
    160
    14DL0
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    23-Feb-10
    3-Apr-14
    7-Jun-13
    -119
    134
    14DL2
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    23-Feb-10
    3-Apr-14
    7-Jun-13
    -119
    160
    14DR2
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    23-Feb-10
    3-Apr-14
    7-Jun-13
    -119
    20
    14LL2
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    20-Feb-10
    31-Mar-14
    4-Jun-13
    -122
    160
    17ER2
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    20-Feb-10
    31-Mar-14
    4-Jun-13
    -122
    160
    17GL2
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    20-Feb-10
    31-Mar-14
    4-Jun-13
    -122
    160
    17SL0
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    17-Feb-10
    28-Mar-14
    1-Jun-13
    -125
    64
    18QL0
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    23-Feb-10
    3-Apr-14
    7-Jun-13
    -119
    160
    19AR5
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    17-Feb-10
    28-Mar-14
    1-Jun-13
    -125
    160
    19DL1
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    20-Feb-10
    31-Mar-14
    4-Jun-13
    -122
    160
    19JR0
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    17-Feb-10
    28-Mar-14
    1-Jun-13
    -125
    60
    19TL1
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    20-Feb-10
    31-Mar-14
    4-Jun-13
    -122
    160
    20GR2
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    20-Feb-10
    31-Mar-14
    4-Jun-13
    -122
    40
    36FL3
    000000000000000F0487
    CLEAR COOL BLACK 05ML
    18-Feb-10
    29-Mar-14
    2-Jun-13
    -124
    65
    19UR0
    000000000000000F0591
    COMFORT WHITE 24ML*300
    28-Oct-09
    28-Oct-11
    1-May-11
    -887
    1
    12SL1
    000000000000000F0593
    COMFORT PINK 24ML*300
    28-Oct-09
    28-Oct-11
    1-May-11
    -887
    42
    12SR1
    000000000000000F0593
    COMFORT PINK 24ML*300
    28-Oct-09
    28-Oct-11
    1-May-11
    -887
    42
    14OR1
    000000000000000F0593
    COMFORT PINK 24ML*300
    28-Oct-09
    28-Oct-11
    1-May-11
    -887
    8
    36EL4
    000000000000000F0594
    CLEAR HF DECRASE 5M*360
    14-Feb-10
    14-Feb-11
    12-Oct-10
    -1088
    14
    13VL1
    000000000000000F0595
    CLEAR COM SFT CRE 5*360
    8-Feb-10
    8-Feb-11
    6-Oct-10
    -1094
    160
    14ER0
    000000000000000F0595
    CLEAR COM SFT CRE 5*360
    8-Feb-10
    8-Feb-11
    6-Oct-10
    -1094
    105
    Database Info
    Oracle 10g
    Version 10.2.0.1.0

    Look at the sample code for generating a CSV file that I've just posted in response to a similar question:
    Re: How to execute a proc and spool files in a database job
    And the use the search button in this forum to find sample code for sending a CLOB as a plain/text e-mail attachment using UTL_SMTP.

  • Fetch data from table(ET_) which is exporting parameter of function module

    Hi,
    I m new to ABAP programming.
    I have to develop a smartform that has to be filled in with fields from few tables.
    These tables have the naming convention ET_<XXX> (i.e. exporting parameter of function module).
    I m not able to directly view its contents in se11 or use select query for it.
    I have a report program which i can execute to view these parameter names.
    Now, how do i fetch data from these parameters/tables and pass it from my driver program to smartform??
    Someone pls guide me...
    Thank You.

    Hi,
    I have done that using Field-Symbols.
    Thanks,
    Preetha

  • Select query taking 30 sec to fetch data from table containing BLOB column.

    Hi Friends,<o:p></o:p>
    Please help me...<o:p></o:p>
    I have 15 columns in a table, in that 2 columns containing blob (images).<o:p></o:p>
    More than 22 lakhs records are in a table.<o:p></o:p>
    While i am try to fetch data from this table it nearly takes 25~30 sec to execute that query.<o:p></o:p>
    When i deleted the two columns containing blob and i tried its executing fast .<o:p></o:p>
    I should not change the table schema.<o:p></o:p>
    Views also i created and indexes also there in a table.<o:p></o:p>
    How can i improve the query execution speed?.<o:p></o:p>

    And how large is the size of BLOB data in your table? If it's several giga bytes, then the time is simply required to read the amount of data from disk and to transfer it to the Client.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Fetch data from Table

    Hi all,
    I am using function module through Call fucntion.
    There i am getting <b>Table Name</b> as import Parameter.
    Now i need to fetch data from that table (Which name we got througfh function module).
    Is there any point to know how can we fetch data from runtime table .
    i need some sample code for this.
    Thanks inn advance,
    Regards,
    Bhaskar

    Hello Bhaskar,
    I don't have an SCM system, so I cannot test out that FM
    However, I modified the above code to update the table as well
    *& Report  ZKRIS_DYNAMIC_TABLE_READ_MOD
    REPORT  ZKRIS_DYNAMIC_TABLE_READ_MOD LINE-SIZE 256.
    DATA : LV_FIELD_DESC TYPE STRING.
    DATA : LV_DATA1 TYPE STRING.
    DATA : LV_DETAIL(128).
    DATA : COMMA TYPE C VALUE ','.
    DATA : LV_TNAME LIKE DD02L-TABNAME.
    DATA : LV_DBTAB1 LIKE DD02L-TABNAME.
    DATA : DREF TYPE REF TO DATA.
    DATA : FLAG_MODIFIED.  " determines if database needs to be updated
    FIELD-SYMBOLS: <ITAB> TYPE ANY TABLE, " used to store dynamic tables
                   <WA>    TYPE ANY,      " used to store record data
                    <WA1> TYPE ANY .      " used to store field data
    * call Fm /SAPAPO/TS_PA_COPY_TABLE_GET here
    LV_DBTAB1 = 'ZGSTSET'. " <-- put your table name here
    DATA: IT_FIELDS TYPE X031L OCCURS 0.
    DATA: WA_FIELDS LIKE LINE OF IT_FIELDS.
    CALL FUNCTION 'DDIF_NAMETAB_GET'
      EXPORTING
        tabname           = LV_DBTAB1
    *   ALL_TYPES         = ' '
    *   LFIELDNAME        = ' '
    *   GROUP_NAMES       = ' '
    *   UCLEN             =
    * IMPORTING
    *   X030L_WA          =
    *   DTELINFO_WA       =
    *   TTYPINFO_WA       =
    *   DDOBJTYPE         =
    *   DFIES_WA          =
    *   LINES_DESCR       =
    TABLES
       X031L_TAB         = IT_FIELDS
    *   DFIES_TAB         =
    EXCEPTIONS
       NOT_FOUND         = 1
       OTHERS            = 2
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    * we do not know the sized of the table that must be generated beforehand
    * hence we use field symbols to dynamically generate the internal table
      CREATE DATA DREF TYPE STANDARD TABLE OF (LV_DBTAB1)
                                WITH NON-UNIQUE DEFAULT KEY.
      ASSIGN DREF->* TO <ITAB> .
    * selects all data
      SELECT * FROM (LV_DBTAB1) INTO TABLE <ITAB> .
      LOOP AT <ITAB> ASSIGNING <WA>.
        FLAG_MODIFIED = ''.
        LOOP AT IT_FIELDS INTO WA_FIELDS.
          ASSIGN COMPONENT WA_FIELDS-FIELDNAME OF STRUCTURE <WA>
            TO <WA1>.
          IF WA_FIELDS-FIELDNAME = 'FIRSTNAME'. " fieldname in the table you wish to modify
            IF <WA1> = 'Kris'. " old value
              <WA1> = 'NewName'. " new value
              MODIFY TABLE <ITAB> FROM <WA>.
              FLAG_MODIFIED = 'X'.
            ENDIF.
          ENDIF.
          WRITE <WA1>. " comment this line to remove the display
        ENDLOOP.
        IF FLAG_MODIFIED = 'X'. " updates database only if the record was changed
          UPDATE (LV_DBTAB1) FROM <WA>.
    *     note that if the field you choose is a key field, sy-subrc will be set to 4
        ENDIF.
    *   display
        NEW-LINE.
      ENDLOOP.

  • Function module to fetch data from table SETLEAVES

    Hi All,
    We have a requirement to fetch the data from table SETLEAVES based on the setclass,subclass and group. As the table holds hierarchical data, Please let me know a FM which fetches all the hierarchical data from the table SETLEAVES.
    Regards
    Shiva

    Try:
        exporting
          e_class                     = '0102'
          e_setid                     = setid
          e_kokrs                     = my_kokrs
          e_mandt                     = sy-mandt
          e_master_data               = 'XXX'
          e_structure                 = 'X  X0200'
          e_replace_class             = space
          e_replace_unit              = space
          e_suffix                    = space
          e_old_line_level            = 1  "l_ol_level
        tables
          t_nodes                     = it_ceg_nodes
          t_values                    = it_ceg_values
        changing
          c_info                      = c_info
          c_overwrite                 = c_overwrite
        exceptions
          no_controlling_area         = 1
          no_chart_of_account         = 2
          different_controlling_areas = 3
          different_chart_of_accounts = 4
          set_not_found               = 5
          illegal_field_replacement   = 6
          illegal_table_replacement   = 7
          fm_raise                    = 8
          convert_error               = 9
          no_overwrite_standard_hier  = 10
          no_bukrs_for_kokrs          = 11
          others                      = 12.
    Rob

  • To Fetch Data from table

    Hi All,
    I have to fetch data from t005u for the filed bezei.
    based on conditions given below
    1) pass kna1-land1 and kna1-regio to t005u-land1 and t005u-bland
    and then i want to pass this to an alv filed.
    thanks in advance
    jay

    hi jay,
    try this code.
    select t005u~bezei
              kna1~land1
              kna1~regio
              into table <itab>
              from t005u join kna1
              on t005u-land1 eq kna1-land1 and
                   t005u-bland eq kna1-regio
              where <condition with selection-screen Parameters>
      After fetching the data build the field catelog using <itab> and
    pass it in the function module REUSE_ALV_GRID_DISPLAY.
    <b><i>Reward points if useful</i></b>
    Chandra
    Message was edited by:
            Chandrasekhar Velpula

  • Send mail by attaching a pdf fetching data from tables.

    Dear Team,
    I have a requirement to send a mail by attaching a pdf.
    Step1 : Getting the data fron tables based on some logic into internal tables. [DONE]
    Step2 : Using this internal and making a pdf  [At present I am making an excel sheet, But client requires non editable well formatted pdf]
    Step3 : Attach this PDF and send it as a mail. [At present I am sending the attched excel but want to send pdf]
    Sample code used is
    **  Body of the mail
    WA_TEXT-LINE = 'Note : This is an autogenerated mail. Please do not reply to this mail.'.
          APPEND WA_TEXT TO TEXT.
          CLEAR WA_TEXT.
    *     create document from internal table with text
          DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
                          I_TYPE    = 'RAW'
                          I_TEXT    = TEXT
                          I_LENGTH  = '12'
                          I_SUBJECT = I_SUBJECT1 ).
    **  Excel Attachemnt
    ***  Preparing the xcel
    CONCATENATE 'SNO' 'Request' 'Data1' INTO WA_TEXT-LINE SEPARATED BY CON_TAB.
                CONCATENATE CON_CRET WA_TEXT-LINE  INTO WA_TEXT-LINE.
                APPEND WA_TEXT TO TEXT.
                CLEAR WA_TEXT.
    CONCATENATE WA_SNO WA_REQUEST WA_DATA1 INTO WA_TEXT-LINE SEPARATED BY CON_TAB.
                  CONCATENATE CON_CRET WA_TEXT-LINE  INTO WA_TEXT.
                  APPEND WA_TEXT TO TEXT.
                  CLEAR : WA_TEXT, TEMP_TYPE .
    *** Attaching the excel
    DATA : COUNTER TYPE I.
          DESCRIBE TABLE TEXT LINES COUNTER.
          LOOP AT TEXT INTO WA_TEXT.
            SIZE =  255 + STRLEN( WA_TEXT-LINE ) + SIZE .
          ENDLOOP.
          CALL METHOD DOCUMENT->ADD_ATTACHMENT
            EXPORTING
              I_ATTACHMENT_TYPE    = 'XLS'
              I_ATTACHMENT_SUBJECT = I_SUBJECT
              I_ATTACHMENT_SIZE    = SIZE
              I_ATT_CONTENT_TEXT   = TEXT.
    ** Semding Mail
       CALL METHOD SEND_REQUEST->SET_DOCUMENT( DOCUMENT ).
    IF REQUESTER_MAIL IS NOT INITIAL.
    *       create recipient for cc
            RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS(
              I_ADDRESS_STRING = REQUESTER_MAIL ).
    *       add recipient with its respective attributes to send request
            CALL METHOD SEND_REQUEST->ADD_RECIPIENT
              EXPORTING
                I_RECIPIENT = RECIPIENT
                I_COPY      = 'X'
                I_EXPRESS   = 'X'.
          ENDIF.
    SEND_REQUEST->SET_SEND_IMMEDIATELY('X').
    *     ---------- send document ---------------------------------------
          CALL METHOD SEND_REQUEST->SEND(
            EXPORTING
              I_WITH_ERROR_SCREEN = 'X'
            RECEIVING
              RESULT              = SENT_TO_ALL ).
          IF SENT_TO_ALL = 'X'.
            WRITE TEXT-003.
          ENDIF.
          COMMIT WORK.
    Please help me in this regard.
    Thanks in advance.
    Sai

    Hi,
    You can convert the data into spool and then pdf,
    please go through this link in this data from an internal
    table of an script or an smartform is converted into spool
    and then sended into mail,
    https://wiki.sdn.sap.com/wiki/display/sandbox/ConversionofSpoolRequestDataintoPDFandExcelFormatandSenditintoMail
    Hope it helps
    Regards
    Mansi

  • Function module to fetch data from table

    Hi All,
    I want to get the entries from the table 'arfcsstate'  for a particular date. Is there a function module to get the same.
    Thanks in advance.
    Regards,
    Anju

    Hi,
    You can use select query
    Select * from arfcsstate into <Internal table name>
    where date <give ur condition.>
    if date is in selection screen than write
    date in s_date.
    Thanx
    Ankur Sharma

  • Please let me know how to write the Query to fetch data from tables

    Hi Folks,
    Please let me know how to get the data from  different tables using the functionality SQ03,SQ02  and SQ01 .
    Helpful answers will points awarded.
    Regards,
    Ram.

    Dear Ram,
    Please find the below link which gives in detail with screen shots.
    [SAP Query|http://media.techtarget.com/searchSAP/downloads/Teach_yourself_SAP_C20.pdf#search=%22CREATE%20REPORT%20USING%20SQVI%20%2C%20SAP%22]
    Thanks
    Murtuza

  • Fetching data from two tables

    Hi friends,
    I've two similar tables A and B with one more column in table B that is "Active Flag".
    Table A
    Rowid----Fname----Lname
    101-----AF1----------AL1
    102----AF2-----------AL2
    103-----AF3---------AL3
    104-----AF4---------AL4
    Table B
    Rowid-----Fname---Lname---Flag
    101-----BF1----------BL1--------Y
    102-----BF2----------BL2---------N
    103-----BF3----------BL3--------N
    104-----BF4----------BL4-------Y
    I need to fetch data in Table C with column rowid, Fname and Lname.
    If Flag is Y in Table B, this record should come to table C otherwise the record from table A will come to C. Rowid is the primary key.
    Table C should be like this..
    Rowid-----Fname---Lname
    101-----BF1----------BL1
    102-----AF2----------AL2
    103-----AF3----------AL3
    104-----BF4----------BL4
    Thanks in advance

    Hi,
    try this
    QL> With T As
    2       (
    3          Select 101 Id, 'BF1' fname, 'BL1' lname, 'Y' flag
    4            From DUAL
    5          Union All
    6          Select 102, 'BF2', 'BL2', 'N'
    7            From DUAL
    8          Union All
    9          Select 103, 'BF3', 'BL3', 'N'
    10            From DUAL
    11          Union All
    12          Select 104, 'BF4', 'BL4', 'Y'
    13            From DUAL),
    14       T1 As
    15       (
    16          Select 101 Id, 'BF1' fname, 'BL1' lname
    17            From DUAL
    18          Union All
    19          Select 102, 'AF2', 'AL2'
    20            From DUAL
    21          Union All
    22          Select 103, 'AF3', 'AL3'
    23            From DUAL
    24          Union All
    25          Select 104, 'BF4', 'BL4'
    26            From DUAL)
    27  Select T1.Id, T1.fname, T1.lname
    28    From T, T1
    29   Where T.Id = T1.Id
    30     And T.flag='Y'
    31  /
           ID FNA LNA
          101 BF1 BL1
          104 BF4 BL4and rowid is oracle reserved word. you should be aware of oracle reserved word, kindly refer this v$reserved_words
    Edited by: user291283 on Sep 7, 2009 10:18 PM

  • Fetching data from internal table in smartform

    Hi,
    I'm able to fetch data from one internal table, but in the table the fields are not coming perfectly, can anybody help me in this?
    Thanks in advance.

    Hi
    You have to to specify the text node that you have created for the table that it belong to which cell in the table. Also you styles to format the text(eg: left aligned, center alinged etc)
    If you have further query please post.
    If this resolves your query close the thread and reward points
    Cheers
    Shafiq

  • Select query taking too much time to fetch data from pool table a005

    Dear all,
    I am using 2 pool table a005 and a006 in my program. I am using select query to fetch data from these table. i.e. example is mentioned below.
    select * from a005 into table t_a005 for all entries in it_itab
                       where vkorg in s_vkorg
                       and     matnr in  s_matnr
                       and     aplp   in  s_aplp
                       and     kmunh = it_itab-kmunh.
    here i can't create index also as tables are pool table...If there is any solutions , than please help me for same..
    Thanks ,

    it would be helpful to know what other fields are in the internal table you are using for the FOR ALL ENTRIES.
    In general, you should code the order of your fields in the select in the same order as they appear in the database.  If you do not have the top key field, then the entire database is read. If it's large then it's going to take a lot of time.  The more key fields from the beginning of the structure that you can supply at faster the retrieval.
    Regards,
    Brent

  • Regarding fetching data into internal table from D.B Tables, D.B View

    Hi All,
    I Have following 5 tables in my Database.
    LTAP
    TABNAME
    FIELDNAME
    KEYFLAG
    LTAP
    MANDT
    X
    LTAP
    LGNUM
    X
    LTAP
    TANUM
    X
    LTAP
    TAPOS
    X
    LTAP
    VLPLA
    Z0MNH
    TABNAME
    FIELDNAME
    KEYFLAG
    Z0MNH
    MANDT
    X
    Z0MNH
    WERKS
    X
    Z0MNH
    ZMANNO
    X
    Z0MNH
    LGNUM
    X
    Z0MNH
    AENAM
    Z0MNH
    BUDAT
    Z0MNH
    CPUTM
    Z0MNH
    LAEDA
    Z0MNH
    STATUS
    Z0MNH
    USNAM
    Z0MNH
    ZARDAT
    Z0MNH
    ZARTIM
    Z0MNH
    ZCLDAT
    Z0MNH
    ZCLTIM
    Z0MNH
    ZDPDAT
    Z0MNH
    ZDPTIM
    Z0MNH
    ZDRIVR
    Z0MNH
    ZINDAT
    Z0MNH
    ZINTIM
    Z0MNH
    ZLOAD
    Z0MNH
    ZNOTES
    Z0MNH
    ZPRDAT
    Z0MNH
    ZPRTIM
    Z0MNH
    ZSUPR
    Z0MNH
    ZTRAILR
    Z3MANBOXIDHDR
    TABNAME
    FIELDNAME
    KEYFLAG
    Z3MANBOXIDHDR
    MANDT
    X
    Z3MANBOXIDHDR
    WERKS
    X
    Z3MANBOXIDHDR
    ZMANNO
    X
    Z3MANBOXIDHDR
    EXIDV
    X
    Z3MANBOXIDHDR
    NLPLA
    Z3MANBOXIDHDR
    NLTYP
    Z3MANBOXIDHDR
    VLTYP
    Z3MANBOXIDHDR
    Z0PAL
    Z3MANBOXIDHDR
    Z3COMENT
    Z3MANBOXIDHDR
    Z3RECPT_FLAG
    Z3MANBOXIDITM
    TABNAME
    FIELDNAME
    KEYFLAG
    Z3MANBOXIDITM
    MANDT
    X
    Z3MANBOXIDITM
    WERKS
    X
    Z3MANBOXIDITM
    ZMANNO
    X
    Z3MANBOXIDITM
    EXIDV
    X
    Z3MANBOXIDITM
    ITEM_NO
    Z3MANBOXIDITM
    MATNR
    Z3MANBOXIDITM
    VEMEH
    Z3MANBOXIDITM
    VEMNG
    Z3MANBOXIDITM
    Z_CARTON
    Z3MANBOXIDSERIAL
    TABNAME
    FIELDNAME
    KEYFLAG
    Z3MANBOXIDSERIAL
    MANDT
    X
    Z3MANBOXIDSERIAL
    WERKS
    X
    Z3MANBOXIDSERIAL
    EXIDV
    X
    Z3MANBOXIDSERIAL
    ZMANNO
    X
    Z3MANBOXIDSERIAL
    ITEM_NO
    Z3MANBOXIDSERIAL
    SERNR
    Based on all the above tables i need to fill in below internal table field as given below:
    <b>Internal Table I_TAB
    ZMANNO
    LGNUM
    WERKS
    EXIDV
    ITEM_NO
    MATNR
    SERNR
    VEMNG
    VEMEH
    VLTYP
    NLTYP
    VLPLA
    NLPLA
    ZLOAD
    USNAM
    STATUS
    BUDAT
    CPUTM
    ZINDAT
    ZINTIM
    ZARDAT
    ZARTIM
    ZCLDAT
    ZCLTIM</b>
    Extract data from Manifest header <b>Z0MNH, Z3MANBOXIDHDR,
    Z3MANBOXIDITM, Z3MANBOXIDSER and LTAP</b> tables based on selection parameter.
    Selection Screen will have folowing Select-option fields-
    <b>LGNUM
    WERKS
    ZMANNO
    USNAM
    ZLOAD
    EXIDV
    MATNR
    SERNR
    VLTYP
    NLTYP
    VLPLA
    NLPLA
    BUDAT
    ZINDAT
    ZARDAT
    ZCLDAT</b>
    Based on above selection criteria i need to fetch above internal table fields data.
    Then need to Move corresponding header and item data in ITAB_RESULT internal table.
    I need to fetch above fields based on above 5 tables and put in final Internal Table.
    Can anybody tell me the logic how can i write the same.
    Also can anybody tell me i am trying to create a DataBaseView for
    Z0MNH, Z3MANBOXIDHDR, Z3MANBOXIDITM, Z3MANBOXIDSERIAL and LTAP tables.
    <b>Note:
    1. Z3MANBOXIDITM table may contain multiple material[MATNR] for same box-id[EXIDV] (with another line item).
    2.  Z3MANBOXIDSERIAL table may contain multiple record for one box id[EXIDV]+item_no[ITEM_NO].</b>
    But what are the <b>TABLE/JOIN Conditions</b> i need to write while creating <b>DB View</b> for above <b>5</b> tables.
    Can anybody solve above 2 issues!
    Thanks in advance.
    Thanks,
    Deep.

    Hi Deep,
    While creation of DB view just make sure abt the key relation between the tables. Based on that u can join the tables...First fetch the data from header table then by using for all entries u can fetch the line items data.
    Hope this helps you. Reply for queries, shall post the updates.
    Regards. 
    Kumar.

Maybe you are looking for

  • Run Rapid Install error:InDbCtxFile.uploadCtx()

    Hi, We are upgrading from 11.5.10.2(Database 10.2.0.3) to 12.0.4,while doing the Rapid Install wizard to lay down the file system,i have seen the errors in logfile as below. 1)Attempting upload of Context file and templates to database...ERROR: InDbC

  • Transferring iphoto library from macbook pro to MacBook Air - dates get scrambled

    Iphoto on old laptop : 7.1.5 Iphoto on new 9.4.2 When I open old library it askes to "update" the files.. does this a few times and end result is complete scramble of photos that were previously ordeded by date I tried to load 7.1.5 on new laptop but

  • Call transaction ME33K

    Dear Abapers, I have a problem when calling transaction ME33K from a custom program I develop. I know that we can pass agreement number using SAP memory with parameter ID = 'VRT'. This is the code to call transaction       SET PARAMETER ID 'VRT' FIEL

  • Setting hostname in Mail !

    Hi, Not sure if this is a Mail or my gateway issue: The issue is that when I send an email, and then look at the header of that message, it says "Received from unknown" Here is a snippet of the header: Received: from unknown (HELO p3presmtp01-06.prod

  • Os x build-in ftp-server ALLWAYS on!?

    hey everytime i start my computer the build-in ftp-server is on. 1. in safty point of view my computer is always open for hackers. 2. an other ftp-server app. i use want me to turn it of... and it starting to drive me mad.... 3. i hate not have contr