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

please help me

Former Member
0 Likes
295

hi all,

i have created an ALV report, after execting the report the output comes correctly but my problem is while downloading the output to local file it should ask SAP user id and password,it should be password protected.

please help me how to write code for asking SAP user id and password while downloading, if we give wrong details it should not accept.

i have tried using sy-ucomm it captures the value %pc, but how to handle it.

please help me its urgent

thanks in advance.

1 REPLY 1
Read only

Former Member
0 Likes
264

Hi

see the below code

SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW TITLE title.

.

Parameters: p_name like sy-uname,

p_pas like sy-uname lower case.

SELECTION-SCREEN skip 1.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 2(70) text-001.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF SCREEN 500.

CALL SELECTION-SCREEN '0500' STARTING AT 10 10 ending at 70 14.

data: begin of it_user occurs 0,

name like sy-uname,

password like sy-uname,

end of it_user.

it_user-name = 'sam'.

it_user-password = '123'.

append it_user.

it_user-name = 'seenu'.

it_user-password = '321'.

append it_user.

it_user-name = 'shanu'.

it_user-password = '123#'.

append it_user.

it_user-name = 'vel'.

it_user-password = '321#'.

append it_user.

AT SELECTION-SCREEN OUTPUT.

loop at screen.

check screen-name eq 'P_PAS'.

move: 1 to screen-invisible.

modify screen.

endloop.

start-of-selection.

if p_pas = it_user-name.

write:/ 'authenticated user'.

else.

write:/ 'give the correct password'.

endif.

this will popup for the userid and password

and this can be used while u download the file

reward points if useful

thanks