Skip to Content
author's profile photo Former Member
Former Member

selection-screen design

Hi everyone,

I am working on a project for which I have to design a selection-screen.

The requirement is such that there are 3 obligatory fields to be filled by the user, which are as follows:

P_LAUFD(parameter,obligatory-date),

P_LAUFI(parameter,obligatory-id),

P_FILENM(parameter,obligatory-filename),

P_LOKAAL(checkbox).

The requirement is such that when the user does not check the checkbox the search help for P_FILENM should show the files from the application server,and when it is checked the files from the presentation server should be shown.

The code that I have written is listed below, but there is a problem with it.

When I don't enter anything in the first 2 fields, the search field for the 3rd field functions as required, but if I first enter something in the first 2 fields and then click on the checkbox, the search help for P_FILENM does not function as reaquired.

Please advise.

Also if possible could you'll kindly explain the sequence of events that is getting triggered?

***************************************

&----


*& Include Z6890_PROJINCLUDE_SEL_SCREEN *

&----


TABLES : SSCRFIELDS.

DATA: FILE LIKE DXFIELDS-LONGPATH.

DATA V_FILENAME LIKE IBIPPARMS-PATH.

DATA: TMP TYPE SSCRFIELDS-UCOMM.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS: P_LAUFD TYPE D OBLIGATORY,

P_LAUFI(6) TYPE C OBLIGATORY.

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.

PARAMETERS: P_FILENM(128) TYPE C OBLIGATORY.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN POSITION 33.

PARAMETER: P_LOKAAL AS CHECKBOX USER-COMMAND SRC.

SELECTION-SCREEN COMMENT 35(6) TEXT-003.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK B2.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-004.

PARAMETERS: P_DEL(2) TYPE C .

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(12) TEXT-005 FOR FIELD P_APPL.

SELECTION-SCREEN POSITION 33.

PARAMETERS: P_APPL(3) TYPE C.

SELECTION-SCREEN POSITION 37.

PARAMETERS: P_APDESC(40) TYPE C.

SELECTION-SCREEN END OF LINE.

PARAMETERS: P_MKDT(8) TYPE N,

P_NOINV(6) TYPE N.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(12) TEXT-006 FOR FIELD P_TOAMNT.

SELECTION-SCREEN POSITION 33.

PARAMETERS: P_TOAMNT(13) TYPE N.

SELECTION-SCREEN POSITION 47.

PARAMETERS: P_TEKEN(1) TYPE C.

SELECTION-SCREEN END OF LINE.

PARAMETERS: P_DESC(60) TYPE C.

SELECTION-SCREEN END OF BLOCK B3.

***********************************************************************************************REPORT Z6890_PROJ_REPORT_DRAFT .

DATA: BEGIN OF GW_LINE,

TEXT(700) TYPE C,

END OF GW_LINE.

DATA: GIN_FILE LIKE TABLE OF GW_LINE.

INCLUDE Z6890_PROJINCLUDE_SEL_SCREEN.

AT SELECTION-SCREEN.

CASE SY-UCOMM.

WHEN 'EXEC'.

IF P_LOKAAL = 'X'.

PERFORM MV_DATA_FRM_PRES_INT .

ELSE.

PERFORM OPEN_FILE_ONAPP_SERVER.

ENDIF.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P_DEL'.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

P_DEL = 'HI'.

ENDIF.

IF SCREEN-NAME = 'P_APPL'.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

P_APPL = 'CHF'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

WHEN 'BACK'.

LEAVE PROGRAM.

WHEN 'EXIT'.

LEAVE PROGRAM.

WHEN 'CANCEL'.

LEAVE PROGRAM.

ENDCASE.

AT SELECTION-SCREEN OUTPUT.

SET PF-STATUS 'PROJ'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P_DEL'.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

ENDIF.

IF SCREEN-NAME = 'P_APPL'.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

ENDIF.

IF SCREEN-NAME = 'P_APDESC'.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

ENDIF.

IF SCREEN-NAME = 'P_MKDT'.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

ENDIF.

IF SCREEN-NAME = 'P_NOINV'.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

ENDIF.

IF SCREEN-NAME = 'P_TOAMNT'.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

ENDIF.

IF SCREEN-NAME = 'P_TEKEN'.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

ENDIF.

IF SCREEN-NAME = 'P_DESC'.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LAUFD.

CALL FUNCTION 'F4_DATE'

EXPORTING

DATE_FOR_FIRST_MONTH = SY-DATUM

DISPLAY = ' '

  • FACTORY_CALENDAR_ID = ' '

  • GREGORIAN_CALENDAR_FLAG = ' '

  • HOLIDAY_CALENDAR_ID = ' '

  • PROGNAME_FOR_FIRST_MONTH = ' '

IMPORTING

SELECT_DATE = P_LAUFD

  • SELECT_WEEK =

  • SELECT_WEEK_BEGIN =

  • SELECT_WEEK_END =

  • EXCEPTIONS

  • CALENDAR_BUFFER_NOT_LOADABLE = 1

  • DATE_AFTER_RANGE = 2

  • DATE_BEFORE_RANGE = 3

  • DATE_INVALID = 4

  • FACTORY_CALENDAR_NOT_FOUND = 5

  • HOLIDAY_CALENDAR_NOT_FOUND = 6

  • PARAMETER_CONFLICT = 7

  • OTHERS = 8

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILENM.

IF TMP = SSCRFIELDS-UCOMM.

CLEAR SSCRFIELDS-UCOMM.

CLEAR TMP.

ELSE.

SSCRFIELDS-UCOMM = 'SRC'.

ENDIF.

CASE SSCRFIELDS-UCOMM.

WHEN 'SRC'.

TMP = SSCRFIELDS-UCOMM.

CALL FUNCTION '/SAPDMC/LSM_F4_FRONTEND_FILE'

  • EXPORTING

  • PATHNAME =

CHANGING

PATHFILE = V_FILENAME

EXCEPTIONS

CANCELED_BY_USER = 1

  • SYSTEM_ERROR = 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.

IF SY-SUBRC = 1.

MESSAGE I000(Z6890_PROJ) .

ENDIF.

ENDIF.

P_FILENM = V_FILENAME.

CLEAR SSCRFIELDS-UCOMM.

WHEN OTHERS.

CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'

EXPORTING

I_LOCATION_FLAG = 'A'

I_SERVER = 'ides47_i47_00'

I_PATH = 'D:\usr\sap\'

FILEMASK = '.'

FILEOPERATION = 'R'

IMPORTING

  • O_LOCATION_FLAG =

  • O_SERVER =

O_PATH = 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.

P_FILENM = FILE.

  • CLEAR SSCRFIELDS-UCOMM.

ENDCASE.

&----


*& Form MV_DATA_FRM_PRES_INT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM MV_DATA_FRM_PRES_INT .

DATA: F_NAME TYPE STRING.

F_NAME = P_FILENM.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = F_NAME

FILETYPE = 'ASC'

  • HAS_FIELD_SEPARATOR = ' '

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • IMPORTING

  • FILELENGTH =

  • HEADER =

TABLES

DATA_TAB = GIN_FILE

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.

IF SY-SUBRC = 1.

  • LEAVE TO LIST-PROCESSING.

  • WRITE: / 'Error: File could not be opened!'.

MESSAGE I001(Z6890_PROJ) WITH P_FILENM.

ENDIF.

BREAK-POINT.

ENDFORM. " MV_DATA_FRM_PRES_INT

&----


*& Form OPEN_FILE_ONAPP_SERVER

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM OPEN_FILE_ONAPP_SERVER .

ENDFORM.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2007 at 05:17 AM

    Hi Piyush,

    Add the below code in your program.

    *Note: you have to take two parameters for files.

    • If you select check box then p_pc parameter is visible.

    • if you dont select check box then p_app parameter is visible.

    PARAMETERS: p_chk1 AS CHECKBOX USER-COMMAND rusr.

    SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME.

    PARAMETERS: p_pc LIKE rlgrap-filename MODIF ID abc.

    PARAMETERS: p_app LIKE rlgrap-filename MODIF ID def.

    SELECTION-SCREEN: END OF BLOCK blk1.

    AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN.

    IF screen-group1 = 'ABC'.

    CLEAR: p_pc, p_app.

    IF p_chk1 = 'X'.

    screen-active = 1.

    ELSE.

    screen-active = 0.

    ENDIF.

    MODIFY SCREEN.

    ENDIF.

    IF screen-group1 = 'DEF'.

    CLEAR: p_pc, p_app.

    IF p_chk1 <> 'X'.

    screen-active = 1.

    ELSE.

    screen-active = 0.

    ENDIF.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_app.

    PERFORM get_fname_app.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_pc.

    CALL FUNCTION 'F4_FILENAME'

    IMPORTING

    file_name = p_pc.

    &----


    *& Form get_fname_app

    &----


    • text

    ----


    FORM get_fname_app.

    DATA: c_fnh_mask TYPE dxfields-filemask VALUE '.',

    search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',

    file_path LIKE dxfields-longpath.

    CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'

    EXPORTING

    i_location_flag = 'A'

    i_server = ' '

    i_path = search_dir

    filemask = c_fnh_mask

    fileoperation = 'R'

    IMPORTING

    o_path = file_path

    EXCEPTIONS

    rfc_error = 1

    OTHERS = 2.

    IF sy-subrc EQ 0.

    p_app = file_path.

    ENDIF.

    ENDFORM. "get_fname_app

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.