Can one field of a variant of an ABAP4 program takes value from a table ?

When I run an ABAP4 program, there is one input field called Time Stamp.  If I run the program directly (without selecting a variant), this Time Stamp field is filled with a field value from a table called TVARVC, but if I select a variant of this program, this Time Stamp field is filled with another field value of the table TVARVC.  It seems that the variant value can be filled with a value in system table, am I right?  If this is the case, then how it is programmed?
Thanks
Message was edited by: Kevin Smith

Hi Kevin
In the table TVARVC you should insert a new record which name (field NAME) have to begin with SAP_SCMA_ and the type (field TYPE)is P for parameter or S for select-options and the values (field LOW and/or HIGH) are your value.
So you have to create a variant and for input field Time Stamp set flag SELECTION VARIABLE and then push button SELECTION VARIABLES. Now you have to insert the name of your record of TVARVC.
So when user choose this variant the input field Time Stamp is filled with value you have entered in TVARVC.
Now in TVARVC you can insert another record (if you want it isn't avaible for SELECTION VARIABLE function in the variant, you should give it a name it doesn't begin with SAP_SCMA_) and put this value in the input field Time Stamp during INITIALIZATION event:
INITIALIZATION.
SELECT * FROM TVARVC WHERE NAME = ......
    Time Stamp = TVARVC-LOW.
Max
P.S. you have opened two post with the same problem, close older one.
Message was edited by: max bianchi

Similar Messages

  • My 27" iMAC is less than 3 month old. Many times regardless of what application I am in the screen will start shifting  back and forth left to right. Then I can't do anything until the screen stabilizes. This takes anywhere from 5 to 25 secs. Any ideas?

    My 27" iMAC is less than 3 month old. Many times regardless of what application I am in the screen will start shifting  back and forth left to right. Then I can't do anything until the screen stabilizes. This takes anywhere from 5 to 25 secs. Any ideas?

    why don't you take advantage of the free 90 days of AppleCare and utilize the free, professional telephone support from Apple instead of asking in the forums?

  • Why can one spot colour convert into two different sets of CMYK values?

    Working within Illustrator CC, I have an EPS file of a logo which has a colour fill value of:
    Pantone 152 U
    CMYK: 0C 51M 100Y 1K
    When I copy and paste this into a new document I get a much duller colour (orange) with colour values of:
    Pantone 152 U
    CMYK: 2C 57M 83Y 2K
    I have enabled 'ask when opening' & 'ask when pasting' for Profile Mismatches in Edit->Color Settings->'Color Management Policies' - no warning shows up.
    I have also tried turning off, changing color management policies.
    I've opened the original eps file and assigned my working space profile (Coated FOGRA39) and then try copy and pasting without success.
    Help!

    In addition to John's useful comments:
    Using Pantone 512U (uncoated) isn't correct for Coated Fogra.
    Why can one spot color convert into two different CMYK sets if converted by the user?
    Assumed, the one spot color is uniquely defined by one Lab set:
    – the CMYK spaces are different
    – the CMYK spaces are the same but the Rendering Intents are different
    – the CMYK spaces are the same but the Black Point Compensations are different
       (on or off for Relative Colorimetric).
    Assumed, the spot colors are equal by name, but valid for different versions, both in Lab:
    – this obviousl at present the most common source of deviations.
    Assumed, the spot colors are defined by CMYK:
    – a chaotic situation which I wouldn't even like to dicuss.
    – CMYK to CMYK conversions should be avoided under all circumstances.
    The solutions:
    If the spot color will be printed always and everywhere by Pantone spot ink:
    – purchase an actual Pantone color fan und discuss with the printer the mixture for the selected ink.
    If the Pantone color is merely a design feature, but the doc will be printed by CMYK:
    – choose such a color and verify by soft proofing that the color is in-gamut for common CMYK spaces. 
    – read the Lab values and proceed as far as possible using Lab.
    – don't use ink names, don't use any reference to Pantone.
    – convert into to a specificic CMYK space in advance to the generation of the specific PDF.
    Best regards --Gernot Hoffmann

  • Unable to read field value from main table - unexpected socket read error

    Hi Friends,
    While executing the below code, I am able to get the value of the field 'id' but i am unable to get the value for the 'materialnumber' field. i am getting the below exception
    +com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ProtocolException: java.io.IOException: Unexpected socket read.  Result is -1.
         at com.sap.mdm.data.commands.AbstractRetrieveLimitedRecordsCommand.execute(AbstractRetrieveLimitedRecordsCommand.java:158)
         at com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand.execute(RetrieveLimitedRecordsCommand.java:157)
         at updaterecords.main(updaterecords.java:126)
    Caused by: com.sap.mdm.internal.protocol.manual.ProtocolException: java.io.IOException: Unexpected socket read.  Result is -1.
         at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:100)
         at com.sap.mdm.data.commands.AbstractRetrieveLimitedRecordsCommand.execute(AbstractRetrieveLimitedRecordsCommand.java:146)
         ... 2 more
    Caused by: java.io.IOException: Unexpected socket read.  Result is -1.
         at com.sap.mdm.internal.net.DataSocket.receiveData(DataSocket.java:59)
         at com.sap.mdm.internal.net.ConnectionImpl.readInt(ConnectionImpl.java:417)
         at com.sap.mdm.internal.net.ConnectionImpl.nextMessage(ConnectionImpl.java:501)
         at com.sap.mdm.internal.net.ConnectionImpl.receiveMessage(ConnectionImpl.java:472)
         at com.sap.mdm.internal.net.ConnectionImpl.send(ConnectionImpl.java:209)
         at com.sap.mdm.internal.net.ReservedConnection.send(ReservedConnection.java:105)
         at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:97)
         ... 3 more+
    import com.sap.mdm.commands.AuthenticateUserSessionCommand;
    import com.sap.mdm.commands.CommandException;
    import com.sap.mdm.commands.CreateUserSessionCommand;
    import com.sap.mdm.commands.DestroySessionCommand;
    import com.sap.mdm.commands.GetRepositoryRegionListCommand;
    import com.sap.mdm.data.Record;
    import com.sap.mdm.data.RegionProperties;
    import com.sap.mdm.data.ResultDefinition;
    import com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand;
    import com.sap.mdm.ids.TableId;
    import com.sap.mdm.net.ConnectionException;
    import com.sap.mdm.net.ConnectionPool;
    import com.sap.mdm.net.ConnectionPoolFactory;
    import com.sap.mdm.schema.FieldProperties;
    import com.sap.mdm.schema.RepositorySchema;
    import com.sap.mdm.schema.commands.GetFieldListCommand;
    import com.sap.mdm.schema.commands.GetRepositorySchemaCommand;
    import com.sap.mdm.search.Search;
    import com.sap.mdm.server.DBMSType;
    import com.sap.mdm.server.RepositoryIdentifier;
    public class updaterecords {
         public static void main(String[] args) {
              try {               
                    String serverName = "159.112.6.26";
                    ConnectionPool connections = null;
                    try {
                         connections = ConnectionPoolFactory.getInstance(serverName);
                    } catch (ConnectionException e) {
                         e.printStackTrace();
                         return;
                   // specify the repository to use
                   // alternatively, a repository identifier can be obtain from the GetMountedRepositoryListCommand
                   String repositoryName = "DEMO";
                   String dbmsName = "MDMD";
                   RepositoryIdentifier reposId = new RepositoryIdentifier(repositoryName, dbmsName, DBMSType.ORACLE);
                   // get list of available regions for the repository
                   GetRepositoryRegionListCommand regionListCommand = new GetRepositoryRegionListCommand(connections);
                   regionListCommand.setRepositoryIdentifier(reposId);
                   try {
                        regionListCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
                   RegionProperties[] regions = regionListCommand.getRegions();
                   // create a user session
                   CreateUserSessionCommand sessionCommand = new CreateUserSessionCommand(connections);
                   sessionCommand.setRepositoryIdentifier(reposId);
                   sessionCommand.setDataRegion(regions[0]); // use the first region
                   try {
                        sessionCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
                   String sessionId = sessionCommand.getUserSession();
                   // authenticate the user session
                   String userName = "meter1";
                   String userPassword = "meter1";
                   AuthenticateUserSessionCommand authCommand = new AuthenticateUserSessionCommand(connections);
                   authCommand.setSession(sessionId);
                   authCommand.setUserName(userName);
                   authCommand.setUserPassword(userPassword);
                   try {
                        authCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
                   GetRepositorySchemaCommand cmd=new GetRepositorySchemaCommand(connections);
                   cmd.setSession(sessionId);
                   try{
                        cmd.execute();               
                   }catch(CommandException e){
                        System.out.println(e.getLocalizedMessage());
                   RepositorySchema repsch=cmd.getRepositorySchema();
                   // the main table, hard-coded
                   TableId mainTableId = new TableId(1);     
                   // specify the result definition (what to retrieve); in this example, nothing
                   ResultDefinition rd = new ResultDefinition(mainTableId);
                   // select all records
                   Search search = new com.sap.mdm.search.Search(mainTableId);
                   //get fields
                   GetFieldListCommand getFieldListCommand = new GetFieldListCommand(connections);
                   getFieldListCommand.setSession(sessionCommand.getUserSession());
                   getFieldListCommand.setTableId(mainTableId);
                   try {
                        getFieldListCommand.execute();
                   } catch (CommandException e) {
                        System.out.println(e);
                   FieldProperties[] lookupFields = getFieldListCommand.getFields();
                   // add fields to records to retrieve
                   rd.addSelectField(repsch.getFieldId("Products","Id"));
                   rd.addSelectField(repsch.getFieldId("Products","MaterialNumber"));                              
                   // retrieve the records
                   RetrieveLimitedRecordsCommand limitingCommand = new RetrieveLimitedRecordsCommand(connections);
                   limitingCommand.setSession(sessionId);
                   limitingCommand.setResultDefinition(rd);
                   limitingCommand.setSearch(search);
                   //limitingCommand.setPageSize(2000);
                   try {
                        limitingCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
                   System.out.println("Record count is " + limitingCommand.getRecords().getCount()+"\n");
                   Record[] records=limitingCommand.getRecords().getRecords();
    System.out.println(records[0].getFieldValue(repsch.getFieldId("Products","Id"))+ " \n");
    System.out.println(records[0].getFieldValue(repsch.getFieldId("Products","MaterialNumber"))+ " \n");
                   // finally destroy the session
                   DestroySessionCommand destroySessionCommand = new DestroySessionCommand(connections);
                   destroySessionCommand.setSession(sessionId);
                   try {
                        destroySessionCommand.execute();
                   } catch (CommandException e) {
                        e.printStackTrace();
                        return;
              } catch (Exception e) {
                   System.out.println(e.getLocalizedMessage());
                   e.printStackTrace();
    Kindly let me know where i am going wrong. MaterialNumber field is a TEXT not a lookup table field.  Above fields are from the main table.
    Thanks,
    Raags

    Hi Friends,
    I got the solution. It was the error because of not having a the below statement.
    limitingCommand.setPageSize(1);
    As i havent used that statement, it was trying to get 1000 records, and i dont know exactly what makes this to get that error. Anyhow., As i want to use for updation, i cn live with one record.
    Thanks,
    Raags

  • Report query not returning the field value from external table

    hi
    I have an issue regarding reports. I have a query having 4 fields from external table and remaining from db tables. the report query returns all the fields from the db tables and only 2 fields from external table. but the same query if I tried in plsql developer it returns all the fields values.
    Can anyone please help me in this issue.
    Thanks and Regards
    kk

    Duplicate post?
    value not displaying in report whereas it returns in plsql developer
    value not displaying in report whereas it returns in plsql developer
    Please log a SR if you do not get any reply to your thread instead of creating new one.
    Thanks,
    Hussein

  • Default value from another table in dummy field on a portal form ..

    A form based on a table :
    id
    name
    xx_id
    I created a dummyfield on the form in which i would like the
    name corresponding to xx_id -> I would like to fetch a value
    from another tabel into a dummy field.
    thanx
    Trine Hindsholm

    I could do this task by creating the form manually - is there anyway I can modify the insert for a form created by the wizard?

  • Passing value from non-table textbox to based one

    Hi all!
    In a master detail form I have a non-table textbox in wich I want the user writte a n: of days,and automatic I want the sysdate increased the n: of days written, in another texbox from a table, that will be insert in the table, but I don4t know how can I do it, There4s an easy way to do it as the "when validate item" trigger in Developer Forms or somtehing like that? I4m thinking in make some PL/SQL code in the ". . before processing the form"
    Any help will be appreciated
    Thks in advance

    Hi,
    This type of tasks could be done from Javascript only, you may take a look at the following post:
    Topic: Referencing form field values in javascript
    http://technet.oracle.com:89/ubb/Forum81/HTML/000073.html
    The topic is kind of lengthy - look for JS function getField().
    Thanks,
    Dmitry

  • To find a field value from a table

    i want to get some field value from a data dictionary table.
    for eg Tragr from Mara. in Fields list it shows the field is in Mara table. but in content screen it does not showing the field at all. Actually of 220 fields of mara table only 99 fields are shown. how to view all the fields of a particular field. is there any setting is there.

    Hi Deva,
    When we execute any table by default SAP will display only few columns.(90 i guess) If we want to view all the columns of the table then do like this after executing the table i.e in ur table output.
    Menupath->Settings->User parameters->choose radiobotton
    Grid display Here u can see all the fields.
    If u don't want to see all the fields then do like this.
    Settings->listformat->Choosefields->Deselectall->Select what
    ever fields u want using the search button in bottom and press enter. It will display only selected fields.
    Some times we will come up with strange situations.
    EG: In the field list some field will be there. But if u select that field from that table in select query it will give u syntax error saying field xxx does't exist in table yyy. This field is nothing but text table field. If u want to select this field then u have to select it from the text table. U can find the text table exist for some table or not in
    Menupath->goto->text table. (In this case makt is text table for mara)
    Just check below code for ur reference.
    DATA: wa_mara TYPE  mara.
    SELECT SINGLE * INTO wa_mara FROM MARA .
    Here if u go to mara table u have field MAKTX But above select will not return the field maktx even we are refering wa_mara to data base table mara. We have to explicitly select it from MAKT.
    Hope this clarified all ur doubts.
    Thanks,
    Vinod.

  • How can i get first four highest values from a table

    suppose we have salary table and we need first 4 highest salaries in one query or attemp

    Or use an analytic:
    SQL> select ename, sal from emp;
    ENAME                       SAL
    SMITH                       800
    ALLEN                      1600
    WARD                       1250
    JONES                      2975
    MARTIN                     1250
    BLAKE                      2850
    CLARK                      2450
    SCOTT                      3000
    KING                       5000
    TURNER                     1500
    ADAMS                      1100
    JAMES                       950
    FORD                       3000
    MILLER                     1300
    14 rows selected.
    SQL> select ename, sal
      2  from
      3  (
      4     select ename
      5           ,sal
      6           ,dense_rank() over (order by sal desc) dr
      7     from   emp
      8  )
      9  where dr <= 4;
    ENAME                       SAL
    KING                       5000
    SCOTT                      3000
    FORD                       3000
    JONES                      2975
    BLAKE                      2850

  • Dynamic Column Names from one table and its corresponding values from another table

    I have 2 tables. First tables gives the specification if a column is required or not. we have the 2nd table with the same column name where we provide the actual values.
    I want to select all the required columns from the 1st table and retrieve the values for those from the 2nd table. Both this i want to achieve in a single select statement.

    This wil require a dynamic Query with a Pivot
    DECLARE @ColsPivot as VARCHAR(MAX);
    DECLARE @Query  AS VARCHAR(MAX);
    1. Retreive the ID for all required field
    SET @ColsPivot = (SELECT STUFF((SELECT  ',' + quotename(CAST([RequirementID] as varchar(3))) FROM [dbo].[Requirement] WHERE required=1 FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)') ,1,1,''));
    This will give you : [1],[2],[3],[8],[9],[14] for exemple.
    2. Build your Query
    SET @Query ='SELECT ClientID,'+@ColsPivot+''
        FROM (
            SELECT [ClientID],[RequirementID],[Value]
            FROM dbo.RequirementValue
            WHERE ClientID=@CliendID --Optional SP parameter
        )src
              PIVOT(
                MAX(Value)
                for [RequirementID] in ('+@ColsPivot+')
        ) p';
    3. Exec(@Query);

  • Function module to fetch SOBID field value from hrp1001 table

    Hi,
    Is there any function module, to fetch the value of the SOBID field from hrp1001 table by passing RSIGN,RELAT,OTYPE,SCLAS field values to that function module.
    Regards,
    Shalini.

    Hi Sikindar,
    I am not able to find these function modules.I am getting message as function module not found.Please let me know is there any other function module.
    Thanks,
    Shalini.

  • Selecting fields those which contains values from a table of one record

    hello
    Is it possible to select the fields of a table having not null values for a single record. The record contains 25 fields like
    FieldNames are Field1, Field2......Field25
    if Field1 and Field12 has some not null values and other fields contain null values, is it possible to retrieve these two fields...
    Thanks for replies..
    Rinson

    Why wouldn't it be? What have you tried? What were your actual results vs. your expected results?

  • Get the values from a table comparing fields of different data types

    Hi Experts,
    I want to fetch AFVC-AUFPL and AFVC- APLZL by passing WBS element from a ztable.
    select aufpl aplzl
      from  afvc
      into TABLE gt_afvc
      FOR ALL ENTRIES IN gt_boq
      where projn = gt_boq-posid.
    AFVC-PROJN - NUMC 8  (WBC ELEMENT)
    ZTABLE-POSID - CHAR24 (WBC ELEMENT)
    How to get aufpl and aplzl by comparing those 2?
    Regards
    Mani

    WBS element does have an conversion routine at the domain level. So sometimes you work with one format (8 digits) and sometimes with 24 digits.
    You use FMs
    CONVERSION_EXIT_ABPSP_INPUT
    CONVERSION_EXIT_ABPSP_OUTPUT
    to convert between values. Do your conversion before your select and do not forget to use a large enough data element for the field, which gets the 24-digits long value of the field.

  • How to pass the values from internal table to field groups

    hi all,
    how can i pass the internal  table values to field groups?
    already field groups are holding some values.. INSERT STATEMENT IS NOT WORKING as it is ovewriting the existing values..
    Use full answers will be rewared.
    Thanks.
    Moderator message - duplicate post locked
    Edited by: Rob Burbank on Jun 23, 2009 9:51 AM

    Hi,
    You can use INSERT statement to put a work area of an Internal table in Field-group
    and use Extract to get info out of it.
    Hope it helps,
    Raj

  • How to take value from one table to another table?

    Hi,
    My requirement is,I have two tables those are Document and Transaction both having one common column "Docseriescode"
    in Document table already having different records with "Docseriescode".
    when i am going  to transaction table for adding records,  in "docseriescode" column automatically generate perticular Docseriescode
    eg:
    i have one "Cargo" record in Document Table with code CCN
    when i am going to Transactional table for inserting in this Docseriescode columns automatically get "CCN" code and get a drop down value
    anybody help me?

    Your use case is a simple master detail relation between two tables. If you don't have foreign keys in the db you can build the associations and links yourself in jdev. Doing this enables you to create  detail rows from a master row where the pk of the master is automatically set in the fk of the detail.
    Here you find more info http://docs.oracle.com/cd/E35521_01/web.111230/e16182/bcquerying.htm#ADFFD292 and Displaying Master-Detail Data - 11g Release 2 (11.1.2.3.0)
    and a sample Master Detail Insert/Delete Sample | JDev &amp;amp; ADF Goodies
    Timo
    Message was edited by: TimoHahn

Maybe you are looking for

  • A1260 2.5GHz, iSight not working

    I have a MacBook Pro, 15", A1260, 2.5GHz. The iSight camera does not work. I have tried all 4 of the suggestions in http://support.apple.com/kb/HT2090. None work. The camera is not listed as a USB device in System Profiler. I've disassembled the MBP

  • What Requirement Needed To Sell Application on iPhone?

    Hi, guys. Greetings. I want to ask help about requirement needed to sell application on iPhone. So if there's any kind person that can helped me out here, i would like to say thank you very much and may God repay your good deeds. Right now me and my

  • Installed real time ETS will not boot

    Hi, I have verified that the target system is compatible. MAX sees the unconfigured system OK. Using DHCP to get TCP to work is OK after target is rebooted. Software installation looks like it went OK. Rebooting the RT system gives the following erro

  • Counterfeit?!

    Midway through installing my CS6 web premium, Student and Teacher edition, the disc was spit out along with a message saying the software appears to be counterfeit. I just perchased it from Amazon new for 450 ish dollars! The box and packaging all se

  • Po with reff to contract

    hi, by what t code and how p.o. is created refference to contract. contract is just a memo for long term aggreement.so in SAP can we create p.o. that shows respective contract. Thanks in advance sumit bisla