cancel
Showing results for 
Search instead for 
Did you mean: 

sapscript default user name&surname problem

Former Member
0 Kudos

hi gurus,

I want to show user name and surname on subscript footer.I tried sy-uname() first.but this is not solve my problem.Then I tried ADDR3_DATA and USR03 table.

First I used like &ADDR3_DATA-NAME_FIRST& &ADDR3_DATA-NAME_LAST& fields.

Then I used like &USR03-NAME1& &USR03-NAME2& but with these options no return value appear to me.

Maybe I need to copy default SAP print program to ZProgram and I should try to make select query.

But this looks like long and heavy way in my opinion.İt's look like easy problem but I get crazy...:)

İs there any easy way for this????

I also used this code below founded by web.-

DATA: l_user_data TYPE soudatai1,

l_user TYPE soudnamei1,

l_fullname type SO_ADRNAM.

    • logon uid ver*

l_user-sapname = sy-uname.

    • get the user definition*

CALL FUNCTION 'SO_USER_READ_API1'

EXPORTING

user = l_user

IMPORTING

user_data = l_user_data.

    • full username*

l_fullname = l_user_data-fullname.

-


this code working and giving my name&surname on program.But I can't include this program to sapscript form.

I use :/PERFORM tags getting dumb error...

Thanks for your helping..

Have a nice day!!

Edited by: ozcandemirbilek on Jan 25, 2011 8:50 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You cannot include this peice of code to your script form. PERFORM is your routine which cannot be used in form. Morever you do have a call FM in your code.

I would suggest to copy the print program and make a Z-Program. Add this piece of code to your Z-print program. Hold the values and pass them to your form.

Former Member
0 Kudos

Hi K.Manas,

First of all thanks your answer..Big perhaps I'll use Zprogram too..

I got the program in form tags and send the parameters from myprogram to script.My form name GET_INF

But I used in sapscript like this.

:/PERFORM GET_INF IN PROGRAM ZPROG

:/INCLUDE &L_USER_DATA&

:/INCLUDE &L_USER&

:/CHANGING &L_FULLNAME&

:/ENDPERFORM

*USER : &L_USER&

-


and getting dump:)).Maybe wrong parameters I sent to sapscript..

Have a nice day...

Former Member
0 Kudos

And what is the dump its throwing ? Have a look at the tricks of calling [How to Call Subroutine in Sap Script|http://wiki.sdn.sap.com/wiki/display/ABAP/SUBROUTINESANDTHEIRUSEIN+SAPSCRIPT]

Former Member
0 Kudos

thank you so much K.Manas.

I tried your advice. my sending parameters were wrong.

By the way I tried this. I looked in su01 transaction.In the table USER_ADDR my default user clients there.I got the my script

field &USER_ADDR-NAME_TEXTC& .it returned to me who is logon.

Regards..

Answers (0)