Scripts in ABAP

Hello gurus!
I have a question about scripts in ABAP. We have a program that requires a lot of queries to obtain info from oracle; we already have a functional version of it but we need to upgrade and this means we have to write a lot more of queries in ABAP. Is there a way to import a script to put in a variable an execute it in ABAP to avoid all this code writing?.
Regards IA

Hi Armando,
if You want to use already programed Oracle SQL Queries in ABAP with no neccessity to recode them into Open SQL (SQL in ABAP), You can probably use [Native SQL|http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3b8b358411d1829f0000e829fbfe/content.htm]. This can be done using [EXEC SQL statement|http://help.sap.com/abapdocu_70/en/ABAPEXEC_CURSOR.htm].
Regards,
Adrian

Similar Messages

  • Calling GUI Scripting from ABAP program

    Is it possible to call GUI Scripting from ABAP and thus to use GUI Scripting as an alternative to CALL TRANSACTION?
    Is the class CL_JAVA_SCRIPT suitable to access GUI Scripting engine? Accessing ABAP data object would work as well in this case as i think. What SAP Logon and WAS releases are required? Is the 6.20 release sufficient for this case?
    I would appreciate if somebody could post an example.

    Hi,
    CL_JAVA_SCRIPT has nothing to do with SAPGUI Scripting.
    Calling SAPGUI Scripting API from ABAP could be possible for programmes experienced with OLE automation calls from ABAP coding.
    The hardest thing will be, to access the scripting engine handle as an entry point. Once you have a handle in your abap session, any api function can be invoked.
    Best regards
    Jens
    BTW: SAP testtool eCATT does call SAPGUI-Scripting from ABAP.

  • SQL Script in ABAP

    Hi Everyone,
    I have sql script which gives certain output from the data base files, is it possible to execute this script in ABAP, I want to embed this sql script in ABAP and get the output into an internal table how is it possible.
    Can anyone suggest me on this, it will be of great use to me.
    Thanks,
    Prashant.

    Hi
    SAP uses Open SQL for accessing data from any of the databases.
    Incase you want to find more details. Also look for Open SQL or Use Native SQL language in ABAP to accomplish the job.
    <b> Open SQL
    http://help.sap.com/saphelp_46c/helpdata/en/c9/5472f9787f11d194c90000e8353423/frameset.htm
    Native SQL
    http://help.sap.com/saphelp_46c/helpdata/en/c9/5472f9787f11d194c90000e8353423/frameset.htm</b>
    Hope this will help.
    Please reward suitable points.
    Regards
    - Atul

  • Method class for calling/executing VB script from abap

    Hi All,
    I need to call a vb script from abap.
    This vb script performs some function then.
    For executing this VB script i use the method CL CL_GUI_FRONTEND_SERVICES=>Execute.
    Now i need to pass data to the vb script in the from of a structure/workarea.
    Does anyone have any idea on what class/method shoul i use?
    Regards,
    Harshit Rungta

    Check Connect VB to SAP
    Kanagaraja L

  • Scripts and Abap

    SAP Scripts and ABAP programs are client dependent or not? Why?
    regards,
    kb

    Hi,
    Standard Texts, SAP Scripts are client dependent objects.Tables are client indpendent but the data in those tables is client dependent as we have there is a field called MANDT. All dictionary objects like Tables, Views and other objects in SE11 and Programs, Fun modules ,smartformsand most of the repository objects are client Independent.
    http://sap.ittoolbox.com/documents/popular-q-and-a/differentiating-between-dependent-and-independent-data-1957
    http://help.sap.com/saphelp_nw2004s/helpdata/en/a9/bb963a570b4b5de10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b7/8a9a3aaf894871e10000000a114084/frameset.htm
    Re: What is the concept of Client
    Reward if found helpfull,
    Cheers,
    Chaitanya.

  • Execute unix script from abap.

    Hi friends,
    I have a abap report which generate  a text file in<b> /usr/tmp/</b>  directory . Now i have a unix script   which encript the text file.  I want to this from abap report. How I can do this . and in which path  I should keep this unix script   Please help.
    Regards

    Hi,
    try the below code
    parameters : p_sfile(60) lower case
    "File to be moved
    "Eg : /home/in/SFILE1.txt
    p_dfile(60) lower case.
    "File's Destination
    "Eg: /home/archive/SFILE1.txt
    data : t_btcxpm
    like btcxpm occurs 0,
    p_addparam
    like sxpgcolist-parameters.
    concatenate
    '/home/ABAP/scripts/Archive_file.sh'
    p_sfile
    p_dfile
    into p_addparam separated by space.
    refresh t_btcxpm. clear t_btcxpm.
    call function 'SXPG_CALL_SYSTEM'
    exporting
    commandname = 'ZSHELL'
    additional_parameters = p_addparam
    tables
    exec_protocol = t_btcxpm
    exceptions
    no_permission = 1
    command_not_found = 2
    parameters_too_long = 3
    security_risk = 4
    wrong_check_call_interface = 5
    program_start_error = 6
    program_termination_error = 7
    x_error = 8
    parameter_expected = 9
    too_many_parameters = 10
    illegal_command = 11
    others = 12.
    if sy-subrc = 0.
    write : /
    'File',p_sfile,'moved to',p_dfile.
    else.
    write : / 'Error Occured'.
    endif.
    Reward points if found helpful……
    Cheers,
    Chandra Sekhar.

  • Script in abap-hr

    hi friends,
    could u plz tell me how to configure sap standard  ABAP-HR script & where we can configure that????
    thanks in advance,
    regards,
    priya.s

    Hi,
    we can generate the remuneration statements.
    Thanks & Regards
    Sunil Kondoju

  • Call a unix script from ABAP program

    Can anybody help me on how to call a unix script from an ABAP program
    Regards
    Anjali

    Hi try the below code
    parameters : p_sfile(60) lower case
              "File to be moved
              "Eg : /home/in/SFILE1.txt
                p_dfile(60) lower case.
              "File's Destination
              "Eg: /home/archive/SFILE1.txt
    data : t_btcxpm
           like btcxpm occurs 0,
           p_addparam
           like sxpgcolist-parameters.
      concatenate
      '/home/ABAP/scripts/Archive_file.sh'
      p_sfile
      p_dfile
      into p_addparam separated by space.
      refresh t_btcxpm. clear t_btcxpm.
      call function 'SXPG_CALL_SYSTEM'
        exporting
          commandname = 'ZSHELL'
          additional_parameters = p_addparam
        tables
          exec_protocol = t_btcxpm
        exceptions
          no_permission              = 1
          command_not_found          = 2
          parameters_too_long        = 3
          security_risk              = 4
          wrong_check_call_interface = 5
          program_start_error        = 6
          program_termination_error  = 7
          x_error                    = 8
          parameter_expected         = 9
          too_many_parameters        = 10
          illegal_command            = 11
          others                     = 12.
      if sy-subrc = 0.
        write : /
        'File',p_sfile,'moved to',p_dfile.
      else.
        write : / 'Error Occured'.
      endif.

  • Run Unix script from abap

    Hi
    Friends  i am runing a abap report which genrate a ( eft.txt ) text file in /usr/tmp/
    Now  i want  to run a unix script   which encript this file.
    I  have created this command in SM69
    type = customer
    command name = ZENC
    Operation system = unix
    externl program     = sh
    parameter for external program = /usr/tmp/ enc.sh eft.txt eftdc eftdo
    enc is unix script and eft.txt is imput text file eftdo eftdc are encripted  files.
    I am us the function module SXPG_CALL_SYSTEM'
    it is ending with  following messege
    1      5     hello
    2     19     eft.txt eftdo eftdc
    3     40     The jar file is not found: Encryptor.jar
    4     44     External program terminated with exit code 1
    and  do not give any output.
    please  help.
    Thanks & regards
    SS

    report zsrchsap.
    *-This is a demo report for Search Sap
    *-Author : Sandeep Kulkarni
    *-Date : 09/20/2001
    parameters : p_sfile(60) lower case
              "File to be moved
              "Eg : /home/in/SFILE1.txt
                p_dfile(60) lower case.
              "File's Destination
              "Eg: /home/archive/SFILE1.txt
    data : t_btcxpm
           like btcxpm occurs 0,
           p_addparam
           like sxpgcolist-parameters.
      concatenate
      '/home/ABAP/scripts/Archive_file.sh'
      p_sfile
      p_dfile
      into p_addparam separated by space.
      refresh t_btcxpm. clear t_btcxpm.
      call function 'SXPG_CALL_SYSTEM'
        exporting
          commandname = 'ZSHELL'
          additional_parameters = p_addparam
        tables
          exec_protocol = t_btcxpm
        exceptions
          no_permission              = 1
          command_not_found          = 2
          parameters_too_long        = 3
          security_risk              = 4
          wrong_check_call_interface = 5
          program_start_error        = 6
          program_termination_error  = 7
          x_error                    = 8
          parameter_expected         = 9
          too_many_parameters        = 10
          illegal_command            = 11
          others                     = 12.
      if sy-subrc = 0.
        write : /
        'File',p_sfile,'moved to',p_dfile.
      else.
        write : / 'Error Occured'.
      endif.

  • How to Open a file by JAVA SCRIPT in ABAP?

    Hi Experts,
    i'm trying to open a pdf file in java script (ONLY) through ABAP.
    Is it possible? If so how?
    The java script what we write in HTML is "window.open("C:
    Temp
    file.pdf");"
    Please advice ASAP.
    Somnath

    Hi,
    You have to make the Vi reentrant so that it does not share the same memory location:
    Regards,
    Even
    Certified LabVIEW Associate Developer
    Automated Test Developer
    Topro AS
    Norway

  • UNIX scripting in ABAP

    Hi Champs,
          I need integerate UNIX application in my ABAP program. Below are the list of requirements for which UNIX will be required:
    1) Need to move a file from one directory to another in Application server.UNIX command can be
    MV Source Target
    2) Need to search for a file in certain Directory.UNIX command can be
    LS <file> Directiories where in files to be search.
    Please can you help me out how to integerate UNIX code with ABAP report.
    Regards,
    Nishant Khimesra

    Nishant,
    To move a file from one directory to another in Application server.
    DATA: command LIKE rs37a-line.
    DATA: BEGIN OF tabl OCCURS 0,
              line(2000),
          END OF tabl.
    command = 'mv /tmp/file1.txt /usr/tmp/file1.txt'.
    CALL 'SYSTEM' ID 'COMMAND' FIELD command
                  ID 'TAB'     FIELD tabl-*sys*.
    To search for a file in certain Directory.
    DATA: command LIKE rs37a-line.
    DATA: BEGIN OF tabl OCCURS 0,
              line(2000),
          END OF tabl.
    command = 'ls /tmp/file1.txt '.
    CALL 'SYSTEM' ID 'COMMAND' FIELD command
                  ID 'TAB'     FIELD tabl-*sys*.
    Regards
    Sabu

  • Call VB Script From ABAP Program

    Hi,
    I need to call a VBS program from an abap program.  This abap will run on both 4.6 and 4.0.
    I would be very grateful for any suggestions on how this can be done.
    Thanks and Kindest Regards
    Danielle

    data: commandline(1000).
    commandline = v_vbs_filename. "complete path of vbs file
      call function 'WS_EXECUTE'
           exporting
                commandline    = commandline
                program        = 'WSCRIPT.EXE'
           exceptions
                frontend_error = 1
                no_batch       = 2
                prog_not_found = 3
                illegal_option = 4
                others         = 5.
      if sy-subrc <> 0.
        raise execution_failed.
      endif.
    Raja

  • ABAP program to execute shell script !

    Hi Friends,
    I have created some shell scripts and need to be executed through ABAP prog in order to automate some process. can any one tell me how to execute these scripts through ABAP program? i know that we have to setup those scripts through SM69 but i dont have clear idea about this.can some one tell me step by step how to do this. ur help will be awarded in terms of points.
    Thanks

    Define the scripts as commands in SM69. Test them in SM69/SM49 to see if they work.
    Next, go to SE37, run FM SXPG_COMMAND_EXECUTE, and specify your command there. Does it work?
    If yes, you can just code a 'CALL FUNCTION' to this FM in your ABAP program, and you are ready to invoke your script from your ABAP.
    For  a list of functions that work with commands (defined in SM69), do a drop-down on SXPG_COMMAND* in SE37.
    A sample code may look like this
    concatenate zsys_id z_infile z_extfile into parm
        separated by space.
    *C_FTP_COMMAND is a script defined in SM49
        CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
          EXPORTING
            COMMANDNAME                   = C_FTP_COMMAND
            ADDITIONAL_PARAMETERS         = parm
            OPERATINGSYSTEM               = SY-OPSYS
          TABLES
            EXEC_PROTOCOL                 = PROT
          EXCEPTIONS
            NO_PERMISSION                 = 1
            COMMAND_NOT_FOUND             = 2
            PARAMETERS_TOO_LONG           = 3
            SECURITY_RISK                 = 4
            WRONG_CHECK_CALL_INTERFACE    = 5
            PROGRAM_START_ERROR           = 6
            PROGRAM_TERMINATION_ERROR     = 7
            X_ERROR                       = 8
            PARAMETER_EXPECTED            = 9
            TOO_MANY_PARAMETERS           = 10
            ILLEGAL_COMMAND               = 11
            WRONG_ASYNCHRONOUS_PARAMETERS = 12
            CANT_ENQ_TBTCO_ENTRY          = 13
            JOBCOUNT_GENERATION_ERROR     = 14
            OTHERS                        = 15.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        else.
          write: /, 'FTP Function module executed with no errors.'.
        ENDIF.

  • ABAP-HR scripts

    hi friends,
    could u plz tell  how to find the standard scripts for abap-hr.
    give me some standard script names regarding hr-abap...
    thanks in advance.
    regards,
    priya.S

    Hi,
    HR forms are created using Tcode PE51. This HR forms are specifically designed to created Payslip.
    So the standard program to access payslip is again country specific.
    For e.g. US, the program name is RPCALCU0.
    Check the report RPCALCU0 you can see down a radio button with text HRFORM...in this the form you have to select the FORM..
    To  create the forms you have to use transction HRFORMS
    Regards,
    Maha

  • In ecatt - how to check at database level using ABAP

    Hi,
    How to check at database level using ABAP in Ecatt tool.
    say,for example I want to check a particular sales order is invoiced or not ,at the database level and if it is invoiced I have stop proceeding to invoicing of that sales order number.
    Could anybody suggest on this with an example?
    thanks.

    Hi,
    you can use the command GETTAB to access single db records.
    Full specified or partitial specified keys can be use at GETTAB. It will return always only one record, also if a couple could match your selection.
    For more advanced scenarios you can also use eCATTs Inline ABAP. In a block between the commands ABAP. ENDABAP. you can code ABAP statements, e.g. SELECT ... INTO TABLE ...
    eCATT script parameters of type 'V' defined in that script using ABAP/ENDABAP will be transfered into the ABAP block and back to script after ABAP perform.
    Best regards
    Jens

Maybe you are looking for

  • 11.1.2.1 Upgrade to existing 11.1.2 - Services don't start

    Not a fun day in EPM world for me... Windows 2008 SP1 three servers (web/app, DB, reporting) We did the upgrade in place from 11.1.2 to 11.1.2.1 and was successful no problems rebooted however none of the services start (we have done the upgrade only

  • Report is being generated but nothing show

    Hi, there was no error in the data tool, I can run and see the expected results in the tool but nothing shows in the reporting server.

  • See an edited picture unedited in finder

    Hello guys and girls. I really need to see an edited picture unedited in finder. I have seen it before with my own eyes on my own computer that it works. I saw an edited picture in this view in finder: http://img413.imageshack.us/img413/5781/lolfzf.p

  • No Picture Previews in Lightroom 3?

    Hi there I have just installed Lightroom 3 - on PC laptop - and imported some images from the Picture Folder on the OS drive Everything seems to be fine except (and its a major except) there are absolutely no thumbnails or previews of these pictures

  • Metro Ethernet Switches Network Implementations

    I wish that Cisco would collect as many as network scenarios and pratical configurations for 3750ME, Metro Ethernet, and MPLS, starting with few basic one. Cut down the marketing materials. It will benefits all customers and cut down supports.