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: 

Uploading the File...

Former Member
0 Kudos

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. Can you please tell me how to achieve this, please try to give me an example because I asked the same question before also but didn't get any suitable response.

Help will really be appreciated

Thanks

Rajeev Gupta

4 REPLIES 4

Former Member
0 Kudos

Rajeev,

Ur initial guess is correct. Create radio buttons in the selection screen.

if r_app = 'X'.
perform app_server.
elseif r_pres = 'X'.
perform pres_server.
endif.

form app_server.
Use open dataset,close dataset etc..
endform.

form pres_server.
Use FM GUI_UPLOAD.
endform.

Regards

Aneesh.

0 Kudos

Hey Aseesh,

Thanks for the reply.

ActuallY once user selected that the file is coming from the server then I need to create one more selection screen for user to enter the location of the file and same in the case of the file coming from the system. Please try elaborate a little bit.

Thanks

Rajeev Gupta

0 Kudos

Rajeev,

Refer this thread. Same problem as yours.

Regards

Aneesh.

Former Member
0 Kudos

Hello,

Check this sample.


SELECTION-SCREEN BEGIN OF BLOCK B02 WITH FRAME TITLE TEXT-SB2.
PARAMETERS: FILENAME LIKE EPSF-EPSDIRNAM
            DEFAULT '\FS000P01P48ZKOBERICHTMITKOART.TXT'.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN ULINE.
PARAMETERS: AP RADIOBUTTON GROUP GRP1,
            PC RADIOBUTTON GROUP GRP1.
SELECTION-SCREEN END OF BLOCK B02.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILENAME.
  PERFORM FRONTEND_FILE CHANGING FILENAME.

FORM FRONTEND_FILE CHANGING P_FILENAME.

  CALL FUNCTION '/SAPDMC/LSM_F4_FRONTEND_FILE'
       EXPORTING
            PATHNAME         = 'C:'
       CHANGING
            PATHFILE         = P_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.
  ENDIF.

ENDFORM.                    " frontend_file

START-OF-SELECTION.
  IF NOT AP IS INITIAL.
    PERFORM GET_FILENAME CHANGING FILENAME
                                  RC.

    PERFORM UPLOAD_APPLICATION_SERVER TABLES IT_FILE
                                      USING  FILENAME
                                    CHANGING RC.
  ENDIF.
  IF NOT PC IS INITIAL.
    PERFORM UPLOAD_WORKSTATION TABLES IT_FILE
                               USING  FILENAME
                             CHANGING RC.
  ENDIF.

Hope thiw will helps you.

Cheers,

Vasanth