Skip to Content

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

Selection Screen

Hi gurus,

I have a condition where I need to upload the file to my program, the file may either come from the system or from the application server, so basically I need to ask user from which way it is coming and then if the user entered that its coming from the computer then I need to ask him the location of the file and same as in the case if user selects applications server,

So far what I know is that first we need to use the radio buttons to ask the user to select either of the option and then as per his selection we need him to enter the file location. For this I tried the below code and this code allows me to select either of the option and now I have two more concerns, as soon as I select the radio button which says that file is coming from the server I should ask the user to enter the file location. I believe this could achieve by using CALL FUNCTION 'F4_FILENAME' and once he selected the file location then I need to upload that file using the function module WS_UPLOAD, so can you please tell me how to get this thing done.

REPORT Z_TEST1 .

*--- Radiobuttons

PARAMETERS: p_up RADIOBUTTON GROUP a DEFAULT 'X' USER-COMMAND rb,

p_list RADIOBUTTON GROUP a.

PARAMETERS: p_pcfile LIKE rlgrap-filename OBLIGATORY

MODIF ID ccc.

Parameters: p_unix LIKE rlgrap-filename OBLIGATORY DEFAULT '.\'

MODIF ID ddd.

*----


  • AT SELECTION-SCREEN

*----


AT SELECTION-SCREEN OUTPUT.

IF p_up = 'X' .

LOOP AT SCREEN.

CASE screen-group1.

WHEN 'CCC'.

screen-input = 1. "Enable

screen-invisible = 0. "Disable

MODIFY SCREEN.

WHEN 'DDD'.

screen-input = 0.

screen-invisible = 1.

MODIFY SCREEN.

ENDCASE.

  • CALL FUNCTION 'F4_FILENAME' "allows user to select path/file

  • EXPORTING

  • program_name = 'ZMMINT_PO_CONVERSION'

  • dynpro_number = syst-dynnr

  • field_name = 'p_up'

  • IMPORTING

  • file_name = p_up.

ENDLOOP.

ENDIF.

IF p_list = 'X'.

LOOP AT SCREEN.

CASE screen-group1.

WHEN 'CCC'.

screen-input = 0.

screen-invisible = 1.

MODIFY SCREEN.

WHEN 'DDD'.

screen-input = 1.

screen-invisible = 0.

MODIFY SCREEN.

ENDCASE.

ENDLOOP.

ENDIF.

Thanks in advance

Rajeev Gupta

Message was edited by:

Rajeev Gupta

Tags:
Former Member
Former Member replied

Put this code in a separate event -

At selection-screen on value-request for p_pcfile.

CALL FUNCTION 'F4_FILENAME' "allows user to select path/file

EXPORTING

program_name = 'Z_TEST1'

dynpro_number = syst-dynnr

field_name = 'p_pcfile'

IMPORTING

file_name = p_pcfile.

ashish

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question