2008 Jul 30 9:48 AM
Hi,
I have designed a selection screen as follows :
SELECTION-SCREEN begin of BLOCK s1.
parameters : s_desc type DD02T-DDTEXT OBLIGATORY DEFAULT 'IS-U' MODIF ID m1 ,
cb_fs as CHECKBOX default 'X' modif id m1.
SELECTION-SCREEN end of BLOCK s1.
SELECTION-SCREEN skip.
SELECTION-SCREEN begin of block s2.
parameters : m_file type string obligatory modif id m2.
SELECTION-SCREEN end of BLOCK s2.
Now, when I process this screen and I I don't give a value to m_file, the fields s_desc and cb_fs becomes disabled. I want these fields to always remain enabled. How can this be achieved?
Thanks,
Sachin.
Hi,
I have designed a selection screen as follows :
SELECTION-SCREEN begin of BLOCK s1.
parameters : s_desc type DD02T-DDTEXT OBLIGATORY DEFAULT 'IS-U' MODIF ID m1 ,
cb_fs as CHECKBOX default 'X' modif id m1.
SELECTION-SCREEN end of BLOCK s1.
SELECTION-SCREEN skip.
SELECTION-SCREEN begin of block s2.
parameters : m_file type string obligatory modif id m2.
SELECTION-SCREEN end of BLOCK s2.
Now, when I process this screen and I I don't give a value to m_file, the fields s_desc and cb_fs becomes disabled. I want these fields to always remain enabled. How can this be achieved?
Thanks,
Sachin.
2008 Jul 30 9:50 AM
2008 Jul 30 9:50 AM
hi check this..
use the
at selection screen output.
loop at screen.
screen-name = 'XXXXX'.
screen-input = 0.
modify screen
endloop.
2008 Jul 30 9:50 AM
Hi,
Remove obligatory in
parameters : m_file type string obligatory modif id m2.Regards,
Anirban
2008 Jul 30 9:50 AM
HI
It cannot be automatically disabled there is some logic written in At selection-screen output
Event in the program.
if you remove that logic, then it will not be disabled.
2008 Jul 30 9:51 AM
Look at below examples. This will solve your problem
selection-screen begin of block b1 with frame.
select-options: glac for bseg-hkont obligatory,
dtfmto for bkpf-budat obligatory,
s_blart for bkpf-blart obligatory.
select-options: p_shkzg for bseg-shkzg .
select-options: kaugdt for bseg-augdt.
selection-screen end of block b1.
selection-screen begin of block b2 with frame.
parameters: rcleared radiobutton group srb,
ropen radiobutton group srb,
rboth radiobutton group srb default 'X',
caltbas as checkbox.
selection-screen end of block b2.
at selection-screen output.
if ropen eq 'X'.
loop at screen.
if screen-name eq '%_KAUGDT_%_APP_%-TEXT' or
screen-name eq '%_KAUGDT_%_APP_%-OPTI_PUSH' or
screen-name eq 'KAUGDT-LOW' or
screen-name eq '%_KAUGDT_%_APP_%-TO_TEXT' or
screen-name eq 'KAUGDT-HIGH' or
screen-name eq '%_KAUGDT_%_APP_%-VALU_PUSH' .
screen-active = 0.
endif.
modify screen.
endloop.
endif.
if rboth eq 'X'.
loop at screen.
if screen-name eq '%_KAUGDT_%_APP_%-TEXT' or
screen-name eq '%_KAUGDT_%_APP_%-OPTI_PUSH' or
screen-name eq 'KAUGDT-LOW' or
screen-name eq '%_KAUGDT_%_APP_%-TO_TEXT' or
screen-name eq 'KAUGDT-HIGH' or
screen-name eq '%_KAUGDT_%_APP_%-VALU_PUSH' .
screen-active = 0.
endif.
modify screen.
endloop.
endif.
if rcleared eq 'X'.
loop at screen.
if screen-name eq '%_KAUGDT_%_APP_%-TEXT' or
screen-name eq '%_KAUGDT_%_APP_%-OPTI_PUSH' or
screen-name eq 'KAUGDT-LOW' or
screen-name eq '%_KAUGDT_%_APP_%-TO_TEXT' or
screen-name eq 'KAUGDT-HIGH' or
screen-name eq '%_KAUGDT_%_APP_%-VALU_PUSH' .
screen-active = 1.
endif.
modify screen.
endloop.
endif.
if not kaugdt is initial.
loop at screen.
if screen-name eq 'ROPEN'.
screen-active = 0.
endif.
if screen-name eq 'RBOTH'.
screen-active = 0.
endif.
modify screen.
endloop.
endif.
Regards
rajesh
2008 Jul 30 9:51 AM
hi,
Put all the three fileds in one Block.
And Apply the neccessary validations in
At SELECTION-SCREEN On < BLOCK>.
Regards
Sumit Agarwal
2008 Jul 30 9:51 AM
check if U have written code in At selection screen output
to disable these fields ..
loop at screen.
if screen-name = 'S_DESC' or
screen-name = 'CB_FS'.
screen-input = 1. < -- it would be zero make it to 1
endif.
modify screen.
endloop.
2008 Jul 30 10:04 AM
Hi,
By default no fields will be disabled.. We will be disabling various fields based on our requirement in the event
AT SELECTION-SCREEN OUTPUT.
using Loop at screen.
if screen-name.....
endif.
Endloop.
So, check in the program whether they have used any conditions to disable.
Regards,
Meera
2008 Jul 30 10:08 AM
Hi,
I have wrotten the following code:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR m_file.
perform file_selection.
START-OF-SELECTION.
perform form_query.
perform fill_table.
perform file_prep.
I tried inseting At Selection-screen output and then loop at screen logic but still the fileds remain disabled.
Thanks,
Sachin.
2008 Jul 30 10:09 AM
2008 Jul 30 10:09 AM
Hi Sachin,
Are you using any event like AT SELECTION-SCREEN ON FIELD or AT SELECTION SCREEN ON BLOCK in your code?
If so, You just use the event AT SELECTION SCREEN. This will solve the issue.
Regards,
Swapna.
2008 Jul 30 10:15 AM
Hi,
I have not written any code in Inititalization or AT SELECTION-SCREEN ON FIELD or AT SELECTION SCREEN ON BLOCK.
Thanks,
Sachin
2008 Jul 30 10:23 AM
Hi Sachin,
I tried ur code. But it is not disabling the other field when i don't give input to m_file and press enter/Execute. In which version of SAP u r? I am in 4.6C. Can u paste ur whole code(Till START-OF-SELECTION event).
Try commenting every thing except selection screen and execute. Check what is happpening.
Check these things and get back.
Thanks,
Vinod.
2008 Jul 30 10:29 AM
Hi Vinod,
following is the code:
REPORT ZTABLES.
tables : DD02T.
INCLUDE ztablesdata.
*
INCLUDE ztablesforms.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR m_file.
perform file_selection.
START-OF-SELECTION.
perform form_query.
perform fill_table.
perform file_prep.
&----
*& Include ZTABLESDATA
&----
This include contains all the data related to ztables program.
SELECTION-SCREEN begin of BLOCK s1.
parameters : s_desc type string OBLIGATORY ,
cb_fs as CHECKBOX ,
m_file type string obligatory .
SELECTION-SCREEN end of BLOCK s1.
TYPES : BEGIN OF tdata,
tab_name type DD02T-TABNAME,
desc type DD02T-DDTEXT,
end of tdata.
DATA : wa_tdata TYPE tdata,
i_tdata type STANDARD TABLE OF tdata,
p_file type string .
&----
*& Include ZTABLESFORMS
&----
&----
*& Form FILL_TABLE
&----
text
----
--> p1 text
<-- p2 text
----
FORM FILL_TABLE .
wa_tdata-tab_name = 'Table Name'.
wa_tdata-desc = 'Short Description'.
append wa_tdata to i_tdata.
select tabname
ddtext
from dd02t
into table i_tdata
where ddtext like s_desc
and ddlanguage = 'E'.
ENDFORM. " FILL_TABLE
&----
*& Form FILE_PREP
&----
text
----
--> p1 text
<-- p2 text
----
FORM FILE_PREP .
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = p_file
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = '|'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
SHOW_TRANSFER_STATUS = ABAP_TRUE
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = i_tdata
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " FILE_PREP
&----
*& Form FILE_SELECTION
&----
text
----
--> p1 text
<-- p2 text
----
FORM FILE_SELECTION .
*CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
I_LOCATION_FLAG = 'P'
I_SERVER = 'P'
I_PATH = m_file
FILEMASK = '.'
FILEOPERATION = 'W'
IMPORTING
O_LOCATION_FLAG =
O_SERVER =
O_PATH = m_file
ABEND_FLAG =
EXCEPTIONS
RFC_ERROR = 1
ERROR_WITH_GUI = 2
OTHERS = 3
.
*IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
EXPORTING
WINDOW_TITLE = 'Save As'
DEFAULT_EXTENSION = '.txt'
DEFAULT_FILE_NAME = 'test'
WITH_ENCODING =
FILE_FILTER = '.txt'
INITIAL_DIRECTORY = 'c:'
DEFAULT_ENCODING =
IMPORTING
FILENAME =
PATH =
FULLPATH = m_file
USER_ACTION =
FILE_ENCODING =
.
p_file = m_file.
ENDFORM. " FILE_SELECTION
&----
*& Form FORM_QUERY
&----
text
----
--> p1 text
<-- p2 text
----
FORM FORM_QUERY .
if cb_fs = 'X'.
concatenate '%' s_desc '%' into s_desc.
endif.
ENDFORM. " FORM_QUERY
2008 Jul 30 11:52 AM
HI,
I don't find the reson why u r facing such peculier problem.
Try to add below code to ur code.
AT SELECTION-SCREEN OUTPUT.
LOOP AT screen.
screen-input = 1.
MODIFY screen.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR m_file.
perform file_selection.
START-OF-SELECTION.
perform form_query.
perform fill_table.
perform file_prep.
Hopefully it should solve ur issue.
Thanks,
Vinod.
2008 Aug 01 7:26 AM
Hi Sachin,
I tried ur code in ECC 5.0 and I am not facing any problems.. Which version are u using?
Regards,
Meera
2008 Aug 01 7:41 AM
Hi,
I am using ECC 6.0 I changed my code and now I am using Leave List-Processing. It is working.
Thanks everyone.
Sachin.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |