Close Sidebar close
Sapignite
  • SAP
  • Coding Challenges
  • Download
  • SAP Ignite Products

Subscribe & Follow

All product names on this web site are trademarks of the companies that own them. Sapignite.com is not affiliated with SAP AG in any way. SAP AG is the registered trademark holder of SAP, SAP R/3, mySAP, ABAP, xApps, NetWeaver, and other proprietary terms. The technical information on this site is verified to the greatest extent possible, however, any information found on this site is used at the site visitor's own risk. Sapignite.com reserves the right to correct any errors or omissions in any portion of this site at any time without obligation.

  • SAP
  • Coding Challenges
  • Download
  • SAP Ignite Products
Sapignite
Sapignite
    ABAP SAP

    Trying your hand with EXE file using SAP ABAP

    July 31, 2017

    From ancient days I used to hear that ABAP is the language which is only used to develop business transaction, it’s not at all Developer friendly langauge. So if you want to do your R&D or want to develop something out of the BOX application put your focus to C/C++ or “the king of programming” JAVA. One can ask counter question here saying “Dude, ABAP is Business language its not developed for developing something out of BOX transaction.

    Now let’s not get into the Fight mode J

    This article talks about one of such out of the BOX solution you can provide to your client if they ask for the same.

    How to Execute the EXE file from your transaction?

    There are many ways you can achive this functionality.

    1. you can use standard class for front end services CL_GUI_FRONTEND_SERVICES .
    2. try a function module GUI_RUN .

    Both use shell script internally to execute the command at system level.Unix shell scripts along with ABAP can be used to perform many tasks. These can be used for sending internet mail w/o using SAP Connect, archiving files, passing data from one system to another, etc.

    Below is the sample code which is used to open calculator and notepad from the abap report program. You can pass any command which is valid in command promt.

    Note : for Function module GUI_RUN its says it’s valid for 32 bits system . But It goes smooth for 64 bits tooo J

    REPORT  ZTEST_EXE.

    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text–001.
    SELECTION-SCREEN PUSHBUTTON /10(10) bt_calc USER-COMMAND CALC.
    SELECTION-SCREEN PUSHBUTTON /10(10) bt_note USER-COMMAND NOTE.
    SELECTION-SCREEN END OF BLOCK b1.

    INITIALIZATION.
    MOVE ‘Calc’ TO bt_calc.
    MOVE ‘Notepad’ TO  bt_note.

    START–OF–SELECTION.

    END–OF–SELECTION.

    at SELECTION–SCREEN.
    case sy–ucomm.
    when ‘CALC’.
    CALL FUNCTION ‘GUI_RUN’
    EXPORTING
    COMMAND          = ‘CALC.EXE’.
    *           PARAMETER         = ‘c:\TEST.TXT’
    **           CD               = ‘
    *         IMPORTING
    *           RETURNCODE       = lv_return.
    when ‘NOTE’.
    CALL FUNCTION ‘GUI_RUN’
    EXPORTING
    COMMAND          = ‘NOTEPAD.EXE’
    PARAMETER         = ‘c:\TEST.TXT’.
    *           CD               = ‘
    *         IMPORTING
    *           RETURNCODE       = lv_return.
    ENDCASE.

    When you execute it, click on the Button Calc to open calculator and notepad to open notepad.

    how to execute windows application using sap abapsample coding for executing exe filesap abap exe filesap abap interface with calculatorsap abap windows exe filesap abap with windows application
    raju borda
    Raju is working with Technical areas like SAP ABAP, PI , Web design, JAVA , PBT, robotics as architect also functional areas like SCM , QM, MM , insurance . When he is not Doing above geeky things you might find him travelling , Cooking , dancing or drinking with friends :-) .
    • Learn Parallel Processing in ABAP

    • Ever Tried making a game in SAP ?

    You Might Also Like

    Tutorial on How to work with Menu EXIT

    August 10, 2017

    Intelli-Den ( Smart House ) SAP Teched Demojam -2013

    July 5, 2017

    Have you ever seen standard SAP ABAP code like these

    August 3, 2017

    No Comments

    Leave a Reply Cancel Reply

Sign up for some exciting content

Recent Posts

  • How to prepare for SAP IBP Certification
  • What is SAP Leonardo ?
  • RoadMap UI Tutorial webdynpro for ABAP
  • Offline Adobe forms in WebDynPro for ABAP
  • MVC Architecture for Webdynpro for ABAP

Categories

  • ABAP
  • Android
  • Coding Challenges
  • Enhancement
  • featured
  • Interviews
  • Learning Hub
  • PI ( Process integration )
  • SAP
  • SAP HANA
  • Uncategorized
  • Webdynpro for ABAP
  • Webdynpro For ABAP