2009 Mar 23 6:15 PM
In an Alv report i have a selection screen with the name city field so defaultly i should get the city name in the field.so the customer has different branches in india if delhi customer enters in to that report he should see delhi location as default and if hyderabad branch customer enters in to the same report he should get hyderabad as city how can i acheive it.
2009 Mar 23 6:28 PM
HI,
Depending on the Userid the Default value of the selection screen field has to be chaged.
Get the user id from SY-USRID and fetch the Loction from USR03 table.
2009 Mar 23 6:20 PM
You can Set default for the selection screen in Initialization Event :
parameters: CITY(30) type c.
INITIALIZATION.
"Sy-uname will give you the use name.
"Use select query and get the city name .Check usr* table to get the city
City = 'DELHI'.Regards,
Gurpreet
2009 Mar 23 6:30 PM
In an Alv report i have a selection screen with the name city field so defaultly i should get the city name in the field.so the customer has different branches in india if delhi customer enters in to that report he should see delhi location as default and if hyderabad branch customer enters in to the same report he should get hyderabad as city how can i acheive it.i need to acheive it dynamically rather static
2009 Mar 23 6:20 PM
For defaulting, u can use DEFAULT key word itself.
or user specific varinats, then u can hv LAYOUTs.
to get quick&effective responses, pls. keep ur thread title more meaningful.
thanq
2009 Mar 23 6:28 PM
HI,
Depending on the Userid the Default value of the selection screen field has to be chaged.
Get the user id from SY-USRID and fetch the Loction from USR03 table.
2009 Mar 24 4:15 PM
In an Alv report i have a selection screen with the name city field so defaultly i should get the city name in the field.so the customer has different branches in india if delhi customer enters in to that report he should see delhi location as default and if hyderabad branch customer enters in to the same report he should get hyderabad as city how can i acheive it.
Could anyone of you please share the valuable inputs on this. If anyone has the sample code to do this, please share.
2009 Mar 24 5:54 PM
Hi Saeed,
Try the below steps. You should write the below code at INITIALIZATION EVENT only as you want to default the city field.
1. Get the SY-USRID (The user id executing the program)
2. Find out which city this user belongs to (Check out table USR01 / USR03)
3. Assign the city value obtained in step 2 to the city field.
Cheers,
Pritam
Edited by: PRITAM MOHANTY on Mar 24, 2009 1:55 PM
2009 Mar 23 6:31 PM
Try this : try using set country as well...
DATA: def TYPE bezei.
PARAMETER: p_land1 TYPE ort01.
INITIALIZATION.
*AT SELECTION-SCREEN OUTPUT.
SELECT SINGLE bezei
INTO def
FROM t005h
WHERE spras = 'E'
AND land1 = 'US' " pass the appropriate fields..
AND regio = 'OH'
AND cityc = '0002'.
IF sy-subrc EQ 0.
p_land1 = def.
ENDIF.