CALL function to extract data from a structure table

Hi Gurus,
Anyone knows how to write a call function to extract data from a structure table?
Your help is very much appreciated.
Thanks alot.

Hi,
structure doesnot hold any data. instead of it you can check the stucture in which table it is used, find the table name,use select query to extract the data u needed.
you can use where used list option to find the structure in which table it is used.
regards
siva

Similar Messages

  • Extracting data from a Structure in R/3.

    Hi,
    This is in continuation to one of my previous questions.
    I found that for a standard report  "S_ALR_87012347"  for FI GL in R/3, the values are taken from a structure "FAGL_S_RFBPET00_LIST2".
    I have used 0FIGL_O02 DSO and 0FI_GL_3 Datasource. The problem is I do not get proper values for G/L Account where the account type is either K (Vendor) or D (Customer). Instead of showing the Vendor/Customer Number here the report shows the G/L account number which is quite obvious. But if we see in the R/3 report (mentioned above), the account number field shows the Vendor/Customer Number if the Account Type is either K or D.
    My question is: can I directly extract data from the Structure FAGL_S_RFBPET00_LIST2?
    If yes, then how...???
    Thanks...!

    Structure does not contains any data. You have to write code (Function module) to populate the data for structure fields.

  • Error Extracting data from a STRUCTURE in SELECT statement

    Hi,
    I have an SAP defined structure BIW_KNA1_S which has been enhanced with 2 fields (ZZS1 and ZZS2). I need to populate these 2 fields with data from the 2 SORT fields from ADRC table.
    I tried the following code but i do not get any output. This piece of code is in a FORM statement from which i should return contents of table ITAB in the foll. code.
    DATA ZS TYPE TABLE OF ADRC WITH HEADER LINE.
    DATA ITAB LIKE TABLE OF BIW_KNA1_S WITH HEADER LINE.
    FIELD-SYMBOLS: <FS> LIKE ITAB.
    SELECT SORT1 SORT2 FROM ADRC INTO CORRESPONDING FIELDS OF TABLE
    ZS WHERE ADDRNUMBER IS NOT NULL.
    LOOP AT ITAB ASSIGNING <FS>.
    IF ZS-ADDRNUMBER IS NOT INITIAL.
      <FS>-ZZS1 = ZS-SORT1.
      <FS>-ZZS2 = ZS-SORT2.
    ENDIF.
    ENDLOOP.
    Since i did not get any output, I then added the foll. line of code before the LOOP statement.
    SELECT * FROM BIW_KNA1_S INTO CORRESPONDING FIELDS OF TABLE ITAB
    WHERE KUNNR IS NOT NULL.
    When i execute this, i get the foll. error.
    "BIW_KNA1_S is not defined in the ABAP dictionary as table, projection view or database view."
    How to extract data from a structure BIW_KNA1_S using a SELECT statement.
    Could someone help.
    Thanks

    Hi Roberto,
    Ok. Let me explain my requirement more clearly. I don't want to write the code in include ZXRSAU02. In ZXRSAU02, i will have only PERFORM statement which will call the FORM statement depending on the name of the program.
    Ex: PERFORM form_name ...tables i_t_data.
    In this way, i don't need to make any changes in this file. I will only need to make the changes in the report where my Actual FORM code resides. In the ABAP report, i will have my FORM code which will return contents.
    And this is the code which my FORM report will consist:
    DATA ZS TYPE TABLE OF ADRC WITH HEADER LINE.
    DATA ITAB LIKE BIW_KNA1_S OCCURS 10 WITH HEADER LINE.
    FIELD-SYMBOLS: <FS> LIKE ITAB.
    SELECT SORT1 SORT2 FROM ADRC INTO CORRESPONDING FIELDS OF TABLE ZS WHERE ADDRNUMBER IS NOT NULL.
    LOOP AT ITAB ASSIGNING <FS>.
    IF ZS-ADDRNUMBER IS NOT INITIAL.
      <FS>-ZZS1 = ZS-SORT1.
      <FS>-ZZS2 = ZS-SORT2.
    ENDIF.
    ENDLOOP.
    But as you said, i will have some problems i suppose. Like if my ADRC has some 70 records and if there are 100 records in BIW_KNA1_S, then when i try to copy the fields from ADRC into ITAB (BIW_KNA1_S) i might have problems. I will get back to you once i clarify these things.
    Thanks for your reply.

  • How to extract data from a structure?(Data Dictionary)

    Hi all,
           This is regarding extracting data from a structure.
    For Eg:if we want to extract data from a structure ADDR1_DATA,How will we do that in report programming?Structures on its own has no existence unless it s attached to a database table or view.when am using 'Where used List' on that structure also I am not getting any database tables or views.What can I do about this?
    Thanking you,
    anjaly

    HI Anjaly,
    as you said structure does not have any value .. unless something is added to it..
    So just use the structure to define the type of the sttructure you want..
    Or to include it in your itab like..
    data : Begin of itab occurs 0.
           include structure ADDR1_DATA.
    data  i type i.
           end of itab.
    you cannot directly extract data from the  structure ADDR1_DATA..
    regards
    satesh

  • How extract data from case structure

    Hi all, I would like to extract the data from case structure, it's circled in red in the attached file. How should I do it? Thanks for taking your time to look at my post. Your help is greatly appreciated.
    Attachments:
    bp.jpg ‏161 KB

    Thank you guys for your prompt reply.
    As u can see from the vi, there's an error, I need the values in the circled area to be passed on to the block ( Bundled by name)
    Thanks !
    Attachments:
    fyp_bp_only.vi ‏90 KB
    fyp_bp_only.vi ‏90 KB

  • How to extract  data from a structure?

    I want to get the data KWERT from structure KOMV.
    is there a way to do this? thanks..

    Hello,
    U can't get data from the structure.
    Find out the dataelement of the field KWERT and search for where used list.It will list number of tables from which u can find out the table from which can fetch the data of the field KWERT.
    Don't forget to award points.#
    Regards,
    Vasanth

  • Error while extracting data from Generic VBAK Table

    Hi,
    When i am extracting data from VBAK using generic extraction via tavle, i am, getting the error "Syntax error in program "SAPLXRSA ""
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "SAPLRSAP" had to be terminated because it has
        come across a statement that unfortunately cannot be executed.
        The following syntax error occurred in program "SAPLXRSA " in include "ZXRSAU01
         " in
        line 159:
        "The type of the database table and work area (or internal table) "L_ST"
        "R_CE1IDEA" are not Unicode convertible. ."
    Please help me out in fixing this,
    Thansk,

    do you have an user-exit? if yes, post the code....
    did you try regenerating the entire stuff (ds, structure,...)...there might be a mismatch between the structures of datasource and the generated extraction program....
    M.

  • Gurus...Need help....extract data from BKPF header table and BSEG line item

    Gurus,
    I have to write the logic to fetch data from bkpf and bseg. Need help on how can i do that..
    I have to get bukrs  belnr gjahr ldgrp from BKPF for a given date and company code. For all these documents, then i have to get the line items from BSEG if the ldgrp is I1 or SPACE.
    If the ldgrp is not I1 or SPACE then i have to fetch the records from BSEG_ADD and then generate a ALV report with all the data including the data that was fetched from BKPF.
    So, it wil be a combined ALV report that displays header as well as LINE item data together...
    Can u please help me with the code...I am not sure how can everything go all together in one internal table....Becoz once its there in one table then only a ALV list can be generated.......
    Cheers:
    Sam

    hi Sam, this may be of some similar thing.
    Use this program, I got this prog from a source and we added a small conditional check in the program which checks document numbers in BSEG and also comapres in BKPF and sees if the output from BSEG falls under the posting data range specified in the initial selection.
    Now just so you know, this output is kinda messed up, so you will have to play with it in Excel to extract the document numbers, if that is what you want.
    ============================
    PROGRAM....... ZFI_BSEG_DOWNLOAD
    TITLE......... Download BSEG
    PROGRAM TYPE.. Download
    ======================================================================
    GENERAL DOCUMENTATION AND COMMENTS
    <...>
    ======================================================================
    ASSOCIATED PROGRAMS
    <Program>..... <Description>
    ======================================================================
    CHANGE HISTORY
    Date By Ticket Description
    REPORT zfi_bseg_download.
    TABLES: bseg, bkpf.
    TYPES: BEGIN OF ty_output,
    line(6000) TYPE c,
    END OF ty_output.
    TYPES: ty_tab_output TYPE TABLE OF ty_output,
    ty_tab_nametab TYPE TABLE OF x031l.
    CONSTANTS: c_delimiter(04) TYPE c VALUE '"%%"',
    c_records TYPE i VALUE 10000.
    SELECTION-SCREEN
    SELECT-OPTIONS: p_bukrs FOR bseg-bukrs,
    p_belnr FOR bseg-belnr,
    p_buzei FOR bseg-buzei,
    p_gjahr FOR bseg-gjahr,
    p_budat for bkpf-budat.
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_append AS CHECKBOX DEFAULT 'X'.
    START-OF-SELECTION
    START-OF-SELECTION.
    PERFORM get_records.
    *& Form get_records
    FORM get_records.
    DATA: l_cursor TYPE cursor,
    lt_bseg TYPE TABLE OF bseg,
    ls_bseg LIKE LINE OF lt_bseg,
    lt_output TYPE ty_tab_output,
    ls_output LIKE LINE OF lt_output,
    lt_nametab TYPE ty_tab_nametab,
    ls_nametab LIKE LINE OF lt_nametab,
    l_field(30) TYPE c,
    l_output(50) TYPE c,
    l_date(10) TYPE c,
    l_len TYPE i.
    FIELD-SYMBOLS: <field>.
    IF p_append NE space.
    OPEN DATASET p_file FOR APPENDING IN TEXT MODE.
    ELSE.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE.
    ENDIF.
    Retrieve BSEF fieldnames and data types
    PERFORM get_fields CHANGING lt_nametab.
    OPEN CURSOR l_cursor FOR
    SELECT * FROM bseg
    WHERE bukrs IN p_bukrs
    AND belnr IN p_belnr
    AND buzei IN p_buzei
    AND gjahr IN p_gjahr.
    Write out fieldnames
    IF p_append IS INITIAL.
    LOOP AT lt_nametab INTO ls_nametab.
    CONCATENATE ls_output ls_nametab-fieldname
    INTO ls_output SEPARATED BY c_delimiter.
    ENDLOOP.
    IF ls_output+0(4) = c_delimiter.
    SHIFT ls_output LEFT BY 4 PLACES.
    ENDIF.
    l_len = strlen( ls_output ).
    TRANSFER ls_output TO p_file LENGTH l_len.
    ENDIF.
    Process BSEG records
    DO.
    CLEAR lt_bseg.
    FETCH NEXT CURSOR l_cursor
    INTO TABLE lt_bseg
    PACKAGE SIZE c_records.
    IF sy-subrc 0.
    EXIT.
    ENDIF.
    LOOP AT lt_bseg INTO ls_bseg.
    SELECT single * FROM BKPF
    WHERE BUKRS = ls_bseg-BUKRS
    AND BELNR = ls_bseg-BELNR
    AND GJAHR = ls_bseg-GJAHR
    AND BUDAT in p_budat.
    if syst-subrc 0.
    continue.
    endif.
    CLEAR ls_output.
    Process individual fields of BSEG record
    LOOP AT lt_nametab INTO ls_nametab.
    CONCATENATE 'LS_BSEG-' ls_nametab-fieldname INTO l_field.
    ASSIGN (l_field) TO <field>.
    CLEAR l_output.
    Process by field data types
    CASE ls_nametab-exid.
    WHEN 'C' OR 'N' OR 'I'.
    Character, Numeric & Integer
    l_output = <field>.
    WHEN 'D'.
    Dates
    WRITE <field> TO l_date DD/MM/YYYY.
    l_output = l_date.
    WHEN 'P'.
    Packed decimals
    WRITE <field> TO l_output.
    WHEN OTHERS.
    MESSAGE a000(zs) WITH 'Data type error - ' ls_nametab-exid.
    ENDCASE.
    SHIFT l_output LEFT DELETING LEADING space.
    CONCATENATE ls_output l_output
    INTO ls_output SEPARATED BY c_delimiter.
    ENDLOOP.
    IF ls_output+0(4) = c_delimiter.
    SHIFT ls_output LEFT BY 4 PLACES.
    ENDIF.
    l_len = strlen( ls_output ).
    TRANSFER ls_output TO p_file LENGTH l_len.
    ENDLOOP.
    IF sy-subrc = 0.
    ENDIF.
    ENDDO.
    CLOSE CURSOR l_cursor.
    CLOSE DATASET p_file.
    ENDFORM. " get_records
    *& Form get_fields
    FORM get_fields CHANGING pt_nametab TYPE ty_tab_nametab.
    CALL FUNCTION 'RFC_GET_NAMETAB'
    EXPORTING
    tabname = 'BSEG'
    TABLES
    nametab = pt_nametab
    EXCEPTIONS
    table_not_active = 1
    OTHERS = 2.
    IF sy-subrc 0.
    ENDIF.
    ENDFORM. " get_fields
    hope this helps.
    cheers,
    Hema.

  • How can I extract data from ST03 - what tables are used?

    Hi
    I currently have to create performance statistics daily for management. To do this I use transaction ST03 and manually copy the previous days Dialog average response time, DB, CPU and GU av. times into a spreadsheet, and also the average dialog response time for 4 key transactions from the transaction profile.
    It would be nice to automate this. I was thinking of writing a basic ABAP program to query the relevant tables to extract this data - does anyone know which tables are used? I'd tried running a trace but it was not clear which tables/rows etc would be required.
    Thanks
    Ross

    Ok, that FM is an old one - for NW2004s (700) need to use 'SWNC_COLLECTOR_GET_AGGREGATES'.
    Have a basic program below. What I'm trying to do is get the average response time for transactions. I can get 'respti' from the table but I think this is the total response time - what field represents average response time?
    Also, the numbers that it's pulling back don't seem to match the numbers in ST03 at all... except 'dcount'. This seems to correct ly show the number of steps... but the other values don't match anything. What am I doing wrong?
    Program below...
    Cheers
    Ross
    REPORT  Z_GETSTATS.
    PARAMETER: day TYPE dats DEFAULT sy-datum.
    DATA: t_usertcode  TYPE swnc_t_aggusertcode,
          wa_usertcode TYPE swncaggusertcode.
    START-OF-SELECTION.
    CALL FUNCTION 'SWNC_COLLECTOR_GET_AGGREGATES'
        EXPORTING
          component     = 'TOTAL'
          periodtype    = 'D'
          periodstrt    = day
        TABLES
          usertcode     = t_usertcode
        EXCEPTIONS
          no_data_found = 1
          OTHERS        = 2.
      LOOP AT t_usertcode INTO wa_usertcode.
             WRITE:/ wa_usertcode-entry_id.
             WRITE:/ wa_usertcode-respti, wa_usertcode-procti, wa_usertcode-cputi, wa_usertcode-dcount, wa_usertcode-ucount.
             WRITE:/ '*************************************'.
      ENDLOOP.

  • How to extract data from a pool table?

    Hello,
    I want to create an generic extractor for table T030, but this is a pool/cluster table and it is not possible to create a view for such a table.
    Do somebody know how to solve this problem? Does there exist function modules to read the data from a pool data?
    Thanks
    Theodor

    Function Module would be your best bet..considering thats the best way as far as performance is taken into consideration.
    But there is a work around too...
    If the other table u use in the join is not a clusture table then u can create a view on that table and u can add append structure to this  with fields from the clusture table and use an exit to populate it.
    Try it Will Work...used this technique when I used KONV.* This Procedure does not decrease performance considerably.
    at least in my case as thre were only a few fields i needed from pool table
    Hope this Helps
    Anand Raj

  • Function to extract data from a ledger to a detail account

    I have created a ledger sheet to collect income and expense chronologically.  I have created running totals by account in another sheet using the SUMIFS function, which works well.
    I would also like to collect the ledger data in seperate detail accounts so the function would look for an account number field and when it finds a match move the related data to the detail account sheet.
    I would like to end up with a Ledger (which I have working) with all entries by date order and a Totals sheet with a running total (which I have working) and a number of separate account sheets with the detail by account.  What function do I need to accomplish the detail by account issue?

    Attached is a screenshot of what I already have.  I would like all the Account 402 entries to appear in order in the Account 402 Escrow sheet.

  • Problem in extracting data from Z totals table (special Ledger)

    Hi Gurus,
    I am in a task of pulling in specific fields from the Z Totals Table of Special Purpose Ledger into the cube. We only need totals records and do not need line items.
    In SBIW, i have generated the transfer structure and datasource for totals table as per the steps of Generic extraction.
    The problem is that am not able to see all the fields (like balance carried forward, total transactions) in the selection fields screen. While extracting i choose totals records only. But now my datasource got generated and am able to see that it is active (green). But some important fields like balance are missing.
    Please let me know your suggestions / ideas.
    Thanks
    Shreya

    We have the exact same Challenge and Issue.   When I view my generated extract structure 3FI_SL_ZB_TT, I don't see any of my key figures.  This was created off the Special Ledger Summary or totals table.
    For Instance, I need fields KSLVT through KSL16. That is, Balance Carried forward in Group currency (period 0) and, total of transactions of the period in group currency, (periods 1-16).  I don't see these at all in the generated extract structure.  Does that mean it must be appended in via transaction RSA6?
    Also, to get the Balance Carried forward do I have to add 0BALANCE to the extract structure?
    Finally, besides the beginning balance, which wiil remain constant, can I get Month-end Year To Date Balances using this approach.  Note, I don't need detail from the line items table.  I just want to make sure I don't need to use that in concert with a Delta and ODS to get my Month End YTD Balance.  I only need this cube for Balances.
    Thanx,
    Joe M

  • How to extract data from a large table!

    Hi all,
    I am working on a survey application using JSP, where users login to the application and fill out survey form. Responses of users are stored in a database table as a numeric value ranging from 1-10. Now I want to create some standard reports based on these records. The problem I foresee here is that every survey has almost 15000 user�s records, in this way we have million of records in the table where we keep records. Now while creating reports, if I search the database for these millions of records and then do some calculations/computations on these values, this will turn out a mess. Please suggest what is the best approach to handle the situation.
    Thanks

    thats something for a Database forum.
    But basicly: Use good indexes !

  • Unable to extract data from an AS/400 system.

    Hello experts.
    We are trying to extract data from an AS/400 system but not having any success until now.
    I´ll write down you the stepts that we have followed until now:
    1.- Create a DB Connect between both systems
    2.- Create a Source System from AS400 in the workbench under DB Connect Directory
    3.- Generate datasources from tebles specified in the schema of the connection
    break point -
    At this point, we had a problem with some tables with at least one fieldname containing character "Ñ".
    After asking some possible solutions to SAP, the told us this is not supported, as the system can´t have any object with character "Ñ", so the transfer structure was unable to activate with this fields in the datasource.
    --- end of brek point --
    4.- After those issues, we´ve decided to implement, in another schema, views from those tables which had the fieldnames with that character "Ñ", changing them to an "N".
    5.- We´ve created another source system with that schema, and user than can see that schema.
    6.- To be able to see those views, in transaction RSDBC, we had to deactivate the two checkboxes in the first window ( Choose tables and Choose views) .
    7.- Right afeter, we could generate correctly the datasources from this logical tables.
    8.- We have designed  the hole dataflow for this datasources and everithing went rigth.
    9.- But wen we tried to execute the infopackage to extract data from those logic tables, we cannot get any registers. Acctualy the charge remains yellow after the job have finished.
    Please, I would appreciate any help you could give us on this problem.
    Thank you very much
    Regards
    Joaquin

    I´d like ti add something to this thread, and maybe clarify a littel bit the question.
    The only way that the BW system recognizes those logical tables, through transaction RSDBC is checking out the two boxes on this transaction, "Select Tables" and "Select Views".
    I don´t know haw these logical tables have been created, bus does this mean that the are not neither tables or views as BW understand them.
    Please, if someone knows anythin about this, answer to this thread.
    Thank you very much.
    Joaquin Sobrido

  • Extract data from CAUFVD

    Is there a way to extract data from CAUFVD structure? I need to get the field for the Delivered Quantity (CAUFVD-GWEMG) but it is not in tables AUFK or AFPO.
    Thanks

    Hi,
    Check the field WEMNG in table AFPO.
    System passes the  above table details to CAUFVD-GWEMG in LCOIHFHI.
    move afpod-wemng            to caufvd-gwemg.
    Please check, I dont have any data to test in my system.
    Shiva

Maybe you are looking for

  • Aperture Facebook integration all screwed up

    1) Sometimes not all of the photos get synced up. Aperture says it's done, but only 40-50 of 100 photos are visible on Facebook. 2) Faces are not linked consistently. For example, sometimes someone will be tagged and then in another photo they won't

  • Problem in using 2 IDs for iTunes music purchase downloads and using iTunes Match for 1 ID

    Dear support managers, We are using 1 macbook pro and 2 apple ID for purchasing iTunes music together (Me and my wife). Actually, I have bought 1 year service of iTunes match on my apple ID and have been using well the service after download the purc

  • Get weekday of DD/MM/YYYY

    I thought I'd almost got here with this script set ShotDate to do shell script "exiftool -s3 -DateTimeOriginal /Users/StudioA/Desktop/MJC_0025.JPG " log ShotDate set theYear to (characters 1 thru 4 of ShotDate) as text set theMonth to (characters 6 t

  • If I redeem an app store gift card on my ipod will i be able to use it on my mac app store too?

    Hi, I just got two App Store Gift Cards and was wondering if I could redeem the two cards on my account and use them for my mac and ipod. Can I? I want to get mac os x lion when it comes out, but also want to get a few apps for my ipod. Please Help..

  • Help me this error :"uncaught error fetching image"

    I have a program written with Swing. This program has one button and fetch Image into this button. Image is in Images directory .When I run this program by IDE, It's OK. However, when I compress classes of this program into Jar file and run, it can n