Posted: Sun Nov 04, 2007 5:55 pm Post subject: Add Comment to CALL FUNCTION Pattern via Clipboard
Commented CALL FUNCTION Pattern
This program provides a commented CALL FUNCTION Pattern. Simply execute this program, entering the desired function module name and it will place the commented pattern output into clipboard ready for pasting back.
CALL FUNCTION popup_with_table_display "
IMPORTING
choise = " sy-tabix Number of table entry
EXPORTING
endpos_col = " int4 Ending position of popup
endpos_row = " int4 Ending position of popup
startpos_col = " int4 Starting position of popup
startpos_row = " int4 Starting position of popup
titletext = " char80 Text in title bar of popup
TABLES
valuetab = " Table with possible values
. " POPUP_WITH_TABLE_DISPLAY
Code:
*&---------------------------------------------------------------------*
*& Beautiful Function Module Call via clipboard *
*&---------------------------------------------------------------------*
*-----------------------------------------------------------------------
* This program takes a parameter as a Function Module Name
* and does a documented "pattern paste"
* Returns pattern Code Via ClipBoard
*-----------------------------------------------------------------------
PROGRAM zclip_pattern.
PARAMETERS: p_func LIKE fupararef-funcname. " Name of Function Module
DATA : BEGIN OF i_tab OCCURS 0,
funcname LIKE fupararef-funcname,
" Name of Function Module
paramtype LIKE fupararef-paramtype,
" Parameter type
pposition LIKE fupararef-pposition,
" Internal Table, Current Line Index
optional LIKE fupararef-optional,
" Optional parameters
parameter LIKE fupararef-parameter,
" Parameter name
defaultval LIKE fupararef-defaultval,
" Default value for import parameter
structure LIKE fupararef-structure,
" Associated Type of an Interface Parameter
stext LIKE funct-stext,
" Short text
END OF i_tab.
DATA: BEGIN OF mtab_new_prog OCCURS 0,
line(172) TYPE c,
END OF mtab_new_prog.
DATA: funcdesc LIKE tftit-stext, " Short text for function module
mylen TYPE i,
myrc TYPE i.
CONSTANTS: myhats(40) VALUE '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'.
TRANSLATE p_func TO UPPER CASE.
SELECT SINGLE
tftit~stext " Short text for function module
INTO funcdesc
FROM tftit
WHERE tftit~funcname = p_func
AND tftit~spras = sy-langu.
TRANSLATE p_func TO LOWER CASE.
CONCATENATE `CALL FUNCTION ` p_func ` " ` funcdesc
INTO mtab_new_prog-line.
APPEND mtab_new_prog.
TRANSLATE p_func TO UPPER CASE.
SELECT
fupararef~funcname " Name of Function Module
fupararef~paramtype " Parameter type
fupararef~pposition " Internal Table, Current Line Index
fupararef~optional " Optional parameters
fupararef~parameter " Parameter name
fupararef~defaultval " Default value for import parameter
fupararef~structure " Associated Type of an Interface Parameter
funct~stext " Short text
INTO TABLE i_tab
FROM fupararef
INNER JOIN funct
ON fupararef~funcname = funct~funcname
AND fupararef~parameter = funct~parameter
AND funct~spras = sy-langu
WHERE fupararef~funcname = p_func
AND fupararef~r3state = 'A'
ORDER BY fupararef~paramtype
fupararef~pposition.
LOOP AT i_tab.
AT NEW paramtype.
CASE i_tab-paramtype.
WHEN 'C'.
MOVE ' CHANGING' TO mtab_new_prog-line.
WHEN 'E'.
MOVE ' IMPORTING' TO mtab_new_prog-line.
WHEN 'I'.
MOVE ' EXPORTING' TO mtab_new_prog-line.
WHEN 'T'.
MOVE ' TABLES' TO mtab_new_prog-line.
WHEN 'X'.
MOVE ' EXCEPTIONS' TO mtab_new_prog-line.
ENDCASE.
APPEND mtab_new_prog.
ENDAT.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.