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

parameter on selection screen

Former Member
0 Likes
1,657

Hi Gurus,

What I need to do is to put the default value for parameter on selection screen. It should be the email address of the person who run this program (from user profile).To get this value I called BAPI_USER_GET_DETAIL . How to pass the value to the parameter on selection screen now?

Thank you in advance.

Regards,

Lena

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,120

Try this:

REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.

PARAMETERS e_mail TYPE bapiadsmtp-e_mail.

DATA: return TYPE TABLE OF bapiret2,
      email  TYPE TABLE OF bapiadsmtp WITH HEADER LINE.

AT SELECTION-SCREEN OUTPUT.
  CALL FUNCTION 'BAPI_USER_GET_DETAIL'
    EXPORTING
      username = sy-uname
    TABLES
      return   = return
      addsmtp  = email.

  LOOP AT email.
    e_mail = email-e_mail.
    EXIT.
  ENDLOOP.

Rob

4 REPLIES 4
Read only

Former Member
0 Likes
1,120

You need to code this logic in INITIALIZATION event. Get the user id and mail address of the user running this program. In Initialization event, pass assign the value of email address to the parameter.

Read only

former_member194669
Active Contributor
0 Likes
1,120

Hi,

Try this


INITIALIZATION.
" Run your bapi and get email address and pass it P_EMAIL parameter or select- option LOW
P_EMAIL = BAPI-EMAIL 

a®

Read only

Former Member
0 Likes
1,121

Try this:

REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.

PARAMETERS e_mail TYPE bapiadsmtp-e_mail.

DATA: return TYPE TABLE OF bapiret2,
      email  TYPE TABLE OF bapiadsmtp WITH HEADER LINE.

AT SELECTION-SCREEN OUTPUT.
  CALL FUNCTION 'BAPI_USER_GET_DETAIL'
    EXPORTING
      username = sy-uname
    TABLES
      return   = return
      addsmtp  = email.

  LOOP AT email.
    e_mail = email-e_mail.
    EXIT.
  ENDLOOP.

Rob

Read only

0 Likes
1,120

Thank you very much. Solved. Points assigned.