RFC_READ_REPORT

I have been scouring the forums and Google all day and still can not figure out why the RFC_READ_REPORT is only display the report ABAP code. It seems kind of silly that this would be the only functionality of this RFC. Does any one have any ideas as to why this would be? I am working on a R/3 4.0B implementation. Also how would I pass report parameters?
Thanks In Advance,
Christopher Caruso

Hello Chris.
RFC_READ_REPORT cannot be used, because it function module source code is all are comment out.
Please use RFC_READ_DEVELOPMENT_OBJECT, when you want to read the source code of a report program by RFC.

Similar Messages

  • RFC Error when using SAPRFC against a Unicode System

    Hi Everybody,
    I try to use the PHP SAPRFC extension against a Unicode System. When I call the client.php which comes with the source package from http://saprfc.sourceforge.net/ where I added:
                   "CODEPAGE"=>"4103",                  // codepage Unicode
                   "UNICODE"=>"1",                      // Unicode
    to the $LOGIN array I get this error:
    Warning: RFC Error Info : Group : 103 Key : RFC_ERROR_LOGON_FAILURE Message : D
    in /var/www/saprfc/client.php on line 48
    RFC connection failed with error:RFC Error Info : Key : C
    Status : EXCEPTION SYSTEM_FAILURE RAISED Message : D Internal:
    there are two trace files after the call. One called dev_rfc.trc with this content:
    **** ERROR file opened at 20060605 050220 CEST, SAP-REL 640,0,119 RFC-VER 3 818129 MT-SL
    T:1079532480 Error in program 'apache2': ======> D
    T:1079532480 Error in program 'apache2':
    <* RfcReceive [1] : returns 3:RFC_SYS_EXCEPTION
    and a file called rfc27443_1079532480.trc:
    **** Trace file opened at 20060605 050500 CEST, SAP-REL 640,0,119 RFC-VER 3 818129 MT-SL
    <<< RfcOpenEx failed
    >TS> Mon Jun  5 05:05:06 2006
    resize I/O buffer to 16000 bytes
    >>>> [7] <unknown>    : EXT  <ac: 74> L sapserver.test.com >>> OPEN  
    UUID: ab_drvstate create uuid {44839DD5-9DCE-6B32-E200-12FDBA107532}
    >>>> [7] <unknown>    : EXT  <ac: 75> L sapserver.test.com >>> 45573492 (45573492)
      -{44839DD5-9DCE-6B32-E200-12FDBA107532}
    >>> RfcOpenEx ...
    Got following connect_param string:
       ASHOST=sapserver.test.com SYSNR=00 CLIENT=002 USER=developer PASSWD=*******
    LANG=EN CODEPAGE=4103 UNICODE=1 TRACE=1
    Send RFCHEADER: 01/LIT/IEEE/SPACE/4103
    Send UNICODE-RFCHEADER: cp:4103/ce:IGNORE/te:REJECT/cs:1/rc:0x00000023
    UUID: send_rfcuuid {44839DD5-9DCE-6B32-E200-12FDBA107532}
    >>> Logon check: calling RFCPING
    >>> RfcCall [7] ...
    *> RfcCall
      FUNCTION RFCPING
            handle = 7
            parameter   = <NULL>
            tables      = <NULL>
    UUID:  RfcCallNew send the uuid to the partner {44839DD5-9DCE-6B32-E200-12FDBA107532}
    >>>> [7] <unknown>    : EXT  <ac: 76> L sapserver.test.com >>> WRITE (45573492)
      -{44839DD5-9DCE-6B32-E200-12FDBA107532}
    000000 | D9C6C3F0 F0F0F0F0 F0F0F0E3 01010008 |................|
    000010 | 01010101 04010003 01010103 00040000 |................|
    000020 | 020B0103 0106000B 04010003 01000100 |................|
    000030 | 00002301 06000700 0F313237 2E302E30 |..#......127.0.0|
    000040 | 2E312020 20202020 00070011 00014500 |.1      ......E.|
    000050 | 11001200 04363430 20001200 13000436 |.....640 ......6|
    000060 | 34302000 13000800 20736172 67652D77 |40 ..... sarge-w|
    000070 | 77772020 20202020 20202020 20202020 |ww              |
    000080 | 20202020 20202020 20000800 0600803C |         ......<|
    000090 | 756E6B6E 6F776E3E 00000000 00000000 |unknown>........|
    0000a0 | 00000000 00000000 00000000 00000000 |................|
    0000b0 | 00000000 00000000 00000000 00000000 |................|
    0000c0 | 00000000 00000000 00000000 00000000 |................|
    0000d0 | 00000000 00000000 00000000 00000000 |................|
    0000e0 | 00000000 00000000 00000000 00000000 |................|
    0000f0 | 00000000 00000000 00000000 00000000 |................|
    000100 | 00000000 00000000 00000000 00000000 |................|
    000110 | 06051400 10D59D83 44CE9D32 6BE20012 |........D..2k...|
    000120 | FDBA1075 32051401 30000761 70616368 |...u2...0..apach|
    000130 | 65320130 01110009 44455645 4C4F5045 |e2.0....DEVELOPE|
    000140 | 52011101 17000D56 F94AFD31 E72211B4 |R......V.J.1."..|
    000150 | 1DCED7F3 01170114 00033030 32011401 |..........002...|
    000160 | 15000145 01150501 00010105 01050200 |...E............|
    000170 | 00050200 0B000336 3430000B 01020007 |.......640......|
    000180 | 52464350 494E4701 02051400 10D59D83 |RFCPING.........|
    000190 | 44CE9D32 6BE20012 FDBA1075 320514FF |D..2k......u2...|
    0001a0 | FF0000FF FF000000 00000000 00000000 |................|
    >>>> [7] <unknown>    : EXT  <ac: 77> L sapserver.test.com >>> FLUSH(WRITE) (45573492)
      -{44839DD5-9DCE-6B32-E200-12FDBA107532}
    <* RfcCall [7] : returns 0:RFC_OK
    >>>> [7] <unknown>    : EXT  <ac: 78> L sapserver.test.com >>> FLUSH(WRITE) (45573492)
      -{44839DD5-9DCE-6B32-E200-12FDBA107532}
    >>>> Listen/WaitForRequest (counter = 4)
    >>>> [7] <unknown>    : EXT  <ac: 79> L sapserver.test.com >>> LISTEN (45573492)
      -{44839DD5-9DCE-6B32-E200-12FDBA107532}
    000000 | 01010008 01010101 04010003 01010103 |................|
    000010 | 00040000 020B0103 0106000B 04010003 |................|
    000020 | 01000200 00002301 06001600 08310031 |......#......1.1|
    000030 | 00300030 00001600 07001E31 0030002E |.0.0.......1.0..|
    000040 | 00310032 0038002E 00330036 002E0031 |.1.2.8...3.6...1|
    000050 | 00350020 00200020 00000700 11000233 |.5. . . .......3|
    000060 | 00001100 12000836 00320030 00200000 |.......6.2.0. ..|
    000070 | 12001300 08360032 00300020 00001300 |.....6.2.0. ....|
    000080 | 08004064 00650063 00720030 0034005F |[email protected]._|
    000090 | 00430052 0034005F 00300030 00200020 |.C.R.4._.0.0. . |
    0000a0 | 00200020 00200020 00200020 00200020 |. . . . . . . . |
    0000b0 | 00200020 00200020 00200020 00200020 |. . . . . . . . |
    0000c0 | 00200000 08000601 003C756E 6B6E6F77 |. .......<unknow|
    0000d0 | 6E3E0000 00000000 00000000 00000000 |n>..............|
    0000e0 | 00000000 00000000 00000000 00000000 |................|
    0000f0 | 00000000 00000000 00000000 00000000 |................|
    000100 | 00000000 00000000 00000000 00000000 |................|
    000110 | 00000000 00000000 00000000 00000000 |................|
    000120 | 00000000 00000000 00000000 00000000 |................|
    000130 | 00000000 00000000 00000000 00000000 |................|
    000140 | 00000000 00000000 00000000 00000000 |................|
    000150 | 00000000 00000000 00000000 00000000 |................|
    000160 | 00000000 00000000 00000000 00000000 |................|
    000170 | 00000000 00000000 00000000 00000000 |................|
    000180 | 00000000 00000000 00000000 00000000 |................|
    000190 | 00000000 00000000 00000000 00000000 |................|
    0001a0 | 00000000 00000000 00000000 00000000 |................|
    0001b0 | 00000000 00000000 00000000 00000000 |................|
    0001c0 | 00000000 00000000 00000605 140010D5 |................|
    0001d0 | 9D8344CE 9D326BE2 0012FDBA 10753205 |..D..2k......u2.|
    0001e0 | 14050000 00050004 03002E43 0041004C |...........C.A.L|
    0001f0 | 004C005F 00460055 004E0043 00540049 |.L._.F.U.N.C.T.I|
    000200 | 004F004E 005F004E 004F0054 005F0046 |.O.N._.N.O.T._.F|
    000210 | 004F0055 004E0044 00040304 02004046 |.O.U.N.D......@F|
    000220 | 0075006E 00630074 0069006F 006E0020 |.u.n.c.t.i.o.n. |
    000230 | 006D006F 00640075 006C0065 00200022 |.m.o.d.u.l.e. ."|
    000240 | 00524643 50494E22 0020006E 006F0074 |.RFCPIN". .n.o.t|
    000250 | 00200066 006F0075 006E0064 002E0004 |. .f.o.u.n.d....|
    000260 | 02FFFF00 00FFFF00 00000000 00000000 |................|
    <* RfcListen [7] : returns 0:RFC_OK
    >>> RfcReceive [7] ...
    Received RFCHEADER [7]: 01/LIT/IEEE/SPACE/4103
    Received UNICODE-RFCHEADER [7]: cp:4103/ce:IGNORE/te:REJECT/cs:2/rc:0x00000023
    UUID: ab_rfccheck_uuid compare uuid's {44839DD5-9DCE-6B32-E200-12FDBA107532}
    Error in program 'apache2': ======> F
    >>>> [7] <unknown>    : EXT  <ac: 80> L sapserver.test.com >>> CLOSE abrfcrcv_mt.c 429 (45573492)
      -{44839DD5-9DCE-6B32-E200-12FDBA107532}
    *> RfcReceive
            handle = 7
            parameter   = <NULL>
            tables      = <NULL>
             Data conversion On
    Error in program 'apache2': <* RfcReceive [7] : returns 3:RFC_SYS_EXCEPTION
    >>>> [7] <unknown>    : EXT  <ac: 81> L sapserver.test.com >>> FREE abrfcio_mt.c 3517 (45573492)
      -{44839DD5-9DCE-6B32-E200-12FDBA107532}
    **** Trace file opened at 20060605 050506 CEST, SAP-REL 640,0,119 RFC-VER 3 818129 MT-SL
    <<< RfcOpenEx failed
    Our SAP Environment is:
    - SAP Web AS 6.20 Unicode Kernel Patchlevel 1602
    - Windows 2003 Server
    - Oracle
    On the PHP Side I use:
    - Debian GNU/Linux 3.1 (Sarge)
    - Apache 2 2.0.54-5
    - PHP4 4.3.10-16
    - SAPRFC 1.4.1
    - SAP RFC SDK non Unicode 6.20 and 6.40 (The problem occurs in both versions)
    Had anyone had sucess using SAPRFC against a Unicode System?
    Regards
    Gregor

    Hi Anton,
    I've just tried your suggestion. I've commented out the CODEPAGE and UNICODE values in my Array and placed:
    [code]saprfc_set_code_page($rfc, "4103");[/code]
    after the
    [code]$rfc = saprfc_open ($LOGIN);[/code]
    The error message I get now is:
    [code]Warning: RFC Error Info : Key : Status : EXCEPTION FU_NOT_FOUND RAISED Message :
    Internal: in /var/www/saprfc/client.php on line 58
    Discovering interface of function module RFC_READ_REPORT failed[/code]
    In the trace File I see:
    [code]>>>> [3] <unknown>    : EXT  <ac: 40> L sapserver.test.com >>> WRITE (80999721)
      -{44839E3E-9E3B-6B30-E200-0534B0CD3057}
    000000 | 05020000 0502000B 00063600 34003000 |..........6.4.0.|
    000010 | 000B0102 00385200 46004300 5F004700 |.....8R.F.C._.G.|
    000020 | 45005400 5F004600 55004E00 43005400 |E.T._.F.U.N.C.T.|
    000030 | 49004F00 4E005F00 49004E00 54004500 |I.O.N._.I.N.T.E.|
    000040 | 52004600 41004300 45005F00 50000102 |R.F.A.C.E._.P...|
    000050 | 05140010 3E9E8344 3B9E306B E2000534 |....>..D;.0k...4|
    000060 | B0CD3057 05140201 00104600 55004E00 |..0W......F.U.N.|
    000070 | 43004E00 41004D00 45000201 0203001E |C.N.A.M.E.......|
    000080 | 5246435F 52454144 5F524550 4F525420 |RFC_READ_REPORT |
    000090 | 20202020 20202020 20202020 20200203 |              ..|
    0000a0 | 03010010 50004100 52004100 4D005300 |....P.A.R.A.M.S.|
    0000b0 | 5F005000 03010330 00040000 00010330 |_.P....0.......0|
    0000c0 | 03020008 000000D8 00000000 0302FFFF |................|
    0000d0 | 0000FFFF 00000000 00000000 00000000 |................|
    >>>> [3] <unknown>    : EXT  <ac: 41> L sapserver.test.com >>> FLUSH(WRITE) (80999721)
      -{44839E3E-9E3B-6B30-E200-0534B0CD3057}
    <* RfcCall [3] : returns 0:RFC_OK
    >>> RfcReceive [3] ...
    >>>> [3] <unknown>    : EXT  <ac: 42> L sapserver.test.com >>> FLUSH(WRITE) (80999721)
      -{44839E3E-9E3B-6B30-E200-0534B0CD3057}
    >>>> [3] <unknown>    : EXT  <ac: 43> L sapserver.test.com >>> READ (80999721)
      -{44839E3E-9E3B-6B30-E200-0534B0CD3057}
    000000 | 05000000 05000415 00044600 4C000415 |..........F.L...|
    000010 | 04160002 45000416 04170006 30003400 |....E.......0.4.|
    000020 | 36000417 04010018 46005500 5F004E00 |6.......F.U._.N.|
    000030 | 4F005400 5F004600 4F005500 4E004400 |O.T._.F.O.U.N.D.|
    000040 | 0401FFFF 0000FFFF 00000000 00000000 |................|
    >>>> [3] <unknown>    : EXT  <ac: 44> L sapserver.test.com >>> FLUSH (READ) (80999721)
      -{44839E3E-9E3B-6B30-E200-0534B0CD3057}[/code]
    Regards
    Gregor

  • Find the package of a tcd / program, and then find enhancements

    how to find package for a tcode
    like for me21n is ME
    i want find the package for the program of any tcode and so that i can find the enhancement with the help of the package in smod
    Edited by: Julius Bussche on Feb 10, 2009 4:26 PM
    Please use meaningfull subject titles

    Hi Rahul,
    This code might be helpfull:
    report zedgar_user_exits line-size 254.                     "100.
    tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir,tstct.
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    data: l_prog like rs38l-include.
    parameters: p_tcode like tstc-tcode. " OBLIGATORY.
    parameters: p_actv as checkbox default 'X',
                p_sum as checkbox.
    start-of-selection.
      select single * from tstc where tcode eq p_tcode.
      if sy-subrc eq 0 or p_tcode is initial.
        if not p_tcode is initial.
          select single * from tadir where pgmid = 'R3TR'
                                       and object = 'PROG'
                                       and obj_name = tstc-pgmna.
          move : tadir-devclass to v_devclass.
          if sy-subrc ne 0.
            select single * from trdir where name = tstc-pgmna.
            if trdir-subc eq 'F'.
              select single * from tfdir where pname = tstc-pgmna.
              select single * from enlfdir where funcname = tfdir-funcname.
              select single * from tadir where pgmid = 'R3TR'
                                           and object = 'FUGR'
                                           and obj_name eq enlfdir-area.
              move : tadir-devclass to v_devclass.
            endif.
          endif.
          select * from tadir into table jtab
                            where pgmid = 'R3TR'
                            and object = 'SMOD'
                            and devclass = v_devclass.
        else.
    *      SELECT * FROM TADIR INTO TABLE JTAB
    **                      WHERE pgmid = 'R3TR'
    *                       WHERE OBJECT = 'SMOD'.
    **                      AND devclass = v_devclass.
          select * from modsapt
                  where sprsl = sy-langu.
            jtab-obj_name = modsapt-name.
            append jtab.
          endselect.
        endif.
        select single * from tstct where sprsl eq sy-langu and
                                   tcode eq p_tcode.
        format color col_positive intensified off.
        if p_sum is initial.
          write:  /(19) 'Transaction Code - ', 20(20) p_tcode,
                 45(50) tstct-ttext.
          skip.
        endif.
        if not jtab[] is initial.
          if p_sum is initial.
            write:/(95) sy-uline.
            format color col_heading intensified on.
            write: /1 sy-vline, 2 'Exit Name', 21 sy-vline ,
                   22 'Description', 95 sy-vline.
            write:/(95) sy-uline.
          endif.
          loop at jtab.
            select single * from modsapt
                    where sprsl = sy-langu and
                    name = jtab-obj_name.
            format color col_normal intensified off.
            if p_actv is initial.
              write:/1 sy-vline, 2 jtab-obj_name hotspot on,
                          21 sy-vline , 22 modsapt-modtext, 95 sy-vline.
            endif.
            tables: modsap.
            data: l_1.
            clear l_1.
            select * from modsap where name = jtab-obj_name
                                   and typ = 'E'.
              if p_actv is initial.
                select single * from tfdir where funcname = modsap-member.
              else.
                select single * from tfdir where funcname = modsap-member
                                             and mand = 'C'.
              endif.
              if sy-subrc eq 0.
                if l_1 is initial.
                  l_1 = 'X'.
                  if p_sum is initial.
                    if not p_actv is initial.
                      write: /1 sy-vline, 2 jtab-obj_name hotspot on,
                             21 sy-vline , 22 modsapt-modtext, 95 sy-vline.
                      clear l_prog.
                      hide l_prog.
                    endif.
                  endif.
                endif.
                data: l_foi like modsap-member.
                l_prog = tfdir-pname+4.
                concatenate 'L' l_prog 'U' tfdir-include into l_prog.
                data: tab_prog type table of d022s with header line.
                clear tab_prog[].
                data: tab_prog2 type table of d022s with header line.
                clear tab_prog2[].
                call function 'RFC_READ_REPORT'
                     exporting
                          program = l_prog
                     tables
                          qtab    = tab_prog
                     exceptions
                          others  = 1.
                clear l_prog.
                loop at tab_prog.
                  if tab_prog-line cp '*INCLUDE*'.
                    replace 'INCLUDE' with '' into tab_prog-line.
                    replace '.' with '' into tab_prog-line.
                    shift tab_prog-line left deleting leading space.
                    write tab_prog-line to l_prog.
                    call function 'RFC_READ_REPORT'
                         exporting
                              program = l_prog
                         tables
                              qtab    = tab_prog2
                         exceptions
                              others  = 1.
                    loop at tab_prog2.
                      if tab_prog2-line eq space
                         or tab_prog2-line cp '#**'.
                        delete tab_prog2.
                      endif.
                    endloop.
                    if not tab_prog2[] is initial.
                      write: /  sy-vline,
                             21 sy-vline,
                                modsap-member,
                             50 l_prog hotspot on intensified,
                             95 sy-vline.
                      hide l_prog.
                      tables: tftit.
                      clear tftit.
                      select single * from tftit where spras = sy-langu
                                            and funcname = modsap-member.
                      if sy-subrc ne 0.
                        select single * from tftit where spras = 'EN'
                                             and funcname = modsap-member.
                        if sy-subrc ne 0.
                          select single * from tftit where spras = 'DE'
                                           and funcname = modsap-member.
                        endif.
                      endif.
                      write: tftit-stext.
                      l_foi = modsap-member.
                    endif.
                    exit.
                  endif.
                endloop.
                if l_foi ne modsap-member and p_actv is initial.
                  l_foi = modsap-member.
                  write: /  sy-vline,
                         21 sy-vline,
                            modsap-member color col_negative,
                         50 l_prog hotspot on intensified,
                         95 sy-vline.
                  hide l_prog.
                  clear tftit.
                  select single * from tftit where spras = sy-langu
                                        and funcname = modsap-member.
                  if sy-subrc ne 0.
                    select single * from tftit where spras = 'EN'
                                         and funcname = modsap-member.
                    if sy-subrc ne 0.
                      select single * from tftit where spras = 'DE'
                                       and funcname = modsap-member.
                    endif.
                  endif.
                  write: tftit-stext color col_negative.
                endif.
              endif.
            endselect.
          endloop.
          if p_sum is initial.
            write:/(95) sy-uline.
            describe table jtab.
            skip.
    *        FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    *        WRITE:/ 'No of Exits:' , SY-TFILL.
          endif.
        else.
    *      IF P_SUM IS INITIAL.
    *        FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    *        WRITE:/(95) 'No User Exit exists'.
    *      ENDIF.
        endif.
    *  ELSE.
    *  ENDSELECT.
    *    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    *    WRITE:/(95) 'Transaction Code Does Not Exist'.
      endif.
    at line-selection.
      get cursor field field1.
      if field1(4) eq 'JTAB' and p_sum is initial.
        set parameter id 'MON' field sy-lisel+1(10).
        call transaction 'SMOD' and skip first screen.
      else.
        if not l_prog is initial.
          set parameter id 'RID' field l_prog.
          data begin of bdcdata occurs 100.
                  include structure bdcdata.
          data end of bdcdata.
          data begin of itab occurs 10.
                  include structure bdcmsgcoll.
          data end of itab.
          clear: bdcdata[], bdcdata.
          clear: bdcdata.
          bdcdata-program  = 'SAPMS38E'.
          bdcdata-dynpro   = '0100'.
          bdcdata-dynbegin = 'X'.
          append bdcdata.
          clear: bdcdata.
          bdcdata-fnam     = 'RS38M-PROGRAMM'.
          bdcdata-fval     = l_prog.
          append bdcdata.
          clear: bdcdata.
          bdcdata-fnam     = 'BDC_OKCODE'.
          bdcdata-fval     = '=SHOP'.
          append bdcdata.
          call transaction 'SE38'  using bdcdata  mode 'E'
                                   messages into itab.
        endif.
      endif.
    regards,
    Edgar

  • Saving source code

    Hi Experts,
    is there any possibility to save the source code with 1 step? (E.g. main program in one file, includes in another file(s), etc...)
    So I would like to save the main program and every subroutines that belongs to it into one or different TXT files "with 1 click"!
    Thx in advance.

    I think you need to write a small utility for this
    report  zaRs
       no standard page heading
       line-size  95 .
    perform f_get_pgm.
      if not i_include[] is initial.
        clear v_index.
        loop at i_include into wa_include
          clear   : i_pgm.
          refresh : i_pgm.
          read report wa_include-txt into i_pgm.
          if sy-subrc eq 0.
          v_date = sy-datum.
          v_time = sy-uzeit.
          concatenate 'C:Backup_' v_date '_' v_time into v_file.
          call function 'WS_DOWNLOAD'
            exporting
              filename = v_file
              filetype = 'ASC'
              mode     = 'A'
            tables
              data_tab = i_pgm.
         endif.
        endloop.
      endif.
    form f_get_pgm.
      call function 'RFC_READ_REPORT'
        exporting
          program = p_rname
        tables
          qtab    = i_pgm.
      describe table i_pgm lines v_lines1.
      wa_include-txt = p_rname.
      append wa_include to i_include.
      if not i_pgm[] is initial.
        clear v_index.
        loop at i_pgm into wa_pgm.
          v_index = sy-tabix.
          translate wa_pgm to upper case.
          split wa_pgm-txt at '"' into wa_pgm-txt v_comment.
          if wa_pgm-txt(1) ne '*' and
              wa_pgm-txt cs 'INCLUDE'.
            replace '.' with space into wa_pgm-txt.
            condense wa_pgm-txt .
            split wa_pgm-txt at space into v_comment v_comment1.
            move v_comment1 to wa_include.
            append wa_include to i_include.
          endif.
        endloop.
      else.
        message i001 with text-001.
      endif.
      clear v_index.
      if not i_include[] is initial.
        loop at i_include into wa_include.
          v_index = sy-tabix.
          select obj_name from tadir
                                 into tadir-obj_name
                                 up to 1 rows
                                 where obj_name eq  wa_include-txt
                                 and   pgmid    eq 'R3TR'
                                 and   object   eq 'PROG'.
          endselect.
          if sy-subrc ne 0.
            delete i_include index v_index.
          endif.
        endloop.
      endif.
    endform.                    " f_get_pgm

  • Procedure to call an RFC from another R/3 system

    Hi ,
    I am new to RFC, how can we do the following steps:
    1.      Run a routine in Dev environment which calls an RFC which is in testing
    2.      The RFC performs the task as written  in it
    3.      RFC passes the result to routine in Dev and
    4.      We display the return in the end in Dev.
    Do i need any authorization for that?
    Regards,
    Pooja

    Hi,
    I wanted to know how to call an RFC from one R/3 system to another R/3 system .
    And what settings should be made to do a RFC in T code SM59?
    what does the function module RFC_READ_REPORT do? Can i call any program through this?(As the documentation is not available I am not able to understand the functionality of this Function module)
    Regards,
    Pooja

  • How does execute PHP Script from SAP?

    I've already installed SAPRFC and run SAP Function from PHP successfully. But failed when tried execute PHP script from SAP (SM59). Anyone can help me for a clear instruction for this problem?
    Thanks

    Hi Max,
    here is the Source:
    [code]
    #!/usr/bin/php -q
    <?php
    // SAPRFC - Server example
    // PHP server function RFC_READ_REPORT
    // Require: CGI version PHP, RFC destination defined in SAP R/3 (SM59)
    // http://saprfc.sourceforge.net
    // Interface definiton for RFC_READ_REPORT
    // (generated by saprfc.php - option Generate PHP)
       $DEF_RFC_READ_REPORT = array (
                             array (
                                     "name"=>"SYSTEM",
                                     "type"=>"EXPORT",
                                     "optional"=>"0",
                                     "def"=> array (
                                             array ("name"=>"","abap"=>"C","len"=>8,"dec"=>0)
                             array (
                                     "name"=>"TRDIR",
                                     "type"=>"EXPORT",
                                     "optional"=>"0",
                                     "def"=> array (
                                             array ("name"=>"NAME","abap"=>"C","len"=>40,"dec"=>0),
                                             array ("name"=>"SQLX","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"EDTX","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"VARCL","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"DBAPL","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"DBNA","abap"=>"C","len"=>2,"dec"=>0),
                                             array ("name"=>"CLAS","abap"=>"C","len"=>4,"dec"=>0),
                                             array ("name"=>"TYPE","abap"=>"C","len"=>3,"dec"=>0),
                                             array ("name"=>"OCCURS","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"SUBC","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"APPL","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"SECU","abap"=>"C","len"=>8,"dec"=>0),
                                             array ("name"=>"CNAM","abap"=>"C","len"=>12,"dec"=>0),
                                             array ("name"=>"CDAT","abap"=>"D","len"=>8,"dec"=>0),
                                             array ("name"=>"UNAM","abap"=>"C","len"=>12,"dec"=>0),
                                             array ("name"=>"UDAT","abap"=>"D","len"=>8,"dec"=>0),
                                             array ("name"=>"VERN","abap"=>"C","len"=>6,"dec"=>0),
                                             array ("name"=>"LEVL","abap"=>"C","len"=>4,"dec"=>0),
                                             array ("name"=>"RSTAT","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"RMAND","abap"=>"C","len"=>3,"dec"=>0),
                                             array ("name"=>"RLOAD","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"FIXPT","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"SSET","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"SDATE","abap"=>"D","len"=>8,"dec"=>0),
                                             array ("name"=>"STIME","abap"=>"C","len"=>6,"dec"=>0),
                                             array ("name"=>"IDATE","abap"=>"D","len"=>8,"dec"=>0),
                                             array ("name"=>"ITIME","abap"=>"C","len"=>6,"dec"=>0),
                                             array ("name"=>"LDBNAME","abap"=>"C","len"=>20,"dec"=>0)
                             array (
                                     "name"=>"PROGRAM",
                                     "type"=>"IMPORT",
                                     "optional"=>"0",
                                     "def"=> array (
                                             array ("name"=>"","abap"=>"C","len"=>40,"dec"=>0)
                             array (
                                     "name"=>"QTAB",
                                     "type"=>"TABLE",
                                     "optional"=>"0",
                                     "def"=> array (
                                             array ("name"=>"LINE","abap"=>"C","len"=>72,"dec"=>0)
    // Create list of PHP server functions
       $GLOBAL_FCE_LIST[RFC_READ_REPORT] = saprfc_function_define(0,"RFC_READ_REPORT",$DEF_RFC_READ_REPORT);
    // PHP server function
       function RFC_READ_REPORT ($fce)
           $REPORT = saprfc_server_import ($fce,"PROGRAM");
           saprfc_table_init ($fce,"QTAB");
           $fd = fopen ($REPORT,"r");
           if (!$fd)
               return ("NOTFOUND");     // raise exception "NOTFOUND"
           while (!feof($fd))
               $LINE = fgets ($fd,73);
               saprfc_table_append ($fce,"QTAB",array("LINE"=>$LINE));
           fclose ($fd);
           saprfc_server_export ($fce,"SYSTEM","PHP");
           return (true);
    // Call script with: ./server.php -a phpgw -g hostname -x sapgw00
       $rfc = saprfc_server_accept ($argv);
    // Dispatch one function call
       $rc = saprfc_server_dispatch ($rfc,$GLOBAL_FCE_LIST);
       saprfc_close ($rfc);
    ?>
    [/code]
    Regards
    Gregor
    Message was edited by: Gregor Wolf

  • Can you read Reports and Tables through RFCs and BAPIS?

    Is there any way to read established reports and tables through RFC or BAPI function calls?  We have a middleware that can execute various BAPIs and RFCs.  I see a few promising ones: RFC_READ_REPORT, but no examples anywhere what the parameters needed are for the inputs. 

    Hello Scott,
    Check below FMs for reading tables and programs.
    Tables : RFC_READ_TABLE
    Program : RFC_READ_DEVELOPMENT_OBJECT
    Please note that for reading program using RFC_READ_DEVELOPMENT_OBJECT , lines in program should not exceed 72 chars else FM will throw dump(READ_REPORT_LINE_TOO_LONG).
    Program code will appear in table QTAB which is 72 chars wide.

  • Happy with SAP and PHP

    Hi:
    I just read <b>John Coggeshall</b> blog...And gotta say..."Woaw, it blows my mind" -:D
    I have been an ABAP Consultant for 3 years and a very active PHP developer for more than 1 year. Actually...and sorry if anyone disagress...I hate Java and also hate JSP...I was glad when i read about BSP (Which i'm planning to learn)...But when i read that SAP and PHP can be mixed together...it was like a dream come true.
    As soon as i can, i'm going to set up my SAPRFC. And hope i can make some contributions to the community.
    Thanks SAP and Zend...For letting me create SAP Web Services without Java stuff -:)
    Greetings,
    Alvaro Tejada Galindo
    ABAP Consultant
    ActualiSap Consultores

    Sorry for my long time away...I have been pretty busy...
    Anyway...a few day ago, i managed to get all my PHP-to-SAP connection...And damn...I gotta say...i really get shocked...It's amazing what you can do, and how easy you can do it -:D
    I just have made two simple examples, but those we're enough to make me happy...I use RFC_READ_TABLE and RFC_READ_REPORT.
    I actually want to make some SM30 simulation...so as soon as get some demo version, i going to post it, or write a blog about it -;) Some time ago, i made something like that using PHP and MySQL...So i don't think it's going to be that hard...Anyway...I should show all the Abapers out there that PHP is a great programming language too and by mixing PHP and SAP...you can get a killer tool -;)
    Greetings,
    Blag.

Maybe you are looking for