Visit the SAP Forum

Languages : English | Dutch | French | Portugese | Italian



INTERVIEW EBOOK
Get 30,000 Interview Questions & Answers in an eBook.

Interview Success Kit - Get Success in Job Interviews



Send your Resume to 6000 Companies
START YOUR WEBSITE
India's Best Web Hosting Company

Making a Java Editor in ABAP and compiling it


Home »ABAP Programming » Java Editor in ABAP


Making a Java Editor in ABAP and compiling it

*************************Creation of Internal table*******************
DATA: BEGIN OF ti_record OCCURS 200,
Line(250),
END OF ti_record.
DATA: BEGIN OF ti_rec OCCURS 200,
Line(250),
END OF ti_rec.


******************************Selection screen************************* selection-screen begin of block b1 with frame . Parameters create radiobutton group g1. PARAMETERS: JavaName(30) lower case. parameters modify radiobutton group g1. selection-screen end of block b1. *******************Calling the java program creation page*************** at selection-screen.   if CREATE = 'X'.     if javaname is not initial.       refresh ti_record[].    concatenate 'public class' javaname into ti_record-line separated by space.    concatenate ti_record-line '{' into ti_record-line separated by space.       Append ti_record.       ti_record-line = 'public static void main(String []args){'.       Append ti_record.       ti_record-line ='//enter ur code here'.       append ti_record.       ti_record-line ='}'.       Append ti_record.       ti_record-line ='}'.       Append ti_record.       EDITOR-CALL FOR ti_record .     else.       Message e001.     endif. ***************************Saving the java program********************* data tfile type string. concatenate 'D:\Programs\' javaname '.java' into tfile. CALL FUNCTION 'GUI_DOWNLOAD'   EXPORTING     FILENAME                        = tfile     FILETYPE                        = 'ASC'   TABLES     DATA_TAB                        =   ti_record.   endif. data new(15).   if MODIFY = 'X'.     new = 'ZJAVAMODIFY1'.     CALL TRANSACTION NEW.   endif. *****************************************************************************************
ZJAVAMODIFY:

REPORT  zjavamodify.
***********************selection screen.*********************
selection-screen begin of block b1 with frame .
Parameters compile radiobutton group g1.
Parameters modify radiobutton group g1.
Parameters execute radiobutton group g1.
PARAMETER : FILE(100) lower case.
selection-screen end of block b1.
DATA: BEGIN OF TI_RECORD OCCURS 1,
LINE(200),
END OF TI_RECORD.
data: st1(30),st2(30).

AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.
  CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
*     DEF_FILENAME           = ' '
      DEF_PATH               = '*.*'
*     MASK                   = ' '
*     MODE                   = ' '
*     TITLE                  = ' '
    IMPORTING
      FILENAME               = FILE
*     RC                     =
           .

End-of-selection.

********************************************************************
*****************************MODIFY*********************************
  if modify = 'X'.
    data: TXT_FILE1 TYPE STRING .
    txt_file1 = file.
**************FM GUI_UPLOAD

    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME = txt_file1
      TABLES
        DATA_TAB = ti_recORD[].
**********End FM GUI_UPLOAD
    EDITOR-CALL FOR ti_record .
**************FM GUI_UPLOAD

    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME = txt_file1
        FILETYPE = 'ASC'
      TABLES
        DATA_TAB = ti_record.
**********End FM GUI_UPLOAD
  endif.

********************end of modify********************

*******************BAT file for compilation n 
execution.****************
  if compile = 'X'.
    DATA: begin of itab_bat_create occurs 0,
       row(500) type c,
      end of itab_bat_create.

    data:comp_join1(250).
    concatenate 'java' 'jCompiler' file into comp_join1
     separated
     by space.
    itab_bat_create-row = 'c:'.
    append itab_bat_create.
    itab_bat_create-row = 'cd Documents and Settings\127740'.
    append itab_bat_create.
    itab_bat_create-row = comp_join1.
    append itab_bat_create.

********FM GUI_DOWNLOAD
    data: st type string.
    st = 'C:\Documents and Settings\127740\compile_java.bat'.
    call function 'GUI_DOWNLOAD'
      EXPORTING
        filename         = st
        filetype         = 'ASC'
      TABLES
        data_tab         = itab_bat_create[]
      EXCEPTIONS
        file_open_error  = 1
        file_write_error = 2
        others           = 3.
********end FM GUI_DOWNLOAD
*****FM dvsvas_doc_ws_execute_50
    CALL FUNCTION 'DSVAS_DOC_WS_EXECUTE_50'
      EXPORTING
        PROGRAM = 'C:\Documents and Settings\127740\compile_java.bat'.
*****end FM dvsvas_doc_ws_execute_50
  endif.
************************end of compile********************************

*********************************************************************
*************************************** output***********************
  if execute = 'X'.
    data: TXT_FILE3 TYPE STRING .
    split File AT '.java' into: st1 st2  .
    concatenate st1 'error.txt' into TXT_FILE3.
**************FM GUI_UPLOAD
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME = txt_file3
      TABLES
        DATA_TAB = ti_recORD[].
**********End FM GUI_UPLOAD
    if not ti_record[] is initial.
      loop at ti_record.
        write:/ ti_record.
      endloop.
    else.
      data: TXT_FILE4 TYPE STRING .
      split File AT '.java' into: st1 st2  .
      concatenate st1 'output.txt' into TXT_FILE4.
**************FM GUI_UPLOAD
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME = TXT_FILE4
        TABLES
          DATA_TAB = ti_recORD[].
**********End FM GUI_UPLOAD
      loop at ti_record.
        write:/ ti_record.
      endloop.
    endif.
  endif.
************************end of 
output****************************************

In ZJAVACREATE we have used the transaction new which is nothing but 
the transaction code for zjavamodify.
A D V E R T I S E M E N T

A D V E R T I S E M E N T

S A P - R E S O U R C E S


Get Free SAP Resources:

Are you looking for:
  • SAP Jobs
  • Free SAP eBooks
  • SAP Softwares
  • SAP Tutorials
  • ERP Implementation Examples
Enter Email Address:
(Enter your email address above and we will instantly send you the download link to you, when you confirm your email.)
Search SAP Resources:
discussionDiscussion Center
Discuss
Discuss

Query

Feedback
Yahoo Groups
Y! Group
Sirfdosti Groups
Sirfdosti
Contact Us
Contact
Sign in

User Name:
Password:
Forget password? | Register


INTERVIEW EBOOK

Get 30,000 Interview Questions & Answers in an eBook.

Interview Success Kit - Get Success in Job Interviews


Send your Resume to 6000 Companies

SAP Resources

  • SAP Articles
  • SAP Books
  • SAP Certifications
  • SAP Companies
  • SAP Study Materials
  • SAP Events
  • SAP Faqs
  • SAP Jobs
  • SAP Job Consultants
  • SAP Links
  • SAP News
  • SAP Sample Papers
  • SAP Interview Questions
  • SAP Training Institutes
  •  
    SAP Tutorial

  • Introduction
  • SAP History
  • SAP Facts
  • SAP Tables
  • SAP Function
  • SAP Report
  • Reasons To Use SAP
  • SAP Landscape
  • SAP Transaction Code
  • SAP Lotus Notes Integration
  • Business Connector and XML
  • Enterprise Release 4.7

  • SAP Training Institutes

  • SAP Training Institutes
  • Job Consultants Address
  • SAP Companies Address

  • Business Process Cycle

  • Analyze
  • Design
  • Implement
  • Operate
  • Optimize
  • Skills And Education

  • Logistics Module

  • Sales and Distribution
  • Quality Management
  • Materail Management
  • Plant Maintenance
  • Financial Modules (FI/CO)
  • Project system
  • Production Planning
  • Service Management

  • SAP NetWeaver

  • Introduction
  • Object Model
  • Interoperability
  • Creating Web Apps
  • Java Connector
  • Advantages & Conclusion
  • Life Cycle Management
  • Composite Application Framework

  • SAP Tools

  • SQL Trace Tool
  • SAP CRM
  • SAP SRM
  • SAP SCM
  • SAP ERP
  • SAP BW

  • SAP Modules

  • SAP FI Module
  • SAP CO Module

  • SAP Technical

  • SAP ITS Architecture
  • Financial Management
  • Manufacturing Planning and Execution
  • Customer Order Management
  • Lackbox Processing
  • SD and Financial Accounting Integration
  • SAP - HR (Human Resource)

  • SAP Miscellanous

  • Web Application Server(WAS)
  • Data Archiving
  • Mobile Engine
  • SAP Script
  • SAP Transactions
  • SAP Business Warehouse(BW)

  • SAP Reference

  • SAP Facts
  • SAP Tables
  • SAP Function
  • SAP Report
  • SAP Landscape

  • SAP Others

  • SAP Treasury
  • SAP Finance
  • SAP WAS
  • SAP Data Archiving
  • SAP ALE
  • SAP EDI
  • SAP Exchange
  • SAP X-APPS
  • SAP Applications Components
  • SAP Software
  • Dunning
  • SAP IDES
  • SAP Payroll Basics
  • SAP BASIS and Security Authorization
  • SAP Backup
  • SAP Router

  • ABAP Tutorials

  • Introduction
  • ABAP Transaction
  • ABAP Function
  • ABAP File Processing
  • ABAP Objects
  • ABAP Syntax
  • ABAP Queries
  • SAPMail Using ABAP
  • ABAP Programming Hints

  • SAP Projects & Codes

  • Finding the user-exits
  • Purchase Order Display
  • Batch Input
  • Dynamic Open SQL
  • Creating Extract Dataset
  • Reading database tables
  • Load table from a UNIX file
  • Create subscreen

  • SAP Resources

  • SAP Books
  • SAP Links

  • Interview Question



  • Common Interview Que.
  • ABAP Interview Que.
  • ERP Interview Que.
  • HR Interview Que.
  • MM Interview Que.
  • PP Interview Que.
  • ALE Interview Que.
  • EDI Interview Que.
  • Basis Interview Questions
  • SAP-SD Interview Questions
  • FI&CO Interview Questions
  • BW Interview Questions
  • CRM Interview Questions
  • Interview Questions

  • Careers at SAP

  • Careers in SAP (SAP Jobs)
  • Advertise
  •