Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

supres selection screen.

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.

Tags:
replied

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 View this answer in context
Not what you were looking for? View more on this topic or Ask a question