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.

Similar Messages

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

  • Sap script program without Nast

    Hi Friends,
    can we right a sap script program without taking nast table into consideration???
    Thanks and Best Regards.
    Kusum.

    Hi,
    Yes you can create an ABAP report with normal selection screen and output will be a sap script.

  • ABAP program for BAPI and convert DB into XML

    ABAP program for BAPI and convert DB into XML
    Thank you,
    Regards,
    Jagrut BharatKumar Shukla

    Refer the link -
    give an example of bapi coding?
    how can we transfer huge amount of data from database server to xml format
    Regards,
    Amit
    Reward all helpful replies.

  • Transport.of SAP script form , printer def and device type is not enaugh

    I transported the SAP script form , printer definition and device types of a thermal printer.
    On original system the printout is ok but on target system not. What should I do?

    Thank you for your fast answer
    As the matther of fact I am technical person. I think Output type belongs to application. However the difference is visible in  se71 ->Utilities->Printing test -> output device ->print preview.
    As I wrote I transpored corresponding. SAP script form , printer def and device type

  • Calling Shell Scripts in Business Workflow and Guided Procedures

    Hi *,
    is it possible to call shell scripts in business workflow and guided procedures? would need further documentation (how to, blog,...) about this issue.
    Thx in advance,
    Rene.

    Hello,
    Workflows consist of tasks.
    A task executed an object's method.
    Methods are written in ABAP.
    In the method you can code whatever you like, including code to execute shellscripts.
    How to do this is not really a workflow question, I would suggest asking in an ABAP forum on how to write a function module to do this in a pure ABAP context. Then it's just a matter of inserting it into a method for use in your WF.
    Cheers,
    Mike

  • In SAP Scripts How to write the fields 90  Degrees to regular format

    Hi ,
    I am working with SAP Scripts . Sometimes you may want to print text vertically.
    I have got a requiremnt in which there we have to write some data which is to be written 90 degres to regular output.
    please let me know if there is any printer setting for that .
    Regards.
    Rohit.

    Dear friend,
    For printing the text verticaly you need to made a
    print controle at printer level.
    select a command and in that you have to go in tab general
    attribute.
    and in front of :Include Printer Control: give the z print controle.
    in my company basis people had made one print controle
    ZR090.
    YOU have to use this command two times between
    the text .
    first command will move the printer at 90 degree and then
    write the text and second will move back to horizental.
    I dont know how this ZR090 can be made.
    rest wht i have written is very true and currently working.
    hope this will solve your problem.
    rewards are expected.
    Thanks and Regards
    vivek kumar srivastava

  • I want to display a HTML file that is stored locally on my machine.

    Hello,
    I am having a problem with my paths (I believe). I have created a JEditorPane that reads in a HTLM page. If the page is form the web it works fine:
    page_jep.setPage("http://www.google.com");However I want to display a HTML file that is stored locally on my machine.
    I have tried the following but cant get it to find the stored page:
    page_jep.setPage("file:///index.htm");
    java.io.FileNotFoundException: \index.htm (The system cannot find the file specified)I have tried putting the index file in both the root directory ( C ) and also the same place as where the class files are.
    Any help will be gratefully received,
    Harold Clements

    Nope, I have tried it:
    page_jep.setPage("file://c:\\index.htm");Gives me:
    java.net.UnknownHostException: c

  • From JCO calling BAPI and want to get the list

    Friends,
            Using JCO i connected to SAP server and want the list of profitcenter and all creditors.
    For Creditors    : BAPI_CREDITOR_GETDETAIL
    For Profit center: BAPI_PROFITCENTER_GETLIST
    I am using both the bapi's but i am not getting the list of it. Basically this two bapi will return table so..will u pls. help me out to solve this problem.
    Thanks
    Hitz

    Hi,
    probably you work wiht wrong data (if is something wrong with connection to SAP, some exception will erased).
    First connect to SAP with SAP gui, go to transaction se37 and try run BAPI_CREDITOR_GETDETAIL. That is a test do you work wiht correct data (in BAPI_CREDITOR_GETDETAIL creditorid is mandatory).
    Other you can do is: get bapi's return table (also export table) and read message.

  • SAP Script Program Code

    Hello,
    I want to write a patch of code in SAP SCript which will fetch multiple lines of data(no of lines fetch is unknown). How can I do it? I tried Perform Endperform but it had limit to the varibales it can send back. I don't know the line items(values) it will return.
    i cannot modify print program? How can I do it?
    Thanks,
    Amol..

    If you do not want to modify the standard program and achive to display you can use sub-routine calls... firstly, you should identify the element that is displaying the line items and use your sub-routine call inside that element and display all the required fields.
    Note: you there is no element which call for line items, I guess there is no other alternative then modifying the driver program.
    Regards,
    SaiRam

  • Sap script convert to pdf and then send to email

    Hi,
    good day sap guys
    ive dev the sap scipt for customer statemnet one which is used the t.code is f.27.
    i need to convert the sap script to pdf and then send to email.
    plz let me know..
    how to do it.
    regards
    chandu

    Hi,
       I script program use the following (go to the "call function 'CLOSE_FORM'")
    data: binfilesize type i.
      data: pdftab type table of tline with header line.
      data: i_itcpp like itcpp.
      data: g_t_otfdata type standard table of itcoo with header line.
      call function 'CLOSE_FORM'
       IMPORTING
         RESULT  = i_itcpp
          tables
            otfdata = g_t_otfdata[]
          exceptions
            others  = 1.
      if sy-subrc ne 0.
        retcode = sy-subrc.
        perform protocol_update.
      endif.
      call function 'CONVERT_OTF'
    exporting
    format = 'PDF'
    importing
    bin_filesize = binfilesize
    BIN_FILE =
    tables
    otf = g_t_otfdata[]
    lines = pdftab[].
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    concatenate file_path  '.pdf' into filename.
    call function 'GUI_DOWNLOAD'
      exporting
      bin_filesize = binfilesize
      filename = filename
      filetype = 'BIN'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    CONFIRM_OVERWRITE = ' '
    NO_AUTH_CHECK = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = ' '
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    IMPORTING
    FILELENGTH =
      tables
      data_tab = pdftab[]
    FIELDNAMES =
      exceptions
      file_write_error = 1
      no_batch = 2
      gui_refuse_filetransfer = 3
      invalid_type = 4
      no_authority = 5
      unknown_error = 6
      header_not_allowed = 7
      separator_not_allowed = 8
      filesize_not_allowed = 9
      header_too_long = 10
      dp_error_create = 11
      dp_error_send = 12
      dp_error_write = 13
      unknown_dp_error = 14
      access_denied = 15
      dp_out_of_memory = 16
      disk_full = 17
      dp_timeout = 18
      file_not_found = 19
      dataprovider_exception = 20
      control_flush_error = 21
      others = 22
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.

  • Calling SAP Script Editor from Report

    Hi,
    Can any one solve this Problem.
    How to call SAPscript  Editor i.e. MS word editor (where we are giving Text elements or Text variables or Text.
    I want to call the above text editor from my report.
    Can any one give answer for this.
    Thanks & Regards,
    Kumar.

    Moarach,
    you need to open a editor for entering the text. You can do that using the function module HR_CALL_TEXTEDITOR. After you have entered the text and clicked on SAVE you get the data returned in an internal table EDITOR_TEXT.
    You can then save the text to a text ID using SAVE_TEXT and COMMIT_TEXT function modules.
    either:
    You will have to use the FM: READ_TEXT, EDIT_TEXT, SAVE_TEXT to achieve this functionality.
    This will basically open the text editor as a pop up box ( size will be as sap script editor) for entering some comments against a Purchase Order.
    For this FMs, you 'll require Text id, text name, text object and language as parameters to be passed.
    thead-tdname = 'Purchase Order No'. " Name
    thead-tdid = 'ZQH1'. " Text ID - E.g. To be created in your system
    thead-tdobject = 'VBBK'. " Texts: application object
    thead-tdspras = sy-langu. " Language Key
    Hope this helps.
    Amit.

  • Calling SAP-script editor

    Hi all,
    I have to call one script editor with my own Text-id and text-object just like to enter header text and item text in VA01 transaction. This should be happen after pressing my own function code. Is there any possibility to do this.
    Thanks in advance,
    pavan

    Hi,
    You can't call your own Text editor from the std transaction VA01 just like that.
    In that VA01 already lot of Texts at header and Item are predefined with the related OBJECT,ID,OBJECTNAME.
    If you want you can create your own Std texts in SO10 Tcode and can call them in the Script using INCLUDE statment.
    reward if useful
    regards,
    ANJI

  • SAP Scripts for Stock Removal and Stock Placement ?

    Hi All,
      Can you please let me know what are the SAP script names and Transaction codes for  Stock Removal and Stock Placements ?
    Thanks,
    Raj

    Hi
    Tcode is MIGO only (select Goods receipt) and mvt type as
    Putaway (305, 315, and so on)
    Stock removal (303, 313, and so on)
    Transfer posting (301, 311, and so on)
    regards
    Yogesh

  • PROGRAM WITH BAPI and BDC's

    Hi All,
    I am using a 2 BAPI's and 3 BDC's in a program. I need all these BAPI and BDC's update the tanscations in a single bundled task? that is if any of BAPI or BDC failed the sucessful BAPI/BDC should be rolled back. How can I make it happen? Any sample code will be helpful
    All Suggestion will be rewarded.

    BAPI-step by step procedure
    http://www.sapgenie.com/abap/bapi/example.htm
    list of all BAPI's
    http://www.planetsap.com/LIST_ALL_BAPIs.htm

Maybe you are looking for

  • Unable to Open Images in Bridge CS3 and Continuing Icon issues!

    Re: Icon issues in Bridge CS3 and also with Photo Downloader that have never been there before.      So, these are the issues.   Just one of the folders that previously would show thumbnails now only shows DNG icons, and none will open in Photoshop t

  • How do I add a Gmail account to my Mail program

    Hi Until now, I have only had @verizon.net email accounts. I now how a @gmail.com email account I don't know how to configure my Mail program so I can receive gmail to my computer, and not have to get it using a Browser. I have attended to configure,

  • Reordering just the jacket of a hard cover book

    I would like to reorder just the jacket of the Large size hardcover book that I have previously ordered.  Is this possible?

  • XI Http Header

    Hi Experts, for testing purposes I would like to export the entire message that is exchanged between the Adapter Engine and the Integration Server. This should not only include the SOAP Envelope, SOAP Header and the payload but also the Http Header i

  • Zen Micro Problem: No idea what's wr

    I have a Zen Micro 6GB. It's been working fine until I plugged it into an older computer of mine. Now I can't add music to it because it doesn't recognize Zen Media Explorer (which is what I use). Frequently it says it isn't plugged in when it is. Pl