Function module to call MSEXCEL macro

Hi
I have a requirement where i download the excel file say X and then through msexcel macros select certain fields of excel X and copy to excel file Y.
i want to run this macro thorugh some sap function module/ program.
is there any standard function module / program which can do this functionality.
pls reply
Regards
Ashish

hi i had a sample program check this..
sample program
REPORT zmm_basic_data .
Report to View Detail Of Material Master BASIC DATA.
Start Date 07.05.2007
Request No.-GR3K931783
TABLES: mara,marc,makt.
DATA: gi_mara LIKE mara OCCURS 1 WITH HEADER LINE,
gi_marc LIKE marc OCCURS 1 WITH HEADER LINE,
gi_makt LIKE makt OCCURS 1 WITH HEADER LINE.
DATA: BEGIN OF gi_download OCCURS 1,
matnr LIKE mara-matnr,"material no
maktx LIKE makt-maktx,"material description
matkl LIKE mara-matkl,"material group
werks LIKE marc-werks,"plant
ekgrp LIKE marc-ekgrp,"purchasing group
spart LIKE mara-spart,"division
meins LIKE mara-meins,"base uit of measure
bismt LIKE mara-bismt,"old material no.
prdha LIKE mara-prdha,"product hierarchy
brgew LIKE mara-brgew,"gross weight
ntgew LIKE mara-ntgew,"net weight
gewei LIKE mara-gewei,"weight unit
volum LIKE mara-volum,"volume
voleh LIKE mara-voleh,"volume unit
zeinr LIKE mara-zeinr,"document no.
zeiar LIKE mara-zeiar,"document type
zeivr LIKE mara-zeivr,"document version
zeifo LIKE mara-zeifo,"page format of document
blanz LIKE mara-blanz,"number of sheets
spras LIKE makt-spras,"language key
END OF gi_download.
DATA: BEGIN OF gi_fieldnames OCCURS 1,
mandt(50),
END OF gi_fieldnames.
*file path and file name data declaration.
DATA: stripped_name LIKE rlgrap-filename,
file_path LIKE rlgrap-filename.
DATA: inpath LIKE ltran-path01,
file LIKE ltran-file01,
outpath LIKE ltran-path02.
Field Symbols ************
FIELD-SYMBOLS <mara> LIKE gi_mara.
FIELD-SYMBOLS <marc> LIKE gi_marc.
FIELD-SYMBOLS <makt> LIKE gi_makt.
FIELD-SYMBOLS <download> LIKE gi_download.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREEN: SKIP.
SELECT-OPTIONS: s_werks FOR marc-werks.
SELECT-OPTIONS: s_ekgrp FOR marc-ekgrp.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECT-OPTIONS: s_matkl FOR mara-matkl.
SELECT-OPTIONS: s_spart FOR mara-spart.
SELECTION-SCREEN: SKIP.
PARAMETER fnm TYPE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN: SKIP.
SELECTION-SCREEN: END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR fnm.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
CHANGING
file_name = fnm
EXCEPTIONS
mask_too_long = 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.
*For fetching the baisc data.
START-OF-SELECTION.
*Getting the general data based on material no,division and material
*group.
SELECT * FROM mara INTO TABLE gi_mara
WHERE matnr IN s_matnr
AND spart IN s_spart
AND matkl IN s_matkl.
*Getting the plant data based on material no,plant and purchasing
*group.
IF NOT gi_mara[] IS INITIAL.
SELECT * FROM marc INTO TABLE gi_marc
FOR ALL ENTRIES IN gi_mara
WHERE matnr EQ gi_mara-matnr
AND werks IN s_werks
AND ekgrp IN s_ekgrp.
ENDIF.
*Getting the material description based on material no
IF NOT gi_mara[] IS INITIAL.
SELECT * FROM makt INTO TABLE gi_makt
FOR ALL ENTRIES IN gi_mara
WHERE matnr = gi_mara-matnr.
ENDIF.
Fetching all data into single internal table ********
SORT gi_mara BY matnr.
SORT gi_makt BY matnr.
SORT gi_marc BY matnr.
*****Transfering the data into gi_download*******
IF s_werks] IS INITIAL and s_ekgrp[ IS INITIAL.
LOOP AT gi_mara ASSIGNING <mara>.
MOVE-CORRESPONDING <mara> TO gi_download.
READ TABLE gi_marc ASSIGNING <marc>
WITH KEY matnr = <mara>-matnr
BINARY SEARCH.
IF sy-subrc = 0.
MOVE <marc>-werks TO gi_download-werks.
MOVE <marc>-ekgrp TO gi_download-ekgrp.
ENDIF.
READ TABLE gi_makt ASSIGNING <makt>
WITH KEY matnr = <mara>-matnr
BINARY SEARCH.
IF sy-subrc = 0.
MOVE <makt>-maktx TO gi_download-maktx.
MOVE <makt>-spras TO gi_download-spras.
ENDIF.
APPEND gi_download.
CLEAR gi_download.
ENDLOOP.
ELSE.
LOOP AT gi_marc ASSIGNING <marc>.
READ TABLE gi_mara ASSIGNING <mara>
WITH KEY matnr = <marc>-matnr
BINARY SEARCH.
IF sy-subrc = 0.
MOVE-CORRESPONDING <mara> TO gi_download.
ENDIF.
READ TABLE gi_makt ASSIGNING <makt>
WITH KEY matnr = <marc>-matnr
BINARY SEARCH.
IF sy-subrc = 0.
MOVE <makt>-maktx TO gi_download-maktx.
MOVE <makt>-spras TO gi_download-spras.
ENDIF.
MOVE <marc>-werks TO gi_download-werks.
MOVE <marc>-ekgrp TO gi_download-ekgrp.
APPEND gi_download.
CLEAR gi_download.
ENDLOOP.
ENDIF.
IF gi_download[] IS INITIAL.
MESSAGE i001(sa) WITH 'Data not found'.
LEAVE LIST-PROCESSING.
ENDIF.
*******Downloading the basic data********
gi_fieldnames-mandt = 'Material no'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Material description'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Material group'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Plant'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Purchasing group'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Division'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Base uit of measure'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Old material no.'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Product hierarchy'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Gross weight'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Net weight'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Weight unit'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Volume'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Volume unit'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Document no.'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Document type'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Document version'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Page format of document'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Number of sheets'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Language key'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames. CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = fnm
IMPORTING
stripped_name = stripped_name
file_path = file_path
EXCEPTIONS
x_error = 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.
CLEAR fnm.
CONCATENATE file_path stripped_name INTO fnm.
CLEAR: inpath,file,stripped_name,file_path,outpath.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = fnm
filetype = 'DAT'
TABLES
data_tab = gi_download
fieldnames = gi_fieldnames
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
MESSAGE i003(sa) WITH 'File downloaded successfuly' fnm.
ENDIF.
Check the following link:
http://sap-img.com/abap/download-to-excel-with-format-border-color-cell-etc.htm
regards,
venkat.

Similar Messages

  • Status : 51- Incorrect function module IDOC_INPUT_MATMAS01 called up

    Hello,
    File - IDOC
    in MONI, checkered flag is shown up and when I go the R3 server, WE05, I get error message
    Status : 51
    Incorrect function module IDOC_INPUT_MATMAS01 called up
    I am using MATMAS04 without extension and updated the same in WE57. also checked in WE42 (MATM)
    now, how do I proceed furthur related the above error message?
    Regards,
    Nikhil.

    can very much
    check your partner profiles PROPERLY. If u have the same IDoc type in 2 different partner profiles, check the 2nd one for it's process code. Isn't it the one, which is called after your Idoc is received? Processing code in partner profile is not based only on Idoc Type, but also on Message Type, Message Code and Extension. If the 2nd profile contains the process code, which is called, then check your incoming idoc for header values. May be this is causing your problem.
    Peter

  • How to capture errors when a Function module is called as BACKGROUND TASK

    How to capture errors when a Function module is called as BACKGROUND TASK?.Please advise.
    FUNCTION ZRPM_DELETE_PROJECT_DATA_API.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(IV_EXTERNAL_ID) TYPE  RPM_TV_EXTID OPTIONAL
    *"     VALUE(IV_PROJECT_GUID) TYPE  RPM_TV_GUID OPTIONAL
    *"     VALUE(FLAG) TYPE  BOOLEAN OPTIONAL
    *"  EXPORTING
    *"     VALUE(EV_RC) TYPE  I
    *"     VALUE(EV_MSG) TYPE  STRING
    *"     VALUE(ET_MSG) TYPE  RPM_TT_MESSAGES
      IF flag = cl_rpm_co=>sc_true.
        Call function 'RPM_DELETE_PROJECT_DATA' IN BACKGROUND TASK
          EXPORTING
            IV_EXTERNAL_ID  = IV_EXTERNAL_ID
            IV_PROJECT_GUID = IV_PROJECT_GUID
          IMPORTING
            EV_RC           = EV_RC
            EV_MSG          = EV_RC
            ET_MSG          = ET_MSG.
        COMMIT WORK.
      ELSE.
        CALL FUNCTION 'RPM_DELETE_PROJECT_DATA'
          EXPORTING
            IV_EXTERNAL_ID  = IV_EXTERNAL_ID
            IV_PROJECT_GUID = IV_PROJECT_GUID
          IMPORTING
            EV_RC           = EV_RC
            EV_MSG          = EV_MSG
            ET_MSG          = ET_MSG.
      ENDIF.
    ENDFUNCTION.
    In above code how to capture 'EV_RC' when FM is called as background task.

    Prakash,
    CALL FUNCTION IN BACKGROUND TASK allows no IMPORTING parameters, so that your code will produce a syntax error.
    The calling program can only handle errors of remote function calls (RFC) if these are either
    - synchronous RFC  (that is CALL FUNCTION ... DESTINATION ...) or
    - asynchronous RFC (that is CALL FUNCTION STARTING NEW TASK ... DESTINATION ...).
    Both synchronous and asynchronous RFC allow the capturing of errors by means of exceptions. But that is a different topic.

  • How to take back the control from RFC function module to calling program

    Hi,
    In our system landscape, more than 200 child systems are connected to Solution manager(SMP). I have copied a RFC enabled function module into all the child systems and calling that FM from Sol Man in sychronous mode.
    Here goes my code in SolMan.
    LOOP AT it_dest INTO wa_dest.
      CALL FUNCTION 'Z_GET_LOGIN_DETAILS' DESTINATION wa_dest-rfcdest
        EXPORTING
          date_fr               = s_date-low
          date_to               = s_date-high
        TABLES
          tab_data              = it_val
        EXCEPTIONS
          communication_failure = 1
          system_failure        = 2
          OTHERS                = 3.
      IF sy-subrc EQ 0.
    *     Updates zuserlogon
          MODIFY zt_logon_det FROM TABLE it_val.
          COMMIT WORK.
          WRITE:/'RFC for Destination', wa_dest-rfcdest, 'succesfully updated.'.
      ELSE.
          WRITE:/'RFC for Destination', wa_dest-rfcdest, ' failed.'.
      ENDIF.
    ENDLOOP.
    Few child systems are very slow & takes more than 20 minutes(Many of the times system hangs) to return the result. But I should not wait for so long. Even if the child system doesn't return any values in 5 minutes I shoud continue with other system ignoring the current one.
    I tried calling the FM in asynchronous mode(STARTING NEW TASK) but no success because only 6 DIA processes possible but as I said I have more than 200 systems connected to SolMan.
    Please help me resolving this problem.
    Thanks,
    Prathap

    If there are only few child systems with bad response time, use asynchronous call using a CALL FUNCTION func STARTING NEW TASK task DESTINATION dest PERFORMING subr or CALLING meth ON END OF TASK. Count asynchronous calls still running/waiting (increment a counter when creating a task (not the one used for task id). In the form/method performed at end of a call decrement the counter. When counter is lower than a limit, 4-5 if 6 processes (*), perform an asynchronous call else perform a synchronous call or wait until the counter falls below the limit.
    Regards,
    Raymond
    (*) Use SPBT_INITIALIZE at start of program to get actual number of free/available processes.

  • How to debug a remote function module in calling system? Help!

    Hi Experts,
       I have a ABAP report (in System A) from where I am calling a remote function module which exists in a different system B.
    ABAP Program(System A)<----calls--
    RFC(System B)
    Can I debug the RFC funnction module in system A using ABAP debugger? In other words if i put a breakpoint on the "call function" statement then in debug mode I want to see that the control is going to system B and I should be able to process the FM code line by line. Is this possible?
    Is there any special transaction or settings?
    Is there any alternative?
    Please help
    Thanks
    Gopal

    hello,
    Try this method.
    first check whether RFC connection is working b/w 2 systems.
    if connection is working, then do like this.
    In System B , put endless loop in FM before some main select statement.
    like
    DATA : v_a TYPE c VALUE space
    DO  .
       IF v_a = 'X'.
         EXIT.
       ENDIF.
    ENDDO.
    the above code will be endleep loop.
    In system A, when cursor goes to CALL FUNCTION DESTINATION 'XXXXX'.
    u shud be logged in system B. the moment control comes to system B.goto tcode SM50 . check ur username . choose that particular  checkbox then in menu bar --> program/session --> Program --> Debugging.
    i hope it will help u.
    try & let us know.
    Thanks,
    Manjunath MS

  • RFC enabled function module using call transaction

    Hi,
    We have a scenario wherein we have a RFC enabled function module which inturn uses a call transaction to create a PM order & attaches the PM notification against it. Sometimes it so happens that the order does not get created for some reason or the other and there are no logs generated on the system to investigate. However we are capturing the messages produced via the BDCMSGCOLL. At present we are using the update parameter as 'L'.
    In some scenarios it states that the notification is locked by the same notification and comes out without creating the order, in this process we are losing out on the order & the notification number which if successful would have got updated in the database.
    I know this could be done via the BAPI, but there are innumerable steps within the BDC which can't be actually done using the BAPI and hence we could not use this procedure.
    Is there any other way by which we can ensure that there's always a successful order creation, I mean without losing out on the order/notification number?. Would changing the update mode to 'S' help?. Since this process is time bound, it can't actually take more time then what its taking with the current logic.
    Please let me know if you require further details on the same. Any help in this regard would be highly appreciated.
    Regards,
    Vidya

    Sorry for an unclear replay.
    In Simple terms; I have 2 scenarios;
    Launch a new tab (IW38 tcode), on click of a button in SAP screen of custom transaction in NWBC.
    Launch a new tab (IW38 tcode), on click of a button in a Non - SAP App opened (using URL) in NWBC.
    For 1st case, i have used
    CL_NWBC=>URL_CONSTRUCT
      EXPORTING
         CANVAS_WDA__CLIENT_TYPE       = 'nwbc'
         CANVAS_TRANSACTION            = 'IW38'
      RECEIVING
         URL                           = lv_URL.
    CALL METHOD CL_NWBC=>URL_LAUNCH
       EXPORTING
         URL    = lv_url
    But it gets open in NWBC HTML not in NWBC Desktop client.
    I tried all the Parameters you have mentioned in your response to this post earlier, but nothing worked. the last one is CANVAS__WINDOW which actually hides the top area and few buttons but still it is a HTML version.
    If i set the HTML_CLIENT = ABAP_FALSE, it launches a new window instead of the tab and asks for Login. If i login in can see the IW38 in NWBC desktop client. But the only problem is we have the restriction of single window/single login for users.
    I am on NWBC PL12 and also updated the GUI 7.3 to PL8.
    Simply the problem is URL_CONSTRUCT for any transaction is launching it in a new tab but in HTML Version.
    For 2nd case,
    It asks for the login details on click of a button on the 3rd party URL opened in NWBC. which means i am launching SAP from a 3rd party.
    Is there any way to achieve the launch of new tab in this case instead of the new window ?
    I hope its more clear now.
    Regards,
    Nik.

  • Function module to call an url from an ABAP program

    Hello
    I'm looking for the ABAP function module to open an internet explorer with an url as parameter. Could somebody help me ?
    Many thanks
    Jerome

    Hi,
    You can use 'CALL_BROWSER'.
    Refer this code:
    call function 'CALL_BROWSER'
    exporting
    url = 'C:Documents and SettingshemantgDesktopnew.html'
    exceptions
    frontend_not_supported = 1
    frontend_error = 2
    prog_not_found = 3
    no_batch = 4
    unspecified_error = 5
    others = 6.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    Regards,
    Gayathri

  • RFC function module with call transaction  and Import memory ID

    Hi,
    I am calling RFC function module from R/3 which exists in BW.
    In BW stand alone function module works fine.
    When I am Calling from R/3 it is not working,
    Can you tell me is it because of the below code, And suggest if any corrections required.
    I am calling the call transaction and using EXPORT memory iD inside the program
    and IMPORT in after that.
    And populating RFC table's table  " p_i_tcode_user" finally.
    set parameter id 'TCD' field p_tcode.
    call transaction 'Z_BW_RSUSR002' AND SKIP FIRST SCREEN.
      ENDIF.
    get the final user data from submitted program
    import gt_users_complete from memory id tcode_userid.
    LOOP AT gt_users_complete.
          lwa_tcode_user-tcode =  p_tcode.
          lwa_tcode_user-uname = gt_users_complete-Bname.
          APPEND lwa_tcode_user TO p_i_tcode_user.
    ENDLOOP.
    Thanks,
    Veerendra.

    HI,
       Can you just exaplin it clearly plz..
    Thanks
    Mahesh

  • BW/ABAP- Function module is called infinitely by Datasource Extractor.

    Hi All,
    A quick ABAP question related to Function Modules and BW data source extractors.
    I’ve written a function module to select data from a database and simply output the data as a table. I then created a text Datasource using transaction rso2 and set it to Extraction by Function Module.
    When I test this using transaction rsa6, I can manipulate the number of calls to my function module using the Display Extra Calls field.
    However, when I test this using transaction rsa1, my function module seems to be called infinite times. So, the number of records being retrieved is increasing exponentially and finally ends with a dump.
    My question: Do I need to include something in my code such that the Function Module by itself will only be called once?
    Or is there some configuration for the Datasource that will limit my function module call to once only.
    Tried so far
    • Introducing a static variable in the function module that exits as soon as the value is greater than 1.
    o Is there another way out?
    Regards,
    Preethi.

    You need to raise the EXEPTION NO_MORE_DATA afte the last record is populated in the output table. Otherwise the program goes into an infinite loop.
    * From now on records get fetched from the database or gets read from the internal table
        FETCH NEXT CURSOR v_cursor
                   APPENDING CORRESPONDING FIELDS
                   OF TABLE <internal table>
                   PACKAGE SIZE i_s_if-maxsize.
        IF sy-subrc <> 0.
          CLOSE CURSOR v_cursor.
          RAISE no_more_data.
        ENDIF.
    * Populate the Output Data Structure into table E_T_DATA and you need to raise the EXEPTION NO_MORE_DATA and close the cursor to avoid any memory leaks

  • Determining How a Function Module Was Called

    I have an RFC-enabled function module which can be invoked from outside of SAP, via an RFC from the JCo, for example, or it can be invoked from another SAP program or function module. I want the RFC-enabled function module to process certain things differently if called from the RFC than if it were called from another program or function module within SAP. Is there an easy way to do, e.g. using something in SYST? Thanks.
    Kevin

    When you make an RFC connection there is a user information passed you can check the terminal that the call is made from but if it's easy or not depends on how the terminals (PC's) in your company are defined.
    Check the ABAP forum for more!

  • IDOC ABAP-PI Port Function Module not called

    HI all,
    i am using a scenario where i am sending (outbound) idocs via abap proxy to PI.
    I have assigned the function module to the abap-pi port.
    when i am trying to send a test idoc via we19, i get the message "IDoc '0000000000198029' transferred to ABAP-PSS port".
    but the function module (a copy of own_function)  doesn't get called. if i am testing the function module from se80 with the above mentioned idoc number '0000000000198029' everything is fine.
    in the partner profile i have added the corresponding idoc message type and selected to send idocs immediately. have i forgotten something in order to trigger the call of the function module ?
    br,
    martin

    Hello,
    I think it is not so easy to send IDoc to XI with ABAP-PSS-Port.
    I would try to create the IDoc and send it to XI-Port (Transactional RFC).
    This is SAP-Standard for IDoc-Scenario (SAP-R3 to XI).
    Best Regards, Dirk

  • Unable to call New Function Module when called thru Internet Service in ESS

    Hi all,
    I am using 4.6C.
    What i want to do: We are attaching a new HTML Template to an iview in which we have a direct call to a newly created Function Module.(Direct call mean to say we are calling the FM thru Flow Editor of HTML template).
    What error i am getting : After publishing all edited/created objects when we test it in portal page. It says :
    ITS System Information
       Flow Execution Failed
    Your request could not be processed by the module provider.
    The module provide returned following error message: Error retreiving parameters from context
    You may check the trace files for more information.
    Please guide to solution at your earliest.
    Regards
    Manish

    Hi Bjoem,
    Search the forum for tutorials and blogs...
    Regards,
    Anubhav

  • Any function module for calling a text editor in subscreen?

    Hi,
    I would like to know if there is any function module that can be used to call a text/note editor and can be displayed in a subscreen of a main screen (dialog programming)? This text/note editor should not be able to edit, but for display only.
    Please help. Thanks...

    >
    Pablo Casamayor wrote:
    > Hi,
    >
    > maybe this can help:
    >
    > check program SAPTEXTEDIT_TEST_1
    > in this program pay attention to:
    >
    >
    > MODULE pai INPUT.
    >
    >   CASE ok_code.
    > ....
    >     WHEN 'FIND'.
    >       PERFORM find_text.
    > ....
    >     WHEN 'HIGHLIGHT'.
    >       highlight = 1.
    >       PERFORM highlight_lines USING highlight.
    >
    >
    >
    > *&---------------------------------------------------------------------*
    > *&      Form  FIND_TEXT
    > *&---------------------------------------------------------------------*
    > FORM find_text.
    >   found = 0.
    >   IF case_sensitive = 'X'.             " button on Dynpro
    >     case_sensitive_mode = editor->true.
    >   ELSE.
    >     case_sensitive_mode = editor->false.
    >   ENDIF.
    >   IF whole_word = 'X'.                 " button on Dynpro
    >     whole_word_mode = editor->true.
    >   ELSE.
    >     whole_word_mode = editor->false.
    >   ENDIF.
    >
    >   CALL METHOD editor->find_and_select_text
    >                EXPORTING search_string = search_string
    >                          case_sensitive_mode = case_sensitive_mode
    >                          whole_word_mode = whole_word_mode
    >                CHANGING string_found = found.
    > * Flush for proper work of the following if statement
    >   CALL METHOD cl_gui_cfw=>flush.
    >   IF NOT search_string IS INITIAL.
    >     IF found NE 0.
    >       MESSAGE s000 WITH text-013.
    >     ELSE.
    >       MESSAGE s000 WITH text-014.
    >     ENDIF.
    >   ENDIF.
    > ENDFORM.                               " FIND_TEXT
    >
    > *&---------------------------------------------------------------------*
    > *&      Form  HIGHLIGHT_LINES
    > *&---------------------------------------------------------------------*
    > *      -->P_HIGHLIGHT  text                                            *
    > *----------------------------------------------------------------------*
    > FORM highlight_lines USING    p_highlight.
    >   IF selection EQ 'X'.
    >     CALL METHOD editor->highlight_selection
    >          EXPORTING highlight_mode = p_highlight
    >          EXCEPTIONS has_no_effect = 1.
    >     IF sy-subrc NE 0.
    > *      add your handling
    >     ENDIF.
    >   ELSE.
    >     CALL METHOD editor->highlight_lines
    >          EXPORTING
    >                  from_line = from_line
    >                  to_line = to_line
    >                  highlight_mode = p_highlight
    >          EXCEPTIONS has_no_effect = 1.
    >     IF sy-subrc NE 0.
    > *      add your handling
    >     ENDIF.
    >   ENDIF.
    >
    > ENDFORM.                               " HIGHLIGHT_LINES
    >
    > and this link:
    > http://help.sap.com/saphelp_45b/helpdata/EN/0e/514035634d761fe10000009b38f889/frameset.htm
    >
    > Best regards.
    >
    > Edited by: Pablo Casamayor on Apr 17, 2009 9:19 AM
    Hi Pablo,
    I have look through the program SAPTEXTEDIT_TEST_1. This program does the Text Selection and Highlighting the Text only after the buttons of each of the function is clicked.
    My requirements will be, having all the selected text (with a string pattern) to be highlighted when this text editor is displayed. Is this possible?
    Really thanks for your replies...
    Regards,
    Chuak Fen

  • Prog/Function Module which call during pressing the button "Pattern" inSE38

    Dear Guru,
    I have encountered an issue : issue is like that I want the name of the function module/ program which invokes as soon as we press the "Pattern" Button in Application tool bar of ABAP se38 editor.
    Please help.
    Thanks & regards
    Saifur Rahaman

    Dear Guru,
    I have Encountered an Issue.
    The Scenario Is like this :-
    As soon as we create a new prog using SE38 it automatically generates a standard pattern like below :
    *& Report  ZSR_TEST_05
    REPORT  ZSR_TEST_05.
    But the requirment is like this as soon as we create a new prog using SE38 it automatically it should generate the The Pattern like below :--
    *& Project            :
    *& Program Name       :
    *& Transaction Code   :
    *& Program Type       :
    *& Functional Domain  :
    *& Technical Coding   :
    *& Functional Guidance:
    *& Coding Review      :
    *& Spec. Review       :
    *& Program Description:
    REPORT  ZSR_TEST_05.
    After going through sdn documentation i have identified that using dynamic pattern we can create this and call that dynamic pattern using PATTERN button in ABAP editor.
    But the thing we require as soon as we generate the prog thr. SE38 atomatically all the details must generate before the report <report_name>.
    For achieving thins what i have to do ... please show me some path to achieve this
    Duplicate locked
    Edited by: Rob Burbank on Oct 31, 2009 3:26 PM

  • Need a Function Module to call a standard Elementary Search help - DEBIK

    Hi Gurus,
    I need to call the standard elementary search help DEBIK in one of my screen fields. Also I need to filter the values for the Account group KTOKD to Z104 ( transshipment location customers).
    Actually i do not want to copy the standard search help DEBIK to custom search help ZDEBIK and give a default value of Z104 to field KTOKD.
    Also i do not want to use FM - F4IF_INT_TABLE_VALUE_REQUEST .
    I want a FM which will call the search help directly . I tried using FM - FC_RVERS_SEARCHHELP but did not succeed. Can anybody help me in this.
    Thanks and Regards,
    Nabanita.

    Can you check both FM DDIF_SHLP_GET and 'F4IF_FIELD_VALUE_REQUEST'
    Kanagaraja L

Maybe you are looking for

  • Restoring deleted emails from a mailbox database edb file.

    hello all. i have done some reading up on this subject and also covered it off in my MCSA 70-341 training. ( some time ago) i dont deal with the exchange server often and would like to be clear before i delve into the exchange server. a user has lost

  • Plugged in iPhone to update, now MBP won't boot up

    I have a MBP Unibody (late 2008) running OS 10.5.8 and a 3G iPhone - everything was working fine until today when I plugged in the iPhone to update to OS4.1 - iTunes wouldn't open and gave me a weird message about installing a new version. Tried agai

  • Unable to clear overrides with Warnock Pro ornament (a real puzzle!)

    Hi, This is really weird. I have a paragraph that InDesign CS6 is marking as overriden. Nothing I do clears this override (the little plus next to the paragraph sign). Now, this is nothing very new. InDesign does do this sometimes. But this time I wa

  • Ipad is black and wont turn on

    My ipad is black and wont turn on the only thing i get a the apple icon in the center of the screen. I tried restarting it. It is fully charged and it is upgraded. Please help

  • My photos downloaded as negatives

    New ipad I downloaded my phots from the PC but they appear as negatives on the ipad. ???