Application Development 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: 

supres selection screen.

Former Member
0 Kudos

Hi,

Can you please suggest me in which statement i am wrong ,i want to supress the second block(B1) on selection screen while i am selecting radio button 3.

REPORT ZFAGPRO no standard page heading line-size 180.

TABLES :ZFagpro,zretpro.

data : begin of itab occurs 0,

CLACN like zfagpro-CLACN,"Customer Loan Account Number

TACNO like zfagpro-TACNO,"Trust Bank Account Number

CHKNO like zfagpro-CHKNO,"Cheque Number

CHKDT(10)," like zfagpro-CHKDT,

PAYAM like zfagpro-PAYAM,

MODPY like zfagpro-MODPY,"Mode of Payment (Cheque /Cash)

CHKDD(10)," like zfagpro-CHKDD,

DPTBK like zfagpro-DPTBK,

DRWBK like zfagpro-DRWBK,

BOCLR like zfagpro-BOCLR,

CLRDT(10), "like zfagpro-CLRDT,

REORE like zfagpro-REORE,

DRCHR like zfagpro-DRCHR,

TNAME like zfagpro-TNAME,

end of itab.

data : begin of itab1 occurs 0,

clacn like zretpro-clacn,

PCUID like zretpro-PCUID,

BUKRS like zretpro-BUKRS,

CHKNO like zretpro-CHKNO,

CHKDT(10)," like zretpro-CHKDT,

PAYAM like zretpro-PAYAM,

TRAID like zretpro-TRAID,

CISBN like zretpro-CISBN,

CISBC like zretpro-CISBC,

TACNO like zretpro-TACNO,

end of itab1.

initialization.

skip 1.

skip 4.

selection-screen begin of block b2 with frame title text-002.

parameters : r1 radiobutton group g1.

parameters : r2 radiobutton group g1.

parameters : r3 radiobutton group g1." modif id jit.

selection-screen end of block b2.

selection-screen begin of block b3 with frame title text-007.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-006.

PARAMETERS: p_file(90) OBLIGATORY modif id bbb.

SELECTION-SCREEN END OF BLOCK b1.

selection-screen end of block b3.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

def_filename = space

def_path = space

mask = ',.,..'

mode = space

title = space

IMPORTING

filename = p_file

EXCEPTIONS

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 4

OTHERS = 5.

IF sy-subrc <> 0 AND sy-subrc <> 3.

MESSAGE e102(yb) WITH 'Error Selecting File'(007).

ENDIF.

at selection-screen output.

if r3 = 'X'.

loop at screen.

if screen-group1 = 'BBB'.

screen-active = 0.

screen-invisible = 1.

endif.

endloop.

endif.

start-of-selection.

if r1 = 'X'.

DATA: filename TYPE string.

filename = p_file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = filename

filetype = 'ASC'

has_field_separator = 'X'

TABLES

data_tab = itab

EXCEPTIONS

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

OTHERS = 17.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

DATA : A1 TYPE SY-DATUM,

A2 TYPE SY-DATUM,

A3 TYPE SY-DATUM.

loop at itab.

ZFAGPRO-CLACN = ITAB-CLACN.

ZFAGPRO-TACNO = ITAB-TACNO.

ZFAGPRO-CHKNO = ITAB-CHKNO.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = ITAB-CHKDT

IMPORTING

DATE_INTERNAL = A1

EXCEPTIONS

DATE_EXTERNAL_IS_INVALID = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ZFAGPRO-CHKDT = A1.

ZFAGPRO-PAYAM = ITAB-PAYAM.

ZFAGPRO-MODPY = ITAB-MODPY.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = ITAB-CHKDT

IMPORTING

DATE_INTERNAL = A2

EXCEPTIONS

DATE_EXTERNAL_IS_INVALID = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ZFAGPRO-CHKDD = A2.

ZFAGPRO-DPTBK = ITAB-DPTBK.

zfagpro-DRWBK = ITAB-DRWBK.

zfagpro-BOCLR = ITAB-BOCLR.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = ITAB-CHKDT

IMPORTING

DATE_INTERNAL = A3

EXCEPTIONS

DATE_EXTERNAL_IS_INVALID = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

zfagpro-CLRDT = A3.

zfagpro-REORE = ITAB-REORE.

zfagpro-DRCHR = ITAB-DRCHR.

zfagpro-TNAME = ITAB-TNAME.

INSERT ZFAGPRO.

if sy-subrc = 0.

write 😕 'sucees fully inserted record NO',sy-tabix,itab-clacn,itab-chkno,itab-chkdt,itab-payam.

else.

write 😕 'Record all ready exist',sy-tabix,itab-clacn,itab-chkno,itab-chkdt,itab-payam.

endif.

endloop.

else.

DATA: filename1 TYPE string.

filename1 = p_file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = filename1

filetype = 'ASC'

has_field_separator = 'X'

TABLES

data_tab = itab1

EXCEPTIONS

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

OTHERS = 17.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

data : b1 type sy-datum.

loop at itab1.

zretpro-clacn = itab1-clacn.

zretpro-PCUID = itab1-PCUID.

zretpro-BUKRS = itab1-BUKRS.

zretpro-CHKNO = itab1-CHKNO.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = ITAB1-CHKDT

IMPORTING

DATE_INTERNAL = b1

EXCEPTIONS

DATE_EXTERNAL_IS_INVALID = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

zretpro-CHKDT = b1.

zretpro-PAYAM = itab1-PAYAM.

zretpro-TRAID = itab1-TRAID.

zretpro-CISBN = itab1-CISBN.

zretpro-CISBC = itab1-CISBC.

zretpro-TACNO = itab1-TACNO.

insert zretpro.

if sy-subrc = 0.

write 😕 'sucees fully inserted record NO',sy-tabix,itab1-clacn,itab1-chkno,itab1-chkdt,itab-payam.

else.

write 😕 'Record all ready exist',sy-tabix,itab1-clacn,itab1-chkno,itab1-chkdt,itab1-payam.

endif.

endloop.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

try with this code.

tables sscrfields.

selection-screen begin of block b2 with frame title text-002.

parameters : r1 radiobutton group g1 user-command uc1.

parameters : r2 radiobutton group g1.

parameters : r3 radiobutton group g1." modif id jit.

selection-screen end of block b2.

selection-screen begin of block b3 with frame title text-007.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-006.

                • don't make p_file as obligatory and raise the messge if P_file

***********is initial

PARAMETERS: p_file(90) modif id bbb. " don't make as obligatory

SELECTION-SCREEN END OF BLOCK b1.

selection-screen end of block b3.

at selection-screen output .

if r3 = 'X'.

loop at screen.

if screen-group1 = 'BBB'.

screen-active = 0.

modify screen.

endif.

endloop.

endif.

at selection-screen.

if r1 = 'X' or r2 = 'X'.

message 'enter the file path' type 'E'."raise a message if p_file is

endif.

Regards,

Suresh

18 REPLIES 18

Former Member
0 Kudos

Hi,

change code as :

loop at screen.
if screen-group1 = 'BBB'.

screen-active = 0.
screen-invisible = 1.
*modify screen.*
endif.
endloop.

You forgot modify statement.

Thanks & Regards,

Navneeth K.

0 Kudos

Are you not able to supress selection block, after adding Modify statement. ?

0 Kudos

statement modify screen is included ,even though it is not working

0 Kudos

Can you paste the modified code

0 Kudos

hi ,

IF r3 = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'BBB'.
        screen-input = '1'.
        screen-active = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

  ENDIF.

Thanks & Regards

Former Member
0 Kudos

if r3 = 'X'.

loop at screen.

if screen-group1 = 'BBB'.

screen-active = 0.

screen-invisible = 1.------>not needed

modify screen----


>specify

endif.

endloop.

endif.

Former Member
0 Kudos

Hi,

This code is all you need....

just after your selection screen design.


AT SELECTION-SCREEN OUTPUT.
  
  IF   r3 = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 =  'BBB'.
        screen-active = '0'.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.

0 Kudos

hi,

suggest me, same problem.

&----


*& Report ZFAGPRO

*&

&----


*&

*&

&----


REPORT ZFAGPRO no standard page heading line-size 180.

TABLES :ZFagpro,zretpro.

data : begin of itab occurs 0,

CLACN like zfagpro-CLACN,"Customer Loan Account Number

TACNO like zfagpro-TACNO,"Trust Bank Account Number

CHKNO like zfagpro-CHKNO,"Cheque Number

CHKDT(10)," like zfagpro-CHKDT,

PAYAM like zfagpro-PAYAM,

MODPY like zfagpro-MODPY,"Mode of Payment (Cheque /Cash)

CHKDD(10)," like zfagpro-CHKDD,

DPTBK like zfagpro-DPTBK,

DRWBK like zfagpro-DRWBK,

BOCLR like zfagpro-BOCLR,

CLRDT(10), "like zfagpro-CLRDT,

REORE like zfagpro-REORE,

DRCHR like zfagpro-DRCHR,

TNAME like zfagpro-TNAME,

end of itab.

data : begin of itab1 occurs 0,

clacn like zretpro-clacn,

PCUID like zretpro-PCUID,

BUKRS like zretpro-BUKRS,

CHKNO like zretpro-CHKNO,

CHKDT(10)," like zretpro-CHKDT,

PAYAM like zretpro-PAYAM,

TRAID like zretpro-TRAID,

CISBN like zretpro-CISBN,

CISBC like zretpro-CISBC,

TACNO like zretpro-TACNO,

end of itab1.

initialization.

skip 1.

skip 4.

selection-screen begin of block b2 with frame title text-002.

parameters : r1 radiobutton group g1.

parameters : r2 radiobutton group g1.

parameters : r3 radiobutton group g1." modif id jit.

selection-screen end of block b2.

selection-screen begin of block b3 with frame title text-007.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-006.

PARAMETERS: p_file(90) OBLIGATORY modif id bbb.

SELECTION-SCREEN END OF BLOCK b1.

selection-screen end of block b3.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

def_filename = space

def_path = space

mask = ',.,..'

mode = space

title = space

IMPORTING

filename = p_file

EXCEPTIONS

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 4

OTHERS = 5.

IF sy-subrc <> 0 AND sy-subrc <> 3.

MESSAGE e102(yb) WITH 'Error Selecting File'(007).

ENDIF.

*at selection-screen output.

*

  • if r3 = 'X'.

  • loop at screen.

  • if screen-group1 = 'BBB'.

*

  • screen-active = 0.

  • screen-invisible = 1.

  • modify screen.

  • endif.

  • endloop.

AT SELECTION-SCREEN OUTPUT.

IF r3 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'BBB'.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

endif.

start-of-selection.

if r1 = 'X'.

DATA: filename TYPE string.

filename = p_file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = filename

filetype = 'ASC'

has_field_separator = 'X'

TABLES

data_tab = itab

EXCEPTIONS

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

OTHERS = 17.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

DATA : A1 TYPE SY-DATUM,

A2 TYPE SY-DATUM,

A3 TYPE SY-DATUM.

loop at itab.

ZFAGPRO-CLACN = ITAB-CLACN.

ZFAGPRO-TACNO = ITAB-TACNO.

ZFAGPRO-CHKNO = ITAB-CHKNO.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = ITAB-CHKDT

IMPORTING

DATE_INTERNAL = A1

EXCEPTIONS

DATE_EXTERNAL_IS_INVALID = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ZFAGPRO-CHKDT = A1.

ZFAGPRO-PAYAM = ITAB-PAYAM.

ZFAGPRO-MODPY = ITAB-MODPY.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = ITAB-CHKDT

IMPORTING

DATE_INTERNAL = A2

EXCEPTIONS

DATE_EXTERNAL_IS_INVALID = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ZFAGPRO-CHKDD = A2.

ZFAGPRO-DPTBK = ITAB-DPTBK.

zfagpro-DRWBK = ITAB-DRWBK.

zfagpro-BOCLR = ITAB-BOCLR.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = ITAB-CHKDT

IMPORTING

DATE_INTERNAL = A3

EXCEPTIONS

DATE_EXTERNAL_IS_INVALID = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

zfagpro-CLRDT = A3.

zfagpro-REORE = ITAB-REORE.

zfagpro-DRCHR = ITAB-DRCHR.

zfagpro-TNAME = ITAB-TNAME.

INSERT ZFAGPRO.

if sy-subrc = 0.

write 😕 'sucees fully inserted record NO',sy-tabix,itab-clacn,itab-chkno,itab-chkdt,itab-payam.

else.

write 😕 'Record all ready exist',sy-tabix,itab-clacn,itab-chkno,itab-chkdt,itab-payam.

endif.

endloop.

else.

DATA: filename1 TYPE string.

filename1 = p_file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = filename1

filetype = 'ASC'

has_field_separator = 'X'

TABLES

data_tab = itab1

EXCEPTIONS

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

OTHERS = 17.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

data : b1 type sy-datum.

loop at itab1.

zretpro-clacn = itab1-clacn.

zretpro-PCUID = itab1-PCUID.

zretpro-BUKRS = itab1-BUKRS.

zretpro-CHKNO = itab1-CHKNO.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = ITAB1-CHKDT

IMPORTING

DATE_INTERNAL = b1

EXCEPTIONS

DATE_EXTERNAL_IS_INVALID = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

zretpro-CHKDT = b1.

zretpro-PAYAM = itab1-PAYAM.

zretpro-TRAID = itab1-TRAID.

zretpro-CISBN = itab1-CISBN.

zretpro-CISBC = itab1-CISBC.

zretpro-TACNO = itab1-TACNO.

insert zretpro.

if sy-subrc = 0.

write 😕 'sucees fully inserted record NO',sy-tabix,itab1-clacn,itab1-chkno,itab1-chkdt,itab-payam.

else.

write 😕 'Record all ready exist',sy-tabix,itab1-clacn,itab1-chkno,itab1-chkdt,itab1-payam.

endif.

endloop.

endif.

0 Kudos

parameters : r1 radiobutton group g1 user command sd.

parameters : r2 radiobutton group g1.

parameters : r3 radiobutton group g1.

specify the user command in paramertes as mentioned above.

otherwise if u double click on the selection screen it will work.

0 Kudos

Please check the screen-group name first, is it given right ?

screen-group1 = 'BBB'. "Is it BBB or should we give B3

0 Kudos

PARAMETERS: p_file(90) OBLIGATORY modif id bbb.

0 Kudos

check what i gave above man

it will work if u give this

parameters : r1 radiobutton group g1 user command sd.

parameters : r2 radiobutton group g1.

parameters : r3 radiobutton group g1.

specify the user command in paramertes as mentioned above.

otherwise if u double click on the selection screen it will work.

0 Kudos

Trying giving

If screen-name = 'P_FILE'.

rather than

screen-group = 'BBB'

0 Kudos

screen group is bbb.

0 Kudos

Put it under event

At Selection-screen.

Former Member
0 Kudos

Hi,

Please check the following code to dynamically diplay .

LOOP AT SCREEN .

IF NOT L_TABNAME IS INITIAL.

IF SCREEN-GROUP1 = 'B1'.

SCREEN-ACTIVE = 1 .

MODIFY SCREEN.

ENDIF.

ELSE.

IF SCREEN-GROUP1 = 'B1'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

Regards,

Tarak

Former Member
0 Kudos

Hi,

try with this code.

tables sscrfields.

selection-screen begin of block b2 with frame title text-002.

parameters : r1 radiobutton group g1 user-command uc1.

parameters : r2 radiobutton group g1.

parameters : r3 radiobutton group g1." modif id jit.

selection-screen end of block b2.

selection-screen begin of block b3 with frame title text-007.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-006.

                • don't make p_file as obligatory and raise the messge if P_file

***********is initial

PARAMETERS: p_file(90) modif id bbb. " don't make as obligatory

SELECTION-SCREEN END OF BLOCK b1.

selection-screen end of block b3.

at selection-screen output .

if r3 = 'X'.

loop at screen.

if screen-group1 = 'BBB'.

screen-active = 0.

modify screen.

endif.

endloop.

endif.

at selection-screen.

if r1 = 'X' or r2 = 'X'.

message 'enter the file path' type 'E'."raise a message if p_file is

endif.

Regards,

Suresh

0 Kudos

thanks suresh

yes just i removed file obligatory now it is working