Calling SAP scripts from WEBDYNPRO

Hi
We need to call SAP scripts from WebDynpro application.  As per my understanding we need to do following steps
Create a new RFC function module and create sap script output in PDF format.For this
    - use OPEN_FORM , by assigning TDGETOTF='X' in the Options(Structure
      ITCPO). 
    - call function module CLOSE_FORM with option OTFDATA
    - convert OTF data to PDF by using function module CONVERT_OTF_2_PDF
Now I would like to know how to display the PDF string from WebDynpro.
Please help....
Regards
Sujith

Hi,
You can call by creating external window method.
create LINK to URL or LINK TO ACTION according to requirement, for this. write code in onaction of that.
data: iv_url type string value 'http://<server>:<port>/sap/bc/gui/sap/its/webgui?~transaction=*se38 RS38M-PROGRAMM=rsparam;DYNP_OKCODE=SHOP'.
  data: api_component  type ref to if_wd_component,
          window_manager type ref to if_wd_window_manager,
          window type ref to if_wd_window.
  api_component = wd_comp_controller->wd_get_api( ).
  window_manager = api_component->get_window_manager( ).
  window = window_manager->create_external_window(
                 url = iv_url
                 modal = abap_false ).
  window->open( ).
Cheers,
Kris.

Similar Messages

  • Calling SAP transaction from WebDynpro

    HI,
    Could someone post a link as to how I may call a SAP transaction from a webdynpro.
    Will this be an external call to R/3 or can i get it embedded in my dynpro.......
    Tnks..

    Hi,
    You can call by creating external window method.
    create LINK to URL or LINK TO ACTION according to requirement, for this. write code in onaction of that.
    data: iv_url type string value 'http://<server>:<port>/sap/bc/gui/sap/its/webgui?~transaction=*se38 RS38M-PROGRAMM=rsparam;DYNP_OKCODE=SHOP'.
      data: api_component  type ref to if_wd_component,
              window_manager type ref to if_wd_window_manager,
              window type ref to if_wd_window.
      api_component = wd_comp_controller->wd_get_api( ).
      window_manager = api_component->get_window_manager( ).
      window = window_manager->create_external_window(
                     url = iv_url
                     modal = abap_false ).
      window->open( ).
    Cheers,
    Kris.

  • Calling Sap Script from SE38

    Hi ,
    Please let me know how to call sapscript from se38.
    Regards,
    Sreeja.

    Look at [BC SAPscript: Printing with Forms|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRPROG/BCSRVSCRPROG.pdf] there you will find the FM to call ([OPEN_FORM|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=open_form&adv=false&sortby=cm_rnd_rankvalue],  [WRITE_FORM|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_weblog&query=write_form&adv=false&sortby=cm_rnd_rankvalue], [CLOSE_FORM |https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=close_form&adv=false&sortby=cm_rnd_rankvalue]and the like, look at the pdf for "Example of a Print Program")
    Don't forget to use [search at sdn|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_weblog&query=sapscript&adv=false&sortby=cm_rnd_rankvalue].
    Regards

  • SAP Script from FM

    am calling a SAP Script from FM, in this SAP script there are some variables used the values to these variables are assigned inside FM. but these are not getting displayed. where as when I am calling the FM from report program the values are getting displayed

    1. You can print the data by using report program or application(through assingment in NACE)
    2. When you want to print some standard SAP application like pur. order , sales order this you will do with NACE and you fire the print from that application transaction like ME21, ME22, VA01 etc.
    3. Next is through stand alone transaction or program that is a report program thorugh which you will call the OPEN_FORM, WRITE_FORM, CLOSE_FORM and print the output.
    I think in your case, you are print through report program. If you want to write some data from print program to layout you should call WRITE_FORM by passing window and text elements.
    even when you are calling sap script from some other wrapper function module also, it calls and prints the data in the form.
    But ultimatly you should print the data by using report program or standard sap application method.
    Thanks,

  • Calling a webservice from webdynpro ABAP.

    Hi,
    Anybody have doc/material with screenshots on calling a webservice from webdynpro ABAP (In WAS 7.0 version using service calls )  with clear steps ?
    Thanks in advance. Ponts will not be a constraint for right answers
    Praveen
    Edited by: Praveen kumar Kadi on Feb 23, 2009 11:19 AM

    Hi Praveen,
    1st Step : configure Logical Port
    http://help.sap.com/saphelp_nw70/helpdata/EN/16/285d32996b25428dc2eedf2b0eadd8/frameset.htm
    2nd Step : Generate Proxy Object
    http://help.sap.com/saphelp_nw70/helpdata/EN/16/285d32996b25428dc2eedf2b0eadd8/frameset.htm
    3rd Step : Instantiating the proxy object & calling the methods exposed by webservice
    data: sys_exception type ref to cx_ai_system_fault,
          sys_exception2 type ref to cx_ai_application_fault,
          client_proxy type ref to zco_myesa, "MY PROXY CLASS
          lv_ret_code type int4,
          lv_input type zsend_email_input,
          lv_response type zsend_email_response.
    data: lv_from type string,
          lv_from_address type string,
          lv_to type string,
          lv_to_address type string,
          lv_subject type string,
          lv_msg type string.
    lv_input-from = 'MYSAPTEST'.
    lv_input-from_address = '<someAddress>'.
    lv_input-to = 'Prashant'.
    lv_input-to_address = '<someAddress>'.
    lv_input-subject = ' TEST'.
    lv_input-msg_body = ' Hi this is wonderfull to see it work'.
    try.
    create object client_proxy
    exporting
    logical_port_name = 'BASIC'. " Basic is a TYPE G RFC Destination
    call method client_proxy->send_email
       exporting
         input  = lv_input
       importing
         output = lv_response    .
      catch cx_ai_system_fault  into sys_exception .
        data lv_err type string.
         lv_err = sys_exception->if_message~get_text( ).
         write: / lv_err.
      catch cx_ai_application_fault into sys_exception2  .
         lv_err = sys_exception->if_message~get_text( ).
         write: / lv_err.
    endtry.
    if lv_response is initial.
       write: /'Not Executed'.
    else.
       write: /'Did Execute'.
    endif.
    Greetings
    Prashant

  • Calling SAP script program in BAPI and want to display in html format

    Dear All,
    I am writing bapi and calling sap script program in it.
    I want output in html format pl suggest me
    same coding is working for report giving error in sapscript only.
    types: begin of tt_html,
                 html type w3html,
           end of tt_html.
    data: list_tab type standard table of abaplist.
    SELTAB-SELNAME = 'S_INVNO'.
    SELTAB-KIND = 'S'.
    SELTAB-SIGN = 'I'.
    SELTAB-OPTION = 'EQ'.
    SELTAB-LOW =  INVOICE_NUM1.
    SELTAB-HIGH = INVOICE_NUM2.
    APPEND SELTAB.
    submit ZSDRDINVPNBRPT with selection-table seltab
    exporting list to memory and return.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = MTAB_REPORT_LIST
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
        CALL FUNCTION 'WRITE_LIST'
         EXPORTING
           WRITE_ONLY       = 'X'
          TABLES
            listobject       = MTAB_REPORT_LIST
         EXCEPTIONS
           EMPTY_LIST       = 1
           OTHERS           = 2.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    CALL FUNCTION 'WWW_LIST_TO_HTML'
           TABLES
                HTML   = MTAB_REPORT_HTML
           EXCEPTIONS
                OTHERS = 1.
    LOOP AT MTAB_REPORT_HTML.
    ENDLOOP.

    For displaying output in html format,
    u can either use BSP ( Business Server Pages)
    or Webdynpro.
    Reward if helpful.

  • Calling SAP Transaction from BSP

    I wonder whether it is possible to call SAP transaction from BSP application and pass to it some data; e.g., PO# when calling VA02?
    The called transaction could appear in a separate MS IE Window (like in some Portal applications) or in SAP GUI.
    Any help will be appreciated.
    Thank you in advance

    I have launched the Java SAPGui from BSP pages before.  I used SNC so that the users were logged on via Single Sign On.  I store the Java Gui in the Mime directory.  You can force the startup transaction.  Theorectically you could also Gui Scripting to try and control the Gui and force in the default value for your PO field.  I have not tried that however.  You will probably want to check the Service Marketplace for documents on the Gui Scripting.  The following is the code from my BSP page to launch the Java Gui in the Browser as an applet:
    <%@page language="abap"%>
    <%@extension name="htmlb" prefix="htmlb"%>
    <HTML>
    <HEAD>
      <TITLE>SAPGUI for the Java Environment</TITLE>
      <STYLE type="text/css">
          body { margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom:0px; }
      </STYLE>
    </HEAD>
    <BODY scroll="no">
    <SCRIPT language="JavaScript">
    // user configurable part starts here
    var pluginurl         = '';
    var scriptable     = 'true';
    var codebase         = '.';
    var jnlp           = 'platin.jnlp';
    var keepalive      = 'true';
    var frog           = 'true';
    var trace          = '';
    var tracefile      = '';
    var connectionData = 'conn=/M/nts163/S/3620/G/SPACE/&tran=SE80&clnt=088&fast=true&sncon=true&sncname=p:[email protected]&sncqop=9';
    // user configurable part ends here
    // verify if Java Plugin as control in Internet Explorer or Java Plugin for Netscape or native JRE of browser must be used
    var jre = 'control';
    if(navigator.platform.indexOf("Mac") > -1)
       jre = 'native';
    else if (navigator.appName.indexOf("Netscape") != -1)
       jre = 'plugin';
    document.open();
    switch (jre)
    case 'control':
        document.writeln('<OBJECT CLASSID  = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"                               ');
        document.writeln('    ID       = "PlatinGUI"                                                                    ');
        document.writeln('    CODEBASE = "j2re-1_3_1_02-win-i.exe#Version=1,3,1,0"                             ');
        document.writeln('    WIDTH    = "100%"                                                 ');
        document.writeln('    HEIGHT   = "100%"                                                 ');
        document.writeln('    BORDER   = 0>                                                      ');
        document.writeln('<PARAM NAME = "TYPE"           VALUE = "application/x-java-applet;jpi-version=1.3.1">         ');
        document.writeln('<PARAM NAME = "SCRIPTABLE"     VALUE = "', scriptable,'">                                ');
        document.writeln('<PARAM NAME = "code"           VALUE = "com.sap.platin.GuiApplet2">                   ');
        document.writeln('<PARAM NAME = "codebase"       VALUE = "', codebase,'">                             ');
        document.writeln('<PARAM NAME = "jnlp"           VALUE = "', jnlp,'">                             ');
        document.writeln('<PARAM NAME = "archive"        VALUE = "GuiStartS.jar">                             ');
        document.writeln('<PARAM NAME = "keepalive"      VALUE = "', keepalive,'">                             ');
        document.writeln('<PARAM NAME = "frog"           VALUE = "', frog,'">                             ');
        document.writeln('<PARAM NAME = "trace"          VALUE = "', trace,'">                             ');
        document.writeln('<PARAM NAME = "tracefile"      VALUE = "', tracefile,'">        ');
        document.writeln('<PARAM NAME = "connectionData" VALUE = "', connectionData,'">                               ');
        document.writeln('                                                                ');
        document.writeln('This page requires a Sun Java Plugin 1.3 and a SAPGUI for Java to view.                      ');
        document.writeln('                                                                ');
        document.writeln('</OBJECT>                                                           ');
        break;
    case 'plugin':
        document.writeln('<EMBED TYPE        = "application/x-java-applet;version=1.3"                         ');
        document.writeln('    PLUGINURL      = "', pluginurl,'"                                          ');     
        document.writeln('    WIDTH          = "100%"                                            ');                                        
        document.writeln('    HEIGHT         = "100%"                                             ');
        document.writeln('    ALIGN          = "BASELINE"                                                ');
        document.writeln('    code           = "com.sap.platin.GuiApplet2"                                      ');
        document.writeln('    codebase       = "', codebase,'"                                        ');
        document.writeln('    jnlp           = "', jnlp,'"                                                ');
        document.writeln('    archive        = "GuiStartS.jar"                                       ');
        document.writeln('    keepalive      = "', keepalive,'"                                       ');
        document.writeln('    frog           = "', frog,'"                                            ');
        document.writeln('    trace          = "', trace,'"                                            ');
        document.writeln('    tracefile      = "', tracefile,'"                                       ');
        document.writeln('    connectionData = "', connectionData,'"                                        ');
        document.writeln(' <NOEMBED>                                                      ');
        document.writeln(' </NOEMBED>                                                      ');
        document.writeln(' </EMBED>                                                              ');
        break;
    case 'native':
        document.writeln('<APPLET CODEBASE  = "', codebase,'"                                                           ');
        document.writeln('        ARCHIVE   = "GuiStartS.jar"                                                           ');
        document.writeln('        CODE      = "com.sap.platin.GuiApplet2"                                               ');
        document.writeln('        WIDTH     = "100%"                                                                    ');
        document.writeln('        HEIGHT    = "100%">                                                                   ');
        document.writeln('<PARAM NAME = "SCRIPTABLE"     VALUE = "', scriptable, '">                                    ');
        document.writeln('<PARAM NAME = "jnlp"           VALUE = "', jnlp, '">                                          ');
        document.writeln('<PARAM NAME = "keepalive"      VALUE = "', keepalive, '">                                     ');
        document.writeln('<PARAM NAME = "frog"           VALUE = "', frog, '">                                          ');
        document.writeln('<PARAM NAME = "trace"          VALUE = "', trace, '">                                         ');
        document.writeln('<PARAM NAME = "tracefile"      VALUE = "', tracefile, '">                                     ');
        document.writeln('<PARAM NAME = "connectionData" VALUE = "', connectionData, '">                                ');
        document.writeln('</APPLET>                                                                                ');
        break;
    document.close();
    </SCRIPT>
    </BODY>
    </HTML>

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

  • How to call IAC Iview from WebDynpro java code

    Hi Team,
    I am tring to call IAC Iview from WebDynpro Java code. we are passing value but blank page  displayed and there is no error show on error log.
    Below is Java Code which i am calling.
      public void wdDoInit()
          try {
                String strURL = "portal_content/TestSRM/iView/TestSRM";                           //WDProtocolAdapter.getProtocolAdapter().getRequestParameter("application");
                 String random = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("random_code");     
                 //wdContext.currentContextElement().setRandomNumber(random);
    //below we are call URL           
    WDPortalNavigation.navigateAbsolute("ROLES://portal_content/TestSRM/iView/TestSRM?VAL="+random,WDPortalNavigationMode.SHOW_INPLACE,(String)null, (String)null,
                       WDPortalNavigationHistoryMode.NO_DUPLICATIONS,(String)null,(String)null, " ");
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
    I am passing value from URL.
    http://<host Name>:<port>/webdynpro/resources/local/staruser/StarUser?random_code=111111111
    when we call above URL we getting blank screen.
    Regards
    Pankaj Kamble

    Hi Vinod,
    read this document (from pages 7 ).
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b5380089-0c01-0010-22ae-bd9fa40ddc62">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b5380089-0c01-0010-22ae-bd9fa40ddc62</a>
    In addition lok at these links: (Navigation Between Web Dynpro Applications in the Portal)
    <a href="http://help.sap.com/saphelp_erp2005/helpdata/en/ae/36d93f130f9115e10000000a155106/frameset.htm">http://help.sap.com/saphelp_erp2005/helpdata/en/ae/36d93f130f9115e10000000a155106/frameset.htm</a>
    <a href="http://help.sap.com/saphelp_erp2004/helpdata/en/b5/424f9c88970f48ba918ad68af9a656/frameset.htm">http://help.sap.com/saphelp_erp2004/helpdata/en/b5/424f9c88970f48ba918ad68af9a656/frameset.htm</a>
    It may be helpful for you.
    Best regards,
    Gianluca Barile

  • How to call a webService from WebDynPro ABAP ?

    We are trying to call a webService from WebDynPro-ABAP application. It is not working, While if we are calling the WebService from a Report, it is working.
    How exactly do we call a WebService from a WebDynPro-ABAP application?
    What are the main steps involved ?

    Hi Phani,
    You will need to create a service call as follows.
    Right click on your WD component name and select Create->Service Call
    The wizard will guide you through a series of steps to make a Web Service Call. On the 3rd screen, it will give you options such as Function Module, Web Service, etc
    Before making a service call, you will need to create a proxy for the Web service in the ABAP Workbench using a WSDL document as a basis. To create or consume Web services, you will need the authorizations associated with the role SAP_BC_WEBSERVICE_ADMIN.

  • Call SAP Transaction from BSP

    Hi,
    I am new to BSP. I have to call SAP Screen on button click event on BSP and also need to pass data at runtime.
    I searched this forum but didn't find the right solution. I tried to call SAP screen from BAPI and through URL but no success.
    Anyone knows how it can be done?
    Regards,
    Usman Malik

    Thanks for your reply,
    Actually I am very new to BSP. I don't understand where to put this code?
    [System]
    Name=DEV
    Description=DEV [Development]
    Client=123
    [User]
    Name=RAJA
    Language=EN
    [Function]
    Title=
    Command=*SU01 USR02-BNAME=raja;
    Type=Transaction
    [Configuration]
    WorkDir=d:xxxxxxSapWorkDir
    [Options]
    Reuse=1
    Second thing is about shortcut. Do I have to place this shortcut on server?
    Thanks,
    Usman Malik

  • Translations of SAP Script from English to Spanish

    Hi All,
    I need to do translate one of the SAP script from English to Spanish. Could anyone please help me how to achieve this?
    Thank you in anticipation.

    Hi Nikhil,
    You can use transaction SE63 to do this: Translation->long Texts->SAPscript->Forms.
    Regards,
    John.

  • Calling Python Script from LabVIEW

    Hello Everyone,
    I want to call the Python script from LabVIEW.
    I tried with using at the command line but i am unable to run that script file..
    i have gone through LabPython but i am unable to call the scripts from there also..
    If someone has an example of a VI which invokes a python script, it will be very helpful...
    Thanks a lot in advance
    Regards
    Avni

    avni wrote:
    I have to invoke the Script file at command prompt.
    Can you descriobe your restriction(s) concerning "invoke the script at the command prompt"?  There may be ways around that.

  • Calling SAP RFC from ODI

    I want to call SAP RFC from ODI. Client has provided only a set of RFC's. So I want to call these RFC's to extract data from SAP ERP system or BW to Oracle Staging using ODI. Would anyone please tell me how it will be possible?

    I want to call SAP RFC from ODI. Client has provided only a set of RFC's. So I want to call these RFC's to extract data from SAP ERP system or BW to Oracle Staging using ODI. Would anyone please tell me how it will be possible?

  • Calling Ant script from Jdeveloper

    Hello Gurus,
    I am trying to call Ant script from Jdeveloper.
    I am able to call it when i don't use any javac in ant script.
    But as soon as i include a javac command
       <javac srcdir="${src}" destdir="${build}"/>
    I get below error
    C:\ant\windows\svn\AntJava\Project1\build.xml:20: Unable to find a javac compiler;
    com.sun.tools.javac.Main is not on the classpath.
    Perhaps JAVA_HOME does not point to the JDK.
    It is currently set to "C:\Oracle\jdk160_24\jre"
    Needless to say i already have implemented all the steps mentioned in the internet.
    I have my JAVA_HOME correctly set in my PATH environment variable.
    I have tools.jar in the CLASSPATH
    Please give a solution from JDeveloper perspective and not a generic one as i am done with all the steps provided in internet.

    any one?????

Maybe you are looking for

  • RECONCILIACION INTERNA ERROR

    Buen día chicos, tengo un problema en una bd en 8.8 pl 18 en la que se está reconciliando un pago con una factura. El pago tiene la caracteristica de ser en USD y aplicar para varias facturas, esta ultima factura con la que se está reconciliando corr

  • Error while opening Page

    I have a simple self service page with a field linked to LOV. When I run the page I get an error Call Stack = java.lang.Throwable      at oracle.apps.fnd.framework.OACommonUtils.getCallStack(OACommonUtils.java:784)      at oracle.apps.fnd.framework.s

  • SCCM Console issue, SQL connectivity login failed for SCCM machine account

    Hi , As part of resolving the corrupt SCCM 2012 R2 environment, we have uninstalled the site from the Standalone primary site and restored it from the last backup. The database is on remote server on SQL 2012 SP1. Only Site recovery is run. Post the

  • HT1725 why can't i download my purchased songs from icloud?

    I have purchased multiple songs from itunes on to my iPhone, these songs are bcked up to my computer but it would not et me listen to them or download them from iCloud.

  • ITunes problem with Libary

    Hey, what i did, i moved all my songs and movies to an external drive, and re-linked it to the itunes, but it won't play my movies, it will play the songs. So i tried to put the movies back into the itunes, but it won't add it, it shows the plus icon