‎2008 Jan 02 12:34 PM
HI all,
My Code is like this
1. In first screen user should enter user id and password it will goes to second screen if it is correct
2. In second screen i have 2 parameters(In disable mode in this automatically value are there based on user id ) and on select-option for date and 4 radio buttons
3. When i press 4rt radio button in that another screen will be displayed in that also 1 parameter and 4 select-options and 4 radio buttons
4. When i press 4rt Radio button in that i want to display 3rd screen again
But my problem is when i press 4rt the information message Report ZCL_APP_TIMESHEET has no variants when i press Enter my program is work perfectly
I dont want to display that message Please help me
Note: All Screens are only one screen in my programm in at selection-screen output i de active some of fields based on some condigions ( it looks 3 screen but in programm it is only one screen i.e is 1000)
Thanks,
Mahi.
‎2008 Jan 02 1:57 PM
Hi,
you can use the user-command addition after parameters .. radiobutton group ..
then when the radiobutton is pressed a user command also gets triggered, sy-ucomm.
This you can then use in your code to alter the appearance of the screen.
Kind regards, Rob Dielemans
‎2008 Jan 02 1:57 PM
Hi,
you can use the user-command addition after parameters .. radiobutton group ..
then when the radiobutton is pressed a user command also gets triggered, sy-ucomm.
This you can then use in your code to alter the appearance of the screen.
Kind regards, Rob Dielemans
‎2008 Jan 02 2:12 PM
Hi Dielemans,
I already used that user-command and my code is perfectly work what i want but, just i don't want that information message this is system message.
Plzz help me it's urgent.
‎2008 Jan 02 2:23 PM
I don't know why you get a message stating something about non existing variants.
You should find out why the message is coming. Just use debugging, create a watchpoint on sy-msgno = ### where ### is the system message.
Also you can use fm DYNP_VALUES_UPDATE to change the dynpro without pbo. This FM is well documented so reading this documentation and using the where used button is sufficient to understand how to use it
Kind regards, Rob Dielemans
‎2008 Jan 02 2:28 PM
‎2008 Jan 03 6:28 AM
My code for my screen is this.
This is 500 lines code that why i did not show the code but my problem is not cleared so i past my one of include program ( I think problem is there so i didn't show my main program)
----
Include ZCL_SELECTION
----
*"Table declarations...................................................
TABLES:
zcl_empdata, " Employees Information table
zcl_time_data1, " Timesheet Data for the Employee
zcl_project, " Master data for Projects
zcl_empgroup. " Master Data for Employee Group
*"Selection screen elements............................................
"----
Selection-Screen block for initial Screen *
"----
SELECTION-SCREEN BEGIN OF BLOCK user WITH FRAME TITLE text-119.
PARAMETERS:
p_userid TYPE zcl_empdata-empid " User ID
MODIF ID use OBLIGATORY,
p_pass TYPE bapiuid-password " User Password
MODIF ID use.
SELECTION-SCREEN END OF BLOCK user.
"----
Selection-Screen block for Employee information to Enter *
Timesheet *
"----
SELECTION-SCREEN BEGIN OF BLOCK timesheet WITH FRAME TITLE text-120.
PARAMETERS:
p_empid TYPE zcl_empid MODIF ID emp OBLIGATORY,
" Employee ID
p_ename TYPE zcl_empname MODIF ID emp.
" Employee Name
SELECT-OPTIONS
s_edate FOR zcl_time_data1-work_date MODIF ID emp.
" Date
SELECTION-SCREEN END OF BLOCK timesheet.
*"Radio Buttons Creation ................................................
PARAMETERS:
r_sav RADIOBUTTON GROUP TS USER-COMMAND disp
MODIF ID emp , " To Display Saved Data
r_enter RADIOBUTTON GROUP ts
MODIF ID emp, " To Enter Timesheet
r_disp RADIOBUTTON GROUP ts
MODIF ID emp, " To Display Timesheet
r_hr RADIOBUTTON GROUP ts
MODIF ID hr, " To Display Timesheets for HR
r_app RADIOBUTTON GROUP TS
MODIF ID MD. " TO Approve Timesheet
"----
Selection-Screen block is used for Approve Timesheet *
"----
SELECTION-SCREEN BEGIN OF BLOCK approve.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-100.
SELECT-OPTIONS
s_group FOR zcl_empgroup-empgroup NO INTERVALS
NO-EXTENSION MODIF ID man MATCHCODE OBJECT ZCL_GROUP.
" Employee Group
SELECTION-SCREEN SKIP. " For Empty Space in Selection Screen
SELECT-OPTIONS:
s_empid FOR zcl_empdata-empid
MODIF ID man, " Employee ID
s_projid FOR zcl_project-projectid
MODIF ID man, " Project ID
s_date FOR zcl_time_data1-work_date
OBLIGATORY MODIF ID man. " Selection Date
SELECTION-SCREEN END OF BLOCK block1.
*"Radio Buttons Creation for Managers....................................
PARAMETERS:
r_get RADIOBUTTON GROUP app USER-COMMAND get MODIF ID man ,
" Get Timesheet for Approve
r_dis RADIOBUTTON GROUP app MODIF ID man ,
" Display Timesheet
r_chan RADIOBUTTON GROUP app MODIF ID man,
" To change Rejected Status
r_reen RADIOBUTTON GROUP app MODIF ID man.
" To Enter Timesheet
SELECTION-SCREEN END OF BLOCK approve.
*" Field string for F4-help values.....................................
DATA:
BEGIN OF fs_values,
pid TYPE zcl_projectid, " Project ID
oid TYPE zcl_obj_id, " Object ID
odec TYPE zcl_obj_desc, " Object Description
END OF fs_values.
*" Field string for F4-help............................................
DATA:
BEGIN OF fs_value,
oid TYPE zcl_obj_id, " Object ID
odec TYPE zcl_obj_desc, " Project ID
END OF fs_value.
*" Work area for it_data...............................................
DATA:
BEGIN OF fs_data,
work_date TYPE zcl_time_data1-work_date,
" Worked Date
projectid TYPE zcl_time_data1-projectid,
" Project ID
projectname TYPE zcl_time_data1-projectname,
" Project Name
objectid TYPE zcl_time_data1-objectid,
" Object ID
object_desc TYPE zcl_time_data1-object_desc,
" Object Description
activityid TYPE zcl_time_data1-activityid,
" Activity ID
activity_desc TYPE zcl_time_data1-activity_desc,
" Activity Desctiption
time_worked TYPE zcl_time_data1-time_worked,
" Time
description TYPE zcl_time_data1-description,
" Description of work
status TYPE zcl_time_data1-status,
" Status for data ( Save, Sub--
bill_status TYPE zcl_time_data1-billingstatus,
" Billing Status
approved_status TYPE zcl_time_data1-approvedstatus,
" Approved Status
workingstatus TYPE zcl_time_data1-workingstatus,
" Working Status
END OF fs_data.
fs_data type zcl_time_data1.
*" Work area for it_timesheet..........................................
DATA:
BEGIN OF fs_timesheet,
cbox(1) TYPE C, " Selection field
empid TYPE zcl_time_data1-empid,
" Employee ID
date TYPE zcl_time_data1-work_date,
" Worked Date
empname TYPE zcl_time_data1-empname,
" Employee Name
empgroup TYPE zcl_time_data1-empgroup,
" Employee Group
projectid TYPE zcl_time_data1-projectid,
" Project ID
projectname TYPE zcl_project-projectname,
" Project Name
objectid TYPE zcl_time_data1-objectid,
" Object ID
object_desc TYPE zcl_object-objectdesc,
" Object Description
activityid TYPE zcl_time_data1-activityid,
" Activity ID
activity_desc TYPE zcl_activities-activitydesc,
" Activity Description
time_worked TYPE zcl_time_data1-time_worked,
" Time Worked
description TYPE zcl_time_data1-description,
" Description of work
status TYPE zcl_time_data1-status,
" Status for data ( Save, Sub--
bill_status TYPE zcl_time_data1-billingstatus,
" Billing Status
app_stat TYPE zcl_time_data1-approvedstatus,
" Approved Status
wstatus TYPE zcl_time_data1-workingstatus,
" Working Status
END OF fs_timesheet.
*" Work area for Table Control.........................................
DATA:
BEGIN OF fs_time,
c_box TYPE c, " Selection field
empid TYPE zcl_time_data1-empid,
" Employee ID
work_date TYPE sy-datum, " Work Date
projectid TYPE zcl_project-projectid,
" Project ID
proname TYPE zcl_project_name, " Project Name
objectid TYPE zcl_object-objectid,
" Object ID
objectname TYPE zcl_object-objectdesc,
" Object Name
activityid TYPE zcl_activities-activity_id,
" Activity ID
actname TYPE zcl_acti_desc, " Activity Name
empname TYPE zcl_time_data1-empname,
" Employee Name
time_worked TYPE zcl_time_data1-time_worked,
" Time Worked
description TYPE zcl_time_data1-description,
" Description Of work
wstatus TYPE zcl_time_data1-workingstatus,
" Working Status
status TYPE zcl_time_data1-status,
" Status for data ( Save, Sub--
bill_status TYPE zcl_time_data1-billingstatus,
" Billing Status
END OF fs_time.
*" Field string For updating the Database..............................
DATA:
fs_time_data TYPE zcl_time_data1, " Used for Pass data to database--
fs_field TYPE dynpread, " Used for F4 Help
fs_sc_val TYPE dynpread, " Used for F4 Help
fs_temp TYPE zcl_time_data1, " Temporary field string for-----
fs_bapiret2 TYPE bapiret2, " Return Parameter
fs_but000 TYPE but000, " Field string for BP: General---
fs_date LIKE s_date, " Work area for s_date
fs_cat TYPE lvc_s_fcat, " Field-string for fieldcatalog
fs_time1 LIKE fs_time. " Field-string for temporary...
*" Internal tables Declaration..................................................
DATA:
t_sc_val TYPE TABLE OF dynpread, " Table to store screen values
t_values LIKE TABLE OF fs_values," Table for Object ID F4 Help
t_value LIKE TABLE OF fs_value, " Table for F4 Help
it_timesheet LIKE TABLE OF fs_time, " Table for Fs_time
it_data LIKE TABLE OF fs_data, " Table for fs_data
t_timesheet LIKE STANDARD TABLE OF fs_timesheet,
" Table for Fs_timesheet
it_fcat TYPE lvc_t_fcat. " Table for fieldcatalog
To create the object for custom container............................
DATA:
g_alv TYPE REF TO cl_gui_custom_container,
" Instance for the Container
g_grid TYPE REF TO cl_gui_alv_grid.
" Instance for ALV grid
*" Variables Declaration...............................................
DATA:
w_new TYPE bapiuid-password, " New Password
w_con TYPE bapiuid-password, " Confirm Password
w_emp, " Flag Screen flow
w_no TYPE i, " For Number in Table Control
w_userid TYPE bapibus1006_head-bpartner,
" Temparary Variable for Fun-----
w_temp1 TYPE sy-ucomm, " Temparary Variable for sy-ucomm
W_cflag TYPE C, " Flag for Check Password
w_int TYPE i, " For Date Calculations
w_int1 TYPE i, " For Date Calculations
w_ucomm TYPE sy-ucomm, " To Store Function Code
W_app, " Flag for Approved Status
w_tabix type sy-tabix, " For temparary Tabix
ok_code TYPE sy-ucomm. " Ok code for Approve Table Control
*" Constants Declaration...............................................
CONSTANTS:
c_x TYPE c VALUE 'X', " Constant with value 'X'
c_s TYPE c VALUE 'S', " Constant with value 'S'
c_time TYPE lvc_s_fcat-tabname value 'T_TIMESHEET',
" Constant with value 'T_TIMESHEET'
c_w TYPE C VALUE 'W', " Constant with value 'W
c_a TYPE C VALUE 'A', " Constant with value 'A'
c_r TYPE C VALUE 'R', " Constant with value 'R'
c_e TYPE c VALUE 'E', " Constant with value 'E'.
c_dele(20) TYPE C VAlue 'TAB_CONTROL_DELETE',
" Constant with value 'TAB.......
c_l TYPE c VALUE 'L', " Constant with value 'L'
c_h TYPE C VALUE 'H'. " Constant with value 'H'
"----
AT SELECTION-SCREEN OUTPUT EVENT *
"----
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name EQ 'P_EMPID' OR screen-name EQ 'P_ENAME'.
screen-input = 0.
MODIFY SCREEN.
ENDIF. " If screen-name eq 'P_EMPID'---
ENDLOOP. " Loop at screen.
SET PF-STATUS 'SCREEN' EXCLUDING 'CPASS' OF PROGRAM
'ZCL_APP_TIMESHEET' IMMEDIATELY.
SET TITLEBAR 'TITLE' WITH text-110.
if zcl_empdata-groupid eq 'MD'.
if r_app eq space or r_reen eq C_X.
loop at screen.
IF screen-group1 EQ 'MAN'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF. " If r_app eq space
endloop. " Loop at screen
else.
loop at screen.
case screen-group1.
when 'EMP'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
when 'MD'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
endcase. " Case screen-group1
endloop. " Loop at screen
ENDIF. " If r_app eq space
if r_reen eq C_X .
loop at screen.
IF screen-group1 EQ 'EMP'.
SCREEN-ACTIVE = 1.
MODIFY SCREEN.
ENDIF.
endloop. " Loop at screen
clear r_reen.
endif.
endif. " If zcl_empdata-groupid eq 'MD'
CASE w_emp.
WHEN space.
LOOP AT SCREEN.
IF screen-group1 EQ 'EMP'.
screen-active = 0.
MODIFY SCREEN.
ENDIF. " If screen-group1 EQ 'EMP'
IF screen-group1 EQ 'MAN'.
screen-active = 0.
MODIFY SCREEN.
ENDIF. " If screen-group1 EQ 'MAN'
IF screen-name EQ 'P_PASS'.
screen-invisible = 1.
MODIFY SCREEN.
ENDIF. " If screen-name EQ 'P_PASS'
IF screen-group1 EQ 'HR'.
screen-active = 0.
MODIFY SCREEN.
ENDIF. " If screen-group1 eq 'HR'
IF screen-group1 EQ 'MD'.
screen-active = 0.
MODIFY SCREEN.
ENDIF. " If screen-group1 eq 'MD'
ENDLOOP. " Loop at screen.
WHEN C_X.
SET TITLEBAR 'TITLE' WITH text-044 p_ename.
LOOP AT SCREEN.
IF zcl_empdata-groupid NE 'HR'.
IF screen-group1 EQ 'HR'.
screen-active = 0.
MODIFY SCREEN.
ENDIF. " If screen-group1 eq 'HR'.
ENDIF. " If p_empid ne 'CL01103'
ENDLOOP. " Loop at screen.
LOOP AT SCREEN.
IF zcl_empdata-groupid NE 'MD' and
screen-group1 EQ 'MD'.
screen-active = 0.
MODIFY SCREEN.
ENDIF. " IF zcl_empdata-groupid NE 'MD'
ENDLOOP. " Loop at screen.
IF p_userid EQ 'TEST01' OR
zcl_empdata-groupid NE 'MD'.
LOOP AT SCREEN.
IF screen-name EQ 'P_EMPID'.
screen-input = 0.
MODIFY SCREEN.
ENDIF. " If screen-name eq 'P_EMPID'.
IF screen-name EQ 'P_ENAME'.
screen-input = 0.
MODIFY SCREEN.
ENDIF. " If screen-name EQ 'P_ENAME'
IF screen-group1 EQ 'EMP'.
screen-active = 1.
MODIFY SCREEN.
ENDIF. " If screen-group1 EQ 'EMP'
IF screen-group1 EQ 'MAN'.
screen-active = 0.
MODIFY SCREEN.
ENDIF. " If screen-group1 EQ 'MAN'.
IF screen-group1 EQ 'USE'.
screen-active = 0.
MODIFY SCREEN.
ENDIF. " If screen-group1 EQ 'USE'.
ENDLOOP. " Loop at screen.
ENDIF. " If p_userid eq 'TEST01'....
IF p_userid EQ 'TEST02' OR
zcl_empdata-groupid EQ 'MD' .
LOOP AT SCREEN.
IF screen-group1 EQ 'MAN'.
screen-active = 1.
MODIFY SCREEN.
ENDIF. " If screen-group1 CP 'MAN'.
IF screen-group1 EQ 'EMP*'.
screen-active = 1.
MODIFY SCREEN.
ENDIF. " If screen-group1 CP 'EMP'.
IF screen-group1 EQ 'USE'.
screen-active = 0.
MODIFY SCREEN.
ENDIF. " If screen-group1 EQ 'USE'.
ENDLOOP. " Loop at screen.
ENDIF. " If p_userid eq 'TEST02' or...
ENDCASE. " Case w_emp
"----
AT SELECTION-SCREEN EVENT *
"----
AT SELECTION-SCREEN.
To check passwrod
If w_cflag is initial.
PERFORM password_user.
w_cflag = c_x.
endif.
SELECT SINGLE
empname " Employee Name
groupid " Employee group id
FROM zcl_empdata
INTO (p_ename,
zcl_empdata-groupid)
WHERE empid EQ p_userid.
IF sy-subrc NE 0.
MESSAGE e003 WITH p_userid text-015.
ENDIF. " If sy-subrc ne 0.
IF p_empid IS INITIAL.
p_empid = p_userid.
ENDIF. " If P_EMPID IS INITIAL
IF sy-ucomm EQ 'CPASS'.
CALL SCREEN '350' STARTING AT 8 5 ENDING AT 45 8.
ENDIF. " If sy-ucomm eq 'CPASS'
IF sy-ucomm EQ 'GET' and r_reen <> 'X'.
IF s_empid IS INITIAL AND s_group IS INITIAL AND s_projid IS INITIAL.
MESSAGE e003 WITH text-118.
ENDIF. " If s_empid IS INITIAL AND..
ENDIF. " If sy-ucomm eq 'GET'
IF r_hr EQ c_X.
SUBMIT AQTGSYSTQV000029ZCL_VIEW====== VIA SELECTION-SCREEN AND RETURN.
ENDIF. " If r_hr eq C_X.
IF w_emp EQ C_X.
IF sy-ucomm EQ 'GET'.
IF r_dis EQ C_X.
PERFORM display CHANGING t_timesheet[].
CLEAR r_dis.
LEAVE TO SCREEN '300'.
ENDIF. " If r_dis eq C_X
IF r_get EQ C_X.
CLEAR r_get.
PERFORM get_timesheet CHANGING t_timesheet[].
LEAVE TO SCREEN '200'.
ENDIF. " If r_get eq C_X.
IF r_chan EQ C_X.
CLEAR r_chan.
PERFORM display_all CHANGING t_timesheet[].
LEAVE TO SCREEN '150'.
ENDIF. " If R_CHAN eq C_X.
ENDIF. " If sy-ucomm eq 'GET'
IF sy-ucomm EQ 'DISP'.
IF r_enter EQ C_X.
w_temp1 = 'SUB'.
LEAVE TO SCREEN 100.
ENDIF. " If r_enter eq C_X
IF r_sav EQ c_x.
w_flag = c_x.
w_temp1 = 'SAVE'.
PERFORM save_data.
LEAVE TO SCREEN 100.
ENDIF. " If r_sav eq C_X
IF r_disp EQ C_X.
PERFORM get_date .
call screen '250'.
ENDIF. " If r_disp eq C_X
ENDIF. " If sy-ucomm eq 'DISP'.
ENDIF. " If W_EMP EQ C_X
"----
INITIALIZATION EVENT *
"----
INITIALIZATION.
fs_date-low = sy-datum - 15.
fs_date-high = sy-datum.
fs_date-sign = 'I'.
fs_date-option = 'EQ'.
APPEND fs_date TO s_date.
append fs_date to s_edate.
Reward defenetly for useful answer,
Mahi.
‎2008 Jan 03 9:51 AM
hi,
like I said you have to find out why this message is showing.
GET is also used in the GUI status of the standard program of SAP when showing a selection screen.
Change the user command to zsomething so change
r_get RADIOBUTTON GROUP app USER-COMMAND get MODIF ID man
and also change the lines containing
IF sy-ucomm EQ 'GET' and r_reen 'X'.
Regards, Rob Dielemans
PS don't forget to change this message to solved.
‎2008 Jan 03 1:24 PM
Hi Rob Dielemans
My Problem is Solved by my own, Thanks for your Suggations (Your Suggations are very meaning full but USER-COMMAND Is not my problem at all ) .
The problem is not in At selection-screen output it is in At selection-screen.