cancel
Showing results for 
Search instead for 
Did you mean: 

Service call issue WD ABAP

Former Member
0 Kudos

Hi,

I have a FM "HRCA_GETEMPLOYEEDATA_FROMUSER" which retrieves the employee master details for the user whoever logged in ECC. This User id is attached to pernr in HR.

I have copied this FM to "Z" and made changes to import paratemer (USERNAME) as default value to SY-UNAME.

I run this FM in se37, it is picks the logged in user id by default as import parameters and retrives the employee details from Infotype.

However, I have created WD ABAP component using service call with Import and export parameters. Created the context mapping with the view controller via Input fields, submit button (with Actions to execute FM) and table element with data binding to display output details.

However, it throws error message as "No active nametab exists for SY". When I run this application in IE it says USER_NOT_FOUND.

Does the import parameter SY-UNAME of logged user is not allowed to pass in WD ABAP ? Then how to proceed with this one to implement ESS applications using WD ABAP. How the FM should be designed for ESS to used for WD ABAP applications.

Please share your inputs.

Regards,

Anil Kumar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Anil ,

u cn use sy-uname for the logged on user ,r u doing it this way


call function 'HRCA_GETEMPLOYEEDATA_FROMUSER'
exporting
username = sy-uname
validbegin = sy-datum
importing
employeenumber = lv_pernr
exceptions
user_not_found = 1
countrygrouping_not_found = 2
infty_not_found = 3
call_others = 4
others = 5.

it works for me ..

Former Member
0 Kudos

Hi Amith,

I am not using import function module (via pattern button) in code as we use in native ABAP. A service call has been created for the FM with import and export parameters for the component controller and mapped these with view controller.

At runtime in IE, user has to confirm his emp ID and click on submit button to retrieve the details in Table element. A simple example similar to "BAPI Usage" tutorials.

Regards,

Anil Kumar.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Perhaps you should post your coding here. SY-UNAME is just as usable in WDA as in any other ABAP application. Have you set a breakpoint and checked the value of SY-UNAME at runtime? Is your application running in the portal? If so, are you using user mapping or SSO - are you sure that the user is being set correctly from the Portal is the gist of that question.

Former Member
0 Kudos

Hi Thomas,

Problem has been resolved. It was only warning message while activation of WD ABAP component (No active nametab exists for SY)

Coding is not much from WD ABAP side. Once service call has been created to WD ABAP component, context mapping is done via component controller to View controller with necessary export parameter.

And the FM is executed in "WDDOINIT" method of view at runtime.

DATA lo_COMPONENTCONTROLLER TYPE REF TO IG_COMPONENTCONTROLLER .

lo_COMPONENTCONTROLLER = wd_this->get_componentcontroller_ctr( ).

lo_componentcontroller->execute_zhrca_getemployeedata_(

).

Output is displayed via a Table element throug data binding.

User ids are same in ECC and Portal as well. SSO is also implemented successfully in the landscape.

WD ABAP execute fine in Portal via WD ABAP iview.

Thank you very much for your inputs.

Regards,

Anil kumar

Answers (0)