Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Enabling Select-options in an RFC function module

Former Member
0 Likes
1,217

Hi Abaper's,

I am using BAdi definition NOTIF_EVENT_SAVE for sending mail notification to user.

Under CHANGE_DATA_AT_SAVE method I have called an RFC enabled function module and written code here for mail notification.I used cl_bcs class for sending file.On executing this I am getting a mail box wherein we can enter user id and send mail.But I don't want to use cl_bcs for sending mail now.So I modified the code by including SO_NEW_DOCUMENT_SEND_API1 function.

My requirement is I want to enable select-options in this function module so that user can get a popup wherein he can select user name from master.On activating I am getting following error:

Local SELECT-OPTIONS are not allowed (FORM routine or GET event is active).

Can any one help me how to resolve this error?

I am using this customized function module for mail notification.If I hardcode mail id,notification is working properly.

Regards,

Sam

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
783

>

> My requirement is I want to enable select-options in this function module so that user can get a popup wherein he can select user name from master

Hi Sam,

in the function groups TOP include, you can define a selection-screen:

SELECTION-SCREEN BEGIN OF SCREEN 9786 [TITLE title].
select-options: s_uname for ...
SELECTION-SCREEN END OF SCREEN 9786.

and in the function use

CALL SELECTION-SCREEN dynnr
                      [STARTING AT col1 lin1
                      [ENDING   AT col2 lin2]]

Everything declared in the function body source code is local.

But you must make sure that CHANGE_DATA_AT_SAVE is not processed in update task.

Regards,

Clemens

Edited by: Clemens Li on Jan 16, 2011 7:36 PM

4 REPLIES 4
Read only

Clemenss
Active Contributor
0 Likes
784

>

> My requirement is I want to enable select-options in this function module so that user can get a popup wherein he can select user name from master

Hi Sam,

in the function groups TOP include, you can define a selection-screen:

SELECTION-SCREEN BEGIN OF SCREEN 9786 [TITLE title].
select-options: s_uname for ...
SELECTION-SCREEN END OF SCREEN 9786.

and in the function use

CALL SELECTION-SCREEN dynnr
                      [STARTING AT col1 lin1
                      [ENDING   AT col2 lin2]]

Everything declared in the function body source code is local.

But you must make sure that CHANGE_DATA_AT_SAVE is not processed in update task.

Regards,

Clemens

Edited by: Clemens Li on Jan 16, 2011 7:36 PM

Read only

Former Member
0 Likes
783

Hi Clemens Li,

Thanx a lot for your input.Its working fine now.When I execute this function module I am getting a separate screen.When the user opens 6 screens already,my newl popup screen is not coming as system shows Maximum number of sessions opened.Can I overcome this problem?

Regards,

Sam

Read only

Clemenss
Active Contributor
0 Likes
783

Hi sam,

no, not really.

Do not worry: The average user will close every session after using it - just to open up again afterward.

You could catch the error, issue a message (TYPE S DISPLAY LIKE 'E') asking the user to close unused open session and try again in a loop.

Regards,

Clemens.

Read only

Former Member
0 Likes
783

Hi Clemens Li,

Thanx for your valuable inputs.

My problem is resolved.

I really appreciate you guys for the Endeavour for making this forum a colossal success.

Regards,

Sam

Edited by: sam24 on Jan 18, 2011 7:52 AM