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!

Similar Messages

  • Calling ABAP Code From BSP

    Hello all,
    I dont have much idea of BSP ans would like to have some inputs from you all.
    I would like to know that can I call ABAP transaction from BSP page ?
    I have got a set of column entries just as an ALV column on my BSP page and I would like to provide hotspot or double click functionality so that for each of the entries in the table , the BSP page navigates to ABAP tcode and back to BSP page.Is this functionality possible?
    any help would highly be appreciated.
    Regards
    Amruta

    Hi Amruta ,
    You can't call an R/3 transaction directly from BSP.
    But you can achieve all the functionalities it does .
    for ex ..if an r/3 transaction is a report , u hav to code in BSP editor .u can call function modules from BSP .
    But one thing u hav to concern is ,,in BSP Apllication logic is seperatd from Business logic .
    U hav to move all your results into an itab / params and display that inside HTML tables .
    Start ur journey from here .......
    http://help.sap.com/saphelp_erp2004/helpdata/en/e6/e23fd8c47e11d4ad320000e83539c3/frameset.htm
    All the best .
    Regards,
    J

  • 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.

  • 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

  • Urgent: Calling ABAP Program using JMS

    Hi,
    I have a scenario where legacy system pass some messages to ABAP Program and this program can handle one message at a time (written in that way).
    Now the receiver communication channel is configured to access J2SE adapter. This J2SE adapter stores the message on R/3 system and triggers the ABAP program located in R/3 system.
    Now when multiple messages are coming at a time in SAP-XI and processed successfully and handover to J2SE adapter. But J2SE adapter triggers the ABAP program for all messages. And here is the problem. ABAP program is not supporting multi - threading.
    my idea is to use JMS adapter...can you guys suggest me how to achieve result and how to configure JMS or any other adapter to call ABAP Program so that only one message will pass to ABAP program at a time.
    Regards,
    Gourav Khare

    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 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 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>

  • 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

  • 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

  • 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!

  • Urgent!!  How to call a custom transaction or an ABAP program in BSP?

    Urgent!!  How to call a custom transaction or an ABAP program in BSP?
    We are pretty new on BSP.  Would be very appreciated if any expert here give us the detailed steps on how to build up the application to just call a custom transaction (e.g., t-code: ztest) or an ABAP program.  Would we have to create a button or event handler to do that?  And the detailed steps?
    Thanks in advance and we will definately give you reward points!

    hi Durairaj,
    During the time to wait for your answer, we copied Bernd's code from your last link, but when activating it, get the 1st error msg:
    Field "CLIENT" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement."DATA" statement. The error shows up here:
    <td>
    <htmlb:inputField id = "client"
    value = "<%= client %>" />
    </td>
    Then we added Client to the page attribute and define it as type String, then get another error:
    The field "EVENT" is unknown, but there is a field with the similar name "EVENT_ID"."EVENT_ID". This error shows up at the beginning in the Event Handler:
    OnInputProcessing:
    code
    • event handler for checking and processing user input and
    • for defining navigation
    • event handler for data retrieval
    event = cl_htmlb_manager=>get_event( runtime->server->request ).
    IF event->name = 'button' AND event->event_type = 'click'.
    button_event ?= event.
    How to resolve this unknown Event error, need to define in Page Attribute tab? but with what type?
    Actually we only want to run an ABAP4 program in BSP, the code is complicated, could you show us an easy way of doing this in BSP?

  • 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