cancel
Showing results for 
Search instead for 
Did you mean: 

First/Last user name in sapscript form

Former Member
0 Kudos

Hello

when call sy-uname in the form i get user name. But I need firs and last name of user who is logged in.

I see that this info contains structure ADDR3_DATA but I don't know how to use it in form.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks for answers!

I'm begginer in sapscript form so can you give me som example?

Is printig program should be changed or I can do this in form directly?

printing program is SAPF130K

Former Member
0 Kudos

Hi ,

Since you are using a standard driver program , so you will need to modify the script.

Here is a link which will give you all information you need to implement it

http://help.sap.com/saphelp_nw04/helpdata/en/d1/803279454211d189710000e8322d00/frameset.htm

Regards

Arun

Former Member
0 Kudos

Hi Arun

I'm using standard print program and z-script.

As I understand well from site which you sent me to In script I have to use perform statement to call different program.

I'm not registered as sap developer so I can not create new program.

Is there other way to get las and firs user names?

Former Member
0 Kudos

Your requirements mean you have to change a program, either copy the standard print program and insert your code or create a PERFORM program to be called by your SAPscript.

There is no way round this. Either register yourself as a developer or ask one of your colleagues who is a developer to make this change for you.

Gill

Former Member
0 Kudos

Thanks Gill. Last question.

I have that code already written in (z) printing program for invoices.

So is it posible via PERFORM to call that code (from different print program)?

Or could I include below code into sapscript (not in print program):

TABLES: adrs ,

adrp , "Persons (Business Address Services)

usr21 , "Assign user name address key

vbdkr ,

DATA: ccname(30) TYPE c, "Card Type

adrp_name_last like adrp-name_last,

adrp_name_first like adrp-name_first,

name_last(15) type c,

name_first(15) type c,

  • creator's name

name_last = sy-uname.

name_first = ' '.

SELECT SINGLE persnumber FROM usr21 INTO usr21-persnumber

WHERE bname = vbdkr-ernam.

if sy-subrc = 0.

SELECT SINGLE name_first name_last

INTO (adrp_name_first, adrp_name_last)

FROM adrp

WHERE persnumber = usr21-persnumber

and date_from le sy-datum

and nation = ' '

and date_to ge sy-datum.

if sy-subrc = 0.

name_last = adrp_name_last.

name_first = adrp_name_first.

endif.

endif.

Message was edited by:

Giovanni Giovanni

former_member196280
Active Contributor
0 Kudos

Check in the following tables basing on Sy-uname.

Check table ADDR3_DATA

ADDR3_DATA-NAME_LAST "Last name

ADDR3_DATA-NAME_FIRST "First name

If want more check here

usr01, usr02, usr03...

Reward points.

Regards,

SaiRam

Former Member
0 Kudos

Hello,

Get the User personal number form USR21 Table then use the Personal nukmber form the table <b>ADRP</b> to get the first and last name.

If useful reward,

Vasanth

Former Member
0 Kudos

Hi Giovanni ,

The data is available in the view USER_ADDR , you can write a select statement to retreive the details.

Regards

Arun

  • Assign points if reply is helpful