Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Enabling Parameters

Former Member
0 Likes
1,713

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.

17 REPLIES 17
Read only

Former Member
0 Likes
1,683

hiii

remove obligatory with m_file parameter.

regards

twinkal

Read only

Former Member
0 Likes
1,683

hi check this..

use the

at selection screen output.

loop at screen.

screen-name = 'XXXXX'.

screen-input = 0.

modify screen

endloop.

Read only

Former Member
0 Likes
1,683

Hi,

Remove obligatory in

parameters : m_file type string obligatory modif id m2.

Regards,

Anirban

Read only

Former Member
0 Likes
1,683

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.

Read only

Former Member
0 Likes
1,683

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

Read only

Former Member
0 Likes
1,683

hi,

Put all the three fileds in one Block.

And Apply the neccessary validations in

At SELECTION-SCREEN On < BLOCK>.

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
1,683

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.

Read only

Former Member
0 Likes
1,683

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

Read only

0 Likes
1,683

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.

Read only

0 Likes
1,683

check if U have written the logic in Initialization ...

Read only

Former Member
0 Likes
1,683

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.

Read only

0 Likes
1,683

Hi,

I have not written any code in Inititalization or AT SELECTION-SCREEN ON FIELD or AT SELECTION SCREEN ON BLOCK.

Thanks,

Sachin

Read only

0 Likes
1,683

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.

Read only

0 Likes
1,683

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

Read only

0 Likes
1,683

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.

Read only

0 Likes
1,683

Hi Sachin,

I tried ur code in ECC 5.0 and I am not facing any problems.. Which version are u using?

Regards,

Meera

Read only

0 Likes
1,683

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.