Skip to Content
author's profile photo Former Member
Former Member

program to get tables used in reports

Hi,

My Requirement is to fetch all custom programs from TADIR table and want to display in a report format.

If i click on a program i want to get a a diagram consist of tables used in that report with ralations it's just like table relation in SQ02.

Anyone tell me is there any standard function module in sap.

and Is there any function module giving table names if we give a program name otherthan GET_TABLES

Thanks & Regards,

Laxmi

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 09:18 AM

    hi

    use this fm RS_PROGRAM_TABLES or you can do one more thing

    go to transaction se 38 then go to utilities->cross reference->database operations

    then go to se49

    hope it helps

    regards

    Aakash Banga

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 09:19 AM

    there is no such f.m

    below report will give all table details for program or for t.code

    TABLES : DD03l, DD02l.

    DATA : Program like sy-repid.

    DATA : BEGIN OF I_FINAL OCCURS 0,

    tabname LIKE dd02l-tabname,

    TABCLASS LIKE dd02l-tabCLASS,

    TEXT LIKE DD02T-DDTEXT,

    END OF I_FINAL.

    DATA : BEGIN of ITAB Occurs 0,

    name like dd02l-tabname,

    END OF ITAB.

    DATA : TCD(100) TYPE C.

    DATA : var1 LIKE dd02l-tabname.

    DATA : DESC LIKE TSTCT-TTEXT.

    *SELECTION SCREEN

    selection-screen skip.

    SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

    PARAMETERS : r1 RADIOBUTTON GROUP r DEFAULT 'X'.

    Parameters : Tcode like sy-tcode.

    selection-screen skip.

    PARAMETERS : r2 RADIOBUTTON GROUP r.

    Parameters : Prog like sy-repid.

    SELECTION-SCREEN END OF BLOCK b2.

    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-001.

    select-options : Type for dd02l-tabclass .

    SELECTION-SCREEN END OF BLOCK B1 .

    *AT SELECTION SCREEN *

    at selection-screen.

    if r1 = 'X' and Tcode is initial.

    message e001(00) with 'Enter Transaction Code' .

    elseif r2 = 'X' and Prog is initial.

    message e001(00) with 'Enter Program Name' .

    endif.

    • START OF SELECTION *

    START-OF-SELECTION.

    if r1 = 'X'.

    Prog = ' '.

    select single * from TSTC where tcode = tcode.

    if sy-subrc = 0.

    program = TSTC-PGMNA.

    select single TTEXT from tstct into desc where tcode = tcode and SPRSL = 'E'.

    else.

    Write :/ 'Invalid Transaction Code'.

    exit.

    endif.

    elseif r2 = 'X'.

    Tcode = ' '.

    program = Prog.

    endif.

    CALL FUNCTION 'GET_TABLES'

    EXPORTING

    PROGNAME = Program

    TABLES

    TABLES_TAB = itab.

    if itab is initial.

    skip.

    skip.

    skip.

    skip.

    skip.

    WRITE :/40 'No Data Found' color 6 INTENSIFIED OFF.

    ELSE.

    PERFORM : categorize.

    endif.

    • END OF SELECTION *

    END-OF-SELECTION.

    LOOP AT I_FINAL.

    WRITE :/4 I_FINAL-tabname COLOR 2 INTENSIFIED OFF NO-GAP HOTSPOT ON, 35 I_FINAL-TABCLASS COLOR 2 INTENSIFIED OFF NO-GAP,

    50 I_FINAL-TEXT COLOR 2 INTENSIFIED OFF NO-GAP.

    ENDLOOP.

    • AT LINE SELECTION *

    AT LINE-SELECTION.

    TCD = SY-LISEL.

    var1 = TCD+3(30).

    set parameter id 'DTB' FIELD VAR1.

    call transaction 'SE11' and skip first screen.

    • TOP OF PAGE *

    TOP-OF-PAGE.

    WRITE :/45 'TABLE DETAILS RELATED TO THE TRANSACTION CODE' COLOR 7 .

    WRITE :/2 'DATE : ' COLOR 1, SY-DATUM COLOR 1 INTENSIFIED OFF NO-GAP.

    WRITE :/2 'TRANSACTION CODE : ' COLOR 1, Tcode COLOR 1 INTENSIFIED OFF NO-GAP.

    WRITE :/2 'TCODE DESCRIPTION : ' COLOR 1, desc COLOR 1 INTENSIFIED OFF NO-GAP.

    WRITE :/2 'PROGRAM NAME : ' COLOR 1, PROGRAM COLOR 1 INTENSIFIED OFF NO-GAP.

    SKIP 1.

    WRITE :/1(140) SY-ULINE.

    WRITE :/4 'TABLE NAME' COLOR 5 INTENSIFIED OFF NO-GAP,35 'TABLE TYPE' COLOR 5 INTENSIFIED OFF NO-GAP,

    55 'DESCRIPTION' COLOR 5 INTENSIFIED OFF NO-GAP.

    WRITE :/1(140) SY-ULINE.

    .

    FORM categorize .

    SELECT dd02ltabname dd02ltabCLASS DD02T~DDTEXT

    FROM dd02l INNER JOIN DD02T ON dd02ltabname = dd02Ttabname

    INTO TABLE I_FINAL

    FOR ALL ENTRIES IN itab

    WHERE DD02L~TABNAME = ITAB-NAME AND TABCLASS IN TYPE AND DDLANGUAGE = 'E'.

    if sy-subrc <> 0.

    skip.

    skip.

    skip.

    skip.

    skip.

    WRITE :/40 'No Data Found' color 6 INTENSIFIED OFF.

    endif.

    ENDFORM.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 09:50 AM

    Use the FM - RS_GET_PROGRAM_TABLES_FIELDS

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.