Dynamic selction tables and fields

Hi Folks,
I have an issue while creating program using field symbols My requirement is I need to develop a program to get table counts with respect to username and date .For that I wrote below program
REPORT  ZDYNAMICFIELDS.
PARAMETERS: TABNAM TYPE DD03L-TABNAME.
PARAMETERS: FLD1 TYPE DD03L-FIELDNAME.
PARAMETERS: FLD2 TYPE DD03L-FIELDNAME.
DATA: FIELD1 TYPE REF TO DATA,
      FIELD2 TYPE REF TO DATA.
CREATE DATA: FIELD1 TYPE (FLD1),
             FIELD2 TYPE (FLD2).
*FIELD-SYMBOLS: <FLD1> TYPE ANY,
              <FLD2> TYPE ANY.
ASSIGN: FIELD1-> TO <FLD1>,
       FIELD2->* TO <FLD2>.
DATA: BEGIN OF ITAB,
      FIELD1 LIKE FIELD1,
      FIELD2 LIKE FIELD2,
      END OF ITAB.
DATA: ITAB1 TYPE REF TO DATA.
CREATE DATA: ITAB1 TYPE TABLE OF ITAB.
FIELD-SYMBOLS: <FS_IT> type standard table.
ASSIGN: ITAB1->* TO <FS_IT> .
DATA: STR TYPE STRING.
CONCATENATE FLD1 FLD2 INTO STR SEPARATED BY ''.
CONDENSE STR.
SELECT (STR) FROM (TABNAM) INTO TABLE <FS_IT> UP TO 1000 ROWS.
write:/ 'total number of records' ,sy-dbcnt.
But this is not working for DATE and TIME fileld,
Can anyone please help me to resolve this issue....
Thanks & Regards,
Sreedhar Tammineni.

Hi Sreedhar,
Are you trying to achieve something like this?
SELECT * FROM (p_table) INTO TABLE <gt_itab>.
  READ TABLE <gt_itab> ASSIGNING <gs_result>
          WITH KEY (lw_key_field1) = p_cond1
                   (lw_key_field2) = p_cond2
                   (lw_key_field3) = p_cond3
                   BINARY SEARCH.
  IF sy-subrc = 0.
    WRITE / 'Record found.'.
  ELSE.
    WRITE / 'No record found.'.
  ENDIF.
where p_table, p_cond1 etc., are selection screen parameters? I found such example in the link below
http://www.divulgesap.com/blog.php?p=ODM=
Hope it helps.
Regards,
Ravi

Similar Messages

  • Some help needed on dynamic internal tables and field symbols

    Hi,
    I have a dyn internal table <dyn_table_r>.
    One of its fields is kna1-kunnr.
    I have another wa <fs>, with only one field alt_kunnr.
    now i want to modify  the data of <dyn_table_r>-kna1-kunnr from <fs>-alt_kunnr
    How should i do it?
    Regards ,
    Harshit Rungta

    Harshit Rungta:
    You have opened a number of related questions today. I'd like to see the other ones closed before you continue with this one.
    I'll lock this but will re-open it once the others are marked as solved.
    Rob

  • Dynamic Work Area and field symbol

    Hi All,
    I'm have a big internal table like this
    data: begin of data occurs 0,
    Field01,
    Field02,
    Field03,
    *bucket 1
    Field04,
    Field05,
    Field06,
    *bucket 2
    Field04,
    Field05,
    Field06,
    *bucket 3
    Field04,
    Field05,
    Field06,
    Field 1, 2 3 will be the same for pernr, first last name.
    Field 4, 5, 6 are the same format but different numbers (or values ) in different buckets.
    Each bucket can be shown (or not) based on the condition of a person, for example if that person live in 2 states, it will show 2 bucket with 2 address info inside each.
    I will run this under get pernr to sort out each person who have many address or not.
    Can I use dynamic work area and field symbol here? if I can, how?
    Really appreciate your help with points...

    You can use the ASSIGN COMPONENT ... and than APPEND the work area to the table.
    Check out this sample program:
    REPORT  ZTEST_NP.
    DATA: BEGIN OF ITAB OCCURS 0,
          F1    TYPE I,
          F2    TYPE I,
          F3    TYPE I,
          END   OF ITAB.
    DATA: WA_ITAB LIKE ITAB.
    DATA: L_CNT TYPE I.
    FIELD-SYMBOLS: <F_FLD> TYPE ANY.
    DO 10 TIMES.    " I want 10 reocrds
      CLEAR L_CNT.
      DO 3 TIMES.   " I have 3 fields
        L_CNT = L_CNT + 1.
        ASSIGN COMPONENT L_CNT OF STRUCTURE WA_ITAB TO <F_FLD>.
        <F_FLD> = L_CNT.
      ENDDO.
      APPEND WA_ITAB TO ITAB.
      CLEAR  ITAB.
    ENDDO.
    LOOP AT ITAB INTO WA_ITAB.
      WRITE: / WA_ITAB-F1,
               WA_ITAB-F2,
               WA_ITAB-F3.
    ENDLOOP.
    Regards,
    Naimesh Patel

  • About Asset report - table and fields

    Hi ,
    I am developing an Asset Report, I need table and field names for following -
    a) GL A/C P&L
    b) ASSET DEPRECIATION SCHEDULED
    c) FORCASTED DEPRECIATION
    d) PLANNED EXPENSES VERSES ACTUAL EXPENSES
    e) GAP DEPRECIATION CATEGORY
    e) When user enters the asset into SAP, the depreciation expense will automatically book to the sub-ledger. However in order to get the amount on the general ledger, which would be closed for prior periods, user must book a manual entry. So , I need this manual entry field.
    Please guide me.
    Regards,
    Narayan

    problem solved

  • Sale Order Item Level Text Field which table and field

    Hi,
    Thanks for your prompt reply and best solution.
    Can you please tell me one more thing, in sale order at item level the TEXT Field maintaining by user at transaction level now they want that field in one of the report, so can you please tell what is the table and field where i will get this sale order item level text details.

    Hello,
    is this going to work for item level text as well.
    can you tell how to proceed with this functional module
    or is there any other thing required.Please elaborate to
    understand better way.
    You can check out two table in respect to Sales TEXT i.e. STXH (STXD SAPscript text file header) and STXL(SAPscript text file lines).
    The best approach of tracing out the Text in respect to Sales Order would be to use the Function module READ_TEXT and put this FM in SE37 and execute with the following parameter.
    Client
    Text ID of text to be read
    Language of text to be read
    Name of text to be read
    Object of text to be read
    Archive handle
    Text catalog local
    When you are essentially looking to read item level Text with respect to Sales Order then your Text OBject would be VBBP.
    Regards,
    Sarthak

  • Sales order item level partial delivery field table and field?

    Will anyone share your expertise,  In SD sales order level, at item what is the table and field name in which the partial delivery status is stored.  I want the table and field name?.  will anyone share pl.

    Hi,
    Try with table VBUP - and field LFSTA.
    Regards

  • What are  the tables and fields  in fico & sd module

    what are  the tables and fields  in fico & sd module

    Hi,
    <b> Sales and Distribution:</b>
    Customers KNA1 General Data
    KNB1 Customer Master – Co. Code Data (payment method, reconciliation acct)
    KNB4 Customer Payment History
    KNB5 Customer Master – Dunning info
    KNBK Customer Master Bank Data
    KNKA Customer Master Credit Mgmt.
    KNKK Customer Master Credit Control Area Data (credit limits)
    KNVV Sales Area Data (terms, order probability)
    KNVI Customer Master Tax Indicator
    KNVP Partner Function key
    KNVD Output type
    KNVS Customer Master Ship Data
    KLPA Customer/Vendor Link
    Sales Documents VBAKUK VBAK + VBUK
    VBUK Header Status and Administrative Data
    VBAK Sales Document – Header Data
    VBKD Sales Document – Business Data
    VBUP Item Status VBAP Sales Document – Item Data
    VBPA Partners
    VBFA Document Flow
    VBEP Sales Document Schedule Line
    VBBE Sales Requirements: Individual Records
    SD Delivery DocumeLIPS Delivery Document item data, includes referencing PO
    LIKP Delivery Document Header data
    Billing Document VBRK Billing Document Header
    VBRP Billing Document Item
    SD Shipping Unit VEKP Shipping Unit Item (Content)
    VEPO Shipping Unit Header
    <b>Financial Accounting</b>
    FBAS             Financial Accounting “Basis”
    BKPF             Accounting Document Header              BUKRS / BELNR / GJAHR
    BSEG             Accounting Document Segment             BUKRS / BELNR / GJAHR / BUZEI
    BSIP             Index for Vendor Validation of Double   BUKRS / LIFNR / WAERS / BLDAT /
                     Documents                               XBLNR / WRBTR / BELNR / GJAHR / BUZEI
    BVOR             Inter Company Posting Procedure         BVORG / BUKRS / GJAHR / BELNR
    EBKPF            Accounting Document Header (docs from   GLSBK / BELNR / GJHAR / GLEBK
                     External Systems)
    FRUN             Run Date of a Program                   PRGID
    KLPA             Customer / Vendor Linking               NKULI / NBUKR / NKOAR / PNTYP
                                                             / VKULI / VBUKR / VKOAR
    KNB4             Customer Payment History                KUNNR / BUKRS
    KNB5             Customer Master Dunning Data            KUNNR / BUKRS / MABER
    KNBK             Customer Master Bank Details            KUNNR / BANKS / BANKL / BANKN
    KNC1             Customer Master Transaction Figures     KUNNR / BUKRS / GJHAR
    KNC3             Customer Master Special GL Transactions KUNNR / BUKRS / GJAHR / SHBKZ
                     Figures
    LFB5             Vendor Master Dunning Data              LIFNR / BUKRS / MABER
    LFBK             Vendor Master Bank Details              LIFNR / BANKS / BANKL / BANKN
    LFC1             Vendor Master Transaction Figures       LIFNR / BUKRS / GJHAR
    LFC3             Vendor Master Special GL Transactions   LIFNR / BUKRS / GJHAR / SHBKZ
                     Figures
    VBKPF            Document Header for Document Parking    AUSBK / BUKRS / BELNR / GJHAR
    FBASCORE         Financial Accounting General Services “Basis”
    KNB1             Customer Master (Company Code)          KUNNR / BUKRS
    LFA1             Vendor Master (General Section)         LIFNR
    LFB1             Vendor Master (company Code Section)    LIFNR / BUKRS
    SKA1             G/L Account Master (Chart of Accounts)  KTOPL / SAKNR
    SKAT             G/L Account Master (Chart of Accounts – SPRAS / KTOPL / SAKNR
                     Description)
    MAHNS            Accounts Blocked by Dunning Selection   KOART / BUKRS / KONKO / MABER
    MHNK             Dunning Data (Account Entries)          LAUFD / LAUFI / KOART / BUKRS /
                                                             KUNNR / LIFNR / CPDKY / SKNRZE /
                                                             SMABER / SMAHSK / BUSAB
    FI-GL-GL (FBS)   General Ledger Accounting: Basic Functions- G/L Accounts
    SKAS             G/L Account Master (Chart of Accounts – SPRAS / KTOPL / SAKNR / SCHLW
                     Key Word list)
    SKB1             G/L Account Master (Company Code)       BUKRS / SAKNR
    FI-GL-GL (FBSC)  General Ledger Accounting: Basic
                     Functions - R/3 Customizing for G/L Accounts
    FIGLREP          Settings for G/L Posting Reports        MANDT
    TSAKR            Create G/L account with reference       BUKRS / SAKNR
    FI-GL-GL (FFE)   General Ledger Accounting: Basic
                     Functions - Fast Data Entry
    KOMU             Account Assignment Templates for G/L    KMNAM / KMZEI
                     Account items
    FI-AR-AR (FBD)   Accounts Receivable: Basic Functions - Customers
    KNKA             Customer Master Credit Management :     KUNNR
                     Central Data
    KNKK             Customer Master Credit Management :     KUNNR / KKBER
                     Control Area Data
    KNKKF1           Credit Management : FI Status data      LOGSYS / KUNNR / KKBER / REGUL
    RFRR             Accounting Data – A/R and A/P           RELID / SRTFD / SRTF2
                     Information System
    FI-BL-PT         Bank Accounting: Payment (BFIBL_CHECK_D)  Transactions – General Sections
    PAYR             Payment Medium File                     ZBUKR / HBKID / HKTID / RZAWE /
                                                             CHECT
    PCEC             Pre-numbered Check                      ZBUKR / HBKID / HKTID / STAPL
    FI-BL-PT-AP(FMZA)Bank Accounting: Payment Transactions – Automatic Payments
    F111G            Global Settings for Payment Program for MANDT
                     Payment Requests
    FDZA             Cash Management Line Items in Payment   KEYNO
                     Requests
    PAYRQ            Payment Requests                        KEYNO
    Hope this solves your concern...
    Regards,
    Habeeb
    Assign points if helpful

  • Help needed  in Table and field

    Hi all,
    can any one tell me the table and field to get basic unit of measure and unit of issue.
    I guess both are different.
    Thanks

    For base unit of measure, uom, T006 is the main table.But whereever you have a quantity yu will find UOM in that table. The field is MEINS.
    when you say unit of issue, you mean actual unit of measure right?
    In that case it again depends on what you are looking at. Example
    in table LIPS there is base UOM and Actual UOM.
    base is always "MEINS" and actual is "LFIMG" in this case.
    So get the table in your functional area and check for the actual uom field in SE11.
    Regards
    Message was edited by:
            Sandeep Bhavsar

  • Table and field for Department ID, Department ID desc, and DIV

    Hi,
    We're planning to develop a "Z" report, by extending CJI3 transaction. I want to add the following fields to this new report. I just wanted to know from what tables these fields are coming from standard SAP (I believe these fields might be related to controlling, so I'm posting in this forum):
    1. Department ID
    2. Department ID Description
    3. Division (DIV)
    Aman

    Hi Asim ,
    The currency in Material Master is updated from the Company Code.
    At first system checks the company code for which the Plant is assigned and picks the currecy from the company code.
    You can find the same in Table T001 ; Field - WAERS
    What do u mean by Product ID ? Let me know where does it exist in Material Master.
    If you know the view, press F1 and then Technical Inf to get the table and Field Name.
    Regards
    Ramesh Ch

  • Table and field for the given object

    Hi all,
    We are developing a report , i need following table and fields. Could you please help me on this?
    Supplier
    No of approval required
    Approval status
    Approval pending with
    In approval since
    Thanks in advance , will appriciate any input
    Hareesha

    Hi  ,
    Still am not able to find out the FM/ table whom its pending for approval (shopping cart). Could you please help me on this?
    (E.g: Shopping cart got created and having 7 levels of approval (Manager1, 2, 3,4,5,6 and 7),let us say First 2 manageru2019s approved, 3rd manager has to approve the Shopping cart, we need to pull these information of pending with 3rd manager in our Z-report )
    Thanks in advance
    Harish

  • Sub Contracting PO- Table and Fields for Materials sent

    Dear Friends,
    I am preparing a functional spec for the sub contracting PO.
    Can you pls provide information about the tables and fields from where the data about the materials to be sent to subcontractor are picked?
    Its picking from the structure MDPM. But pls throw some light on the same how the data is picked and printed in PO from certain tables.
    Thanks in advance
    Shashidhar

    Dear Shash,
    Here some details of table infirmation not only your related feild available in all feilds
    http://www.erpgenie.com/sap/abap/tables_fi.htm
    Hope this helps you
    Prem.

  • Key Figure Reference table and fields

    I am getting the following error:
    /BIC/CSSMMIMI1-/BIC/KFMI_LCHF (specify reference table AND reference field)
    I am aware that it is asking me to put a reference table and field for the field in the structure.
    However, what I am not sure about is should I do this action from SE11 or is there a program or other method which would be more suitable (this is not business content)?
    Thanks

    Hi Edwin,
    Thanks for that, the currency type and quantity type are hard coded in the key figure for most of the key figures apart from one, i.e for the quanity I hard code PCS
    From RSD2 I just check the repair option is that correct

  • Tcode CA03's  table and fields

    Hello Expert,
    In CA03 Transaction Code, there are fields like Operating ,workcenter, plant , control Key, Activity Type etc..
    I just want to know where these all customization can be done want to check cost center and activity hours for one article.
    I want to create one report where i have to display below fields :
    material, workplace ,costcenter, activity, hourse.
    i am not getting the exact table and fields.
    and how can i calculate hours based on activity???means activity duration (machine hour and man hour).
    Thanks in Advance.
    Sujeet

    Hi,
    Check the following tables:
    CSKS - Cost center master
    CSKT - Cost center texts
    CSLA - Activity master
    CSLT  - Activity type texts
    CSSL  - Cost center / activity
    Hope this helps you
    Regards,
    Rajnai

  • Asset accounting Tables and Fields.

    Hi Experts,
    I need some table and field in asset accounting, my requirement is below.
    1) 2009 depreciation expense for all assets still in service (not written off during 2009) (by class, by asset); and
    2) 2009 depreciation expense on all assets written off during the year (by class, by asset)
    Thanks in advance.
    REgards,
    Sam.

    Hi Sam,
    I think in ANLC you find what you need.
    If not, give me feedback
    regards Bernhard

  • Table and fields for tax details

    Hi,
    I have to create one Finance module Report in which i want to display net amount without tax for one single line item which is open item for incoming customer invoice, the accounting department need to know the net value (without tax) .
    In tcode FB03 , if you see the document number then it will give all accounts(customer), posting key wise amount, but this amount is gross amount. in this amount tax amount is added as per tax code. (you can see by clicking tax details tab), and tax calculated is for whole ducoments number not for single line item.
    i want net amount without adding tax amount for particular single line item. so please guide me table and fields from where and how i can calculate. in tax tab there is field base amount but its giving calculation against all total against document.
    table i am using in my report is KNA1.KNKK, KNB1, BKPF. BSEG.
    Give me some idea. how can i prepare report.
    Have a Nice Day,
    Regards,
    Sujeet

    Dear Dzed Maroz ,
    Thanks for your reply.
    I have already checked these fields (HWSTE, FWSTE) in table BSET. this fields tax amount againt that Document Number. (which may contains more than one line items), but my requirement is to find the amount without tax for individual line item.
    reason is , i want to display in my report only open items and it will be a line item, so i am displaying net amount as well base amount (without tax) for particular line items.
    but tax details is calculated based on document number not against customer number.this is incoming invoice
    ,and in customization tax code is assigned, so its reflecting amount after including tax amount.
    is there any way to find out solution? please give me some idea.
    regards,
    sujeet

Maybe you are looking for

  • Adobe Premiere CC 2014 crashing and can't open project in Premiere CC

    Hi, Till now I had been working with Premiere CC with no problems. I decided to try out Premiere CC 2014 with a new project, and I regret I did. I start working ok, but after about an hour of editing, it freezes on playback. And its a much smaller pr

  • How to open .p7s files

    Can anyone please tell me the best way to open a smime.p7s attachment? Do I have to download a viewer? The online directions I've found are confusing. Thanks.

  • Created new mailbox, not showing up

    I recently created a new top level mailbox, named "Sent Messages"; it did not appear immediately after creation, and hasn't shown up after restarting Mail. I thought maybe I didn't hit the "OK" button during the Naming prompt, so I tried to add a new

  • Combining two itunes accounts

    Hi!  I am guessing it happened when I got an iphone through my job, but I ended up with two seperate itunes accounts.  It seems like some things on my iphone reference one account whereas the other things reference the other account.  I really want t

  • Candy crush horror and thieves NO REPAIR AND NO SUPPORT App Store is useless too

    For months now I've sent over 100 emails complaining about Candy Crush not working properly. I've received NO HELP. 0% besides automatic emails to watch the same videos.  I've sent them screen pictures SEVERAL times. They reply with the exact same em