Save an input mask as variant for a method of a Z class

Hi all,
quite a dumb question, but I switched to OO abap recently and can't find this feature...
When I'm creating a custom function module, I can test in debug simply lauching it and saving parameters of the input mask iin a Variant, so that I can try the run with these params whenever I want simply loading the variant I saved.
Now... I'm working on a method in a custom class; I'd like to test but everytime I have to populate the parameter mask since I can't find a "save variant" option. Is there any way to accomplish this? Thanks in advance.

Could write an ABAP UNIT class and definition and perform ABAP UNIT test on the object...ABAP Unit is regression testing for programmers but I do development testing with the tool.

Similar Messages

  • Unable to RegisterNative for a method of a C++ class

    Hi all,
    Summary: problem with registering method from a C++ class
    that should be called from java (jvm and class loaded by
    C++ exe so the need of
    I have a C++ class Menu in which are defined some callbacks.
    That's my legacy code I want to paritally reuse: I must do
    some hybrid application keeping some C++ windows and
    replacing some with Java windows. The menu are the same in
    all windows (both C++ and Java). You launched new window with
    some buttons. For the button on C++ GUI, if the window to
    create is a C++ one, it should called old code, if it's a
    java one, it should use new java code and vice versa:
    from java GUI, we should be able to create new java window
    and C++ window (using the old code in C++).
    To be able to call from java launched from C++. I use the
    RegisterNative method of the JNI framwork. So far so good.
    I was able to make an exemple (see:
    http://forum.java.sun.com/thread.jsp?forum=52&thread=527872&tstart=0&trange=15)
    I put interesting part of my code below. I have no problem
    with the java part. I also have no problem call java from
    method of my C++ class. But when I try to add some stuff
    for registering C++ method of a class I got an error from
    the compiler
    Menu.cpp
    Menu.cpp(1277) : error C2440: '=' : cannot convert from
    'void (__stdcall Menu::*)(struct JNIEnv_ *,class _jobject *)' to 'void *'
    There is no context in which this conversion is possible
    If I declare the method cbDoSomethingNative as a C method outside
    Menu class, I can compile but unfortunately I don't know then
    how to access the method Menu::cbDoSomething() that is not
    static and cannot be because I'm accessing some data non static
    from it.
    Casting to (void *) lead to similar problem: cast not possible.
    Any idea? (No I do not have Rob Gordon's book "Essential JNI").
    Thanks,
    Xavier.
    /* File: Menu.h */
    class Menu public BaseMenu {
    public:
      // Construtor
      Menu();
    protected:
      // IlogViews stuff: the lecagy code not to be touched
      // called when event from C++ GUI received on a C++ window
      virtual void cbDoSomething(IlvGraphic*);
      // JNI wrapper I would like to have
      virtual void JNICALL cbDoSomethingWrapper(JNIEnv *env, jobject obj);
      // A lot of other stuff not interesting for this question
    }/* File: Menu.cpp */
    void Menu::Menu()
      // legacy part, to be kept untouched
      JNIManager* jniManager = JNIManager::getInstance();
      jclass myJavaclass = jniManager->getMyJavaClass();
      JNINativeMethod nm;
      nm.name = "cbDoSomethingNative";
      nm.signature = "()V";
      nm.fnPtr = cbDoSomethingNative;  // <--- HERE IS THE ERROR
      JNIEnv* jniEnv = jniManager->getJNIEnv();
      jniEnv->RegisterNatives(myJavaclass, &nm, 1);
    void JNICALL Menu::cbDoSomethingNative(JNIEnv *env, jobject obj)
      Menu::cbDosomething(0);
    }/* File: JNIManager.h */
    #include <jni.h>
    #define USER_CLASSPATH "myJavaApplication.jar"
    class JNIManager
    private:
      static JNIManager *instance;
      JNIEnv *env;
      JavaVM *jvm;
      jclass classJavaMenu;
      jmethodID midDosomehting;
    private:
      JNIManager();
    public:
      ~JNIManager ();
      static JNIManager* getInstance();
      JNIEnv* getJNIEnv();
      jclass getClassJavaMenu();
      void deleteAllGlobalRef();
    protected:
      JavaVM* getJVM();
      jclass getMyJavaClass();
      jmethodID getMethodIDDoSomething();
    };/* File: JavaMenu.java */
    public class JavaMenu  {
      public native void DoSomethingNative();
      // A lot of other stuff not interesting for this question
      // callback method which should behave as Menu::cbDoSomething
      // when event from Swing GUI received on a java window
      public void dosomehtingFromJava() {
        DoSomethingNative();

    if I'm right, such cast is not allowed
    careful or notYes and no.
    In C++ I can cast absolutely anything to anything.Yes but...There is no but.
    >
    For example I can cast a double to a function pointer.I tried the cast first, if I remember well compilation was OK
    (with a C-style cast) but linkage was not possible.
    JNI does NOT accept method from class because the
    method signature is not the same because of the this
    pointer that makes all the difference.No it doesn't.
    If you had a problem then you were doing something different.
    As I said C++ allows you to cast anything to anything else.
    Now you might not have been using the C style cast, or reinterpret_cast or it might not have linked regardless of how you coded it (it had nothing to do with the cast you used.)

  • How to save Checkbox inputs as a Variants in WD ABAP

    Hi,
    I am going through this nice blog [http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414700)ID0832150950DB20043138143752756391End?blog=/pub/wlg/10731] which helped me creating varaint options for SELECT -optins fields.
    Everything works fine..
    Now I want to save some selection screen Check boxes , plus input fields in to this.
    I have NODE called ATTR in which I have checkboxes attributes like ATT1,ATT2,ATT3 etc..
    So what I was trying to pass the checkbox values by reading and then  assigning it to lv_att1 but it says i cannot change value..
    where am i going wrong?
    method HANDLEFROM_SAVEVARIANT .
      DATA lo_nd_attr TYPE REF TO if_wd_context_node.
      DATA lo_el_attr TYPE REF TO if_wd_context_element.
      DATA ls_attr TYPE wd_this->element_attr.
      DATA lv_att1 LIKE ls_attr-att1.
    ** navigate from <CONTEXT> to <ATTR> via lead selection
      lo_nd_attr = wd_context->get_child_node( name = wd_this->wdctx_attr ).
    * get element via lead selection
      lo_el_attr = lo_nd_attr->get_element(  ).
    * get single attribute
      lo_el_attr->get_attribute(
        EXPORTING
          name =  `ATT1`
        IMPORTING
          value = lv_att1 ).
    wd_this->lt_att1  = lv_att1.
    wd_this->lt_range_table = lt_range_table .
      wd_this->M_HANDLER->SET_RANGE_TABLE_OF_SEL_FIELD(
                 exporting I_ID = 'PS_PSPID'
                           IT_RANGE_TABLE = lt_range_table  ).
    I

    Hi iam a starter in ABAP and i got a small error while coding that is
    PARAMETERS:
      ABAP  AS CHECKBOX.
      SELECTION-SCREEN COMMENT 5(4) text-010.
      SELECTION-SCREEN END OF LINE.
      SELECTION-SCREEN BEGIN OF LINE.
      PARAMETERS:
      MM AS CHECKBOX.
      SELECTION-SCREEN COMMENT 5(4) text-011.
      SELECTION-SCREEN END OF LINE.
      selection-screen end of block nam1.
    if ABAP = 'X'.
    WRITE ' YOU ARE ELIGIBLE CONSULTANT'.
    ENDIF.
    in the above code my requirement is when i check the abap the following msg must be showed in the output screen but its not showing..
    please help me if anyone knows how to do it. thank you.
    And this is the part of the code if anyone want to see whole code it is attached with this thread.

  • Save the input data of single WD4A screen

    Hi All,
    I am interested to know, whether as in the case of the ABAP report screen where we can save the input data as variant, is it possible for us to save all the input fields into a variant in WD4A.
    Thanks,
    Selvakumar M.,

    hi,
    Refer the following blogs on Variant in Wd Abap :
    /people/sharad.agrawal/blog/2008/08/21/creating-and-using-variant-in-select-options-with-web-dynpro-for-abap-1
    /people/sharad.agrawal/blog/2008/08/25/creating-and-using-variant-in-select-options-with-web-dynpro-for-abap-2
    I hope it will help you.
    Thanx.
    Saurav.

  • Select-options for OO Methods

    Hi all,
    How can I define select-options for a method in a global class.
    And how can I pass these select-options from a report.
    Thanks & Regards
    Eshwar

    Hi all,
    How can I define select-options for a method in a global class.
    And how can I pass these select-options from a report.
    Thanks & Regards
    Eshwar

  • Soucre code for JTextArea methods

    Where do I go to find the soucre code for the methods
    of the JTextarea class. In particular the method setWrapStyleWord(boolean);
    Does sun actually release this soucre code

    Same place as all the other source code, in a file called src.jar in the directory where you installed your SDK.

  • Save a phone number without the input mask

    Hi,
    I actually have 2 related issues that I hope you might be able to help me with.
    I have a form linked to an interactive report, so when I click a record, the form is populated with the record's data. I just started using the new text field masked input plugin to handle phone number formatting, etc., which Patrick recommended.
    The plugin works nicely when a phone number being displayed from the source is 10 characters. The input mask I'm using is (999) 999-9999. However, I also have phone numbers in records that don't include the area code. When I select one of those records, the phone number field is blank. I would like it to display 999-9999, and be right justified. Is there an easy fix for that?
    My next problem occurs when I try to save the record. The process tries to save the phone number, including the mask, (14 characters), to the table. I only want to save the number to the table, excluding the mask. I'm sure there is a way to do this but I haven't found it yet.
    Thanks in advance for any help,
    Gary

    This is my solution to parsing the number only from the masked phone number:
    1) Create a field, 'P1_PHONE_MASKED', with a phone number mask: (?***) 999-9999
    2) Create a hidden Database Column like: 'P1_PHONE' It will initially hold the value of the record's phone column.
    3) create a javascript function in the page's before header section, between the space tags, to strip out all non-numeric values and update the hidden field:
    function remmask(src,tar){
    var mystring = $x(src).value;
    mystring = mystring.replace(/\D/g,'');
    $x(tar).value = mystring;
    4) Place the function call in the from in the HTML Form Elements Attributes of P1_PHONE_MASKED: onBlur="javascript:remmask('P1_PHONE_MASKED','P1_PHONE');"
    Now, anytime you change the value in P1_PHONE_MASKED, P1_PHONE gets updated with just the number values from P1_PHONE_MASKED.
    You can also add validation to the function to ensure that the length of the phone number is either 7, no area code, or 10, including area code. Normally, the mask should handle validation, but as you can see, to make this work, I had to make the mask more flexible, to allow for alpha numeric values in the first 3 positions and to allow for either 7 or 10 characters. Unfortunately, that means a user could enter something like XXX12 and the mask won't reject it.
    Partial solution to displaying ( ) 999-9999 in the masked input field P1_PHONE_MASKED when initially selecting a record for display.
    1) Make the Source Type for P1_PHONE_MASKED "SQL Query"
    2) Insert a query similar to the one below into "Source Value or Expression"
    SELECT
    CASE
    WHEN length(METAREPO.CONTACTS.CONTACT_PHONE) = 10
    THEN
    METAREPO.CONTACTS.CONTACT_PHONE
    WHEN length(METAREPO.CONTACTS.CONTACT_PHONE) = 7
    THEN
    '___'||METAREPO.CONTACTS_2011.CONTACT_PHONE
    END
    FROM METAREPO.CONTACTS
    WHERE METAREPO.CONTACTS.CONTACT_ID = :P1_CONTACT_ID
    This will display 7 digit phone nubers as follows: (___) 999-9999 in the masked field: P1_PHONE_MASKED.
    I wanted to use spaces between the () to make it perfect, but I'm unable to get this to work. I've tried things like:
    ' '||METAREPO.CONTACTS_2011.CONTACT_PHONE
    LPAD(METAREPO.CONTACTS_2011.CONTACT_PHONE,3,' ')
    Both of which work in PL/SQL Developer, but not in Apex. I believe this is because HTML collapses spaces by default.
    I would like very much to resolve this last issue. Any suggestions?
    Regards,
    Gary

  • 'Save As Variant' for Module Pool Program - FM to be called?

    I have a dialog program, i want to activate the 'Save As variant' when i click on save on the selection screen of the transaction i created for the dialog program. What funtionality should be called or written for the PF-STATUS to implement the functionality.

    hi Dagny,
      You can't have variants for module pool. It is possible only for selection screen.
    You have following alternatives :-
    1. Create a report with same selection screen as you have now in module pool.
    And then make a call screen to your intial module pool.
    In this way you can all the advantage of variants as well as module pool.
    OR
    2. Create a transaction variant using transaction SHDO.
    Hope it is helpful.
    and do search the form , it is already answered before.
    regards
    venkat

  • Input Masks for one field

    Hi,
    Can I assign different input masks for one field on a presentation?
    Thanks

    Hi vijay,
    1. U have not given proper parameters
       while calling the FM.
    2. have a look at this (just copy paste)
    3.
    REPORT ABC.
    DATA : BEGIN OF ITAB OCCURS 0,
    UNAME LIKE USR01-BNAME,
    END OF ITAB.
    data : RETURN_TAB LIKE DDSHRETVAL occurs 0 .
    data : RETURN_wa LIKE DDSHRETVAL .
    PARAMETERS : A(12) TYPE C.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR A.
    ITAB-UNAME = 'U01'. APPEND ITAB.
    ITAB-UNAME = 'U02'. APPEND ITAB.
    ITAB-UNAME = 'U03'. APPEND ITAB.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    DDIC_STRUCTURE = ' '
    retfield = 'ITAB-UNAME'
    PVALKEY = ' '
    DYNPPROG = SY-REPID
    DYNPNR = SY-DYNNR
    DYNPROFIELD = 'A'
    STEPL = 0
    WINDOW_TITLE =
    VALUE = ' '
    VALUE_ORG = 'S'
    MULTIPLE_CHOICE = ' '
    DISPLAY = ' '
    CALLBACK_PROGRAM = ' '
    CALLBACK_FORM = ' '
    MARK_TAB =
    IMPORTING
    USER_RESET =
    tables
    value_tab = ITAB
    FIELD_TAB = FTAB
    RETURN_TAB = return_tab
    DYNPFLD_MAPPING =
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 2
    OTHERS = 3
    break-point.
    regards,
    amit m.

  • How to Save Multiple Variants for a Report at a time?

    Hi Experts,
    I have a report in one server and I have copied the same into another server.
    And now I also have to copy the variants of that report.
    There are totally 192 variants for the report. So, is there any easier way to copy all those variants for the new report that I have created, rather than re-creating the variants one-by-one manually.
    Note:There is no connection to both the servers. So I cannot transport them.
    Thanks in advance.

    Basis can do a export and import transport, still if don't have connection between boxes.
    or
    check this
    http://www.sap-basis-abap.com/abap/copy-program-variants-from-one-to-another.htm

  • How to create variant for table/view ?

    Hi,
    When I go through SM30, I find a radio button called variant. I don't know the effect.
    Can anyone tell me how to create variant for table / view ?
    I want to know when we need to create variant for table/view.
    Best regards,
    Chris Gu

    hi ,
    Whenever you start a program in which selection screens are defined, the system displays a set of input fields for database-specific and program-specific selections. To select a certain set of data, you enter an appropriate range of values.
    For further information about selection screens, refer to Selection Screens in the ABAP User's Guide.
    If you often run the same program with the same set of selections (for example, to create a monthly statistical report), you can save the values in a selection set called a variant
    Procedure
    To create a new variant:
           1.      On the ABAP Editor initial screen, enter the name of the program for which you want to create a variant, select Variants, and choose Change.
           2.      On the variant maintenance initial screen, enter the name of the variant to be created.
    Note the naming convention for variants (see below).
           3.      Choose Create.
    If the program has more than one selection screen, a dialog box for screen assignment appears. The dialog box does not appear if the program only has one selection screen. The selection screen appears in this case.
           4.      If there is more than one selection screen, select the screens for which you want to create the variant
    5.      Choose Continue.
    The (first) selection screen for the report appears.
    If your program has more than one selection screen, use the scroll buttons in the left-hand corner of the application toolbar to navigate between them and to fill the fields with values. If you keep scrolling forwards, the Continue button appears on the last selection screen.
           6.      Enter the desired selection values, including multiple selection and dynamic selection.
           7.      Choose Continue.

  • How to create transaction or screen variant for custom tcode in module pool

    Hi,
              I have one module pool program with custome tcode ,i want to create transaction or screen variant for this tcode.Next time when we run this tcode we need a variant for this tcode.
    I tried by using of SHD0 but it is working only for standred tcodes.Is there any possibilty please help me.
    thanks,
    Lavanya.

    Hi,
    you created a Custom Tcode for ur module pool Pgm..if u execute the Tcode in the output screen give the input details and press Save Option then variant will be created. Then you can use that variant.
    otherwise.. while creating a Tcode..
    select an option for Tcode type Tranasction With variant ..there u will provide the variant for ur Tcode ( which is already created ).
    Regards,
    PraVeen.

  • Creation of a Variant for FBL3N

    Hi Gurus,
    Actually, i want to create a variant for GL line item display with posting date range as last month's date range.
    For eg. if i use that variant in october, it should pick posting date range from 01.09.08 to 30.09.08 and i use this variant in november, it should pick posting date range from 01.10.08 to 31.10.08.
    Please help me in solving this issue.
    Thank You

    On the report's selection-screen:
    1. Hit the SAVE button to create a variant
    2. In the table 'Objects for Selection Screen':
                   2.1. scroll to the row showing your input selection field (say posting date) and
                   2.2. in column 'Selection Variable' of the respective row   select 'D'.
                   2.3. in column 'Name of the Variable' of the respective row  select 'Previous month'
    Edited by: Prasad Kosuru on Nov 28, 2008 7:25 PM
    Edited by: Prasad Kosuru on Nov 28, 2008 7:28 PM

  • Dynamic Variant for Date Range

    Making the Variant for Date or Date Range Dynamic in the Selection Screen of any Program.
    There are actually many ways you can make the Variant for Dateu2019s Dynamic.
    1.     Providing he Values in the Variant Variables.
    2.     By creating the variables in the table TVARVC
    3.     By Initializing the values in the program itself.
    I saw many posts with respect to these and found that everyone has their own way of dealing. Even I wrote code in the program initialization to get this done.
    Here in this post I am showing you the easiest option which is available in the Variant creation.
    EX : If you want to execute the batch job based on a date range.
         SY-DATE u2013 60 days , that means always your program should execute the batch job based on System Date. And the variant should change accordingly.
    Following are the step by stop to do that.
    1. Select your program and select the Variant Radio button and then Click on Display.
    2. It will pop up a screen with variant option below the program name.
    3. Enter the Variant name and click on Create
    4. You will see a screen, with the Attributes button.
    5. Once you click on the Attributes button, it will take you a screen with selection option.
    6. In my scenario my input is based on Calender Day, so select the Selection Variable for Calender Day: You will find 2 options T & D.
    7. Select D: Dynamic date Calculation, then select the Name of Variable (input using f4). You can find many options.
    8. Scroll down the Variant Attributes and select current date u2013 xxx, current date + yyy
    9.Though it seems to be inactive, just double click on the row to provide the date range.
    10. Just enter the value for xxx and yyy to get you dynamic range based on number of days
    11. In my scenario I have to consider System Date u2013 60 days. 0 means current day.
    12. Click on OK to check the range has been reflected or not. Then save the Variant and check the value by executing the program with saved Variant.
    You can check the same in blog with all the screen shots attached but this thing is so easy you don't require screen shots.
    Regards
    Shankar Chintada

    Hi Shankar,
    It would be great if you can put this information in Wiki .
    Pravender

  • Transaction Variant for a Custom Report

    Hi Folks...
    I am trying to create a transaction variant for a custom report...and i am unable to do it. Have any one tried that before and got it worked..please let me know.
    Thanks in advance.
    Rajeev

    hi,
    i also used a different approach based on the requirement.  this might be helpful to someone:
    requirement: to make one of the parameter fields as display only.  other users should not be allowed to edit this field & make it modifiable again.
    _solution1:_ in the program, assign the parameter field to a modification id and make it protected (screen-input=0). 
    limitation: needs program modification incase there is a future requirement to change the parameter field value.
    solution2: [1]create & save a variant and protect that parameter field. [2] go to SE93 & create a report transaction, put your saved variant in the 'start with variant'. [3] go to SU21 & create an authorization object for controlling the access to the variant. [4] ask your basis to attach this authorization object to the user id responsible for maintaining the variants for that program. [5] add a logic to check the authorization object in your program whenever the user tries to save or delete variants.
    remarks: in production, make sure the authorization object & the update profile are transported.  create also the same variant name as what you have defined in your report transaction code.

Maybe you are looking for

  • How come I can't see my Ipod Touch on Itunes?

    When I had the 9.2 version (the one before 10), just recently before I changed it to 10, my Ipod Icon wouldn't show up on Itunes so I couldnt sync my ipod or do anything, even though it was plugged and was charging. So, then I was like okay, maybe th

  • I can no longer get you tube on my i-pod touch?

    I can no longer get you tube on my i-pod touch 16gb? When I access you tube I get a message cannot connect.

  • Issue on Java Run Deski document, save format in a unmanaged disk location

    Post Author: usaitconsultant CA Forum: JAVA m developing an java application-based that will run deski report/document in a window machine and save output formatted report/document (pdf, etc.) to a local destination (unmanaged disk). However, no phys

  • Extension cannot be used

    Yesterday I started getting a whole bunch of similar error messages. They all read some variation of "System Extension cannot be used" followed by something in the /System/Library/Extensions folder ending in ".kext". I ran a Permissions Repair using

  • Error installing WLS 5.1 on Intel Xeon

    Hi, Could you help me? I try to install BEA WebLogic 5.1 Enterprise Server on Windows 2000 (HP workstation X4000) with Intel Xeon processor. After setup I have an error about: WLPASSWDW.exe and when I startweblogic.cmd I have the error: D:\weblogic>d