Struts: passing a formbean from action to action

Hi,
I need to share the same bean between actions, not only by declaring it in all of them (already done, some validated, some not), but also if in action 1 i populate the bean (it's an insertion page), i want to pass it on to action 2 (who must display it).
How is that done in Struts?
Right now i put the populated bean into the session as an attribute after action 1, then i call the next action but even if the jsp associated with action has an html:form declaration and should look for the bean in the session, it doesn't.
It correctly pulls out the bean declared, but the values inserted in page1 are not there.
Can you help me? Please ask for any additional info..

I'm sorry I think I got it solved.. I can fill the bean with data from a form and retrieve the same bean from the next action, as long as it's in the request or in the session scope in both (same scope both actions).

Similar Messages

  • For struts - fwd the formbean in multiple JSP-action-JSPs

    Hello All,
    I know this is EJB forum but just I had one Qn so posting.
    I know you all must be doing struts as you are doing EJbs.
    I have following things and I want to HIT the DB only at last JSP
    submit click. How do I keep the formbeans ?
    READ EVERYTHING CAREFULLY ---------
    I can use session but, I want request or some similar way, or
    if there is any thing struts way,
    if all is not possible then I will go for session.
    Please don't tell me any request or action chaining because
    that is not something the case here and as it is highly discouraged
    I am NOT going to use that. its not that case anyways,
    JSP 1 - has a formbean 1
    - submit - goes to Action1
    ACTION1 - get the formBean1 ( I get the values1 here hahahaha)
    do any processing on formBean1 if needed
    set the formbean1 in request ( i am doing this )
    mapping.findfwd("success") - to JSP 2
    JSP2 - <%get the formbean1 from request and SOP it
    (I get the values1 here hahaha) %>
    has its own field and formBean2
    submit - goes to Action2
    ACTION2 - get the formBean2 (I get the values2 haha)
    get the formBean1 (I get NULL ?????)
    Point is I want to set the formBean1 from request
    orginating from JSP2 -submit. JSP2-formBean2 gets submitted there
    properly but how can keep fwding formBean1.
    Please don't tell me to keep ALLL formBean1 values as hidden
    in JSP2. as its not good logic and its tooo much values. etc. etc.
    As a matter of fact I have 4 such JSPs and if user selectes codes
    on page 4 then only send all earlier 3 formBeans + current formBean4
    to DB, else ignore all ( means just ignore, go to new jsp or main menu
    let all formBeans garbage collected... hahahaha )
    How can I do this ?
    I will reply to any Qn s immly as I am in hurry....delivery is very very near
    guys ..........:)
    anyways,
    Enjoy the coding.....!!!
    Sandeep

    Off hand, the only thing I can think of is to create two completely separate projects.
    However, if you want to maintain a good development team and project, I suggest you keep it as one project and not try to hide anything from one group of developers. Instead, install CVS as your repository. It will track what changes were made and by who and you can roll back to a previous version of a JSP or java class if necessary. Your team should be briefed on the architecture you decide on (Spring, Sturts, etc), and basic good coding practices you want enforced.
    Here are a few rules:
    * nothing is to be checked into CVS that doesn't compile cleanly.
    * nothing is to be checked into CVS that has any error or warning messages form your IDE outstanding.
    * nothing is checked into CVS without the comment field of the commit dialog box being filled in.
    * You have one build.xml file that eveyone uses to compile all code.
    * All JSP pages are to be well formed xml (no dangling tags).
    * all java classes and JSP pages are to be properly indented.
    * all classes are to have javadoc describing what a class is for, and all functions are to have javadoc describing what the function does (not how it does it).

  • Is it possible to pass a variable from a shell script back to an Automator action?

    Is it possible to pass a variable from a shell script back to an Automator action?
    For instance, if I assign a value of foo to $var1 in my shell script how would I retrieve/pass that value in the next Automator action. I see that there is a variable called "Shell Script" but I can't any information on how to use it. 

    red_menace,
    Thanks but I still don't understand how to pass a single value that was set in the UNIX scipt back to Automator has a variable. Take the example below, I write 4 varables to STDOUT and all 4 are stored in a variable named "storage".  How do I assign 1 of these values to the Automator "storage" variable? For instance if I wanted to assign the value of $var2 to "storage" , how would I do that?

  • Hello  I don't know who to complain to as you do not appear to have a complaints department, despite searching the web, I trust you can pass this to relevant department for action, as I'm very angry over my recent repair.  Following my issue relating to a

    Hello
    I don't know who to complain to as you do not appear to have a complaints department, despite searching the web, I trust you can pass this to relevant department for action, as I'm very angry over my recent repair.
    Following my issue relating to a blank screen 2 weeks ago, your advisor arranged for my iMac to collected by Amsys, for repair and return, this was done and it was returned to me last Tuesday, onWednesday I set up my iMac again and instantly realised I had problems, much worse than before. I called Amsys to inform them of the issue of the computer being very very slow and unable to open iPhoto and pages, and document listing would not show up, plus I had no sound on the mac.They informed me that they had only replaced the video card and what they had done would have not affected the computers performance. He suggested I reinstall OSX again which I did, but this made no difference to the programs, so I called you.
    Your technician on the phone was very good as they have always been, and made an appointment for me to go into the Milton Keynes Apple store the next day at 1 pm, which I did.
    The gentleman on the Genius Bar was very good and was able to run tests on the iMac in my presence, and diagnosed immediately an issue with the sound problem, and advised me that this could not be fixed while I wait and I would need to leave it for repair. I made him aware of the previous repair, and he was able to see via your system, the list of logged issues I have had with this since purchasing in September 2012. I'm sure you can see from the way you record all calls and issues the problems I have had.
    Today I called to ask if my iMac would soon be ready for collection, I was told the repairs had been completed and it was being tested. However to my dismay, I learned of another serious issue relating to the repair carried out by Amsys. I was informed that 6 screws were missing from the the iMac internally, which caused me much distress and concern, they also told me I had to wait even longer as the screws had to be ordered and installed on arrival before I could collect it.
    My issues here are: I trusted the Amsys repairer as it was arranged and recommend by you, it is very evident they are not competent to repair, as they have caused more problems with my iMac on its return, despite enclosing a checklist, fully ticked showing everything working well, it clearly wasn't ! Plus the issue of missing parts (screws) during the repair, I have already expressed my disgust with Amsys, by email and had a response, within the hour, apologising and told me they were looking into this.
    This where I stand on this, I have not had my iMac for  almost two weeks and I do not know when I will get it back. I'm also very worried about what other damage has been caused by Amsys and the quality of my iMac now. I want to know what you, Apple is going to do about this ? I have already been very inconvenienced by this and until now I have been a very loyal apple customer with 2 iPads, and 4 iPhones in our household, not to mention the iMac.
    I feel I have been very let down by this experience, on my iMac, which cost a lot of money, I have also lost a lot of money with lost work and unable to carry out my business without it, and I will be seeking compensation.
    I trust you will take this complaint seriously and pass it to the relevant department for action.
    Yours sincerely
    Des Withey 
    Sent from my iPad
    On 26 Feb 2014, at 11:44, Apple Support <[email protected]> wrote:
    Thanks for contacting us.
    Thanks for contacting Apple Support. If you need more help later, you can open the case below or start a new support request online.
    Case ID:
    Open this case
    Sincerely,
    Apple Support
    Get help online
    Visit Apple Support to learn more about your product, download software updates, and much more.
    Join the conversation
    Find and share solutions with Apple users around the world.
    TM and copyright © 2014 Apple Inc. 1 Infinite Loop, MS 96-DM, Cupertino, CA 95014.
    All Rights Reserved / Privacy Policy / Apple Support / Give us feedback
    On behalf of Apple Distribution International

    Call Apple Customer Relations - 1-800-275-2273.  Ask politely & firmly that you want to be transferred to Customer Relations.  Tell them exactly what you stated in your post.
    GOOD LUCK!
    These are user-to-user forums where everyday folk (volunteers) post questions and offer answers (technical support) to each other.  

  • Passing 2 Text Strings to Applescript Action

    I am trying to make a Automator Workflow that Checks if an RSS Feed has Changed & if there is a change then Tweet the New Update.
    I have managed to get the URL and Extract the Text from the feed. and limit it to just the very latest 1 Item from the feed, Then i  have 2 Variables set-up one Called OldText and Another Called NewText.
    I Need to compare the 2 Variables for any change.
    In an applescript action i tried the following
    on run {input, OldText, NewText}
              if NewText = OldText then beep
              return input
    end run
    I Get a Syntax Error
    current application, current application} doesn’t match the parameters {input, OldText, NewText } for run.
    I was using beep just for testing code will work
    can it not pass 2 variables at a time ?

    The parameters to an Automator action are already defined - you can't just put in your own.  In the case of the Run AppleScript action, the run handler is defined as:
       on run {input, parameters}
    where the input parameter is a list (even if there is only one item) of the items passed from the previous action, and the parameters parameter is a list of the user interface settings (text fields, check boxes, etc) and options of the action itself.  If you are passing items to your script from previous actions in your workflow, you can get the desired item number from the input list (e.g. item 2 of input - I am guessing that you would know the order), and to get the value of a named variable from the workflow you can just ask Automator, for example:
       set oldText to (get value of variable "oldText" of front workflow)

  • Buying and item from iTunes, What action do you take in between having chossen an item to purchase and then being able to click on the word BUY. I have clicked on the price as it satates in the tutorial and I get a list of actions such as gift this item

    This question is for anyone who has purchased an item from iTunes.
    What action or actions do you take inbetween having selected the item to be purchased and having the word BUY appear on your screen for you to clic on it?
    I have been told to clic on the price. When I do that this list appears; gift this, add to wish list, tell a friend, copy link, share on Facebook & share on Twitter.
    Should I clic on one of thses or press enter after having clicked on one of these?
    What action do you take inbetween having chossen an item to purchase and being able to see the word BUY?

    Thank you for the answer. Apple support has been working on this question for several days.
    I don't think they see any difference between the two tabs as I didn't think there was any seperation and the arrow was the place to clic on the price.
    What would it take to get your statment added to the iTune tutorial?
    For that matter what would it take to get actual tutorials listed under the heading Tutorials listed at the bottom of most iTunes screens. If you clic on the heading Tutorials at the bottom of iTunes pages it lists ads not tutorials.
    Thanks again for your help.

  • Call a Automatic Row Fetch from a Dynamic Action

    Hi,
    can I execute the Automatic Row Fetch from a dynamic action?
    I only found this post (Dynamic Actions to call Automatic Row Processing (DML) but the link where the solution is does not work :(
    Thanks,
    Edited by: Elena.mtc on 09-nov-2012 5:46

    Elena.mtc wrote:
    I forgot to say, for several reasons, I don't want to submit the page. So that's where I find the complexity in calling the ARf.
    Thanks.You cannot fire the ARF because it is designed to run when the page is rendered and it cannot be called as a standalone
    Create a dynamic action as follows to fetch the form detials
    Action: Execute PL/SQL Code
    PL/SQL Code:
    begin
      select ename, job, mgr, hiredate, sal
        into :P4_ENAME, :P4_JOB, :P4_MGR, :P4_HIREDATE, :P4_SAL
        from emp
       where empno = :P4_EMPNO;
    exception
      when others then
        null;
    end;
    Page Items to Submit: P4_EMPNO
    Page Items to Return: P4_ENAME,P4_JOB,P4_MGR,P4_HIREDATE,P4_SAL
    See this working example: http://apex.oracle.com/pls/apex/f?p=32940:4
    Login as test/test
    If you want to make it more dynamic you can query the APEX metadata to find the form items on your current page
    select * from apex_application_page_db_items
    where page_id =:APP_PAGE_ID
    and application_id = :APP_ID;

  • Frame skipping from the Multiple Actions window (Cp4)

    Can anyone remind me how to trigger this:
    rdcmndGotoFrameAndResume := rdinfoCurrentFrame -10
    but from the Multiple Actions window on Cp4?
    I want to show a colleague how to set up a slide with multiple images that the learner can click as many times as they like to show relevant captions (and hide previously shown ones). Obviously the big problem is stopping the project from continuing until the learner clicks a separate Continue button.
    Normally I'd use Advanced Actions and add the code above in addition to the show/hide stuff, but this time I want to keep things as simple as possible using Multiple Actions as it's far more intuitive - but it won't let me do this kind of assignment.
    Any suggestions? One of the options is to execute javascript but I'm not sure what the javascript equivalent of this is, or even how it should get wrapped up in that window.
    Thanks

    As far as I can remember, you cannot create an 'expression' like this in Multiple actions, you only have the Assign action but the system variables that you can access with Assign are limited.
    Moreover I want to warn you: Multiple actions were abandoned in Captivate 5 and later because they do not always function well. So be very careful using them.
    If you want to show this, you'll need to use advanced actions, that have the possibility to access all variables and to create expressions.
    Why do you rewind the playbar 10 frames?
    Lilybiri

  • Passing a parameter from one class to another class in the same package

    Hi.
    I am trying to pass a parameter from one class to another class with in a package.And i am Getting the variable as null every time.In the code there is two classes.
    i. BugWatcherAction.java
    ii.BugWatcherRefreshAction.Java.
    We have implemented caching in the front-end level.But according to the business logic we need to clear the cache and again have to access the database after some actions are happened.There are another class file called BugwatcherPortletContent.java.
    So, we are dealing with three java files.The database interaction is taken care by the portletContent.java file.Below I am giving the code for the perticular function in the bugwatcherPortletContent.java:
    ==============================================================
    public Object loadContent() throws Exception {
    Hashtable htStore = new Hashtable();
    JetspeedRunData rundata = this.getInputData();
    String pId = this.getPorletId();
    PortalLogger.logDebug(" in the portlet content: "+pId);
    pId1=pId;//done by sraha
    htStore.put("PortletId", pId);
    htStore.put("BW_HOME_URL",CommonUtil.getMessage("BW.Home.Url"));
    htStore.put("BW_BUGVIEW_URL",CommonUtil.getMessage("BW.BugView.Url"));
    HttpServletRequest request = rundata.getRequest();
    PortalLogger.logDebug(
    "BugWatcherPortletContent:: build normal context");
    HttpSession session = null;
    int bugProfileId = 0;
    Hashtable bugProfiles = null;
    Hashtable bugData = null;
    boolean fetchProfiles = false;
    try {
    session = request.getSession(true);
    // Attempting to get the profiles from the session.
    //If the profiles are not present in the session, then they would have to be
    // obtained from the database.
    bugProfiles = (Hashtable) session.getAttribute("Profiles");
    //Getting the selected bug profile id.
    String bugProfileIdObj = request.getParameter("bugProfile" + pId);
    // Getting the logged in user
    String userId = request.getRemoteUser();
    if (bugProfiles == null) {
    fetchProfiles = true;
    if (bugProfileIdObj == null) {
    // setting the bugprofile id as -1 indicates "all profiles" is selected
    bugProfileIdObj =(String) session.getAttribute("bugProfileId" + pId);
    if (bugProfileIdObj == null) {
    bugProfileId = -1;
    else {
    bugProfileId = Integer.parseInt(bugProfileIdObj);
    else {
    bugProfileId = Integer.parseInt(bugProfileIdObj);
    session.setAttribute(
    ("bugProfileId" + pId),
    Integer.toString(bugProfileId));
    //fetching the bug list
    bugData =BugWatcherAPI.getbugList(userId, bugProfileId, fetchProfiles);
    PortalLogger.logDebug("BugWatcherPortletContent:: got bug data");
    if (bugData != null) {
    Hashtable htProfiles = (Hashtable) bugData.get("Profiles");
    } else {
    htStore.put("NoProfiles", "Y");
    } catch (CodedPortalException e) {
    htStore.put("Error", CommonUtil.getErrMessage(e.getMessage()));
    PortalLogger.logException
    ("BugWatcherPortletContent:: CodedPortalException!!",e);
    } catch (Exception e) {
    PortalLogger.logException(
    "BugWatcherPortletContent::Generic Exception!!",e);
    htStore.put(     "Error",CommonUtil.getErrMessage(ErrorConstantsI.GET_BUGLIST_FAILED));
    if (fetchProfiles) {
    bugProfiles = (Hashtable) bugData.get("Profiles");
    session.setAttribute("Profiles", bugProfiles);
    // putting the stuff in the context
    htStore.put("Profiles", bugProfiles);
    htStore.put("SelectedProfile", new Integer(bugProfileId));
    htStore.put("bugs", (ArrayList) bugData.get("Bugs"));
    return htStore;
    =============================================================
    And I am trying to call this function as it can capable of fetching the data from the database by "getbugProfiles".
    In the new class bugWatcherRefreshAction.java I have coded a part of code which actually clears the caching.Below I am giving the required part of the code:
    =============================================================
    public void doPerform(RunData rundata, Context context,String str) throws Exception {
    JetspeedRunData data = (JetspeedRunData) rundata;
    HttpServletRequest request = null;
    //PortletConfig pc = portlet.getPortletConfig();
    //String userId = request.getRemoteUser();
    /*String userId = ((JetspeedUser)rundata.getUser()).getUserName();//sraha on 1/4/05
    String pId = request.getParameter("PortletId");
    PortalLogger.logDebug("just after pId " +pId);  */
    //Calling the variable holding the value of portlet id from BugWatcherAction.java
    //We are getting the portlet id here , through a variable from BugWatcherAction.java
    /*BugWatcherPortletContent bgAct = new BugWatcherPortletContent();
    String portletID = bgAct.pId1;
    PortalLogger.logDebug("got the portlet ID in bugwatcherRefreshAction:---sraha"+portletID);*/
    // updating the bug groups
    Hashtable result = new Hashtable();
    try {
    request = data.getRequest();
    String userId = ((JetspeedUser)data.getUser()).getUserName();//sraha on 1/4/05
    //String pId = (String)request.getParameter("portletId");
    //String pId = pc.getPorletId();
    PortalLogger.logDebug("just after pId " +pId);
    PortalLogger.logDebug("after getting the pId-----sraha");
    result =BugWatcherAPI.getbugList(profileId, userId);
    PortalLogger.logDebug("select the new bug groups:: select is done ");
    context.put("SelectedbugGroups", profileId);
    //start clearing the cache
    ContentCacheContext cacheContext = getCacheContext(rundata);
    PortalLogger.logDebug("listBugWatcher Caching - removing markup content - before removecontent");
    // remove the markup content from cache.
    PortletContentCache.removeContent(cacheContext);
    PortalLogger.logDebug("listBugWatcher Caching-removing markup content - after removecontent");
    //remove the backend content from cache
    CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(((JetspeedUser)data.getUser()).getUserName()));
    PortalLogger.logDebug("listBugWatcher Caching User: " +((JetspeedUser)data.getUser()).getUserName());
    PortalLogger.logDebug("listBugWatcher Caching pId: " +pId);
    if (pdata != null)
    // User's data found in cache!
    PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null");
    pdata.removeObject(PortletCacheHelper.getUserPortletHandle(((JetspeedUser)data.getUser()).getUserName(),pId));
    PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null- after removeObject");
    PortalLogger.logDebug("listBugWatcher Caching -finish calling the remove content code");
    //end clearing the cache
    // after clearing the caching calling the data from the database taking a fn from the portletContent.java
    PortalLogger.logDebug("after clearing cache---sraha");
    BugWatcherPortletContent bugwatchportcont = new BugWatcherPortletContent();
    Hashtable httable= new Hashtable();
    httable=(Hashtable)bugwatchportcont.loadContent();
    PortalLogger.logDebug("after making the type casting-----sraha");
    Set storeKeySet = httable.keySet();
    Iterator itr = storeKeySet.iterator();
    while (itr.hasNext()) {
    String paramName = (String) itr.next();
    context.put(paramName, httable.get(paramName));
    PortalLogger.logDebug("after calling the databs data from hashtable---sraha");
    } catch (CodedPortalException e) {
    PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
    context.put("Error", CommonUtil.getErrMessage(e.getMessage()));
    catch (Exception e) {
    PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
    context.put(     "Error",CommonUtil.getErrMessage(ErrorConstantsI.EXCEPTION_CODE));
    try {
    ((JetspeedRunData) data).setCustomized(null);
    if (((JetspeedRunData) data).getCustomized() == null)
    ActionLoader.getInstance().exec(data,"controls.EndCustomize");
    catch (Exception e)
    PortalLogger.logException("bugwatcherRefreshAction", e);
    ===============================================================
    In the bugwatcher Action there is another function called PostLoadContent.java
    here though i have found the portlet Id but unable to fetch that in the bugWatcherRefreshAction.java . I am also giving the code of that function under the bugWatcherAction.Java
    ================================================
    // Get the PortletData object from intermediate store.
    CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(
    //rundata.getRequest().getRemoteUser()));
    ((JetspeedUser)rundata.getUser()).getUserName()));
    pId1 = (String)portlet.getID();
    PortalLogger.logDebug("in the bugwatcher action:"+pId1);
    try {
    Hashtable htStore = null;
    // if PortletData is available in store, get current portlet's data from it.
    if (pdata != null) {
    htStore =(Hashtable) pdata.getObject(     PortletCacheHelper.getUserPortletHandle(
    ((JetspeedUser)rundata.getUser()).getUserName(),portlet.getID()));
    //Loop through the hashtable and put its elements in context
    Set storeKeySet = htStore.keySet();
    Iterator itr = storeKeySet.iterator();
    while (itr.hasNext()) {
    String paramName = (String) itr.next();
    context.put(paramName, htStore.get(paramName));
    bugwatcherRefreshAction bRefAc = new bugwatcherRefreshAction();
    bRefAc.doPerform(pdata,context,pId1);
    =============================================================
    So this is the total scenario for the fetching the data , after clearing the cache and display that in the portal.I am unable to do that.Presently it is still fetching the data from the cache and it is not going to the database.Even the portlet Id is returning as null.
    I am unable to implement that thing.
    If you have any insight about this thing, that would be great .As it is very urgent a promt response will highly appreciated.Please send me any pointers or any issues for this I am unable to do that.
    Please let me know as early as possible.
    Thanks and regards,
    Santanu Raha.

    Have you run it in a debugger? That will show you exactly what is happening and why.

  • How to pass a parameter from one action1 in block1 to action2 in block2.

    Dear Experts,
    How to pass a parameter from one action1 in block1 to action2 in block2.
    My Process Structure is as follows..
           Process
                Sequential Block
                     Action 1
                     Parallel Dynamic Block
                             Sequential Sub Block
                             Action 2.
    while i am  trying to execute the action1 the following error is shown below:
    Cannot complete action: The activity could not be read.
    Please suggest me how to do?
    Regards,
    Rajesh N

    Hello Rajesh!
    I think you are talk about the mapping parameters of your process.
    This case in design time of your workflow, you have the vision of your blocks and actions, you have on action 1 the output parameter and you have the action 2 an input parameter.
    So you have that make a group mapping on your process, map in this group the action1 outpu parameter with the action2 input parameter.
    Regards, Ronaldo Rampelotti

  • Pass user name from MII to SAP R/3 via JRA

    When calling in MII a BAPI that executes a goods movement in SAP R/3 via a JRA connection, the user name of the JRA connection is passed to SAP R/3 and not the user name of the person who executed the action in MII. This means that the documented goods movements in SAP R/3, that were created with the JRA connection, are all posted with the same user name. We would like to register the user name of the person who is logged into MII, because we want to know which person executed the goods movements. How can we achieve this?

    Thank you guys, enabling the autobind was a good tip.
    We don't use JRA anymore, instead we use JCO to pass the user name. This is how we did it:
    Prerequisites:
    u2022 Login name in ABAP must be the same as in Netweaver (Java) - when creating users in Netweaver, copy them from ABAP. An other option might be to map the users in Netweaver with the users of ABAP, in case users are different.
    u2022 SSO certificates have to be exchanged between the two systems, SAP R/3 and Netweaver CE.
    u2022 Profile parameters in SAP R/3 system should be correct
    Confirguration in SAP MII:
    u2022 In the JCO action block (for RFC or BAPI call) in the link editor, set SAPUserName property to u201C$MYSAPSSO2$u201D
    u2022 Define a transaction property MYSAPSSO2 and in the link editor from the JCO action block, link it to SAPSSO2Ticket property
    u2022 In MII Menu - Dataservers - XacuteConnector activate property u201CAutobindu201D
    u2022 In MII Menu - System Connection Editor - JCO (used JCO connection) - activate u201CSSOu201D

  • How to Pass internal table from a program to Samrt form

    Hi Pals
    I want to pass an internal table which I have declared in the program to Smartform..can you please help
    me asap.
    Regards
    Praveen

    Hai.
    check link.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf
    check this.
    How to create a New smartfrom, it is having step by step procedure
    http://sap.niraj.tripod.com/id67.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    Here is the procedure
    1. Create a new smartforms
    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table
    Pages and windows
    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
    Main windows -> TABLE -> DATA
    In the Loop section, tick Internal table and fill in
    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
    Global settings :
    Form interface
    Variable name Type assignment Reference type
    ITAB1 TYPE Table Structure
    Global definitions
    Variable name Type assignment Reference type
    ITAB2 TYPE Table Structure
    4. To display the data in the form
    Make used of the Table Painter and declare the Line Type in Tabstrips Table
    e.g. HD_GEN for printing header details,
    IT_GEN for printing data details.
    You have to specify the Line Type in your Text elements in the Tabstrips Output options.
    Tick the New Line and specify the Line Type for outputting the data.
    Declare your output fields in Text elements
    Tabstrips - Output Options
    For different fonts use this Style : IDWTCERTSTYLE
    For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    5. Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Smartform
    you can check this link here you can see the steps and you can do it the same by looking at it..
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    SMARTFORMS STEPS.
    1. In Tcode se11 Create a structure(struct) same like the Internal table that you are going to use in your report.
    2. Create Table type(t_struct) of stracture in se11.
    3. In your program declare Internal table(Itab) type table of structure(struct).
    4. Define work area(wa) like line of internal table.
    5. Open Tcode Smartforms
    6. In form Global setting , forminterface Import parameter define Internal table(Itab) like table type of stracture(t_struct).
    7. In form Global setting , Global definitions , in Global data define Work area(wa) like type stracture(struct).
    8. In form pages and window, create Page node by default Page1 is available.
    9. In page node you can create numbers of secondary window. But in form there is only one Main window.
    10. By right click on page you can create windows or Go to Edit, Node, Create.
    11. After creating the window right click on window create table for displaying the data that you are passing through internal table.
    12. In the table Data parameter, loop internal internal table (Itab) into work area(wa).
    13. In table there are three areas Header, Main Area, Footer.
    14. Right click on the Main area create table line by default line type1 is there select it.
    15. Divide line into cells according to your need then for each cell create Text node.
    16. In text node general attribute. Write down fields of your work area(wa) or write any thing you want to display.
    17. Save form and activate it.
    18. Then go to Environment, function module name, there you get the name of function module copy it.
    19. In your program call the function module that you have copied from your form.
    20. In your program in exporting parameter of function pass the internal table(itab).
    SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.
    SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can
    configure forms with data from an SAP System for the relevant business processes.
    To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
    You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
    You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
    SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
    SAP Smart Forms also support postage optimizing.
    Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
    What Transaction to start SAP Smart Forms?
    Execute transaction SMARTFORMS to start SAP Smart Forms.
    Key Benefits of SAP Smart Forms:
    SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time.
    You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
    To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
    These actions do not include writing of coding lines or using a Script language.
    Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one.
    For Web publishing, the system provides a generated XML output of the processed form.
    Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
    SmartForms System Fields
    Within a form you can use the field string SFSY with its system fields. During form processing the system replaces these fields with the corresponding values. The field values come from the SAP System or are results of the processing.
    System fields of Smart Forms
    &SFSY-DATE&
    Displays the date. You determine the display format in the user master record.
    &SFSY-TIME&
    Displays the time of day in the form HH:MM:SS.
    &SFSY-PAGE&
    Inserts the number of the current print page into the text. You determine the format of the page number (for example, Arabic, numeric) in the page node.
    &SFSY-FORMPAGES&
    Displays the total number of pages for the currently processed form. This allows you to include texts such as'Page x of y' into your output.
    &SFSY-JOBPAGES&
    Contains the total page number of all forms in the currently processed print request.
    &SFSY-WINDOWNAME&
    Contains the name of the current window (string in the Window field)
    &SFSY-PAGENAME&
    Contains the name of the current page (string in the Page field)
    &SFSY-PAGEBREAK&
    Is set to 'X' after a page break (either automatic [Page 7] or command-controlled [Page 46])
    &SFSY-MAINEND&
    Is set as soon as processing of the main window on the current page ends
    &SFSY-EXCEPTION&
    Contains the name of the raised exception. You must trigger your own exceptions, which you defined in the form interface, using the user_exception macro (syntax: user_exception <exception name >).
    Example Forms Available in Standard SAP R/3
    SF_EXAMPLE_01
    Simple example; invoice with table output of flight booking for one customer
    SF_EXAMPLE_02
    Similar to SF_EXAMPLE_01 but with subtotals
    SF_EXAMPLE_03
    Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the form is called for each customer and all form outputs are included in an output request
    check this:
    http://help.sap.com/saphelp_nw04s/helpdata/en/a5/de6838abce021ae10000009b38f842/content.htm
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/SMARTFORMS_tutorial.html
    check this linkls------>
    https://www.sdn.sap.com/irj/sdn/collaboration
    http://help.sap.com/saphelp_erp2004/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Insert Images in smartforms
    regards.
    sowjanya.b.

  • Retrieve data passed in session from another application in visual jsf

    hi,
    I'm using jboss 4.2.2, visual jsf, etbeans 6.0.1
    My application needs to read the data passed in session from the calling application.
    i try to get it using the below in init()
    HttpServletRequest request=(HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
    String value=(String) request.getAttribute("id");
    System.out.print(value);
    But it always prints null.
    any idea??
    Thanks.

    Hi,
    My value is still null.
    I created a simple web application. In the jsp page, ==>
    <form method="post" action="http://localhost:8080/MyApp/">
    <input type="hidden" name="username" value="ME"/>
    <input type="submit" value="Submit" name="Submit"/>
    </form>
    In MyApp, which is a Web application with Visual JSF, in the welcome file init() method, i get the values ==>
    String value = (String) FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("username");
    System.out.print("request value in welcome page init() = " + value);
    Fearing loss of data by request, i tried in session too. But no luck.

  • Passing filter attributes from endeca to OAF

    Hi,
    We have the following scenario.
    The user searches for an object in endeca. In order to refine the results list, he/she selects some of the filter attributes from the guided navigation. Assuming that there are links for the items in the results list, is it possible to pass the attribute values which are selected in the filters
    apart from passing the attributes which are specific to the record selected in the result list?
    Pl. suggest.
    Thanks
    Chandra

    The usual way is to set those values as bean properties and let the JSF access them.
    Something like:
    mainPage.jsf<h:form>
        <h:inputText value="#{myBean.value}" />
        <h:commandButton value="submit" action="#{myBean.action}" />
    </h:form>MyBean.javaprivate String value; // + getter + setter
    public String action() {
        System.out.println(value); // Do something with value? Persisting in DB?
        return "anotherPage"; // Navigation case (do not redirect if bean is request scoped!)
    }anotherPage.jsf<h:outputText value="#{myBean.value}" />

  • Pass URL parameters from BSP to WDA for ABAP (via Post   )

    Dear Gurus,/ Joerge,
    I am unable to post my Code here, but with the guidance provided by Joerge i am able to solve this
    i Have been through the Below thread
    Pass URL parameters from WD to BSP via Post
    Dear Gurus,
    "Since I am unable to Post new thread i am Continuing this thread, though this Issue has been
    " resolved,i need some more info on the following issue, Kindly guide me,
    I have gone through the below thread but left with no clue
    Pass URL parameters from WD to BSP via Post
    Here i have 2 Issues
    First one is --->
    " After pressing the Button I am calling this URL which is WDA for ABAP
          action="http://company/sap/bc/webdynpro/sap/zuser"> " I am calling WDA for ABAP URL here
    " Kindly guide me how to pass the Value
    Second one is -->
    " This value need to be passed to the URL above and
    " How to capture the Same in WINDOWINIT method of WDA for ABAP
    " And how to Capture this Value in Webdynpro INIT method
    "Here am using Form and method = post , I am removing this as it is causing some problem while posting
          action= my WDA For ABAP URL here " I am calling WDA for ABAP URL here
    " Kindly guide me how to pass the Value
    " This value need to be passed to the URL above and
    " How to capture the Same in WINDOWINIT method of WDA for ABAP
    Thanks and Regards
    Ramchander Rao.K

    Hi,
    let me see if I understand you well.
    BSP -
    You wrote the code for catching the user name in the event OnCreate, which means that you know who´s working with the BSP application when it starts.
    Somewhere you must have a button or something with text like "Call WDA application". When user presses the button, it triggers events OnInputProcessing. Here you must write the code for the cookie that "sends" the parameter(s), something like:
    CALL METHOD cl_bsp_server_side_cookie=>set_server_cookie
      EXPORTING
        name                  = 'MY_COOKIE'
        application_name      = 'ZUSER_NAME_GET'
        application_namespace = 'ZUSER_NAME_GET'
        username              =  sy-uname
        session_id            = 'SAME_FOR_ALL'
        data_value            = PAGE_DATA
        data_name             = 'PAGE_DATA'
        EXPIRY_TIME_REL       = 3600.
    you call then the URL for the WDA application.
    WDA -
    probably in method WDDOINIT of the component controller you´ll write the code for reading the "content" of the cookie:
    CALL METHOD cl_bsp_server_side_cookie=>get_server_cookie
      EXPORTING
        name                  = 'MY_COOKIE'
        application_name      = 'ZUSER_NAME_GET'
        application_namespace = 'ZUSER_NAME_GET'
        username              =  sy-uname
        session_id            = 'SAME_FOR_ALL'
        data_name             = 'PAGE_DATA'
    CHANGING
        data_value            = PAGE_DATA.
    read more about the cookies in SDN, because I am not sure if this is the correct example for transmiting values. I´ve used it in conjunction of instructions IMPORT and EXPORT for transmiting an internal table.
    if this is not working properly, then try with IMPORT TO MEMORY and EXPORT FROM MEMORY.

Maybe you are looking for