Application Development and Automation 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: 
Read only

BDC

Former Member
0 Likes
327

How to give two paths in BDC while data uploading?

3 REPLIES 3
Read only

amit_khare
Active Contributor
0 Likes
308

SELECTION-SCREEN BEGIN OF BLOCK rs1 WITH FRAME TITLE text-001.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS p_psrv RADIOBUTTON GROUP rad1 DEFAULT 'X'.

SELECTION-SCREEN COMMENT 5(21) text-002.

SELECTION-SCREEN POSITION 30.

PARAMETERS p_pfile TYPE rlgrap-filename DEFAULT ' '.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS p_asrv RADIOBUTTON GROUP rad1.

SELECTION-SCREEN COMMENT 5(21) text-003.

SELECTION-SCREEN POSITION 30.

PARAMETERS p_afile TYPE rlgrap-filename .

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK rs1.

IF NOT p_psrv IS INITIAL.

PERFORM get_data_from_pressvr. "**----> UPLOAD FROM PC

ELSE.

PERFORM get_data_from_appsevr. "**----> UPLOAD FROM SERVER

ENDIF.

&----


*& Form get_data_from_pressvr

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_data_from_pressvr .

MOVE p_pfile TO v_file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = v_file

filetype = 'ASC'

TABLES

data_tab = it_upload

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.

ENDIF.

endform. " get_data_from_pressvr

&----


*& Form get_data_from_appsevr

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_data_from_appsevr .

OPEN DATASET p_afile FOR INPUT IN TEXT MODE.

IF NOT sy-subrc IS INITIAL.

MESSAGE e003 WITH p_afile.

ENDIF.

DO.

READ DATASET p_afile INTO it_upload.

IF sy-subrc IS INITIAL.

APPEND it_upload.

CLEAR it_upload.

ELSE.

EXIT.

ENDIF.

ENDDO.

CLOSE DATASET p_afile.

endform. " get_data_from_appsevr

Regardt

Reward all helpful replies.

Amiot

Read only

Former Member
0 Likes
308

You will have two radio buttons .

parameters :P_file1 type c RADIOBUTTON GROUP rbl1 default 'X',

P_file2 type c radiobutton group rb1 .

parameters : P_file like rlgrap-filename obligatory.

P_file1 - Presentation File

p_file2 - Application File

When user select one of the radio button,then it will download or upload the data.

Reward Points if it is useful

Thanks

Seshu

Read only

Former Member
0 Likes
308

Hello,

You can make use of check boxes in the selection screen to have 2 different files for teh BDC.

For Example

PARAMETERS : p_check1(1) AS CHECKBOX, -- Presentation Server

p_check2(1) AS CHECKBOX. -- Application Server

SELECT-OPTIONS :

p_file1 LIKE rlgrap-filename .

******

IF p_check1 EQ 'X'.

<Upload the file Using the GUI_UPLOAD fm>

ELSEIF p_check2 EQ 'X'.

<Upload the file from Application SERVER using the commands OPEN DATASET >

ENDIF.

Regards,

Sowmya