cancel
Showing results for 
Search instead for 
Did you mean: 

User Notification Message on Portal using Web Dynpro Java

Former Member
0 Kudos

Hi All,

I am working on adding user notification message (error message) on Portal Application.If user is locked in SAP backend,users should be able to see error message on Portal.

And development team has added ABAP code in Function Module in SAP backend.Please find below the same.

ABAP code in SAP:

IF wa_tab-ustyp EQ 'A'.

         IF wa_tab-uflag EQ c_1 OR wa_tab-uflag EQ c_2 OR wa_tab-uflag EQ c_3

            OR wa_tab-uflag EQ c_4 OR wa_tab-uflag EQ c_5 OR wa_tab-uflag EQ c_6.

           wa_return-type = 'E'.

           wa_return-message = text-019.

           wa_return-parameter = p_userid.

           APPEND wa_return TO return.

         ENDIF.

We have done testing in SAP backend and it is working fine.

But when we are trying to read this message on Portal using Web dynpro Java-SAP Netweaver Developer Studio,we are not able to see the message (text-019) on Portal from SAP Backend..

Please help me to resolve this issue.

Thanks and Regards,

Snehal Raghoji

Accepted Solutions (0)

Answers (2)

Answers (2)

xavier_aranda
Participant
0 Kudos

HI,

Check the languaje you are executing the function module and the configuired for portal user. It is possible that this language are "hardcoded" in JCo configuration.

Hope it help

junwu
Active Contributor
0 Kudos

wdj code please.

0 Kudos

Hi Jun Wu,

Thanks for your reply!

Please find below wdj code.

Public void executeRequest.Y00_Mm_Prapproval_List() {

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try

{

   wdContext.currentRequest_Y00_MM_PRAPPROVAL_LISTElement().modelobject().execute();

   wdContext.nodeResponse().invalidate();

   wdContext.nodeY00_MM_PRAPPROVAL_LISTResponse().invalidate();

   wdContext.nodeI_HEADER().invalidate();

   wdContext.nodeItem_IHeader().invalidate();

   wdContaxt.nodeRETURN().invalidate();

   wdContext.nodeItem_Ret().invalidate();

   wdContext.nodeI_ITEM().invalidate();

   wdContext.nodeItem_IItem().invalidate();

}

catch(Exception e)

{

manager.reportMessage(IMessagePRdashboardComp.DATA_RETRIEVAL_ERROR,null);

manager.reportException(e.getMessage());  //trying to read backend message through this line

}

  }

Regards,

Snehal Raghoji

junwu
Active Contributor
0 Kudos

did u use sso or technical user to execute the function module?

Former Member
0 Kudos

HI Jun Wu,

Sorry for late reply!

I used sso to execute this function module.

One more thing i want to tell,the code is already there for this portal application-PR Approval dashboard.Later i got enhancement to add user notification message.And we did below things for it:

1.The ABAP code is added with the help of DEV team(code shown in above discussion)

2.WDJ code is already there for perticular Function Module

3.We add Text view on one of the views and later we bind its 'Text'property to same module attribute in which the message is appended from backend.

I want to know is there anything i am missing from my side in WDJ code. 

Thanks and Regards,

Snehal Raghoji

former_member191044
Active Contributor
0 Kudos

Hi Sehal,

why do execute the model and invalidate the response nodes after? So you will delete all results.

Also you do not raise a exception in the ABAP code so you can't catch any. I looks like if you append the message to the return type so you would have to read it out of your model context.

Regards,

Tobias

junwu
Active Contributor
0 Kudos

if you are using sso, the user is locked, how you suppose the rfc can be called?

just like you are asking a dead man are u alive or not? how they can answer u?

Former Member
0 Kudos

HI Jun/Tobias,

Thanks for your prompt Response!

@Jun:You are saying if it is SSO and user is locked,it will not call the RFC to execute the function module.

If i create a new Function Module and use technical user,is it then possible for me to show the same.Do you have reference link for this how to execute this?

@Tobias:Yes,i appended the message to the return type.So,if i want to read error message from Backend,how should i do then?as you are saying i can't catch it through reportException.

Regards,

Snehal Raghoji

junwu
Active Contributor
0 Kudos

if your account is locked, are u able to logon? if logon is not possible, what else u can do?

Former Member
0 Kudos

HI,

The user account is locked in SAP and i want to show user lock notification message on Enterprise Portal application screen.

If above method is not feasible,is there any other way to show message on Portal screen?

Please let me know if anybody has idea on this.

Thanks and Regards,

Snehal

junwu
Active Contributor
0 Kudos

use technical user to execute that rfc, the current logon user id will be one of the input parameter

nof sure if your abap can handle this or not.

former_member197472
Active Participant
0 Kudos

Hi,

Use another RFC using JCo destination configured for predefined user(e.g admin)

This RFC(with input as user id and output as lock status) will have ABAP code to return status of user (ie whether it is locked or not).

Call this RFC in init() method of WD Java component controller. If you get success result then go ahead with your routine code else Print error message.

--

Regards,

Amey