How to call a maintenance view  from a program

Hello Abapers,
Can anybody explain with some examples. How to call a mainetenance view from a program.
Thanks
Ranjith.

Use FM 'VIEW_MAINTENANCE_CALL'.
REPORT  zmaintaintest.
VARIABLES / CONSTANTS                          
CONSTANTS: 
                c_action(1) TYPE c VALUE 'U',                                 "Update
          c_viewname TYPE tabname value 'ZEMP_EXAMPLE', "View Name
          c_field(6) TYPE c VALUE 'EMPNO'.                            "Field Name
INTERNAL TABLES
DATA: itab_rangetab TYPE STANDARD TABLE OF vimsellist,
          v_empno TYPE zempno,
          wa_rangetab TYPE vimsellist.
SELECTION SCREEN
PARAMETERS:     p_empno TYPE   zempno   OBLIGATORY.  "Emplyee ID
AT SELECTION-SCREEN                                                 
AT SELECTION-SCREEN.
Chcking the existence of the user in EMPLOYEE table
  PERFORM validate_employee.
START_OF_SELECTION                                                  
START-OF-SELECTION.
This will restrict the user view so that user can only view/change
Table data corresponding to his/her Employee ID
  PERFORM define_limited_data_area.
Displaying table maintenance view for a particular employee ID
  PERFORM call_view_maintenance.
*&      Form validate_employee
Validate plant entered in the selection screen
FORM validate_employee.
  SELECT SINGLE empno     u201CEmployee ID
    FROM zemp_example     u201CEmployee Table
    INTO v_empno
    WHERE empno = p_empno.
  IF sy-subrc <> 0.
    MESSAGE 'Not an Valid User' TYPE 'I'.
  ENDIF.
ENDFORM.                    "validate_employee
*&      Form DEFINE_LIMITED_DATA_AREA
To restrict the user view so that user can see/change table data
corresponding to his employee ID. Here one internal table is
getting populated with field name as u201CEMPNOu201D (Key field of the table)
And value as given by user in Selection Screen and this is passed as
Parameter in function module 'VIEW_MAINTENANCE_CALL'
FORM define_limited_data_area.
  CLEAR wa_rangetab.
  wa_rangetab-viewfield  = c_field.
  wa_rangetab-operator  = 'EQ'.
  wa_rangetab-value       = p_empno.
  APPEND wa_rangetab TO itab_rangetab.
ENDFORM.                    "define_limited_data_area
*&      Form CALL_VIEW_MAINTENANCE.
Displaying table maintenance view for a particular employee ID
FORM call_view_maintenance.
  CALL FUNCTION 'VIEW_MAINTENANCE_CALL'      
    EXPORTING
      action           = c_action
      view_name   = c_viewname
    TABLES
      dba_sellist     = itab_rangetab.
ENDFORM.                    "call_view_maintenance
Regards,
Joy.

Similar Messages

  • How to call a Webdynpro view from BSP page (MVC) in a new window?

    Dear Experts,
    kindly advise how to call a webdynpro view from BSP application after performing an event (through button or hyper link).
    Regards,
    Sarat.

    Hi,
    This has been discussed many times in several forums.
    Please check the method CL_WD_UTILITIES=>CONSTRUCT_WD_URL, to create a runtime url for your WD Application and call this URL.
    Refer thread: Call Webdynpro Application from BSP Application
    Hope this will be useful!
    Regards,
    Meganadhan S

  • How to Access Maintenance View from a program

    Hi Experts,
    I have created a maintenance view for a table. i want to insert data's into the table through the maintenance view. I don't know how to access the view, how to insert data into the Maintenance view. Please suggest me how to access the view from the program.
    with regards,
    James...
    Valuable answers will be rewarded...

    Hi,
    What is the need to search for a program.
    Use transaction SM30 or SE16 to create or maintain entries in the table.
    e.g. if the Maintenance view is created on table A, then Goto transaction SM30 or SE16 and give the table name as A and proceed. This will automatically take u to the maintenance view on tha table A.
    Regards,
    Himanshu

  • How to call a Particular View from a View of Current Component

    Hi Experts,
    Pls let me get a solution for my small issue..
    I do have 2 components cur_component and old_component which contain 2 Views each say, cur_vew1 & cur_view2 and old_view1 & old_view2 respectively.
    Now, When i click a button in cur_view1 then it should call the view - old_view1 of old_component and when i click a button in cur_view2 then it should call the view - old_view2 of old_component.
    When i tried, its calling the default view of the old_component. but i want to call the views of the old_component dynamically...
    hope am clear enough about my issue..
    Kindly help on me on this to solve this..
    With Thanks in advance,
    Amala

    hi ,
    have u done component usage to reuse ur old component in ur new component .
    refer this article on component usage :
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2e71ce83-0b01-0010-11a4-98c28a33195f
    to know , how to set the context attribute for visibility , u wud also like to go to this thread :
    Re: How to SET a value to an attribute usibng WIZARD?
    refer to Uday's reply in this thread as well  :
    Call view of another WDA Component and pass the value to it
    1) When you create your context at component controller level in component MAIN you have a property for the node which says as: "Interface Node" Just checkmark this checkbox. When you do this you would be able to share the data within your context nodes across other components.
    2) Specify a default value of AA in the "Default Value" property of the attribute in component MAIN
    3) Now go to your other component SUB which you would like to also get initialised. Define a usage of your component MAIN within this component.
    4) Go to your component controller & create your context node & attribute with exactly the same names as how you had created in your MAIN component.
    5) Do a mapping between the interface controller of your MAIN component & the component controller of your SUB component
    6) You would be able to see that the appearance of the node has changed to an interface node. This means that your SUB component now has an exact replica of your MAIN components context data.
    regards,
    amit
    Edited by: amit saini on Oct 13, 2009 2:47 PM

  • How to call an external server from Webdynpro program?

    Hi All,
    i have a requirement in which i have to call an external server from Webdynpro ABAP program.
    how to imp

    hi ,
    do u mean u need to call the external link from ur WD ABAP application ?
    if so , u either create
    1 a Link to URL ( LTU ) UI element  and call the external link using that
    2 if u wish to use some other fuctionality and thn wish to call the URL in ur application ,u write this piece of code in ur relevant on Action method :
    data:  lo_window_manager type ref to if_wd_window_manager.
    data:  lo_api_component  type ref to if_wd_component.
    data:  lo_window         type ref to if_wd_window.
    data:  ld_url type string.
    lo_api_component  = wd_comp_controller->wd_get_api( ).
    lo_window_manager = lo_api_component->get_window_manager( ).
    ld_url =  ''.  // ur external sever link here
    CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW     
    EXPORTING     URL                = ld_url           
    RECEIVING     WINDOW         = lo_window.
    lo_window->open( ).
    I hope u wud be able to create URL now .
    regards,
    amit
    Edited by: amit saini on Oct 13, 2009 11:25 AM

  • How to call an alv report from another program and return back

         Hello ,
    I am calling one abap program (Prgm B) from another program (Prgrm A).
    Here, Prgm B is an ALV report. I have fetch some data from Prgem B that gets stored in an internal table.
    Now, I am using below code in Prgrm A,
      SUBMIT Prgrm B VIA SELECTION-SCREEN
                          WITH SELECTION-TABLE rspar
                          EXPORTING LIST TO MEMORY
                          AND RETURN.
    When Prgrm A executed, it lead me to selection screen of Prgrm B and when I click F8, it shows me the report output, In short, it doesnt return back to Prgrm A. It ends up showing me the alv report if Prgrm B even afetr using RETURN statement.
    I want to get back to Prgrm A by fetching some data from Prgrm B.
    Please let me know, if i am missing something.
    Regards,
    Seema

    Hi Seema,
    Refer below code.
    DATA: v_matnr LIKE mara-matnr.
    DATA: t_listobject TYPE abaplist OCCURS 0 WITH HEADER LINE.
    DATA: t_mara TYPE mara OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF t_ascilist OCCURS 0,
             line(200).
    DATA: END OF t_ascilist.
    data var(3) type c.
    SELECT-OPTIONS: s_matnr FOR v_matnr.
    var = '  3'.
    START-OF-SELECTION.
       SUBMIT ztestaks1 WITH s_matnr IN s_matnr EXPORTING LIST TO MEMORY
       AND RETURN.
       CALL FUNCTION 'LIST_FROM_MEMORY'
            TABLES
                 listobject = t_listobject
            EXCEPTIONS
                 not_found  = 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.
       ELSE.
         CALL FUNCTION 'LIST_TO_ASCI'
    *     EXPORTING
    *       LIST_INDEX               = -1
    *       WITH_LINE_BREAK          = ' '
           TABLES
             listasci                 = t_ascilist
             listobject               = t_listobject
           EXCEPTIONS
             empty_list               = 1
             list_index_invalid       = 2
             OTHERS                   = 3.
         IF sy-subrc <> 0.
           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
         ELSE.
           WRITE:/ 'Below are the lines from the submitted program.'.
           LOOP AT t_ascilist.
             WRITE:/ t_ascilist-line.
           ENDLOOP.
           SKIP 2.
         ENDIF.
       ENDIF.
       IMPORT t_mara FROM MEMORY ID 'T_MARA'.
       WRITE:/
    'Here is the output from the table exported from the submitted program.'
       LOOP AT t_mara.
         WRITE:/ t_mara-matnr.
       ENDLOOP.
    Submitted program
    REPORT  ZTESTAKS1.
    DATA: v_matnr LIKE mara-matnr,
           v_maktx LIKE makt-maktx.
    DATA: t_mara TYPE mara OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF t_makt OCCURS 0,
             matnr LIKE makt-matnr.
    DATA: END OF t_makt.
    SELECT-OPTIONS: s_matnr FOR v_matnr,
                     s_maktx FOR v_maktx.
    START-OF-SELECTION.
       SELECT matnr INTO TABLE t_makt
                    FROM makt
                   WHERE matnr IN s_matnr
                     AND maktx IN s_maktx.
    if not t_makt[] is initial.
       SELECT * FROM mara
                INTO TABLE t_mara FOR ALL ENTRIES IN t_makt
               WHERE matnr = t_makt-matnr.
    endif.
       EXPORT t_mara TO MEMORY ID 'T_MARA'.
       WRITE:/ 'This list is from the submitted program'.
       SKIP 1.
       LOOP AT t_mara.
         WRITE:/ t_mara-mtart.
       ENDLOOP.
    Hopes this helps you.
    Thanks,
    Ashok.

  • How to call the 2 Tcodes from single program.

    Dear Friends,
    I would like to call 2 tcodes form a single program based on some conditions like :
    I have a program ZRR wich is madule pool report with selection screen and screen 100, 200.
    If I excuted tcode ZXX then I need to call the report with selectin screen ( from there with giving some input data I will go to screen 100 ),
    If I excuted tcode ZYY then I need to call the same report skiping the selection screen and need to go directly screen 200.
    Pls help me on this if any bady is faced the similar problem.
    Thanks,
    Sridhar

    hi,
    yes you can do this..
    try this
    create a two screen suppose 9000 and 9001..
    then right click on your program name...
    create a TCODE say TONE..
    in this give the screen number 9000..
    now again right click on the program name
    create a TCODE say Tsecond
    in this give the screen number 9001...
    hope this will help you..
    Regards
    Ritesh J

  • How to call a badi implementaion from report program

    Hi ABAP Guru,
    I have ZBADI_FALLBACK_DEF new badi created by me and there two implementation ZBADI_FALLBACK_IMP and ZBADI_FALLBACK_IMP1
    Now I am calling this badi from report program
    DATA:
       W_HANDLE TYPE REF TO ZBADI_FALLBACK_DEF.
    * GET BADI - for getting objects..................
    GET BADI W_HANDLE.
    * CALL BADI - for calling interface methods.
    CALL BADI W_HANDLE->ADD.
    This is fine,,,
    But I want to call only one implementaion ZBADI_FALLBACK_IMP.But here two implementaion is called.Please help....

    Hi Palash,
    Then you create filter BADI  and  use filter in implementation.
    While getting BADI reference use filter
    GET BADI W_HANDLE FILTERS
    Thanks & Regards,
    Arun

  • How to call a Calculation View from Sql ?

    Hi All,
    I'm trying to test my calulation views. Now i'd like to call it through sql. How to do it ?
    Thanks
    Sakthivek

    Hi Sakthivek,
    After you activate your calculation view successfully, you will find it under schema "_SYS_BIC" -> Column Views in your Studio. Then you can use select sql statement to query the calculation view.
    Best regards,
    Wenjun

  • How to call a perl module from Java program.

    Hi,
    I create a simple java program as follows
    class test{
    public static void main(String args[])
    {try {                    
    Runtime r = Runtime.getRuntime();
    r.exec("perl test.pl");
    catch(Exception e)
    {e.printStackTrace();}
    and test.pl is located in the same directory as the java program. The program compiles but with no return as I execute it. I am not sure what is wrong.
    Thanks,

    I think the wrong line is here; r.exec("perl test.pl");
    Usually the JVM needs the full path.If the path for either the executable or the script was wrong then, given the code posted, it would not hang.
    >
    To automatticaly get the path (if the file is in the
    class path) use
    System.getProperty("java.class.path")
    That gets paths(plural).
    Try this:
    r.exec("perl " +
    System.getProperty("java.class.path") + "\test.pl");I am rather certain that that won't work on any standard operating system.

  • How to use table maintenance view in module pool screen

    hi ,
    want to use table maintenance view in a module pool screen so that i can edit, insert, delete and update date in to the ztable.please help.

    You can simply call it via SM30.   Or you can call the table maintence view from any program(report or module pool) using a function module.
      call function 'VIEW_MAINTENANCE_CALL'
           exporting
                action                       = 'U'
                view_name                    = 'Z_Table_Name'
           exceptions
                client_reference             = 1
                foreign_lock                 = 2
                invalid_action               = 3
                no_clientindependent_auth    = 4
                no_database_function         = 5
                no_editor_function           = 6
                no_show_auth                 = 7
                no_tvdir_entry               = 8
                no_upd_auth                  = 9
                only_show_allowed            = 10
                system_failure               = 11
                unknown_field_in_dba_sellist = 12
                view_not_found               = 13
                others                       = 14.
    Regards,
    RIch Heilman

  • How to call backing bean method from java script

    Hi,
    I would like to know how to call backing bean method from java script.
    I am aware of serverListener and [AjaxAutoSuggest article|http://www.oracle.com/technology/products/jdev/tips/mills/AjaxAutoSuggest/AjaxAutoSuggest.html]
    but i am running in to some issues with [AjaxAutoSuggest article|http://www.oracle.com/technology/products/jdev/tips/mills/AjaxAutoSuggest/AjaxAutoSuggest.html]
    regarding which i asked for help in other thread with subject ....Question on AjaxAutoSuggest article (Ajax Transactions Using ADF and J...)
    The reason why i posted is ( though i realise both are duplicates) .. that threads looks as a specific question to that article hence i would like to ask the quantified problem is asked in this thread.
    So could any please letme know how to call backing bean method from java script
    Thanks
    Murali
    Edited by: mchepuri on Oct 24, 2009 6:17 PM
    Edited by: mchepuri on Oct 24, 2009 6:20 PM

    Hello,
    May know how to submit a button autoamtically on onload of page with clicking a welcome alert box. the submit button has managed button too to show a message on console using SOP.
    the problem is.
    1. before loading the page a javascript comes on which i clicked ok
    2. the page gets loaded and the button is there which gets automatically clicked and the managed bean associated with prints a message on console using SOP.
    I m trying to do this through server listener and click listener. the code is(adf jspx page)
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" binding="#{backingBeanScope.backing_check4.d1}">
    <af:form id="f1" binding="#{backingBeanScope.backing_check4.f1}">
    <af:commandButton text="commandButton 1"
    binding="#{backingBeanScope.backing_check4.cb1}"
    id="cb1" action="#{beanCheck4.submit1}"/>
    <af:clientListener type="click" method="delRow"/>
    <af:serverListener type= "jsServerListener"
    method="#{backingBeanScope.backing_check4.submit1}"/>
    <f:facet name="metaContainer">
    <af:resource type ="javascript">
    x=confirm("hi");
    // if(x){
    delRow = function(event){
    AdfCustomEvent.queue(event.getSource(), "jsServerListener", {}, false);
    return true;
    </af:resource>
    </f:facet>
    </af:form>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_check4-->
    </jsp:root>
    the backing bean code is -----
    public class classCheck4 {
    public classCheck4() {
    public String submit1() {
    System.out.println("hello");
    return null;
    }

  • How to call a SQL function from an XSL expression

    Hi
    In R12, in Payroll Deposit adivce/Check writer, We need to sort the earnings tag <AC_Earnings> in to two different categories as regular and other earnings. In the DB and form level of element defintiion we have a DFF which differentiates between the two kinds of earnings. But the seeded XML that is gerneated by the check writer does not have this field.
    The seeded template displays all the earnings in one column. How can we achieve this in the template without modifying the seeded XML.
    The one approach i have is to write a function and based on the return value sort the data. For this I need to know :
    1) How to call a SQL function from an XSL expression that is allowed in BI template.
    If anyone ahs faced similar requirements please share your approach.
    Thanks
    Srimathi

    Thank u..
    but i'd seen that link wen i searched in google..
    Is it possible without using any 3rd party JARs and all?
    and more importantly plz tell me what should be preferred way to call a javascript function?
    Do it using addLoadEvent() or Windows.Load etc
    OR
    Call it thru Xsl? (I donno how to do dis)
    Thanks in Advance..
    Edited by: ranjjose on Jun 3, 2008 8:21 AM

  • How to call a web service from forms 9i

    Hello all, I was trying to run the example on this website that shows how to call a webservice from forms, and I recieved an error. I am at the last step, where it tells me to create a button and add a when button pressed trigger. Here is the code I am using from the example:
    DECLARE
    jo ora_java.jobject;
    rv ora_java.jobject;
    ex ora_java.jobject;
    BEGIN
    jo := CurrencyExchangeServiceStub.new;
    --This will get the exchange rate from US Dollars to UK Sterling.
    rv := CurrencyExchangeServiceStub.getRate(jo,'USA','UK');
    message (float_.floatValue(rv));
    EXCEPTION
    WHEN ORA_JAVA.JAVA_ERROR then
    message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
    WHEN ORA_JAVA.EXCEPTION_THROWN then
    ex := ORA_JAVA.LAST_EXCEPTION;
    message(Exception_.toString(ex));
    END;
    It gives me an error on"Exception_.tostring" component must be declared. Does anyone have any suggestions? I am trying to figure out how to call an external WS from a form. Thanks.

    IN forms Builder under Import java classes
    Change the Import Classes field to java.lang.Exception and press Import. This will create a PL/SQL package for the Exception Java class. While this is not essential, it does make error reporting easier. Now press Close to dismiss the dialog.

  • How to call a function module from a transformation

    Hi,
    Could somebody please let me know how I can call an abap function module from a transformation (abap xslt program). I know how to call the class methods from transformation, but how do i call a function module..?
    Thanks,
    Shashi.
    Edited by: Shashi Kanth Kasam on Apr 8, 2010 12:45 PM

    Ya. I can do that. But I don't want to use a class and a method to call that function module. Want to directly call function module from transformation. Is that possible..?
    Thanks,
    Shashi

Maybe you are looking for