How to access BPS variables in ABAP Exit Function

Hi Experts,
I am using a Exit Function. My BPS variables contain multiple values. I want to trasfer then (may be directly read) to an internal table from where I can loop over then.
Could you please suggest me the code for this?
Points will be awarded.
Thanks in advance,
Shiwesh

Did you try using the FMs API_SEMBPS_VARIABLE_GETDETAIL or Z_VARIABLE_GET_DETAIL for this?

Similar Messages

  • BPS Variables of Type Exit (How To Document)

    Hello,
    I'm trying to restrict entries for (say) variable #2, based on the selection of variable #1. 
    I've just realised characteristic relationships cannot be used and need to use a user exit.  I've gone through the "How To" on BPS Variables of Type Exit and have gotten the function modules to working properly. 
    However when the function module attempts to pass the data to BPS Variable #2, BPS gives an ERROR saying that in order to write new values into variable #2, the variable must have a replacement path "USER DEFINED VALUES".
    However this is not possible as the replacement path must be set to "USER EXIT" so the function module can be activated.
    The only way around this is to tell the function module which BPS Variable it should choose to write the data to, if so does anyone the ABAP to store values into a BPS Variable.
    Right now would appreciate any comment on this.
    Kind regards,
    Marinos

    Hi Marc,
    Yes, the How To paper answers my problem, and when I run the program via se37 the correct variable selections are being populated in table ETO_CHARSEL.  However when values are passed to the BPS Variable, the first information message read "The Conditions were Adapted"  but no values are passed to the variable.  Then a second error message "Entry not possible, var does not have replacement type user-spec vals."  This seems to be a conundrum as the variable needs to be set as user-exit.
    Any thoughts?
    Marinos
    My Z_SIMPLE_RELATION code is
    FUNCTION Z_SIMPLE_RELATION.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_AREA) TYPE  UPC_Y_AREA
    *"     VALUE(I_VARIABLE) TYPE  UPC_Y_VARIABLE
    *"     VALUE(I_CHANM) TYPE  UPC_Y_CHANM
    *"     VALUE(ITO_CHANM) TYPE  UPC_YTO_CHA
    *"  EXPORTING
    *"     VALUE(ETO_CHARSEL) TYPE  UPC_YTO_CHARSEL
    Change constant according to your needs
    TABLES: /BIC/MTASSTCAT.
    CONSTANTS:
    l_source_var TYPE upc_y_variable VALUE 'TCAPASST',
    l_source_area TYPE upc_y_area VALUE 'TCAP001P',
    l_use_restricted_values TYPE boole-boole VALUE 'X',
    l_buffer_call TYPE boole-boole VALUE 'X'.
    DATA:
    l_subrc LIKE sy-subrc,
    ls_return LIKE bapiret2,
    l_type LIKE upc_var-vartype,
    lto_varsel_all TYPE upc_yto_charsel,
    lto_varsel TYPE upc_yto_charsel,
    lto_var TYPE upc_yto_charsel,
    lt_chavl TYPE /bic/PTASSTCAT occurs 0,
    ls_chavl like line of lt_chavl,
    lto_chanm type upc_yto_cha.
    read source value
    CALL FUNCTION 'Z_VARIABLE_GET_DETAIL'
    EXPORTING
    i_area = l_source_area
    i_variable = l_source_var
    i_buffer = l_buffer_call
    IMPORTING
    e_subrc = l_subrc
    es_return = ls_return
    e_type = l_type
    eto_varsel_all = lto_varsel_all
    eto_varsel = lto_varsel
    eto_chanm = lto_chanm.
    IF l_subrc <> 0.
    MESSAGE i136(upc_fw) WITH l_source_var.
    Values of variable &1 cannot be determined
    EXIT.
    ENDIF.
    now, you are free to determine the logic on how to
    derive the values based on the source values.
    Example 1: determine the next year
    Assumptions:
    - we have only a single year in the selection
    - the variable is of type characteristic
    DATA: ls_varsel TYPE upc_ys_charsel,
    l_next_year(4) TYPE n,
    l_entries TYPE i.
    We have a single value for the year and only one characteristic
    => our value is stored in the first line
    IF l_use_restricted_values IS INITIAL.
    lto_var = lto_varsel_all.
    ELSE.
    lto_var = lto_varsel.
    ENDIF.
    READ TABLE lto_var INTO ls_varsel INDEX 1.
    check prerequisites:
    - record found?
    IF sy-subrc <> 0.
    MESSAGE i147(upc_fw) WITH l_source_var.
    Variable &1 does not contain any values
    EXIT.
    ENDIF.
    - exactly one record and characteristic?
    DESCRIBE TABLE lto_var LINES l_entries.
    IF l_entries <> 1.
    MESSAGE i534(upc) WITH l_source_var.
    Variable &1 must be restricted to a value
    EXIT.
    ENDIF.
    SELECT * FROM /BIC/PTASSTCAT INTO TABLE lt_chavl
      WHERE asset_clas = ls_varsel-low.
      if sy-subrc <> 0.
        MESSAGE e026(upc) WITH ls_varsel-low '0ASSET_CLAS'.
    Attribute value not found
      exit.
    endif.
    ls_varsel-seqno = '0000'.
    ls_varsel-chanm = '/BIC/TASSTCAT'.
    LOOP AT lt_chavl INTO ls_chavl.
    ls_varsel-seqno = ls_varsel-seqno + 1.
    ls_varsel-low = ls_chavl-/BIC/TASSTCAT.
    APPEND ls_varsel TO eto_charsel.
    ENDLOOP.
    ENDFUNCTION.

  • How To ... BPS Variables of type exit

    Dear All,
    I am reading the How To ... BPS Variables of type exit sap document.
    On chapter 3.3.1 step 10 to 12 it's explain how to populated variable, and check user exit action to display one value in fonction of an other one.
    Unfortunately on step 11, when I click on F4 I got nothing. I can't enter value.
    Would you please let me know if the system should be configured in a particular way ?
    Thanks

    Hi Luminy,
    If you have followed Step 2 with 2002 then you would have got that at f4
    regards
    Happy Tony
    <b>Points == Thanks</b>

  • How can I access JSP variables from a JavaScript function in a JSP page?

    Respected sir
    How can I access JSP variables from a JavaScript function in a JSP page?
    Thanx

    You may be get some help from the code below.
    <%
        String str="str";
    %>
    <script>
        function accessVar(){
           var varStr='<%=str%>';
           alert(varStr);// here will diplay 'str'
    </script>

  • How to access system variables in Script Component in data flow task in SSIS

    Hi,
    I am new to SSIS. Can someone tell me how to access system variable in Script Component in SSIS using C# code.
    Thanks

    You can use the System.Environment.GetEnvironmentVariable(...) to read the variables. An example is here:
    http://msdn.microsoft.com/en-us/library/y6k3c7b0.aspx
    Vikash Kumar Singh || www.singhvikash.in

  • How to access _global variables in different domain

    hi
    i am loading a swf in local and this has to be communicate the swf which was in the server(different domain). using the system.security.allowdomail i can access the variables, but i can't able to access _global variable.
    Pls tell how to access _global variable in different domain
    Thanks in advance
    @flash

    Ganesh,
    It should work the way you mentioned it. I don't see why it
    didn't unless there is a spelling mistake or something. If there
    is you should have a got an error message. :-)
    I actually don't recommend using globals at all, I would rather
    use a PL\SQL Package Specification to define Global Variable.
    These variables are valid for the duration of the Session and
    they are restricted to Char(255) limit. It reduces the number of
    mistakes when converting dates and Such. It also forces the
    developers to place all the globals in one place instead of
    multiple places. Read Feurstein's book on PL\SQL Programming for
    more details.
    Sunil
    MS Ganesh (guest) wrote:
    : Hi Steve,
    : I know how to assign values to global variables.
    : I did the following
    : Form Name : FIRST_FORM
    : :global.group_id := 'SUPERVISOR'
    : call_form('SECOND_FORM');
    : In Second Form
    : When New Form Instance
    : Message(:global.group_id);
    : No message is displayed.
    : Please explain to me the steps in detail.
    : Thanks in advance.
    : Bye
    : MS GANESH
    : Steve (guest) wrote:
    : : Just assign value to global variable i.e.
    : : :global.foo := 'anything'; or
    : : COPY('anything', 'global.foo');
    : : to remove global variable
    : : ERASE('global.foo');
    : : Note: global variables are always VARCHAR2(255);
    : : MS Ganesh (guest) wrote:
    : : : Dear OTN Members,
    : : : I would like to pass values between forms,
    : : : I know it is possible to do it by using Parameters.
    : : : But I would like to know how to use global variables to
    : : : accomplish the same task.
    : : : Thanks in Advance.
    : : : Bye
    : : : MS Ganesh
    null

  • Access payroll variables from custom payroll function

    Hi All,
    I have a requirement to create a custom payroll function that returns some data from IT0006 and IT0032.
    I have written the code in PCBURZDE0, as the payroll is for Germany, it does read the data needed.
    My question is, how I can access the variables specified for the function in the payroll schema.
    Schema definition in PE01
    Zeile     Fkt        Par1  Par2 Par3 Par4 D Text
    000010 BLOCK BEG                              Fahrradleasing
    000020 _DFRD &PRO GEN
    000030 BLOCK END
    If I double-click Par1 for function _DFRD (&PRO), then I see he two variables I should write the data to:
    Zeile  VarArg. FZ T Operation        Operation Operation Operation Operation Operation *
           -------------+---------+------------------+---------+---------+---------+---------+
    000010                  AMT= PKWWRPRINT     *
    000020           1     AMT= ENTKM  PRINT
    So, as I understand I should write the two variables PKWWR and ENTKM, I have the values in the function code, but I don't know how to access these variables.
    Thanks for your help!
    Gyöngyi

    1 - PIT is a Function that is used in the Payroll Schema to "Process the Internal Table".
    2 - You mentioned that you had created a Custom Function to read IT0006 and IT0032, and I only suggested to you that you could have that Custom Function generate Information WageTypes and save them in the Input Table where they could then be used in PCRs.
    3 - I did not mention that you can read only one value through operation AMT, but I mentioned that using AMT=xxxxxx followed by AMT=yyyyyy means that the first statement is useless.  On the other hand, using AMT=xxxxxx followed by AMT+yyyyyy and AMT+zzzzzz will result in the amount being the total of the 3 values.
    4 - Please read some documents on Schemas, Functions and PCRs, such as in the Wikis on this site, and study your current Payroll Schema, it's sub-schemas, it's functions and the operations in it's PCRs.  Note that t-code pe01, pe02 and pe04 can be used to find some documentation on functions and operations.

  • Inserting records in the ABAP exit function (hashed table XTH_DATA)

    Hi all,
    I want to add records in the logic of an ABAP exit function. Due table XTH_DATA being a hashed table the normal insert or append is not possible.
    My logic MUST move the data to a temporary table (ITAB) where the logic is executed (modifying KYF values and creating new records.
    In order to quickly get to a result I have solved the problem in an awful way through hardcoding the structure of ITAB to be the same as XTH_DATA is in this specific case.
    I would like to know if someone has an exmaple of a nice way to dynamically create an ITAB with the structure of XTH_DATA?
    At the end it should be possible to do: XTH_DATA[] = itab[].
    Greetings,
    Martin

    Hi Martin,
    the only way I know is to solve this problem with sort of pointers, field symbols. Roughly spoken the idea is you lookup the structure of xth_data in table dd03l. you define an internal table of type any. you loop around your xth_data table and assign the value of each column of xth_table to your internal table. then you do your your adding. Hopefully then you can simply assign xth_data to your itab.
    regards,
    Jürgen

  • How to access a variable from within a symbol.

    How do I access a variable set outside a symbol from within that symbol?
    Thanks

    If you set a variable on stage ,say
    sym.setVariable("stageVariable", "I am stage variable");
    You can access it from within  a symbol using :
    var myVariable = sym.getComposition().getStage().getVariable("stageVariable");
    Basically you need to get handle to the symbol in which the variable is defined.

  • How to access a variable in if clause?

    Hi Friends,
    I have declared a varialbe like this
    <?xdoxslt:set_variable($_XDOCTX, ’cnt’, 10)?>
    Now if i want to access the variable in "if" clause ,something like
    <if:cnt=10?>
    How can i access it?

    Hi,
    try the following
    <?if:xdoxslt:get_variable($_XDOCTX, 'cnt')= 10?>
    Your logic goes here
    <?end if?>
    regards
    Rupesh

  • How to access Workflow variables in Form Designer?

    Hello,
    I am wanting to set certain subforms to readonly depending on which part of the workflow the form is currently on. I already have the JavaScript code working to set the subform fields to readonly, but now I cannot figure out how to trigger this and where do I keep a variable to keep track of which part of the workflow I am currently in.
    I assume I will have a variable in the workflow itself and then I can use the Set Value QPAC to change the variable for each workflow step before it goes to the User QPAC, but what about within the form? I don't understand how the form javascript will know to execute, so how does my workflow "talk" to the form to set these fields to readonly?
    Right now the JavaScript code is sitting in the root::initialize part of the form. I was assuming I could have something like "if my workflow variable is equal to XX then set this subform to read only". But, how do I access my workflow variable in the form designer?
    Also, since I have digital signatures, I am having to pass all the form data in document variables, will this affect how I need to do this? I was also thinking of possibly accessing/setting a hidden field in the form, but thought the above way may be better.
    I hope that made sense!
    Thank you,
    Jennifer

    To follow-up, I spoke with Adobe support this morning and they said that I cannot access Workflow variables within Designer (besides those Workflow variables that are already provided).
    He mentioned that if I use the hidden fields, that I would need to Render the form each time before going to the User to trigger this to happen. So, I am not sure what I will do just yet. I probably not worry about making the fields readonly for the time being; it was a little extra thought I had and isn't required for our process.
    Thank you,
    Jennifer

  • How to access Websphere variables using java

    Hi
    I want to access Websphere variables using java.
    Any help is appreciated!!
    Thanks
    P

    WebSphere Application Server has a bunch environmental variables such as log locations. These are held at the "server", "node", and "cell" level.
    To access them, you have to get the right context. Something like this, I believe...
    InitialContext initialContext = new InitialContext();
    initialContext.lookup("foo:bar/baz/blah"); //correct context hereGo to the IBM website for WAS and do a search on namespace bindings. That should give you some more information.
    Good luck.

  • Copy Function using ABAP Exit Function

    Hi Experts,
    I am trying to write a copy function using Exit Function (ABAP Code) for BPS-BW. Can anyone suggest me any how-to document provided by SAP for this purpose which mentions the standard steps as well as exactly where to change if I want to change some characteristics values. e.g. I would like to copy from one submission to another, so I would like to change the values of the characteristics SUBMISSION.
    Points will be rewarded.
    Thanks in advance

    Or alternatively you can suggest me, what changes do I need to make in the following code if I want to append to the xth_data rather than replacing the values. I want to use it for copy purpose to want to add extra record in the cube with modified characteristic value rather than replacing the first with the second.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(I_AREA) TYPE  UPC_Y_AREA
    *"     REFERENCE(I_PLEVEL) TYPE  UPC_Y_PLEVEL
    *"     REFERENCE(I_METHOD) TYPE  UPC_Y_METHOD
    *"     REFERENCE(I_PARAM) TYPE  UPC_Y_PARAM
    *"     REFERENCE(I_PACKAGE) TYPE  UPC_Y_PACKAGE
    *"     REFERENCE(IT_EXITP) TYPE  UPF_YT_EXITP
    *"     REFERENCE(ITO_CHASEL) TYPE  UPC_YTO_CHASEL
    *"     REFERENCE(ITO_CHA) TYPE  UPC_YTO_CHA
    *"     REFERENCE(ITO_KYF) TYPE  UPC_YTO_KYF
    *"  EXPORTING
    *"     REFERENCE(ET_MESG) TYPE  UPC_YT_MESG
    *"  CHANGING
    *"     REFERENCE(XTH_DATA) TYPE  HASHED TABLE
    FIELD-SYMBOLS: <ls_data> TYPE ANY,
    <ch_struct> TYPE ANY,
    <cl_coorder> TYPE ANY.
    LOOP AT xth_data ASSIGNING <ls_data>.
    now <ls_data> points to a line of xth_data and can
    be used to reference each characteristic and/or
    keyfigure contained within.
    choose first structure which contains the characteristics.
    ASSIGN COMPONENT 'S_CHAS' OF STRUCTURE <ls_data> TO
    <ch_struct>.
    *Assign fields for value assignment in the record (ls_data)
    choose the characteristic '0COORDER' (use uppercase)
    ASSIGN COMPONENT '0COORDER' OF STRUCTURE <ch_struct> TO
    <cl_coorder>.
    *<cl_coorder> now contains the value of the internal order in the
    *record...
    *Make the changes in the values
    <cl_coorder> = '2'.
    When I am changing <cl_coorder> value to '2', I want it to get appened to xth_data as an additional record. That means the earlier <cl_coorder> value must be available in the cube as it is. What changes do I need to do in the code, please suggest.

  • How can I pass variable to eventdriven startElement() function?

    I am new to java and SAX. Could anybody tell me how to pass variable to eventdriven startElement function? I tried the following code but didn't work.
    public class ReadXmlSax extends DefaultHandler
    String elementName;
    String requestName;
    Vector v = new Vector();
    public Enumeration getAttribute(String sFileName, String sTagName, String sAttrName)
         Enumeration e;
         elementName=sTagName;
    requestName=sAttrName;
    File f = new File(sFileName);
    // Use an instance of ourselves as the SAX event handler
    DefaultHandler handler = new ReadXmlSax();
    // Use the default (non-validating) parser
    SAXParserFactory factory = SAXParserFactory.newInstance();
    try {
    // Parse the input
    SAXParser saxParser = factory.newSAXParser();
    saxParser.parse(f, handler);
    } catch (Throwable t) {
    t.printStackTrace();
    e = v.elements();
    return(e);
    //===========================================================
    // SAX DocumentHandler methods
    //===========================================================
    public void startDocument()
    throws SAXException
    public void endDocument()
    throws SAXException
    public void startElement(String namespaceURI,
    String sName, // simple name
    String qName, // qualified name
    Attributes attrs)
    throws SAXException
              //System.out.println(elementName);
              if (qName.equals(elementName))
                   String serverName = attrs.getValue("",requestName);
                   v.addElement(serverName);
    }

    I attached the main call the ReadXmlSax class. I added the
    "system.out.println(elementName);" in the function getAttribute and startElement as well. I got printing out "name" for elementName from function getAttribute but got others printing out "null" for elementName from function startElement. Any suggestions? thanks
    import java.io.*;
    import java.util.*;
    import ReadXmlSax;
    public class ReadElement
         public static void main(String argv[])
              ReadXmlSax r = new ReadXmlSax();
              Enumeration e = r.getAttribute("dre.xml","server","name");
              try{
                   while (e.hasMoreElements()) {
                   System.out.println((String)e.nextElement());}
              }catch(Throwable t){
                   t.printStackTrace();
    <strong>test</strong>

  • How to access a variable from one program to another (independent)

    Hi,
    My requirement is to use a variable(value) from one program(prog1) to another (prog2). how is it possible.
    Regards
    Arani Bhaskar

    Go for memory id .
    passing on values from one program to another program
    Program1
    EXPORT (variable) TO MEMORY ID 'LOC'.
    Program2
    IMPORT (variable) FROM MEMORY ID 'LOC'.
    LOC is the address , for more press f1 on export in abap editor.

Maybe you are looking for