Call ABAP program from Unix script passing dynamic filename

Hi,
Does anyone know if it is possible to call an ABAP program from a Unix script passing a dynamic filename to the ABAP program?
We are receiving a file from an external company and on receipt of the file want to call an ABAP program passing the filename.  The filename is made up of File ID, Date and Time which we need to read in the ABAP program.  We usually use Events to trigger a program which is fine when the filename if static however since this filename will be dynamic we cannot do this.  In addition we cannot just rename the file to a static name in the Unix script as we need to know the value of the date and time from the file ID in the ABAP program.  I can change the ABAP program to check our /in directory for a Filename that starts with the fixed File ID however I thought there must be a better way of doing this.  We want the external company to put this information in a file header record but they don't want to change the file contents.  Any ideas would be appreciated.
Thanks,
Sinead.

You could follow the following method
1.Let the external file reside in the SAP application layer in a defined path e.g. /usr/sap/tmp/interface/working/
2.Write an ABAP program which will include the following steps:-
   i) read all files in the file path using function module EPS_GET_DIRECTORY_LISTING
  ii) Read the data from files existing in the directory using OPEN_DATASET statement
iii) After the files have been read move the files to another directory e.g. /usr/sap/tmp/interface/backup/ or you can delete the file.
3.Schedule this program to be executed depending on the frequency of the external file being generated.

Similar Messages

  • Calling ABAP Program from a Process Chain

    I am calling an ABAP Program from Process Chain by adding a Process Type u201CABAP Programu201D,
    My ABAP program writes lots of information using write statements.
    I looked in Process Chain Log; I do not see output from Write statement. I am pretty sure my write statements were executed. I also looked in SM37 job log. I do not see any more information.
    Where to see the output generated from ABAP.
    Thanks.

    Hi,
    First find out where your ABAP program the data written.You need to write it into and spool then only you can see it.
    Transaction SP01, you can use the FM 'GET_PRINT_PARAMETERS' in your abap program to write to spool.
    Thanks,
    Ravi

  • Call ABAP program from a Feature - PE03

    We are in process of upgrading from 4.6 C to ECC 6.0.  One feature (CSTV1) will not activate because there is a limit on generated programs to under 10,000 ABAP statements.  SAP told me to call an ABAP program from the feature to reduce the number of ABAP statements in the generated program.  Has anyone created a feature that called an ABAP program?  I searched SAP help and I can't find any information about calling a ABAP program.
    Thanks in advance,
       Mark Ashabraner

    Hi Mark,
    You can try it this way.. Get the name of the ABAP Program generated by the feature from its attributes. it will be something like '1PAPA/FEAT020Z0106'...May be you can change this program ie  put a substantial chunk of this code in a subroutine in another program & call that with a PERFORM from this Program..
    ~Suresh

  • Call ABAP Program from outside SAP

    Hi all,
    How can I call an ABAP program from outside SAP, for example from a C++ executable, a .NET assembly or a JAVA package ? Are their "adapters" provided by SAP for this ?
    Angela

    Hi Angela,
    as mho already stated:
    For external connections to ABAP, the sap-proprietary "remote function call (RFC)" is a common way.
    SAP delivers an RFC-library for this, and for some development environments SAP even offers a connector on top of this library to make connectivity more easy (SAP Java Connector, SAP Business Connector, SAP Connector for Microsoft .Net). An RFC is always starting function modules in ABAP, not ABAP programs, and these function modules need the attribute "remote-enabled".
    (Remark: in the context of SAP NetWeaver Process Integration, SAP offers adapters for connectivity, also for ABAP systems.)
    For ABAP systems on basis code line 6.20 and above, the remote-enabled function modules can externally be used as web services.
    Information on RFC can be found in the SAP Help Portal http://www.help.sap.com, e.g. [RFC Call - Example Program|http://help.sap.com/saphelp_nw04/helpdata/en/3d/733760ccb411d2b4550060941936e3/frameset.htm]. A search in SDN provides links to the Help Portal as well.
    >
    Angela GALACY wrote:
    > For example, what if I develop an EJB inside NetWeaver, will I be able to access this from any J2EE client ?
    This part is beyond the ABAP question, and my guess is pretty simple: like on any other J2EE server.
    Regards, Boris

  • Error while calling ABAP program from Data Services

    Hi All,
    We have a ABAP program which accepts two parameters 1] a date 2] a string of comma separated ARTICLE numbers .
    We have used a ABAB transform in ABAP dataflow which refers this ABAP program.
    If I pass a string of 6 articles as second parameter the job executes successfully
    But if i pass 9 articles as follows
    $GV_ITEM_VALUES='3564785,1234789,1234509,1987654,1234567,2345678,3456789,4567890,5456759';
    i get the following error
    ABAP program syntax error: <Literals that take up more than one line are not permitted>.
    The error occurs immediately after ABAP dataflow starts, ie even before the ABAP job gets submitted to ECC
    I am using BODS 4.2 . The datatype of $GV_ITEM_VALUES is varchar(1000).
    The ABAP program that gets generated by the DS job has the following datatype for this parameter
    PARAMETER $PARAM2(1000) TYPE C
    Is there a different way to pass string characters to ABAP transform in data services?
    I have attached the screen shot of trace log and error
    Regards,
    Sharayu

    Hi Sharayu,
    The error your getting is because the  literals exceeds more than 72 characters.
    It seems that the length of the string is exceeding more than 72 character.
    Can you check the following in ECC GUI
    Go to Transaction SE38=>Utilities=>Settings=>ABAP Editor=>Editor=> Downwards -Comp.Line  Length(72).
    The checkbox which defines length 72 must be clicked so the error is coming. Can you uncheck the checkbox and then try passing the parameter $GV_ITEM_VALUES using the BODS job
    Regards
    Arun Sasi

  • Trigger ABAP program using UNIX script

    Hi All,
    I want to trigger an Abap program whenever a unix file comes to SAP.
    Can any1 please tellme how to write a unix script to trigger the ABAP program.
    Thanks in advance.

    you will need to create a batch job in SM37 for the ABAP program, and use an event for the start criteria.
    The event can be created in SM62
    Then in unix, you will need to call an executable SAPEVT.
    This will be in the directory /usr/sap/<SAPSID>/SYS/exe/run
    you will need to use the appropriate profile for the SAP system to run the sapevt utility.
    example :-
    sapevt abap_event -t pf=/usr/sap/<SID>/SYS/profile/<SID>_DVEBMGS00_<SYSNAME> nr=00

  • Urgent: call ABAP program from BSP

    hi BSP experts,
    We just want to trigger an ABAP program to say "Hello World" in BSP and see the wording "Hello World" on web browser when running it from BSP.  One BSP expert Raj gave the answer by using the following in BSP:
    oninitialization:
    submit ('z_program_name') and return exporting list to memory.
      call function 'LIST_FROM_MEMORY'
           tables
                listobject = listobject.
      call function 'WWW_HTML_FROM_LISTOBJECT'
           exporting
                report_name = 'z_program_name'
           tables
                html        = html
                listobject  = listobject.
      clear output_str.
      loop at html into html_wa.
        concatenate output_str html_wa into output_str.
      endloop.
    layout code:
    <htmlb:content design="design2003">
    <htmlb:page title = " ">
    <htmlb:form>
    <%= output_str %>
    </htmlb:form>
    </htmlb:page>
    </htmlb:content>
    We put the above in our BSP and then activate them, but get the following error:
    Field "LISTOBJECT" is unknown. It's neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement."DATA" statement.
    And the error stopps here:
    submit ('z_program_name') and return exporting list to memory.
    call function 'LIST_FROM_MEMORY'
    tables
    listobject = listobject.
    Any idea? 
    We will give you reward points!

    hi Tanguy,
    Eventually, I have figured it out on how to make the code works by showing "Hello World!" on web browser. But actually we would like to run another ABAP program which open a new container on users' machines, download an Excel template stored on server to the opened container on users' machinese, and then dump SAP table data to the opened excel template. This program works very well through SAP GUI, but users would like to run it on web that we tried to run this program in BSP, but it doesn't work with your code! Any idea?
    Thanks alot!

  • How to call ABAP programs from Excel

    Hello everyone,
    Currently I'm investigating the integration of Excel and ABAP program. I find it's easy to call Excel from ABAP program, but does anyone of you know how I can first open and do some actions in an Excel sheet first, and then, for example, when I press the save button, the data will be transferred back to ABAP system? I think when openning the Excel, the logon of the backend system is needed.
    I've ever seen this functionality in some BW-reporting tools, but I cannot remember the details.
    Thank you very much and best regards,
    Leon

    yes in BW we are having this concept of creating wookbooks & queries.
    If u have BW server Go to Transaction RRMX  - u will get a Microsoft Excel sheet.
    Here it allows u to logon to the SAP system.
    For details see this link.
    <a href="https://forums.sdn.sap.com/click.jspa?searchID=561476&messageID=2553631">https://forums.sdn.sap.com/click.jspa?searchID=561476&messageID=2553631</a>
    <a href="https://forums.sdn.sap.com/click.jspa?searchID=561476&messageID=519862">https://forums.sdn.sap.com/click.jspa?searchID=561476&messageID=519862</a>

  • Call ABAP program from a process chain

    Hi ,
    Can anyone tell me how do we call an ABAP program in R3 from a process chain in BW.
    Its real urgent please help.
    Thanks
    Ankit

    Hi,
    Create ABAP program in BI/BW system with name like ZFILL_CALL.
    Create RFC enabled function module(eg: ZRFCFM) in R/3 system, in this function module call your program which fills the ZTABLE from application server.
    Call RFC function module ZRFCFM from your program ZFILL_CALL in BW system.(u need to RFC connections to these systems).
    Create process of type "ABAP program" which u will find in General sevices in RSPC. Attach this process befor u r inpackage process chain.
    Hope it will work.
    Sree

  • How to call Abap Program from Javascript or html ?

    Hi All,
        I have developed a program using html, abap and javascript. I want to call an abap program while clicking on the button.
    How can I do it ?

    Hi Rajesh,
    What kind of program it is? is it a report or a transaction?
    If it's transaction, you can call the transaction as below from a link or button.
    http://<host>:<port>/sap/bc/gui/sap/its/webgui?~transaction=<transaction>
    Please replace the parameters in <..> with appropriate values before testing.
    Regards,
    Ravi

  • Calling ECC Program from BW by passing values

    Hi,
    We have a requirement where we need to call ECC Program through BW Process Chain and whenever we execute Program the Date Parameter Value should always be current date. Please let me know how we can achieve this?
    Regards
    Sushma

    You can create a process chain and call a remote process chain in ECC R system.
    In R3, create a process chain and execute the program there...
    The program can be adjusted to take the correct system date

  • Removing or destroying an ABAP program from memory

    Hello!
    Is there a command to kill, unload, remove or destroy a previously called ABAP program from memory? Let me explain what I'm trying to do:
    I'm doing some WM developments and I use the function L_TO_CONFIRM to confirm transfer orders. This function belongs to function group L03B (program SAPLL03B) and eventually it makes external  calls to subroutines belonging to program SAPML03T.
    If my Z program calls this funcion, the SAPLL03B program is responsible for loading SAPML03T into memory and everything works fine. The loaded programs list (on the debugging menu) are like this:
    No     Program          Group with
    52     SAPLL03B       
    78     SAPML03T      52
    This is also what I get if testing L_TO_CONFIRM from SE37, where it also works.
    But I wanted to reuse some subroutines from SAPML03T on my Z program, so I call something like this:
    PERFORM set_quit_icon(sapml03t) ...
    This call happens before the function call, so SAPML03T gets loaded by my Z program first, and stays on the memory. The list of loaded programs then looks like this:
    No     Program          Grouped with
      1     ZWMO_023
    27     SAPML03T       1
    So after calling the external subroutine in SAPML03T, I do some more coding and finally call the function L_TO_CONFIRM. Inside this call, my list looks like:
    No     Program          Group
      1     ZWMO_023 => My Z program
    27     SAPML03T       1
    28     SAPLL03B       
    So SAPML03T is grouped with my Z program and not SAPLL03B as it would be if I hadn't called the external subroutine first.
    Now, the problem:
    Since SAPML03T and SAPLL03B apparently share some global data (at least global workarea/table LTAK), in a normal call (SAPML03T)LTAK gets filled by a select statement and instantly (and somewhat inexplicable from what I new until now) (SAPLL03B)LTAK also gets filled by the same data. Well, I've only seen stuff like this with field-symbols but this is not the case. I would bet this two workareas would always be in fact two different workareas, but during the straight function call they are not. They are the same (I wish I could find their pointer addresses (like C++ stuff) to prove they were the same, but I couldn't). But if I call the external subroutine first and SAPML03T gets loaded, then I do have two different LTAKs and that's where I have problems, because L_TO_CONFIRM was coded considering this single workarea thing and when I have two, it doesn't work.

    Yes, I tought about that.
    As a matter of fact, just last week we had another global memory issue in a costing user-exit and we tried solving it with a STARTING NEW TASK. This initialy solved our problem, but this command leads to the opening of a new gui session, and when running this cost calculation procedure in the background, a short dump COMMUNICATION FAILURE was raised, probably because of the lack of a SAP GUI link. We then used DESTINATION 'NONE' and this solved the problem (I think it also opens a new LUW).
    Also my WM problem is on a Z application that will be running under SAP Console, and I don't think opening a new GUI session with STARTING NEW TASK under SAP Console will work. I should try it anyway. - edited: I just remebered I did this a couple years go and it works
    I could use DESTINIATION 'NONE' in this case too, since the funcion module is RFC-enabled already. There are a few ways to solve the problem (which is already solved by the way). My main question still is about removing a whole program from SAP memory through ABAP commands.
    Thank you very much!

  • Calling a report from unix shell script

    Hi,
    I had to call a report from unix shell script.
    May i know the procedure to accomplish this
    Thanks in Advance
    A.Gopal

    First you should not include the whole path to your report in the call ...
    Use like this:
    /ora/u01/oracle/v101/as2/bin/rwrun.sh report=an_stati destype=file desname=/ora/u01/oracle/v101/as2/test.pdf desformat=pdf
    In $ORACLE_HOME/bin/reports.sh:
    1) Verify that you have updated the REPORTS_PATH variable to include your folder where you have the report in question
    REPORTS_PATH=/ora/u20/app/qits/env1/run:$ORACLE_HOME/reports/templates:$ORACLE_HOME/reports/samples/demo: ....
    2) Verify that the REPORTS_TMP variable is pointing to a valid location and that the oracle user has access to write on it.
    After that, post the content of the tracefile located at $ORACLE_HOME/reports/logs/{in-process report server name folder}/rwserver.trc
    If no file is present then it means that you need to enable trace in your reports's conf file.... go to the $ORACLE_HOME/reports/conf folder and and locate the .conf file that correspond to your in-process reports server name (as specified in the rwservelet.properties file)... open/edit the file to enable trace logs ..
    i.e.
    Change the following line:
    <!--trace traceOpts="trace_all"/-->
    to <trace traceOpts="trace_all"/>
    Bounce the reports server and try to run the report again, this time the .trc file should be generated, post the content so that we can take a look.

  • Error while calling java program from ABAP

    Hi Experts,
    We are trying for RFC inbound scenario.
    We followed the below blog
    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    We are working with SAP JCO 3.0.2
    We are getting the error : 'STFC_CONNECTION' could not be found in the server repository.
    After I run the Java server program if I execute the RFC destination directly from SM 59 it is showing successful messages.
    If I stop the java program then this RFC is failing. Based on this we concluded that RFC to Java connection is working fine.
    But as mentioned in blog if we call the RFC Destination from ABAP program it is giving the below error,
    'STFC_CONNECTION' could not be found in the server repository.
    If we test the RFC destination using RFC_TRUSTED_CHECK standard FM we are getting the below error.
    'RFCPING' could not be found in the server repository.
    We create the RFC destination of Type : TCP/IP as exactly mention in the blog.
    Please help us in resolving this issue.
    Thanks
    Prince

    Pabi,
    Using the RFC connection,we can establish a link between Java and SAP.
    Afterwards,hope we can call Java program from ABAP.
    Below is the sample piece of code to establish RFC connection(link) between Java and SAP.
    DATA: REQUTEXT LIKE SY-LISEL,
          RESPTEXT LIKE SY-LISEL,
          ECHOTEXT LIKE SY-LISEL.
    DATA: RFCDEST like rfcdes-rfcdest VALUE 'NONE'.
    DATA: RFC_MESS(128).
    REQUTEXT = 'HELLO WORLD'.
    RFCDEST = 'JCOSERVER01'. "corresponds to the destination name defined in the SM59
    CALL FUNCTION 'STFC_CONNECTION'
       DESTINATION RFCDEST
       EXPORTING
         REQUTEXT = REQUTEXT
       IMPORTING
         RESPTEXT = RESPTEXT
         ECHOTEXT = ECHOTEXT
       EXCEPTIONS
         SYSTEM_FAILURE        = 1 MESSAGE RFC_MESS
         COMMUNICATION_FAILURE = 2 MESSAGE RFC_MESS.
    IF SY-SUBRC NE 0.
        WRITE: / 'Call STFC_CONNECTION         SY-SUBRC = ', SY-SUBRC.
        WRITE: / RFC_MESS.
    ENDIF.
    Regards,
    Sree

  • How to call  java program from ABAP

    Hi Experts,
         My requirement is to call java programs from ABAP. For that i have set up SAP JCO connection by using this link http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/739. [original link is broken] [original link is broken] [original link is broken] Connection gets sucessfully. After this how to call java program from ABAP as per our requirement. Please help me out.
      Also i tried this way also.. but while executing the DOS Command line appear & disappear in few seconds. So couldnt see the JAVA output. Please help me out to call java programs in ABAP..
    DATA:command TYPE string VALUE 'D:Javajdk1.6.0_20 injavac',
    parameter TYPE string VALUE 'D:java MyFirstProgram'.
    CALL METHOD cl_gui_frontend_services=>execute
    EXPORTING
    application = command
    parameter = parameter
    OPERATION = 'OPEN'
    EXCEPTIONS
    cntl_error = 1
    error_no_gui = 2
    bad_parameter = 3
    file_not_found = 4
    path_not_found = 5
    file_extension_unknown = 6
    error_execute_failed = 7
    OTHERS = 8.
    Thanks.

    This depends on the version of your Netweaver Java AS. If you are running 7.0, you will have to use the Jco framework. The Jco framework is deprecated since 7.1 though. If you want to build a RFC server in 7.1 or higher, it is adviced that you set it up through JRA.
    Implement an RFC server in 7.0:
    http://help.sap.com/saphelp_nw04/helpdata/en/6a/82343ecc7f892ee10000000a114084/frameset.htm
    Implement an RFC server in 7.1 or higher:
    http://help.sap.com/saphelp_nwce72/helpdata/en/43/fd063b1f497063e10000000a1553f6/frameset.htm

Maybe you are looking for

  • How can I create a file uploader for my website

    I am looking for a solution for creating a file uploader interface for my website. I need to accept files on a users local machine and upload them to designated directory on my server. Can I do this with JSP? Any advice or help would be appreciated T

  • After updating iOS 6 on 3GS, All my old text messages went unusable.

    Hi, I have iphone 3gs. i've updated iOS 6 on saturday. App Store crashed couple of times when i search for any apps. i've opened my old text messages which has an important phone number. There was lot of conversation happenened in that messages but n

  • Deactivate SAP WMS

    Hi Guys, Can you please advise me if you have any document on the below. 1.Cut-off activities to deactivate  the warehouse in existing plant /sloc 2.Steps to deactivate SAP WMS Thanks Tata Reddy

  • How do I get what does the function does.

    Hello. I want to get what the function actually does like in javascript: object.onmouseout what has hot a result of this: function anonymus() { what ever the function does but in flash I tried to use this: object.onEnterFrame but I get this [type Fun

  • Ovi Suite 2.0 WILL NOT LET ME DO ANYTHING because ...

    First off I want to say that Ovi Suite will not let me do anything because the program is locked up trying to find maps. I can't stop it no matter what I try and do. Reinstalling it does nothing for me, since as soon as I open the program up again, i