How to Execute or Publish URL using ABAP

Hi,
    I would like to publish URL (Ex: HTTP://WWW.SDN.SAP.COM  ) Using any ABAP Statement.
    If i execute ABAP Report, it should publish the URL.
   Please guide me to achive this. Thanks in Advance!
Thanks,
Nagesh Ganisetti.

DATA: edurl(2048).
DATA: html_control TYPE REF TO cl_gui_html_viewer,
      g_custom_html_container TYPE REF TO cl_gui_custom_container.
DATA: l_html_container_name(30) TYPE c.
l_html_container_name = 'CUSTOM_BROWSER'.
  CREATE OBJECT g_custom_html_container
    EXPORTING
      container_name              = l_html_container_name
    EXCEPTIONS
      cntl_error                  = 1
      cntl_system_error           = 2
      create_error                = 3
      lifetime_error              = 4
      lifetime_dynpro_dynpro_link = 5.
  CREATE OBJECT html_control
       EXPORTING
            parent    = g_custom_html_container.
edurl = 'http://www.sap.com'.
  CALL METHOD html_control->show_url
       EXPORTING
            url = edurl
       EXCEPTIONS
            cnht_error_parameter = 1
            OTHERS = 2.
Just create a Dynpro with a custom control called "CUSTOM_BROWSER".
Greetings,
Blag.

Similar Messages

  • How to upload data into IT0000 using ABAP-HR program

    Hello,
    I'm required to upload data into multiple infotypes [IT000, 0001, 0002, etc] using single input text file. Can anyone able to guide me, how to upload data into IT0000 using ABAP program ?
    Thanks in advance.
    Regards
    Prabhakar.
    Message was edited by:
            Prabhakara Muthyal

    Example code for HR_MAINTAIN_MASTERDATA to COPY IT0002
    DATA: INT_0002_FINAL TYPE STANDARD TABLE OF PA0002 WITH HEADER LINE.
    DATA: VALUES        LIKE PPROP OCCURS 10 WITH HEADER LINE,
    RETURN        LIKE BAPIRETURN1,.
    LOOP AT INT_0002_FINAL.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-PERNR'.
          VALUES-FVAL  = INT_0002_FINAL-PERNR.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-BEGDA'.
          VALUES-FVAL  = INT_0002_FINAL-BEGDA.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-ENDDA'.
          VALUES-FVAL  = INT_0002_FINAL-ENDDA.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-nachn'.
          VALUES-FVAL  = INT_0002_FINAL-NACHN.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-gblnd'.
          VALUES-FVAL  = INT_0002_FINAL-GBLND.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-vorna'.
          VALUES-FVAL  = INT_0002_FINAL-VORNA.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-rufnm'.
          VALUES-FVAL  = INT_0002_FINAL-RUFNM.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-name2'.
          VALUES-FVAL  = INT_0002_FINAL-NAME2.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-inits'.
          VALUES-FVAL  = INT_0002_FINAL-INITS.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-famst'.
          VALUES-FVAL  = INT_0002_FINAL-FAMST.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-gbdat'.
          VALUES-FVAL  = INT_0002_FINAL-GBDAT.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-sprsl'.
          VALUES-FVAL  = INT_0002_FINAL-SPRSL.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-anzkd'.
          VALUES-FVAL  = INT_0002_FINAL-ANZKD.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-natio'.
          VALUES-FVAL  = INT_0002_FINAL-NATIO.
          APPEND VALUES.
    * maintain master data
          CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
            EXPORTING
              PERNR           = INT_0002_FINAL-PERNR
              ACTIO           = 'COP'
              BEGDA           = INT_0002_FINAL-BEGDA
    *         ENDDA           = INT_0002_FINAL-ENDDA
              SUBTY           = SPACE
              NO_ENQUEUE      = SPACE
              DIALOG_MODE        = '0'
              TCLAS              = 'A'
            IMPORTING
              RETURN1         = RETURN
            TABLES
              PROPOSED_VALUES = VALUES
    *         MODIFIED_KEYS   =
            EXCEPTIONS
              OTHERS          = 1.
          IF RETURN IS INITIAL.
            WRITE:/' Done....'.
          ELSE.
            WRITE:/   RETURN-ID, RETURN-TYPE, RETURN-NUMBER, RETURN-MESSAGE_V1, RETURN-MESSAGE_V2, RETURN-MESSAGE_V3, RETURN-MESSAGE_V4.
          ENDIF.
          CLEAR VALUES.
          REFRESH VALUES.
        ENDLOOP.

  • How to upload an excel file using ABAP.

    Hi,
    Can anyone please help me in understanding how to upload an excel file using ABAP.
    Thanks!!

    http://diocio.wordpress.com/2007/02/12/sap-upload-excel-document-into-internal-table/
    check the link
    TYPES: Begin of t_record,
    name1 like itab-value,
    name2 like itab-value,
    age   like itab-value,
    End of t_record.
    DATA: it_record type standard table of t_record initial size 0,
    wa_record type t_record.
    DATA: gd_currentrow type i.
    *Selection Screen Declaration
    PARAMETER p_infile like rlgrap-filename.
    *START OF SELECTION
    call function ‘ALSM_EXCEL_TO_INTERNAL_TABLE’
    exporting
    filename                = p_infile
    i_begin_col             = ‘1′
    i_begin_row             = ‘2′  “Do not require headings
    i_end_col               = ‘14′
    i_end_row               = ‘31′
    tables
    intern                  = itab
    exceptions
    inconsistent_parameters = 1
    upload_ole              = 2
    others                  = 3.
    if sy-subrc <> 0.
    message e010(zz) with text-001. “Problem uploading Excel Spreadsheet
    endif.
    Sort table by rows and colums
    sort itab by row col.
    Get first row retrieved
    read table itab index 1.
    Set first row retrieved to current row
    gd_currentrow = itab-row.
    loop at itab.
      Reset values for next row
    if itab-row ne gd_currentrow.
    append wa_record to it_record.
    clear wa_record.
    gd_currentrow = itab-row.
    endif.
    case itab-col.
    when ‘0001&#8242;.                              “First name
    wa_record-name1 = itab-value.
    when ‘0002&#8242;.                              “Surname
    wa_record-name2 = itab-value.
    when ‘0003&#8242;.                              “Age
    wa_record-age   = itab-value.
    endcase.
    endloop.
    append wa_record to it_record.
    *!! Excel data is now contained within the internal table IT_RECORD
    Display report data for illustration purposes
    loop at it_record into wa_record.
    write:/     sy-vline,
    (10) wa_record-name1, sy-vline,
    (10) wa_record-name2, sy-vline,
    (10) wa_record-age, sy-vline.
    endloop.

  • 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

  • How to generate new perner number using Abap Code in pa0002. what is the fu

    how to generate new perner number using Abap Code in pa0002. what is the function Module used.

    hi
    define internal number ranges for ur implementation then when u run PA 40  do not input any employee number , system will generate the employee number automatically.
    Regards
    sameer

  • How-to trigger a process chain using ABAP?

    Does anybody know how to trigger a process chain using ABAP code?
    Any help would be appreciated!
    Thanks
    Ioan

    Hi Ioan,
    try this in your ABAP:
        CALL FUNCTION 'BP_EVENT_RAISE'
          EXPORTING
            eventid         = 'Your Event'
            eventparm       = 'START'
            target_instance = ' '
          EXCEPTIONS
            OTHERS          = 01.
    and schedule your process chain, waiting for 'Your Event'.
    regards
    Siggi

  • How to execute application server file from abap program

    Hi Friends,
    i have a requirement to execute application server file using abap program.
    i got a file directory like '/home/im3/hrintf/xxx.sh' , it's of unix file, so they want me to execute through abap program.
    pls suggest me with relevant logic.
    Thank you.
    Regards
    Ramesh M

    Define the external command in SM49/SM69
    Try with SXPG_CALL_SYSTEM or SXPG_COMMAND_EXECUTE
    Also check this link
    link:[Execute Unix Script|http://searchsap.techtarget.com/tip/0,289483,sid21_gci774071,00.html]

  • How to execute a exe file using javascript on app window.load.

    How to execute a exe file using javascript on app window.load.

    Hi sb00349044,
    As I have already mentioned in multiple replies to your previous questions, the SUMO forums focuses on providing help to end users with usage-questions and issues.
    For developer-related questions, please refer to one of the many resources readily available that I have linked to in the past:
    * [https://developer.mozilla.org/en-US/Firefox_OS MDN]
    * [http://stackoverflow.com/questions/tagged/firefox-os StackOverflow]
    * [https://lists.mozilla.org/listinfo Mozilla Mailing Lists]
    - Ralph

  • How can i call the browser to open URL using ABAP ???

    Hi all ,,
    Could you help please to solve this case ??? :).
    I'm working out a plan to open URL internet address using ABAP program ..
    Could you share to me the command or the way to run the internet browser (e.g. internet explorer) in order to run some URL address ???
    If you don't mind ..
    Could kindly please give the steps to make it .. ???
    Tks a lot ..
    i'll appreciate any responses.
    Best regards,
    Niel.

    Hi,
    CALL FUNCTION 'CALL_BROWSER'
                 EXPORTING
                      URL                    = URL "http://,,,,,,"
                      BROWSER_TYPE           = ' ' "'SAP Help Viewer'
                      CONTEXTSTRING          = 'Business Browser'
                 EXCEPTIONS
                      FRONTEND_NOT_SUPPORTED = 1
                      FRONTEND_ERROR         = 2
                      PROG_NOT_FOUND         = 3
                      NO_BATCH               = 4
                      UNSPECIFIED_ERROR      = 5
                      OTHERS                 = 6.
          ENDIF.
    Pls. reward if useful....

  • How to Raise Event in BW using ABAP program

    Hi BW Experts,
    Can anyone tell how to raise event in BW using a ABAP program.
    Program should ask for the event to be raised and destination server.
    Edited by: Arun Purohit on May 14, 2008 11:04 AM

    Hi Arun,
    By Using BP_EVENT_RAISE function module you can raise an event.Create an ABAP program and call the function module BP_EVENT_RAISE and create a avariant to specify the event to be raised. Schedule this ABAP code. Go to the start process type and set the schedule to "after event" and mention the event name that you created. Also, I think now you can mention the time as well and you can also schedule for periodic scheduling.
    T Code : SM62 --> To Create an Event.
    T Code : SE38 --> To Create an ABAP Program
    Use Function Module : BP_EVENT_RAISE to raise an event.
    Related links:
    http://help.sap.com/saphelp_sem40bw/helpdata/EN/86/6ff03b166c8d66e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_sem40bw/helpdata/EN/86/6ff03b166c8d66e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_sem40bw/helpdata/EN/86/6ff03b166c8d66e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_sem40bw/helpdata/EN/86/6ff03b166c8d66e10000000a11402f/frameset
    Hope this helps
    Regards
    CSM Reddy

  • How to execute this SQL Query in ABAP Program.

    Hi,
    I have a string which is the SQL Query.
    How to execute this sql Query (SQL_STR) in ABAP Program.
    Code:-
    DATA: SQL_STR type string.
    SQL_STR = 'select * from spfli.'.
    Thanks in Advance,
    Vinay

    Hi Vinay
    Here is a sample to dynamically generate a subroutine-pool having your SQL and calling it.
    REPORT dynamic_sql_example .
    DATA: BEGIN OF gt_itab OCCURS 1 ,
    line(80) TYPE c ,
    END OF gt_itab .
    DATA gt_restab TYPE .... .
    DATA gv_name(30) TYPE c .
    DATA gv_err(120) TYPE c .
    START-OF-SELECTION .
    gt_itab-line = 'REPORT generated_sql .' .
    APPEND gt_itab .
    gt_itab-line = 'FORM exec_sql CHANGING et_table . ' .
    APPEND gt_itab .
    gt_itab-line = SQL_STR .
    APPEND gt_itab .
    gt_itab-line = 'ENDFORM.' .
    APPEND gt_itab .
    GENERATE SUBROUTINE POOL gt_itab NAME gv_name MESSAGE gv_err .
    PERFORM exec_sql IN PROGRAM (gv_name) CHANGING gt_restab
    IF FOUND .
    WRITE:/ gv_err .
    LOOP AT gt_result .
    WRITE:/ .... .
    ENDLOOP .
    *--Serdar

  • How to Execute Remote procedures that use DBLinks?

    Using Oracle 10g (RAC Linux) to remote connect Windows 10g to dblink to AS/400 <
    <I have created a procedure that I execute remotely by issuing the following:
    CALL GLOBAL.REFRESH_STAGING@KRONOSLINK();
    The procedure errors as
    Error at line 2
    ORA-20001: ERROR OCCURED
    ORA-06512: at "GLOBAL.REFRESH_STAGING", line 47
    ORA-06512: at line 1
    The procedure runs without error from the host database. The problem is when the procedure makes a call to the dblink.
    I unsuccessfully attempted to capture the error message.
    Question: Is it possible to execute remote procedures that use dblinks? If so, How is that accomplished.
    Question: What is the proper way to handle exceptions in this case?
    Bonus: What can be done to improve this procedure? (Suggestions, like adding return on the procedure).
    CREATE OR REPLACE PROCEDURE GLOBAL.REFRESH_STAGING IS
    NOOBJECT EXCEPTION;
    OBJECTEXIST EXCEPTION;
    PRAGMA EXCEPTION_INIT(NOOBJECT, -00942); -- Exception handling for ORA-00942 - table or view does not exist
    PRAGMA EXCEPTION_INIT(OBJECTEXIST, -00955); -- Exception handling for ORA-009555 - name is already used by an existing object
    sT LONG := '';
    sS LONG := '';
    sST LONG := '';
    cursor csrO is
    SELECT
    SCHEMANAME,
    TABLENAME
    FROM GLOBAL.STAGING_TABLES;
    csrR csrO%ROWTYPE;
    BEGIN
    FOR csrR IN csrO
    LOOP
    sT := csrR.TABLENAME;
    sS := csrR.SCHEMANAME;
    sST := sS || '.' || sT;
    BEGIN
    EXECUTE IMMEDIATE 'drop table global.' || sT || ' purge';
    EXCEPTION
    WHEN NOOBJECT THEN
    NULL;
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.FORMAT_CALL_STACK);
    DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.FORMAT_ERROR_STACK);
    RAISE_APPLICATION_ERROR (-20001, 'ERROR OCCURED');
    END;
    BEGIN
    EXECUTE IMMEDIATE 'create table global.' || sT || ' nologging as select * from ' || sST || '@thebosslink';
    COMMIT;
    EXCEPTION
    WHEN OBJECTEXIST THEN
    NULL;
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.FORMAT_CALL_STACK);
    DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.FORMAT_ERROR_STACK);
    DBMS_OUTPUT.PUT_LINE(SQLCODE || ' - ' || SQLERRM);
    RAISE_APPLICATION_ERROR (-20001, 'ERROR OCCURED');
    END;
    END LOOP;
    END REFRESH_STAGING;
    Thanks,
    blevels

    SET LINESIZE 500;
    COLUMN DB_LINK FORMAT a20
    COLUMN HOST FORMAT a20
    COLUMN USERNAME FORMAT a20
    COLUMN OWNER FORMAT a10
    COLUMN TABLE_NAME FORMAT a20
    select db_link,username, host from all_db_links where db_link = 'KRONOSLINK';
    select privilege from dba_sys_privs where grantee = 'SYSTEM';
    select owner, table_name from dba_tab_privs where grantee='SYSTEM';
    DBLINK_ USERNAME HOST
    KRONOSLINK SYSTEM ORCL
    1 row selected.
    PRIVILEGE
    GLOBAL QUERY REWRITE
    CREATE MATERIALIZED VIEW
    CREATE TABLE
    UNLIMITED TABLESPACE
    SELECT ANY TABLE
    5 rows selected.
    OWNER TABLENAME_
    SYS INCEXP
    SYS INCEXP
    SYS INCEXP
    SYS INCEXP
    SYS INCEXP
    SYS INCEXP
    SYS INCEXP
    SYS INCEXP
    SYS INCEXP
    SYS INCEXP
    SYS INCEXP
    SYS INCVID
    SYS INCVID
    SYS INCVID
    SYS INCVID
    SYS INCVID
    SYS INCVID
    SYS INCVID
    SYS INCVID
    SYS INCVID
    SYS INCVID
    SYS INCVID
    SYS INCFIL
    SYS INCFIL
    SYS INCFIL
    SYS INCFIL
    SYS INCFIL
    SYS INCFIL
    SYS INCFIL
    SYS INCFIL
    SYS INCFIL
    SYS INCFIL
    SYS INCFIL
    SYS DBMS_ALERT
    SYS DBMS_SYS_ERROR
    SYS DBMS_RULE_EXIMP
    SYS DBMS_AQ
    SYS DBMS_AQADM
    SYS DBMS_AQ_IMPORT_INTER
    NAL
    SYS DBMS_AQELM
    SYS DBMS_TRANSFORM_EXIMP
    SYS SYS_GROUP
    SYS DBMS_DEFER_IMPORT_IN
    TERNAL
    SYS DBMS_REPCAT
    WMSYS WM$UDTRIG_INFO
    SYS SET_TABLESPACE
    SYS CHECK_UPGRADE
    SYS AVINASH
    SYS AVINASH
    SYS AVINASH1
    SYS AVINASH1
    SYS DB_PMP
    SYS DB_PMP
    SYS DIR_TESTCASE
    SYS DIR_TESTCASE
    SYS EXPORT_FULL_DIR
    SYS EXPORT_FULL_DIR
    SYS PUMP
    SYS PUMP
    SYS LOGS
    SYS LOGS
    SYS DPUMP_DIR2
    SYS DPUMP_DIR2
    SYS AVIS
    SYS AVIS
    SYS DPDIR_LCLLGS
    SYS DPDIR_LCLLGS
    67 rows selected.
    Edited by: user10860953 on Jan 28, 2010 10:43 AM

  • How to execute a stored procedure using Nqcmd

    hi everyone,
    I am having a stored procedure in Database which i want to execute it from nqcmd. Could anyone pls let me know how to execute it.
    Regards

    EJB3 JPA does not define stored procedure execution. There is a native query in JPA, but this is mainly for SQL. If you stored procedure has no output parameters you can normally get away with using a native query to execute it (be sure to include BEGIN/END in Oracle).
    <p>
    In TopLink 11g preview there are JPA extensions for defining stored procedures. You can use the @NamedStoredProcedureQuery for this, and then access the named query by name and execute it. You can also create an instance of a TopLink StoredProcedureCall and set it in your JPA Query through the TopLink Query extension setDatabaseQuery(), or define the named stored procedure query using a DescriptorCustomizer.
    <p>
    In TopLink Essentials there is no direct stored procedure support, so you would need to use JDBC directly.
    <p>
    If you are using a DataSource in your application the best way to get a JDBC connection is to use your DataSource directly. If the DataSource is JTA managed this will be the same connection that TopLink writes with.
    <p>
    If you need to get the connection directly from TopLink you can use,
    ((oracle.toplink.<essentials>.ejb.cmp3.EntityManager)entityManager.getDelegate()).getUnitOfWork().getConnection();
    <p>
    You may need to first call, UnitOfWork.beginEarlyTransaction(), (also ensure you release the uow connection).
    <p>
    <p>---
    <p>James Sutherland

  • How to schedule a Process Chain using ABAP Program?

    Hi All,
    I want to schedule the activity of extracting data from the query to a flatfile.
    Currently we are schedulling it using the transaction rscrm_bapi.
    I need to know , how we can achieve the same using an abap program and not ( rscrm_bapi) in a process chain.
    Any help would be appreciated.
    Regards
    Purva

    Your problem will be solved if you use the Function Module "RSPC_API_CHAIN_GET_STATUS" instead of the function module "RSPC_API_CHAIN_GET_LOG".
    The function module "RSPC_API_CHAIN_GET_STATUS" gives you the STatus of the process chain, when you pass the Chain Name and the Log ID.
    If you get an output
    G or F - Report that the Chain is Successfully Completed.
    A - The chain is Currently running
    R or X - Report that the chain has ended with Errors.
    Sample code :
    REPORT Z_BW_GET_STATUS_PROZESSKETTE.
    TABLES rspclogchain.
    DATA: gt_rspclogchain LIKE rspclogchain OCCURS 0,
    wa_rspclogchain LIKE rspclogchain.
    DATA: gt_log LIKE rspc_s_msg OCCURS 0,
    wa_log LIKE rspc_s_msg,
    gt_status like RSPC_STATE.
    SELECT * FROM rspclogchain
    INTO CORRESPONDING FIELDS OF TABLE gt_rspclogchain
    WHERE datum = sy-datum
    AND chain_id = 'BD_C02_1D'.
    IF sy-subrc = 0.
    SORT gt_rspclogchain BY datum DESCENDING
    zeit DESCENDING.
    READ TABLE gt_rspclogchain
    INTO wa_rspclogchain INDEX 1.
    CALL FUNCTION 'RSPC_API_CHAIN_GET_STATUS'
    EXPORTING
    i_chain = wa_rspclogchain-chain_id
    i_logid = wa_rspclogchain-log_id
    IMPORTING
    E_STATUS = gt_status.
    IF gt_status = 'G' or gt_status = 'F'.
    WRITE :/ 'BD_C02_2D chain COMPLETED'.
    ELSE.
    WRITE :/ 'BD_CO2_2D chain is Running or Ended with Errors'.
    ENDIF.
    ELSE.
    WRITE :/ 'No chain BD_C02_2D started for today ! or keine Kette BD_C02_2D gestartet !'.
    ENDIF.
    I have just provided a sample code, you might have to edit or add necessary messages to the program.
    Regards,
    Ramya

  • General question: How to execute a batch input using different user name?

    Hi everyone,
    I would be very grateful if someone could tell me how to execute a batch input from source code using a differente username so the batch input is executed with different permissions.
    For example, I log on with:
    Username: A
    , but I'd like to execute a batch input using the rights and permissions of user B.
    Thanks in advance and best regards.
    Ben.

    If you are calling the BDC in a program, create a job to run the program and specify the user you want each program to run under.

Maybe you are looking for