SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Auto Program Generation



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP Dictionary
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Wed Apr 16, 2008 8:54 am    Post subject: Auto Program Generation Reply with quote

Code:
*----------------------------------------------------------------------*
* P R O G R A M H E A D E R *
*----------------------------------------------------------------------*
* Program ID : Header n Program Generation *
* Version : 1.0 *
* SAP Version : R/3 System *
* Program Name : ZVGTEST *
* Created by : Vaibhav B Gawali *
* Created on : 20070718 *
* Program Type : Report *
* Description : This reports generated a new report with *
* header and some default values. *
*----------------------------------------------------------------------*
REPORT zprogram2 NO STANDARD PAGE HEADING LINE-SIZE 65 LINE-COUNT 80.
*----------------------------------------------------------------------*
* TYPES *
*----------------------------------------------------------------------*
TYPES : BEGIN OF x_output,
str TYPE char72,
END OF x_output.
*----------------------------------------------------------------------*
* CONSTANTS *
*----------------------------------------------------------------------*
CONSTANTS : c_x TYPE char1 VALUE 'X',
c_i TYPE char1 VALUE 'I',
c_s TYPE char1 VALUE 'S',
c_rid TYPE char3 VALUE 'RID',
c_se38 TYPE char4 VALUE 'SE38',
c_star TYPE char1 VALUE '*',
c_dash TYPE char1 VALUE '-',
c_colon TYPE char1 VALUE ':',
c_01 TYPE char30 VALUE 'Title',
c_02 TYPE char30 VALUE 'Program ID',
c_03 TYPE char30 VALUE 'Version',
c_04 TYPE char30 VALUE 'SAP Version',
c_05 TYPE char30 VALUE 'Program Name',
c_06 TYPE char30 VALUE 'Created by',
c_07 TYPE char30 VALUE 'Created on',
c_08 TYPE char30 VALUE 'Program Type',
c_09 TYPE char30 VALUE 'Message Class',
c_10 TYPE char30 VALUE 'Description',
c_11 TYPE char30 VALUE 'Change History',
c_12 TYPE char30 VALUE 'Change Id',
c_13 TYPE char30 VALUE 'Author',
c_14 TYPE char30 VALUE 'Changed On',
c_15 TYPE char30 VALUE 'Description',
c_incl TYPE char35 VALUE ' INCLUDE',
c_type TYPE char35 VALUE ' TYPES',
c_cons TYPE char35 VALUE ' CONSTANTS',
c_itab TYPE char35 VALUE ' INTERNAL TABLES',
c_wa TYPE char35 VALUE ' WORK AREA',
c_var TYPE char35 VALUE ' VARIABLES',
c_range TYPE char35 VALUE ' RANGE',
c_fs TYPE char35 VALUE ' FIELD SYMBOLS',
c_ss TYPE char35 VALUE ' SELECTION SCREEN',
c_ssa TYPE char35 VALUE ' SELECTION SCREEN VALIDATION',
c_init TYPE char35 VALUE ' INITIALIZATION',
c_sos TYPE char35 VALUE ' START OF SELECTION',
c_eos TYPE char35 VALUE ' END OF SELECTION'.
*----------------------------------------------------------------------*
* INTERNAL TABLES *
*----------------------------------------------------------------------*
DATA :t_output TYPE TABLE OF x_output.
*----------------------------------------------------------------------*
* WORK AREA *
*----------------------------------------------------------------------*
DATA :w_output TYPE x_output.
*----------------------------------------------------------------------*
* VARIABLES *
*----------------------------------------------------------------------*
DATA : g_line TYPE char72.
*----------------------------------------------------------------------*
* FIELD SYMBOLS *
*----------------------------------------------------------------------*
FIELD-SYMBOLS : TYPE x_output.
*----------------------------------------------------------------------*
* SELECTION SCREEN *
*----------------------------------------------------------------------*
*********************************************************************
* Block One for Program Header
*********************************************************************
SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE g_text01,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Title
*---------------------------------------------------------------------
PARAMETERS : cb_title TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t01 FOR FIELD p_title.
PARAMETERS : p_title TYPE char50 DEFAULT 'P R O G R A M H E A D E R'.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Program ID
*---------------------------------------------------------------------
PARAMETERS : cb_pid TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t02 FOR FIELD p_pid.
PARAMETERS : p_pid TYPE char50.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Version
*---------------------------------------------------------------------
PARAMETERS : cb_ver TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t03 FOR FIELD p_ver.
PARAMETERS : p_ver TYPE char5 DEFAULT '1.0'.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*---------------------------------------------------------------------
* SAP Version
*---------------------------------------------------------------------
PARAMETERS : cb_sver TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t04 FOR FIELD p_sver.
PARAMETERS : p_sver TYPE char50 DEFAULT 'R/3 System'.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Program Name
*---------------------------------------------------------------------
PARAMETERS : cb_repid TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t05 FOR FIELD p_repid.
PARAMETERS : p_repid TYPE char50.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Created by
*---------------------------------------------------------------------
PARAMETERS : cb_ernam TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t06 FOR FIELD p_ernam.
PARAMETERS : p_ernam TYPE syuname DEFAULT sy-uname.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Created on
*---------------------------------------------------------------------
PARAMETERS : cb_erdat TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t07 FOR FIELD p_erdat.
PARAMETERS : p_erdat TYPE sydatum DEFAULT sy-datum.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Program Type
*---------------------------------------------------------------------
PARAMETERS : cb_typ TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t08 FOR FIELD p_typ.
PARAMETERS : p_typ TYPE char50 DEFAULT 'Report'.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Message Class
*---------------------------------------------------------------------
PARAMETERS : cb_msgcl TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t09 FOR FIELD p_msgcl.
PARAMETERS : p_msgcl TYPE symsgid.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Description
*---------------------------------------------------------------------
PARAMETERS : cb_desc TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t10 FOR FIELD p_desc.
PARAMETERS : p_desc TYPE char50 DEFAULT 'Program description'.
SELECTION-SCREEN:END OF LINE,
END OF BLOCK b1.
*********************************************************************
* Block Two for Change History
*********************************************************************
SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE g_text02,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Change History
*---------------------------------------------------------------------
PARAMETERS : cb_chist TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t11 FOR FIELD p_chist.
PARAMETERS : p_chist TYPE char50 DEFAULT 'C H A N G E H I S T O R Y'.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Change Id
*---------------------------------------------------------------------
PARAMETERS : cb_cid TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t12 FOR FIELD p_cid.
PARAMETERS : p_cid TYPE char50.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Author
*---------------------------------------------------------------------
PARAMETERS : cb_aut TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t13 FOR FIELD p_aut.
PARAMETERS : p_aut TYPE syuname DEFAULT sy-uname.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Changed On
*---------------------------------------------------------------------
PARAMETERS : cb_chg TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t14 FOR FIELD p_chg.
PARAMETERS : p_chg TYPE sydatum.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*---------------------------------------------------------------------
* Description
*---------------------------------------------------------------------
PARAMETERS : cb_cdesc TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(20) g_t15 FOR FIELD p_cdesc.
PARAMETERS : p_cdesc TYPE char50 DEFAULT 'Description'.
SELECTION-SCREEN:END OF LINE,
END OF BLOCK b2.
*********************************************************************
* Block Three for Other data
*********************************************************************
SELECTION-SCREEN:BEGIN OF BLOCK b3 WITH FRAME TITLE g_text03,
BEGIN OF LINE.
*----------------------------------------------------------------------
* INCLUDES
*----------------------------------------------------------------------
PARAMETERS : cb_incl TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(18) g_t16 FOR FIELD cb_incl.
*----------------------------------------------------------------------
* TYPES DECLARATION
*----------------------------------------------------------------------
PARAMETERS : cb_type TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 26(18) g_t17 FOR FIELD cb_type.
*----------------------------------------------------------------------
* CONSTANT DECLARATION
*----------------------------------------------------------------------
PARAMETERS : cb_cons TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 49(18) g_t18 FOR FIELD cb_cons.
*----------------------------------------------------------------------
* DATA DECLARATION FOR INTERNAL TABLES
*----------------------------------------------------------------------
PARAMETERS : cb_itab TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 72(18) g_t19 FOR FIELD cb_itab.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*----------------------------------------------------------------------
* DATA DECLARATION FOR WORK AREA
*----------------------------------------------------------------------
PARAMETERS : cb_wa TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(18) g_t20 FOR FIELD cb_wa.
*----------------------------------------------------------------------
* DATA DECLARATION FOR VARIABLES
*----------------------------------------------------------------------
PARAMETERS : cb_var TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 26(18) g_t21 FOR FIELD cb_var.
*----------------------------------------------------------------------
* RANGES
*----------------------------------------------------------------------
PARAMETERS : cb_range TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 49(18) g_t22 FOR FIELD cb_range.
*----------------------------------------------------------------------
* FIELD SYMBOLS
*----------------------------------------------------------------------
PARAMETERS : cb_fs TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 72(18) g_t23 FOR FIELD cb_fs.
SELECTION-SCREEN:END OF LINE,
BEGIN OF LINE.
*----------------------------------------------------------------------
* SELECTION SCREEN
*----------------------------------------------------------------------
PARAMETERS : cb_ss TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 3(18) g_t24 FOR FIELD cb_ss.
*----------------------------------------------------------------------
* SELECTION SCREEN VALIDATION
*----------------------------------------------------------------------
PARAMETERS : cb_ssa TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 26(18) g_t25 FOR FIELD cb_ssa.
*----------------------------------------------------------------------
* INITLIZATION
*----------------------------------------------------------------------
PARAMETERS : cb_init TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 49(18) g_t26 FOR FIELD cb_init.
SELECTION-SCREEN:END OF LINE,
END OF BLOCK b3.
*********************************************************************
* Block Four for Miscellaneous data
*********************************************************************
SELECTION-SCREEN:BEGIN OF BLOCK b4 WITH FRAME TITLE g_text04,
BEGIN OF BLOCK b5 WITH FRAME TITLE g_text05,
BEGIN OF LINE.
*----------------------------------------------------------------------
* TYPE OF LINE AT OUTPUT DOTTED OR STAR
*----------------------------------------------------------------------
PARAMETERS : rb_dot RADIOBUTTON GROUP rb1.
SELECTION-SCREEN:COMMENT 3(25) g_t27 FOR FIELD rb_dot,
END OF LINE,
BEGIN OF LINE.
PARAMETERS : rb_star RADIOBUTTON GROUP rb1.
SELECTION-SCREEN:COMMENT 3(25) g_t28 FOR FIELD rb_star,
END OF LINE,
END OF BLOCK b5,
BEGIN OF BLOCK b6 WITH FRAME TITLE g_text06 ,
BEGIN OF LINE.
*----------------------------------------------------------------------
* TYPE OF END I.E. OPEN AT ONE END OR CLOSED AT OTHER END
*----------------------------------------------------------------------
PARAMETERS : rb_open RADIOBUTTON GROUP rb2.
SELECTION-SCREEN:COMMENT 3(25) g_t30 FOR FIELD rb_open,
END OF LINE,
BEGIN OF LINE.
PARAMETERS : rb_close RADIOBUTTON GROUP rb2.
SELECTION-SCREEN:COMMENT 3(25) g_t31 FOR FIELD rb_close,
END OF LINE ,
END OF BLOCK b6,
END OF BLOCK b4.
*----------------------------------------------------------------------*
* SELECTION SCREEN VALIDATION *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN ON p_repid.
  DATA : l_repid TYPE syrepid.
  IF p_repid IS INITIAL.
    MESSAGE 'Please enter program name' type 'E'.
  ELSE.
    TRANSLATE p_repid TO UPPER CASE.
    SELECT SINGLE progname FROM reposrc INTO l_repid
    WHERE progname EQ p_repid.
    IF sy-subrc EQ 0.
      MESSAGE 'Program already exists' type 'E'.
    ENDIF.
  ENDIF.
*----------------------------------------------------------------------*
* INITIALIZATION *
*----------------------------------------------------------------------*
INITIALIZATION.
  g_text01 = 'Program Header Details'.
  g_text02 = 'Change History'.
  g_text03 = 'Other Data'.
  g_text04 = 'Miscellaneous Data'.
  g_text05 = 'Line type'.
  g_text06 = 'Open/Closed'.
  g_t01 = 'Title'.
  g_t02 = 'Program ID'.
  g_t03 = 'Version'.
  g_t04 = 'SAP Version'.
  g_t05 = 'Program Name'.
  g_t06 = 'Created by'.
  g_t07 = 'Created on'.
  g_t08 = 'Program Type'.
  g_t09 = 'Message Class'.
  g_t10 = 'Description'.
  g_t11 = 'Change History'.
  g_t12 = 'Change Id'.
  g_t13 = 'Author'.
  g_t14 = 'Changed On'.
  g_t15 = 'Description'.
  g_t16 = 'Include'.
  g_t17 = 'Types'.
  g_t18 = 'Constants'.
  g_t19 = 'Internal Tables'.
  g_t20 = 'Work Area'.
  g_t21 = 'Variables'.
  g_t22 = 'Ranges'.
  g_t23 = 'Field Symbols'.
  g_t24 = 'Selection Screen'.
  g_t25 = 'Screen Validation'.
  g_t26 = 'Initialization'.
  g_t27 = 'Dotted -------------------------'.
  g_t28 = 'Star *************************'.
  g_t30 = 'Open ended'.
  g_t31 = 'Close ended'.
*----------------------------------------------------------------------*
* START OF SELECTION *
*----------------------------------------------------------------------*
START-OF-SELECTION.
*----------------------------------------------------------------------
* TYPE OF LINE DOTTED --------------- OR STAR ***********
*----------------------------------------------------------------------
  IF rb_dot EQ c_x.
    DO 72 TIMES.
      CONCATENATE g_line c_dash INTO g_line.
    ENDDO.
  ELSE.
    DO 72 TIMES.
      CONCATENATE g_line c_star INTO g_line.
    ENDDO.
  ENDIF.
*----------------------------------------------------------------------
* TITLE
*----------------------------------------------------------------------
  IF cb_title EQ c_x.
    PERFORM build_output USING g_line.
    CLEAR w_output .
    w_output-str+2 = p_title.
    APPEND w_output TO t_output.
    PERFORM build_output USING g_line.
  ENDIF.
*----------------------------------------------------------------------
* PROGRAM ID
*----------------------------------------------------------------------
  IF cb_pid EQ c_x.
    PERFORM build_desc USING c_02 p_pid.
  ENDIF.
*----------------------------------------------------------------------
* VERSION
*----------------------------------------------------------------------
  IF cb_ver EQ c_x.
    PERFORM build_desc USING c_03 p_ver.
  ENDIF.
*----------------------------------------------------------------------
* SAP VERSION
*----------------------------------------------------------------------
  IF cb_sver EQ c_x.
    PERFORM build_desc USING c_04 p_sver.
  ENDIF.
*----------------------------------------------------------------------
* PROGRAM NAME
*----------------------------------------------------------------------
  IF cb_repid EQ c_x.
    PERFORM build_desc USING c_05 p_repid.
  ENDIF.
*----------------------------------------------------------------------
* CREATED BYE
*----------------------------------------------------------------------
  IF cb_ernam EQ c_x.
    PERFORM build_desc USING c_06 p_ernam.
  ENDIF.
*----------------------------------------------------------------------
* CREATED ON
*----------------------------------------------------------------------
  IF cb_erdat EQ c_x.
    PERFORM build_desc USING c_07 p_erdat.
  ENDIF.
*----------------------------------------------------------------------
* PROGRAM TYPE
*----------------------------------------------------------------------
  IF cb_typ EQ c_x.
    PERFORM build_desc USING c_08 p_typ.
  ENDIF.
*----------------------------------------------------------------------
* MESSAGE CLASS
*----------------------------------------------------------------------
  IF cb_msgcl EQ c_x.
    PERFORM build_desc USING c_09 p_msgcl.
  ENDIF.
*----------------------------------------------------------------------
* PROGRAM DESCRIPTION
*----------------------------------------------------------------------
  IF cb_desc EQ c_x.
    PERFORM build_desc USING c_10 p_desc.
    PERFORM build_output USING g_line.
  ENDIF.
  PERFORM build_output USING g_line.
*----------------------------------------------------------------------
* CHANGE HISTORY
*----------------------------------------------------------------------
  IF cb_chist EQ c_x.
    CLEAR w_output.
    w_output-str+2 = p_chist.
    APPEND w_output TO t_output.
    PERFORM build_output USING g_line.
  ENDIF.
*----------------------------------------------------------------------
* CHANGE ID
*----------------------------------------------------------------------
  IF cb_cid EQ c_x.
    PERFORM build_desc USING c_12 p_cid.
  ENDIF.
*----------------------------------------------------------------------
* CHANGES BY
*----------------------------------------------------------------------
  IF cb_aut EQ c_x.
    PERFORM build_desc USING c_13 p_aut.
  ENDIF.
*----------------------------------------------------------------------
* CHANGED ON
*----------------------------------------------------------------------
  IF cb_chg EQ c_x.
    PERFORM build_desc USING c_14 p_chg.
  ENDIF.
*----------------------------------------------------------------------
* CHANGE DESCRIPTION
*----------------------------------------------------------------------
  IF cb_cdesc EQ c_x.
    PERFORM build_desc USING c_15 p_cdesc.
  ENDIF.
  PERFORM build_output USING g_line.
*----------------------------------------------------------------------
* REPORT NAME
*----------------------------------------------------------------------
  CONCATENATE space 'REPORT' p_repid
  'NO STANDARD PAGE HEADING LINE-SIZE 65 LINE-COUNT 80.'
  INTO w_output-str SEPARATED BY space.
  APPEND w_output TO t_output.
*----------------------------------------------------------------------
* INCLUDES
*----------------------------------------------------------------------
  IF cb_incl EQ c_x.
    PERFORM build_output USING g_line.
    PERFORM build_output USING c_incl.
    PERFORM build_output USING g_line.
  ENDIF.
*----------------------------------------------------------------------
* TYPES DECLARATION
*----------------------------------------------------------------------
  IF cb_type EQ c_x.
    PERFORM build_output USING g_line.
    PERFORM build_output USING c_type.
    PERFORM build_output USING g_line.
  ENDIF.
*----------------------------------------------------------------------
* CONSTANT DECLARATION
*----------------------------------------------------------------------
  IF cb_cons EQ c_x.
    PERFORM build_output USING g_line.
    PERFORM build_output USING c_cons.
    PERFORM build_output USING g_line.
  ENDIF.
*----------------------------------------------------------------------
* DATA DECLARATION FOR INTERNAL TABLES
*----------------------------------------------------------------------
  IF cb_itab EQ c_x.
    PERFORM build_output USING g_line.
    PERFORM build_output USING c_itab.
    PERFORM build_output USING g_line.
  ENDIF.
*----------------------------------------------------------------------
* DATA DECLARATION FOR WORK AREA
*----------------------------------------------------------------------
  IF cb_wa EQ c_x.
    PERFORM build_output USING g_line.
    PERFORM build_output USING c_wa.
    PERFORM build_output USING g_line.
  ENDIF.
*----------------------------------------------------------------------
* DATA DECLARATION FOR VARIABLES
*----------------------------------------------------------------------
  IF cb_var EQ c_x.
    PERFORM build_output USING g_line.
    PERFORM build_output USING c_var.
    PERFORM build_output USING g_line.
  ENDIF.
*----------------------------------------------------------------------
* RANGES
*----------------------------------------------------------------------
  IF cb_range EQ c_x.
    PERFORM build_output USING g_line.
    PERFORM build_output USING c_range.
    PERFORM build_output USING g_line.
  ENDIF.
*----------------------------------------------------------------------
* FIELD SYMBOLS
*----------------------------------------------------------------------
  IF cb_fs EQ c_x.
    PERFORM build_output USING g_line.
    PERFORM build_output USING c_fs.
    PERFORM build_output USING g_line.
  ENDIF.
*----------------------------------------------------------------------
* SELECTION SCREEN
*----------------------------------------------------------------------
  IF cb_ss EQ c_x.
    PERFORM build_output USING g_line.
    PERFORM build_output USING c_ss.
    PERFORM build_output USING g_line.
  ENDIF.
*----------------------------------------------------------------------
* SELECTION SCREEN VALIDATION
*----------------------------------------------------------------------
  IF cb_ssa EQ c_x.
    PERFORM build_output USING g_line.
    PERFORM build_output USING c_ssa.
    PERFORM build_output USING g_line.
  ENDIF.
*----------------------------------------------------------------------
* INITLIZATION
*----------------------------------------------------------------------
  IF cb_init EQ c_x.
    PERFORM build_output USING g_line.
    PERFORM build_output USING c_init.
    PERFORM build_output USING g_line.
  ENDIF.
*----------------------------------------------------------------------
* START OF SELECTION
*----------------------------------------------------------------------
  PERFORM build_output USING g_line.
  PERFORM build_output USING c_sos.
  PERFORM build_output USING g_line.
*----------------------------------------------------------------------
* END OF SELECTION
*----------------------------------------------------------------------
  PERFORM build_output USING g_line.
  PERFORM build_output USING c_eos.
  PERFORM build_output USING g_line.
  LOOP AT t_output assigning .
    IF -str+1(6) NE 'REPORT'.
      CONCATENATE c_star -str INTO -str.
      IF rb_close EQ c_x.
        +71 = c_star.
      ENDIF.
    ENDIF.
  ENDLOOP.
* Create a new report as per the name entered by the user
  INSERT REPORT p_repid FROM t_output.
  IF sy-subrc EQ 0.
    MESSAGE 'Pls save the new program in an requets or local file.'
    type c_i.
    MESSAGE 'Pls do enter the program title in Menu Goto->Attributes.'
    type c_i.
    MESSAGE 'Report created sucessfully.' type c_s.
    EXPORT p_repid TO MEMORY ID c_rid.
    CALL TRANSACTION c_se38 AND SKIP FIRST SCREEN.
  ENDIF.
*---------------------------------------------------------------------*
* END OF SELECTION
*---------------------------------------------------------------------*
END-OF-SELECTION.
*&---------------------------------------------------------------------*
*& Form BUILD_DESC
*&---------------------------------------------------------------------*
* -->FP_DATA
*----------------------------------------------------------------------*
FORM build_desc USING fp_desc fp_val.
  CLEAR w_output.
  w_output-str+2 = fp_desc.
  w_output-str+25(1) = c_colon.
  w_output-str+27 = fp_val.
  APPEND w_output TO t_output.
ENDFORM. " BUILD_DESC
*&---------------------------------------------------------------------*
*& Form build_output
*&---------------------------------------------------------------------*
* -->FP_DATA
*----------------------------------------------------------------------*
FORM build_output USING fp_data.
  IF fp_data IS NOT INITIAL.
    CLEAR w_output.
    w_output-str = fp_data.
    APPEND w_output TO t_output.
  ENDIF.
ENDFORM. " build_output
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP Dictionary All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.