Generate URL to Portal Objects in Web Dynpro

Hi All,
I have a requirement where in I have to generate a URL to portal objects such as iviews/pages from the PCD. I am able to retrieve the PCD contents but I am not able to generate the URL dynamically.
I cannot use WDPortalNavigation.absoluteNavigate method, since I need the URL of the object.
IUrlGenerator can be used, but it is asking for the IPortalComponentRequest object. Now where can I get this object in web dynpro.
Or is there a way to generate the URL of the iview/page dynamically in Web Dynpro. I have to use standard API only.
Please provide inputs on this.
Thanks in advance.

Use the below url
/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2f<yourfolder ID>!2f<if any subfolder id>
!2fcom.abc.xyz
where com.abc.xyz is the ID of the xyz iview/page
Use that url in your webdynrpo
Raghu

Similar Messages

  • Reusable objects using web dynpro java...any suggestions ?

    Hello All,
    I want to create few Reusable objects using web dynpro java. Please suggest some scenarios.
    regards
    Mrinalini.

    Hi,
    I can suggest especially this one:
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30d56578-f7e5-2a10-5ab5-8afc55d2e0e8
    Some other hits you may find useful:
    This guide mentions some tutorials about reusability:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/ba2db0e5-0601-0010-9790-e271902f2c38?quicklink=index&overridelayout=true
    Here
    Web Dynpro Java [original link is broken]
    and here
    SAP NetWeaver Composition Environment Samples Center [original link is broken]
    you'll find other tutorials as well.
    Best Regards,
    Ervin

  • Userid of a Portal-user in Web Dynpro ABAP

    Dear colleagues,
    we want to migrate our application from BSP to Web Dynpro ABAP and I'm looking for a procedure how I can get the userid of a Portal-user in Web Dynpro ABAP which is running inside an iView ?
    In BSP I used iView application parameter user_id and in the BSP the event handler for data retrieval with:
    userid = runtime->server->request->get_form_field( 'userid' ).
    Found a lot of entries how to do it in Java but no one for WDA ?
    Thanks in advance
    Michael

    Hi Michael,
    Actualy it is not so trivial. You have some options:
    1) In case user_id is parameter of iView you can read URL parameter like described here Webdynpro ABAP url-parameters
    2) In case user_id is not iView parameter you can use usuall ABAP <i>sy-uname</i> system variable.
    But pay attantion that it is not really EP user. Here we have 2 options: user mapping and SSO. In case of user mapping <i>sy-uname</i> will contain R/3 user which is mapped to EP user. In case of SSO <i>sy-uname</i> will contain same user name like in EP, because by using SSO user must ne the same on issuing and accepting systems.
    Best regards, Maksim Rashchynski.

  • Get date from portal in a web dynpro?

    hi all,
    how get date from portal in a web dynpro???
    thanks.

    new Date(System.getTimeInMillis());
    Good luck, Roelof

  • How to set a variable in portal session using web dynpro java.

    Hi,
    I have created a web dynpro application, which is running inside portal. I have created a role called "R1". Inside role R1, i have created 3 workset W1, W2 and W3. and inside each workset i have some pages and iviews.
    My requirement is when user logins to the portal , and when he clicks on role R1 for the first time, a login page should come (so that we can do revalidation), and when he enters his password again in that login page , then only workset W1, W2 and W3 should be visible/accessible to him and after successful revalidation, if he clicks again on role R1, in that particular portal session, than that login page should not come.
    for this, i thought i will set a variable in portal session, whenever user successfully revalidated himself, and if after successful revalidation he clicks again on role R1, i will check in doinit method of webdynpro whether variable is set or not (which i already set on successful revalidation), and if it is set then i will do Donavigation else i will present login page to the user.
    Can anyone tells me how to set a variable in portal session using web dynpro java.
    thanks
    Arush

    Hi,
    Try this:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE, key, value)
    WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE, key)
    Ex:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE,"Key1","Value1");
    String value1=WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE,"Key1").toString();
    /people/william.cui/blog/2007/02/12/sharing-session-context-between-parent-and-external-windows-running-on-same-host
    Regards,
    Charan

  • Can the role info be passed from portal to ABAP web dynpro application

    Hi,
    We have some roles in the portal. We call the ABAP web dynpro applications from the portal. Is it possible to pass on the role from the portal to the Web dynpro ABAP application so that we can use this role information in the application.
    Thanks,
    Pooja

    Hi,
    you can try to add the expression
      role=<IView.PCDUnit>
    as part of the Application Parameters in the iView. This will be the role in 99%. However not all iViews started in the Portal must belong to a role. You can start iViews using page navigation that are not part of a role. Therefore the PCD does not talk about roles but about "units" which is the superordinate term.
    the value will be the PCD path of the role - e.g:
      portal_content/myFolder/roles/myRole

  • ALV object in Web dynpro ABAP

    Hi All,
    I want to include ALV object in web dynpro ABAP, instead of a table in a window. I have SAP Version 4.6 as backend.
    Pl help.

    Hi Nirmal,
    the information on ALV and WDA is here: http://help.sap.com/saphelp_nw2004s/helpdata/en/74/fd4142646ab46be10000000a155106/frameset.htm
    As you know, Web Dynpro ABAP is availiable with NW2004s, not before.
    Regards, Heidi

  • Modifying / Moving objects in Web Dynpro Layout

    Hi.
    Can someone tell me if it is possible to edit buttons or other objects from Web Dynpro layout? If it is possible, how can I do this?
    When I say edit, I mean move button/object to certain location or make size bigger.
    I know I can do this in Adobe form layout, but I am hoping I can keep adobe form separately from buttons, so off-line Adobe form will not have buttons.
    Thanks in advance for your help.
    John

    Hi John,
    There is no property by which the size of a button can be changed. Although the text can be varied by using property "Design" of the text elements.
    As far as position is concerned, The button can be placed anywhere according to user requirement. The simplest way of doing that is creating a toolbar and creating right aligned or left aligned buttons. or by just using the properties of the layout you are using.
    Check the [Layout documentation|http://help.sap.com/saphelp_erp2005/helpdata/en/47/af8841349e1909e10000000a155106/frameset.htm] for more details
    Regards,
    Kinshuk

  • Create Callable object of Web Dynpro Component (GP interface) giving error

    Hi All,
    We are facing a strange error in Guided Procedure.
    While trying to create a new callable object of Web Dynpro Component (GP interface) after selecting the type and click on Next it is throwing below error.
    *javax.xml.stream.FactoryConfigurationError: Requested factory com.ctc.wstx.stax.WstxInputFactory cannot be located. Classloader =com.sap.engine.services.deploy.server.ApplicationLoader 3995fdb9 sap.com/cafeugpuidt
        at javax.xml.stream.FactoryLocator.loadFactory(FactoryLocator.java:120)
        at javax.xml.stream.FactoryLocator.locate(FactoryLocator.java:109)
        at javax.xml.stream.FactoryLocator.locate(FactoryLocator.java:54)
        at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:41)
        at org.apache.axiom.om.util.StAXUtils$7.run(StAXUtils.java:311)*
    Also while running the GP processses which are created in the past and working fine till few days back are also giving the same above error.
    Please help us in resolving the issue.
    Regards,
    Satish

    Hi Peter,
    Check this link.It may be helpful.
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/java/netweaver%252bdeveloper%252bstudio%252b(NWDS)
    Regards,
    Sumangala

  • Create portal user using web dynpro abap application

    Dear All,
    I would like to know is it possible to create portal user-id through web dynpro abap application.
    My requirement is
    > I have to create a web dynpro abap application. In the web dynpro abap application I have name email-id and phone number as entry fields.
    > I will click on submit, one unique id will get created. This unique id will be the login id for portal.
    I found how to create portal user using web dynpro java, but i could not find regarding web dynpro abap.
    If it is possible to create the portal users using web dynpro abap pls share the code as well.
    Regards,
    Swapnil Indulkar

    Hi swapnil,
    I think by using BAPi.. BAPI_USER_CREATE1 you can create.
    Please check this...
    Create portal user from webdynpro abap
    Creating user and assigning a group through code
    user administration su01
    How can i get the portal user id from logon ticket in the webdyn 4 ABAP
    Cheers,
    Kris.
    Edited by: kissnas on May 21, 2011 8:47 AM

  • Using KM and Collaboration API in portal component and web dynpro

    Hi,
    I have to develop portal components and Web Dynpros (JAVA) which have to use the following functions:
    - copy, delete KM documents
    - sending E-Mails 
    Can anyone give me some actual documentation links for the KM and Collaboration APIs ?
    Which references do I need in portalapp.xml for KM/collaboration and which jar-Files do I have to add to the project?
    We are using NetWeaver 7.01 SP18.

    Hi  Yogalakshmi,
    thank you for the link and the information. Now I managed to work with the KM documents.
    One more Question: to get the resource Context, I use this code:
    portalUser = WPUMFactory.getServiceUserFactory().getServiceUser("cmadmin_service");
    IResourceContext resourceContext = new ResourceContext(portalUser);
    The method getServiceUser is deprecated, also the com.sapportals.portal.security.usermanagement.IUser is deprecated. Is there an other possibility to get the ResourceContext. (perhaps with com.sap.security.api.IUser) ?

  • Access Portal Services within Web Dynpro

    Hi,
    I created a portal service and would like that some values of the same have to be set by a Web Dynpro application, but i have a problem to access this
    service. Always that a i try to get a reference of this service the object isn't instantiated and i get a null instantiated.
    What i`m trying to do is the broadcast message described in [/people/prakash.singh4/blog/2005/04/28/brodcast-messages-to-logged-on-users-in-portalpart1 |/people/prakash.singh4/blog/2005/04/28/brodcast-messages-to-logged-on-users-in-portalpart1]with a variation that need of some
    more Attributes and that the same will be pass by the Web Dynpro, like the broadcast message i`ll just use the alert concept and don't the publication.
    Follow below the describe of executed actions.
    1 - I did all the process as the [Weblog|/people/prakash.singh4/blog/2005/04/28/brodcast-messages-to-logged-on-users-in-portalpart1].
    2 - I generated the Jar and insert the same in a DC.
    3 - I generated the Web Dynpro application, in the used DCs and added the DC with the Jar, and i inserted the reference in a Sharing References. 
    4 - Did the deploy and insert the Web Dynpro in a Portal Iview.
    But always that i execute, i can't capture the reference of the service.
    Note: The reference in Sharing References was executed for several diferents forms of test, like for exemple:
    PORTAL:<vendor>/com.teste.broadcast
    PORTAL:com.teste.broadcast
    PORTAL:<vendor>/com.teste.broadcast.alertreceiver
    PORTAL:com.teste.broadcast.alertreceiver
    But always adding one at a time.
    Until put the saller like sap.com i already try.
    The creation of the service as described in the weblog can be accessed for a Web Dynpro? What the problem to access the Service??
    The codes follow Bellow.
    portalapp.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <application>
      <application-config>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb,com.sap.portal.runtime.system.notification"/>
        <property name="ServicesReference" value="com.teste.broadcast"/>
      </application-config>
      <services>
        <service name="alertreceiver">
          <service-config>
            <property name="className" value="com.teste.broadcast.alertreceiver"/>
          </service-config>
        </service>
      </services>
    </application>
         BroadcastAppView.java
    import com.sap.security.api.IUser;
    import com.sap.tc.webdynpro.clientserver.portal.WDPortalUtils;
    import com.sap.tc.webdynpro.clientserver.portal.sf.WDPortalServiceType;
    import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
    import com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;
    import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;
    import com.sapportals.portal.prt.service.notification.INotificationService;
    import com.sapportals.portal.prt.service.notification.NotificationStringBufferPool;
    import com.sapportals.portal.prt.service.notification.StreamData;
    import com.sapportals.portal.prt.service.notification.TopicData;
    import com.sapportals.portal.prt.service.notification.TopicDataContainer;
    import com.teste.broadcast.Ialertreceiver;
    public void onActionSendMessage(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionSendMessage(ServerEvent)
            IWDMessageManager msgManager = wdComponentAPI.getMessageManager();
            INotificationService notService = null;
            try {
                    notService =    (INotificationService)
                            WDPortalUtils.getServiceReference("com.teste.broadcast");
                    //notService =  (INotificationService)
                    //      WDPortalUtils.getServiceReference("com.teste.broadcast.alertreceiver");
                    //notService =  (INotificationService)
                    //      WDPortalUtils.getServiceReference(IAlertreceiver.KEY);
            } catch (Exception ex) {
                    msgManager.reportWarning("2-" + ex.getMessage());
            TopicDataContainer container = new TopicDataContainer(TOPIC_NAME);
            StreamData  messageStream = new StreamData(new ByteArrayInputStream(textMessage.getBytes()));
            TopicData durationdata =
                    new TopicData(TopicDataContainer.STRING, "60");
            TopicData userdata =
                    new TopicData(TopicDataContainer.STRING, user.getUniqueName());
            container.addTopicData("message", messageStream);
            container.addTopicData("duration", durationdata);
            container.addTopicData("user", userdata);
            container.addTopicData("group", "GROUP_ACCESS");
            //notService.publish(TOPIC_NAME, container);
            msgManager.reportWarning("-" + notService);
        //@@end
       * The following code section can be used for any Java code that is
       * not to be visible to other controllers/views or that contains constructs
       * currently not supported directly by Web Dynpro (such as inner classes or
       * member variables etc.). </p>
       * Note: The content of this section is in no way managed/controlled
       * by the Web Dynpro Designtime or the Web Dynpro Runtime.
      //@@begin others
      private final static String SERVICE_NOTIFICATION = "com.sap.portal.runtime.system.notification.notification";
      private final static String TOPIC_NAME = "USTBroadCastAlerts";
      //@@end
    Thank.
    Luciano Feletti Aponte

    Hi Luciano,
    Take a look at for your answer:
    /thread/833576
    Regards,
    Rogério

  • Portal 7.3 & Web Dynpro iView, both accessed from Internet via Web Dispatch

    Hi guru,
    I'd like to know the best (or the correct) way to configure the FQDN and required DNS setting to allow user access ABAP Web Dynpro iview from internet.
    My setup here is very typical:
    One EP 7.3 in intranet, having "ep.internal.mycomp.com" as FQDN (given during installation)
    One SAP ECC in intranet, having "erp.internal.mycomp.com" as SAPLOCALHOSTFULL parameter
    One Web Dispatcher in DMZ, having "service.mycomp.com", and listen to 80 port (later added 8000 port for AS ABAP).
       User access my portal by using http://service.mycomp.com/irj, no problem.
    But problem raised during access WD4A iview, here are my problem and questions:
    [Problem]
    At the beginning, we found that the WD4A iView can only be accessed in intranet, not from internet. Eventhough we register "service.mycomp.com" in public DNS. After some http level analysis, I was shock that the WD4A iview is provided directly by AS ABAP which running this WD4A, EP does not play a "relay" role. (Don't believe the URL bar in your IE, use Tamper Data or HTTP live to check the HTTP requests, you will get it). Since we DO NOT have "erp.internal.mycomp.com" in public DNS, so the iview cannot be displayed. But I DON'T want direct access to my ERP box.
    I don't know a way to get rid of the "erp.mycomp.com" request generated by EP. So I tried to overcome the problem by leveraging the same Web Dispatcher used by EP. And I did make the WDisp -> ERP WD4A work using WDisp's FQDN (ie. service.mycomp.com:8000, also keep original service.mycomp.com:80 to EP), but the iview in EP does not use this FQDN. It use the SAPLOCALHOSTFULL parameter configured in backend ERP.  WDisp does not do any URL replacement for me.
    [Question 1]
    Is there any way to hide WD4A iview in EP (server to server communication only)?
    [Question 2]
    If I can only have "service.mycomp.com" entry in my public DNS, should I change the SAPLOCALHOSTFULL in ERP to "service.mycomp.com"?  I doubt  that it may cause a "loop" situation between WDisp and ERP ?
    [Question 3]
    Is it possible to access WD4A on ERP by two different FQDNs (one for public via WDisp, the other for internal access w/o WDisp) ? I know there is only one SAPLOCALHOSTFULL configuration.
    Anyone have done such integration ? please share your configuraiton. Thanks

    Hay Wei-Shang Ku,
    Many thanks to your prompt reply of this very old post I tried to ask!
    for the /sap/* redirect, think it required to use icm/HTTP/redirect_<xx> parametet in WDISP profile. And i did applied below too to make default WDISP URL go to /irj  (Portal login page).
    icm/HTTP/redirect_0 = PREFIX=/,TO=/irj
    so for "all request to /sap/* will go to ERP":
    icm/HTTP/redirect_0 = PREFIX=/sap/*,TO=/???  (how do you set the TO value here?)
    May i have your WDISP profile setting for reference? Did you make use of parameter wdisp/system_0?
    And here is my overall setting:
    we only have "service.mycomp.com" entry in public DNS.
    1. "service.mycomp.com" is WDISP URL mapped to 1 public IP (we used default http 80 port)
    2. we want user can access JPortal & also backend ERP via WebDynpro iView in JPortal via
       service.mycomp.com  (only port only)
    3. ERP system profile:
        SAPLOCALHOSTFULL = <ERPHOSTNAME>.mycomp.com (not in public DNS)
        icm/server_port_0 = PROT=HTTP,PORT=80$$,TIMEOUT=3600,PROCTIMEOUT=3600
    4. Portal:
        ABAP WebDynpro iView setting -
       System  = XXX (where XXX is alias of system iView)
      System iView setting -
        Logical System Name = ERPCLNTXXX
        ITS host = <ERPHOSTNAME>.mycomp.com:8000
    Thanks again your information, have headache of this issue for long times....
    Gary

  • Issues with portal integration of Web dynpro for ABAP application

    Hi,
    I have the following issues when i integrate a Web Dynpro for ABAP application with portal.
    1. the iview does not contain some images, such as table scroll button images, maximize and close buttons of popups etc.
    2. the iview loads properly, but there is an error in the status bar that says "Access denied"
    3. is it possible to do absolute navigation from
       role1->folder1->iview1 to role1->folder2->iview2?
       when i fire this navigation from the webdynpro
       application, the navigation does not happen in the
       portal.
    thanks,
    Kavitha

    >
    sridhar vadaga wrote:
    > Hi Experts,
    >
    >
    > CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    >   EXPORTING
    >     text           = url
    >  IMPORTING
    >    BUFFER         = content .
    >
    >
    > Thanks & Regards
    > Sridhar
    I think you are overestimating the power of the SCM_STRING_TO_XSTRING function module.  By supplying a URL as the value of the input text, it isn't going to magically go read the content from the remote location and convert that to a binary string.  It is going to take whatever value you supply in th importing TEXT parameter convert that to binary.  In other words it is literally converting the string http://xxx/test.xls to binary.  You will need some other mechanism to read the content from the remote location into ABAP memory before you can process it.  You will need to use the CL_HTTP_CLIENT class or call some sort of web service to retrive the content.

  • How to close portal page by Web Dynpro App

    Hi There,
    I would like to close a portal page by clicking a button of a Web Dynpro App which is inside an iView on that page.
    Is this possible or not?
    Bertil

    Bertil,
    First, it is very bad decision to make decisions instead of user. Just redirect him to logoff page and let close window himself.
    In WebDynpro you may use <b>Exit plug</b> on interface view with parameter <b>Url</b> (notice the case) of type string.
    Then you may previously fire this plug with JavaScript url: javascript:void(window.top.close())
    In recent versions of WD this will not work. So you have to redirect user via exit plug to some static html page, that contains in header <script>window.top.close();</script>
    VS

Maybe you are looking for