Default sales org on selection screen using set and get parameter!!

Hi,
I need to default value on selection screen using SET n GET parameter...logic to be used should be:
Sales Organisation:
This field should be filled by default using the user parameter id VKO. (using sentence GET PARAMETER and SET PARAMETER)...
Hope i need to write the code in initialisation and what shud b the content?
Regards
Gunjan

hi,
TABLES <table name>.
  SET PARAMETER ID VKO FIELD <tablename-fieldname>.
call transaction 'zxx'.
try this sample program,
REPORT BOOKINGS NO STANDARD PAGE HEADING.
TABLES SBOOK.
START-OF-SELECTION.
  WRITE: 'Select a booking',
  SKIP.
GET SBOOK.
  WRITE: SBOOK-CARRID, SBOOK-CONNID,
         SBOOK-FLDATE, SBOOK-BOOKID.
  HIDE:  SBOOK-CARRID, SBOOK-CONNID,
         SBOOK-FLDATE, SBOOK-BOOKID.
AT LINE-SELECTION.
  SET PARAMETER ID: 'CAR' FIELD SBOOK-CARRID,
                    'CON' FIELD SBOOK-CONNID,
                    'DAY' FIELD SBOOK-FLDATE,
                    'BOK' FIELD SBOOK-BOOKID.
  CALL TRANSACTION 'BOOK'.
regards,
siva
Message was edited by:
        Shan

Similar Messages

  • How to use  SET and GET parameter commands ?

    Explain these two giving an example?As which is used for what?

    Hi Albert,
             SAP allows you to make use of SPA/GPA technique to fill the input fields of a called transaction with data from the calling program.SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETER statements.
    To fill one, use:
    SET PARAMETER ID <pid> FIELD <f>.
    This statement saves the contents of field <f> under the ID <pid> in the SAP memory. The code <pid> can be up to 20 characters long. If there was already a value stored under <pid>, this statement overwrites it. If the ID <pid> does not exist, double-click <pid> in the ABAP Editor to create a new parameter object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID <pid> FIELD <f>.
    This statement fills the value stored under the ID <pid> into the variable <f>. If the system does not find a value for <pid> in the SAP memory, it sets SY-SUBRC to 4, otherwise to 0.
    To fill the initial screen of a program using SPA/GPA parameters, you normally only need the SET PARAMETER statement.
    The relevant fields must each be linked to an SPA/GPA parameter.
    On a selection screen, you link fields to parameters using the MEMORY ID addition in the PARAMETERS or SELECT-OPTIONS statement. If you specify an SPA/GPA parameter ID when you declare a parameter or selection option, the corresponding input field is linked to that input field.
    On a screen, you link fields to parameters in the Screen Painter. When you define the field attributes of an input field, you can enter the name of an SPA/GPA parameter in the Parameter ID field in the screen attributes. The SET parameter and GET parameter checkboxes allow you to specify whether the field should be filled from the corresponding SPA/GPA parameter in the PBO event, and whether the SPA/GPA parameter should be filled with the value from the screen in the PAI event.
    When an input field is linked to an SPA/GPA parameter, it is initialized with the current value of the parameter each time the screen is displayed. This is the reason why fields on screens in the R/3 System often already contain values when you call them more than once.
    When you call programs, you can use SPA/GPA parameters with no additional programming overhead if, for example, you need to fill obligatory fields on the initial screen of the called program. The system simply transfers the values from the parameters into the input fields of the called program.
    However, you can control the contents of the parameters from your program by using the SET PARAMETER statement before the actual program call. This technique is particularly useful if you want to skip the initial screen of the called program and that screen contains obligatory fields.
    If you want to set SPA/GPA parameters before a program call, you need to know which parameters are linked to which fields on the initial screen. A simple way of doing this is to start the program that you want to call, place the cursor on the input fields, and choose F1 followed by Technical info. The Parameter ID field contains the name of the corresponding SPA/GPA parameter. Alternatively, you can look at the screen definition in the Screen Painter.
    The SPA/GPA parameter for the input field Company has the ID CAR. Use this method to find the IDs CON, DAY, and BOK for the other input fields.
    The following executable program is connected to the logical database F1S and calls an update transaction:
    REPORT BOOKINGS NO STANDARD PAGE HEADING.
    TABLES SBOOK.
    START-OF-SELECTION.
      WRITE: 'Select a booking',
      SKIP.
    GET SBOOK.
      WRITE: SBOOK-CARRID, SBOOK-CONNID,
             SBOOK-FLDATE, SBOOK-BOOKID.
      HIDE:  SBOOK-CARRID, SBOOK-CONNID,
             SBOOK-FLDATE, SBOOK-BOOKID.
    AT LINE-SELECTION.
      SET PARAMETER ID: 'CAR' FIELD SBOOK-CARRID,
                        'CON' FIELD SBOOK-CONNID,
                        'DAY' FIELD SBOOK-FLDATE,
                        'BOK' FIELD SBOOK-BOOKID.
      CALL TRANSACTION 'BOOK'.
    The basic list of the program shows fields from the database table SBOOK according to the user entries on the selection screen. These data are also stored in the HIDE areas of each line.
    Cheers
    Nishanth

  • Set and get parameter id

    Hi,
    I need to store one variable value and I need to retrieve the same variable value in same program. For this I have written set and get parameter ids in the same program. It is working fine but if I log off the system and if I logon the system it is not working I mean before log off the variable is showing some value if I log on again that variable is showing empty. But I want to capture the field values after log off and log on also. Is there any other option can I use table?
    Please help me I will give points.
    Thanks.

    Hi
    SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens
    SAP global memory retains field value through out session.
    set parameter id 'MAT' field v_matnr.
    get parameter id 'MAT' field v_matnr.
    They are stored in table <b>TPARA</b>.
    ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data
    to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.
    ABAP memory is temporary and values are retained in same LUW.
    export itab to memory id 'TEST'.
    import itab from memory Id 'TEST'.
    Here itab should be declared of same type and length.
    http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
    ABAP Memmory & SAP Memmory
    http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    Regards
    Anji

  • Memory Problem with SEt and GET parameter

    hi,
    I m doing exits. I have one exit for importing and another one for changing parameter.
    SET PARAMETER exit code is ....
    *data:v_nba like eban-bsart,
           v_nbc like eban-bsart,
           v_nbo like eban-bsart.
           v_nbc = 'CAPX'.
           v_nbo = 'OPEX'.
           v_nba = 'OVH'.
    if im_data_new-werks is initial.
      if im_data_new-knttp is initial.
        if im_data_new-bsart = 'NBC' or im_data_new-bsart = 'SERC' or im_data_new-bsart = 'SERI'
           or im_data_new-bsart = 'SER' or im_data_new-bsart = 'SERM' or im_data_new-bsart = 'NBI'.
          set parameter id 'ZC1' field v_nbc.
        elseif im_data_new-bsart = 'NBO' or im_data_new-bsart = 'NBM' or im_data_new-bsart = 'SERO'.
          set parameter id 'ZC2' field v_nbo.
        elseif im_data_new-bsart = 'NBA' or im_data_new-bsart = 'SERA'.
          set parameter id 'ZC3' field  v_nba.
        endif.
      endif.
    endif. *
    and GET PARAMETER CODE IS....
      get parameter id 'ZC1' field c_fmderive-fund.
      get parameter id 'ZC2' field c_fmderive-fund.
      get parameter id 'ZC3' field c_fmderive-fund.
    FREE MEMORY ID 'ZC1'.
      FREE MEMORY ID 'ZC2'.
       FREE MEMORY ID 'ZC3'.
    In this code i m facing memory problem.
    It is not refreshing the memory every time.
    So plz give me proper solution.
    Its urgent.
    Thanks
    Ranveer

    Hi,
       I suppose you are trying to store some particular value in memory in one program and then retieve it in another.
    If so try using EXPORT data TO MEMORY ID 'ZC1'. and IMPORT data FROM MEMORY ID 'ZC1'.
    To use SET PARAMETER/GET PARAMETER the specified parameter name should be in table TPARA. Which I don't think is there in your case.
    Sample Code :
    Data declarations for the function codes to be transferred
    DATA : v_first  TYPE syucomm,
           v_second TYPE syucomm.
    CONSTANTS : c_memid TYPE char10 VALUE 'ZCCBPR1'.
    Move the function codes to the program varaibles
      v_first  = gv_bdt_fcode.
      v_second = sy-ucomm.
    Export the function codes to Memory ID
    EXPORT v_first
           v_second TO MEMORY ID c_memid.        "ZCCBPR1  --- Here you are sending the values to memory
    Then retrieve it.
    Retrieve the function codes from the Memory ID
      IMPORT v_first  TO v_fcode_1
             v_second TO v_fcode_2
      FROM MEMORY ID c_memid.                                   "ZCCBPR1
      FREE MEMORY ID c_memid.                                   "ZCCBPR1
    After reading the values from memory ID free them your problem should be solved.
    Thanks
    Barada
    Edited by: Baradakanta Swain on May 27, 2008 10:20 AM

  • Set and get parameter

    what is set parameter and get parameter ?  give me one example.

    Hi Pradeep,
    SET PARAMETER and GET PARAMETER, is mainly used when you are dealing with SAP MEMORY.
    Meaning - You have multiple sessions open. Now you want to access from variables declared locally in different sessions.
    You can use
    SET PARAMETER
    to assign the value to SAP Memory and using
    GET PARAMETER
    you can retreive the values assigned by previous statement in a different session.
    <b>Reward points for helpful answers</b>.
    Best Regards,
    Ram.

  • SAP Memory, Set and Get parameter

    Hi All,
         I am running two programs in background from program1
    Eq: Program1 --> Calls 2 programs
                              Program1_01.(First Program)
                              Program2_01(Second Program).
    Programs1 schedules Program1_01 and Program1_02 in background. These two programs are interdependent.
    Program1_01 extracts data, evaluates and sets the Flag. This Flag is exported to SAP Memory using
    Set parameter id 'p_id_flag' field Flag.
    Program1_02 checks for Program1_01 is completed in background. If complted gets the Flag value from SAP Memory using "Get paramter id 'p_id_flag' field Flag.
    When i checked this is not happning. When saw Flag in Program1_01 is set as Flag = 'X'.
    When I came and checked in Program1_02 after Get Parameter statement Falg value is SPACE.
    Cn hlp on this?

    Hi,
    The problem simply lies in fact that pid was provided in lowercase.
    Use:
    SET PARAMETER ID 'P_ID_FLAG' FIELD flag.
    GET PARAMETER ID 'P_ID_FLAG' FIELD flag.
    It works fine then.
    Note!
    Though SAP claims it is mandatory to create pid in TPARA table, in fact this is not required. Each time SET PARAMETER is executed, system checks if data object P_ID_FLAG was defined in SAP memory. If not it will automatically create it for us. But be carefull here. If there is such data object, its value will be overwritten.
    As for your last question, your statement (FREE MEMORY ....) is ok.
    Regards
    Marcin
    Edited by: Marcin Pciak on Jan 22, 2009 1:14 PM

  • How set and get parameter for a session of a portlet (Java)

    I would like get parameter and set parameter for a portlet in portal 9.02. This parameter must be availbale during the session of the portal.
    With Java Servlet
    // I retrieve my session
    HttpServletRequest httpreq = (HttpServletRequest)req;
    HttpServletResponse httpresp = (HttpServletResponse)resp;
    HttpSession session = httpreq.getSession();
    //And after i can get or set some parameter for this servlet
    //Example
    session.setAttribute("MyEmployeeNumber","600000");
    String id = (String)session.getAttribute("MyEmployeeNumber");
    // But with Portlet in portal, i can't do it.
    PortletRenderRequest pr= (PortletRenderRequest)httpreq.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    String sUser=pr.getUser().getName();
    ProviderSession session=pr.getSession();
    // But after if i want get or set a value in this session i have a internal error 500
    session.setAttribute("MyEmployeeNumber","600000");
    I would like my parameter is avalaible during a session for a user in each page of the portal, because my portlet is on each page.

    I have almost the same problem. I tried as you suggested, but it doesn't work yet.
    provider.xml
    <session>true</session>
    <passAllUrlParams>true</passAllUrlParams>
    My code in my jsp-portlet is
    <%@page contentType="text/html; charset=windows-1252"
    import="oracle.portal.provider.v2.render.PortletRenderRequest"
    import="oracle.portal.provider.v2.render.PortletRendererUtil"
    import="oracle.portal.provider.v2.http.HttpCommonConstants"
    import="oracle.portal.provider.v2.ParameterDefinition"
    import="oracle.portal.provider.v2.render.http.HttpPortletRendererUtil"
    %>
    <%@page session="true"%>
    <%
    PortletRenderRequest pReq = (PortletRenderRequest)request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    String valueSession = (String)pReq.getAttribute("sesion");
    if (valueSession != null) {
    pReq.setAttribute("session", "value1");
    out.println("<br>(1)valueSession != null");
    out.println("<br>(1)valueSession : " + pReq.getAttribute("session"));
    } else {
    pReq.setAttribute("session", "value2");
    out.println("<br>(2)valueSession == null");
    out.println("<br>(2)valueSession : " + pReq.getAttribute("session"));
    %>
    And i always get as result:
    (2)valueSession == null
    (2)valueSession : value2
    Even when i send values (post) at the same page or browsing between tabs:
    I check my provider registration and it has the value "once per session"
    I have portal 9.0.2.2.14
    Thanks

  • Set up new sales org/plant but without using Finance - is this possible?

    Hi,
    I was asked if the following is possible.
    Set up a new sales org/plant but without using Finance.
    It should be possible to create purchase order with goods in
    and sales orders with delivery and goods issue.
    But the invoice will be done in an external system.
    So, all what has to do with finance will be done in an external system
    also the goods in/goods out values.
    So the stock and stock movements should be visible in SAP, but the values for this stock
    will be posted in the external system manually.
    So the question is: Is it possible to set up a new sales org/plant
    but without using Finance?
    Thanks
    Regarfds
    Dieter

    Hi,
    really nobody has a hint?
    Most important: the stock movements should only consider only quantity no values?
    Isn´t there any way to say for a certain material it only consider quantities but no values?
    Regards
    Dieter

  • HR-ABAP: Defaulting Radio Button on Selection Screen of PNP LDB

    Hi all,
    I am using PNP LDB (Logical Database) for program which is used for Payroll Results.
    Now I have a requirement wherein it is necessary to select 'Up to today' as default on the selection screen.
    We are having 4.7C version of SAP. I tried following code in INITIALIZATION event:
    Initializing Selection Screen Data Selection Option to 'Up To Today'
    INITIALIZATION:
      MOVE:  'X'    TO    pnptimr4, " This is the option which I want as Default selection.
             space  TO    pnptimr1,
             space  TO    pnptimr2,
             space  TO    pnptimr3,
             space  TO    pnptimr5,
             space  TO    pnptimr6.
    But still I dont see this Radiobutton getting selected as Default selection while running the program.
    By Default it selects Option : 'Other Period' (pnptimr6).
    Any Idea how to resolve this ??
    Regards,
    Avinash

    hi...
    When the INITIALIZATION event occurs, you can set default values for the selection screen.
    The fields for the data selection are defined in structure QPPNP.
    Possible values for field PNPTIMED are:
    D     =      Today (key date)
    M     =     Current month
    Y     =     Current year
    P     =     To current date
    F     =     From today (from current date)
    The person selection fields are defined in include program DBPNPSEL. They are internal tables that must be filled using APPEND.
    so in intialization you have to write code as
    PNPTIMED : P.
    so up date will be defaulted in selection screen.
    award points if helpful.

  • How to hide input fields on selection screen using variant attribute

    Hello all,
    I want to know how to hide input fields on selection screen using variant attribute conpletely.
    As you know, when setting the attribute of variant "Hide field" checked, the field is temporarily hidden, but when clicking "All Selections(F7)" button on the selection screen, the fileds become appeared.
    I want to hide the field completely. Di you know how to do ?
    Thank you for your support.
    Regards,
    Hideki Kozai

    Use this attribute hide field and save the variant. Then create transaction for this program setting default variant for parameter Start with variant . The user who runs it will have it by defualt set.
    Otherwise
    in PBO simply use LOOP at screen and output = 0 for this field. This will ensure that field is invisible in any case.
    Regards
    Marcin

  • To create Dynamic Selection screen using Key Fields

    Hi All,
    We have a requirement where we want to create Dynamic selection screen using Key fileds of Z-table or any standard table.
    Please provide some solution if you have worked in this area.
    Thanks in Advance,
    Anand Raj Kuruba

    Hi,
    You can use the following statement.
    SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE|TABLE <node>.
    declares a node <node> of a logical database for dynamic selections in the selection include.
    To use the dynamic selections in the SELECT statements of the subroutine PUT_<node>, you must use the data object DYN_SEL. The data object DYN_SEL is automatically generated in the logical database program as follows:
    TYPE-POOLS RSDS.
    DATA DYN_SEL TYPE RSDS_TYPE.
    You do not have to program these lines yourself. The data object DYN_SEL is available in the database program but not in a connected executable program.
    The type RSDS_TYPE of the data object is defined in the type group RSDS as follows:
    TYPE-POOL RSDS.
    WHERE-clauses ------------------------------
    TYPES: RSDS_WHERE_TAB LIKE RSDSWHERE OCCURS 5.
    TYPES: BEGIN OF RSDS_WHERE,
    TABLENAME LIKE RSDSTABS-PRIM_TAB,
    WHERE_TAB TYPE RSDS_WHERE_TAB,
    END OF RSDS_WHERE.
    TYPES: RSDS_TWHERE TYPE RSDS_WHERE OCCURS 5.
    Expressions Polish notation ---------------
    TYPES: RSDS_EXPR_TAB LIKE RSDSEXPR OCCURS 10.
    TYPES: BEGIN OF RSDS_EXPR,
    TABLENAME LIKE RSDSTABS-PRIM_TAB,
    EXPR_TAB TYPE RSDS_EXPR_TAB,
    END OF RSDS_EXPR.
    TYPES: RSDS_TEXPR TYPE RSDS_EXPR OCCURS 10.
    Selections as RANGES-tables -----------------
    TYPES: RSDS_SELOPT_T LIKE RSDSSELOPT OCCURS 10.
    TYPES: BEGIN OF RSDS_FRANGE,
    FIELDNAME LIKE RSDSTABS-PRIM_FNAME,
    SELOPT_T TYPE RSDS_SELOPT_T,
    END OF RSDS_FRANGE.
    TYPES: RSDS_FRANGE_T TYPE RSDS_FRANGE OCCURS 10.
    TYPES: BEGIN OF RSDS_RANGE,
    TABLENAME LIKE RSDSTABS-PRIM_TAB,
    FRANGE_T TYPE RSDS_FRANGE_T,
    END OF RSDS_RANGE.
    TYPES: RSDS_TRANGE TYPE RSDS_RANGE OCCURS 10.
    Definition of RSDS_TYPE
    TYPES: BEGIN OF RSDS_TYPE,
    CLAUSES TYPE RSDS_TWHERE,
    TEXPR TYPE RSDS_TEXPR,
    TRANGE TYPE RSDS_TRANGE,
    END OF RSDS_TYPE.
    For more information, please check this link.
    http://help.sap.com/saphelp_nw04/helpdata/en/67/93b80914a911d2953c0000e8353423/content.htm
    Regards,
    Ferry Lianto

  • Skip the selection screen using BDCTAB call transaction

    Hi experts,
    I am using BDCTAB for call transaction SWI1 I need to skip the selection screen. Can you please tell me how to skip the selection screen using BDC call transaction?
    Thank you in advance.....

    hi,
    the first step is to pass some values to the selection screen, at least Date From and Date To; otherwise, it´ll take a long time. The second step is to emulate the Execute button, which is done with '/08'.
    PERFORM fields USING 'BDC_OKCODE'   '/08'.
    Third step is to catch the programme and screen number.

  • What is the default screen brightness setting and keyboard backlight brightness default setting, and how to you go back to default?

    What is the default screen brightness setting and keyboard backlight default setting? I just got a new Macbook Air and fiddled a lot with it, and now just want to know how to set the brightness levels back to default. Thanks everyone!

    Hey sberman,
    I maxed out the screen brightness before I clicked on "restore defaults" in system preferences> energy saver (which has to do with battery, not exactly screen brightness) to see if the screen went back to a "normal" brightness level, but it didn't. I don't think it restored the brightness to default..

  • Error Message in selection screen Status bar is getting truncated

    Hi Guys,
    Error Message in selection screen Staus bar is getting truncated (full message is not getting displayed).... can anybody tell me how to reslove this

    Hi
    Maimum we can give the error message length is 50 char. If you give more than that it will get truncated.
    What you can do this split 50 and 50 like that you can give 200 chnars.
    Data : Text1 type char50
              Text2 type char50
    If sy-surc ne 0.
    Message Text1 Text2  TYPE "E'' or 'S'
    endif.

  • Who can tell me how to use ni-imaq functions imgSessionSerialWrite and imgSessionSerialRead to set and get my carema attribute?

    Who can tell me how to use ni-imaq functions imgSessionSerialFlash,imgSessionSerialWrite and imgSessionSerialRead to set and get my carema attribute?
    My camera is duncantech ms3100 and the frame grabber is pci-1428.I use ni-imaq2.6.When I use these functions,it tell me error -1074397163(IMG_ERR_BINT:Bad interface) .

    I have the same problem on my IPAD 2. One calender that i cant delete or find any settings for... Its just in the calender app under diffrent calenders.  how do i delete it?

Maybe you are looking for

  • How best to move user folder to a Mac Mini + external drive

    I am streamlining my desktop computer setup. Whereas before I was using a PowerMac G5 as my primary desktop computer, I realize I am using my MacBook Pro more often, so in the interests of conserving space, I will be switching over to a Mac Mini conn

  • Can I use BOTH IE & FF and retain the shortcuts to both to use at will?

    Can I use BOTH IE & FF and retain the shortcuts to both to use at will? I can download FF ok and use for a day or so along with IE, but after that I start to get messages from Windows saying IE is not my default browser and do I want to make it the d

  • How do I remove multiple duplicate photos in a catalog PSE 10

    I have multiple duplicate photos in my Photoshop Element 10 catalog - I have run across the compare a photo tutorials but I have possiblely some 200+ photos that are duplicates. Has anyone come across a simpler way to remove duplicate photos?

  • Purchase Order from a Contract in error

    Hi to everybody, we've implemented an SRM extended classic scenario with SAP R/3 as the back-end system. Sometimes, when I create an order from a contract, the transmission of that document to the R/3 system fails due to a "different kind of material

  • Error message whilst syncing

    Cannot sync my i-pod........every time I try it tells me there is an unknown error(-69). V. frustrating, anybody have a solution?