Hi,
I am creating a sales order application where in i have to pass the user id (customer logged in through portal) .
I have made the MODEL RFC as ticket, and meta data as user id password where i have passed the service user and password.
Now my problem is that there will be 'N' customer ids in Portal but we are not creating any customer ids in SAP ECC. We are planning to pass the user id of portal logged in user to ECC (which will be customer id) and get the data based on the customer id passed.
Question is how do i pass customer id to BAPI, ? Do i have to make the MODEL JCO as user/password or ticket should be fine as i am getting information for only customer logged in Portal ?
How and where do i write the the following piece of code ? Should it be in wdDo init() or in the execute method of Controller ?
try{ IUser user = WDClientUser.getLoggedInClientUser().getSAPUser(); IUserAccount[] acct = user.getUserAccounts(); if(acct[0] != null) { String strUserid = acct[0].getLogonUid(); customer=strUserid.substring(0,strUserid.indexOf(".")); if(customer.equalsIgnoreCase(customer)) wdContext.currentYOURRFC_InputElement().setCustomer(customer); } }catch(Exception ex) { ex.getMessage(); }
Should the above code be in the component controller before i execute the BAPI ?
your help is appreciated.
Regards
PN