‎2007 Sep 11 4:08 AM
Hi All,
My BDC program only able to run in "Display errors only" & "Foreground" mode.
If I running in Background Mode, it will get error as below.
Can anyone explain what are the caused of this errors? Have any solution to it??
Error :
Control Framework: Fatal error - GUI cannot be reached
Runtime error RAISE_EXCEPTION has occurred
Thanks.
‎2007 Sep 11 5:01 AM
Hi..
this error comes when the Tcode is an Enjoy Transaction like ME51N, ME21N.
Bcoz these transactions will use CONTROLS that are not Supported in BDC.
For enjoy Transaction always use BAPI to migrate the Data.
Otherwise use the Conventional Tcode like ME21 for BDC.
<b>reward if Helpful</b>
‎2007 Sep 11 5:01 AM
Hi..
this error comes when the Tcode is an Enjoy Transaction like ME51N, ME21N.
Bcoz these transactions will use CONTROLS that are not Supported in BDC.
For enjoy Transaction always use BAPI to migrate the Data.
Otherwise use the Conventional Tcode like ME21 for BDC.
<b>reward if Helpful</b>
‎2007 Sep 11 6:59 AM
Hi...........
R u taking the file from presentation server or application server???..............if u r trying to upload the file from presentation server GUL_<b>upload</b> and GUI_<b>download</b> will work...........if the file is in application server then u have to use open dataset to read the file...............................
Reward points if helpful................
Regards,
Sree.
‎2007 Sep 11 7:08 AM
Hi
We cannot upload data from Presentation Server files in Background mode.
So checkout whether you are using GUI_UPLOAD..
In that case it cannot be run in background.
<b>reward if Helpful</b>
‎2007 Sep 11 7:23 AM
Hi follow this code ,
REPORT zpurcloseing
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA: x_file TYPE string.
INTERNAL TABLE DECLARATION***************************
DATA : BEGIN OF itab OCCURS 0,
banfn TYPE eban-banfn,
ebakz TYPE eban-ebakz,
menge TYPE eban-menge,
ekgrp TYPE eban-ekgrp ,
dispo TYPE eban-dispo,
frgdt TYPE eban-frgdt ,
webaz TYPE eban-webaz,
preis TYPE eban-preis ,
waers TYPE eban-waers ,
peinh TYPE eban-peinh,
repos TYPE eban-repos ,
ekorg TYPE eban-ekorg,
END OF itab.
**********END OF INTERNAL TABLE DECLARATION*****************
PARAMETERS : p_file TYPE rlgrap-filename OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM f4_help.
*include bdcrecx1.
START-OF-SELECTION.
MOVE p_file TO x_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = x_file
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.
WRITE:/ 'internal table not populated ' .
ENDIF.
PERFORM open_group.
LOOP AT itab.
REFRESH bdcdata.
CLEAR bdcdata.
PERFORM bdc_dynpro USING 'SAPMM06B' '0105'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-BANFN'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-BANFN'
itab-banfn.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RM06B-BNFPO'
'10'.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RM06B-BNFPO'
'10'.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-BNFPO(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=DETA'.
PERFORM bdc_field USING 'RM06B-BNFPO'
'10'.
PERFORM bdc_field USING 'RM06B-TCSELFLAG(01)'
'X'.
PERFORM bdc_dynpro USING 'SAPMM06B' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-EBAKZ'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_field USING 'EBAN-TXZ01'
'HMHD Liner 22"x36"x100gm'.
PERFORM bdc_field USING 'EBAN-MENGE'
itab-menge.
PERFORM bdc_field USING 'RM06B-EEIND'
'09.04.2006'.
PERFORM bdc_field USING 'RM06B-LPEIN'
'D'.
PERFORM bdc_field USING 'EBAN-EKGRP'
itab-ekgrp.
PERFORM bdc_field USING 'EBAN-DISPO'
itab-dispo.
PERFORM bdc_field USING 'EBAN-FRGDT'
itab-frgdt.
PERFORM bdc_field USING 'EBAN-WEBAZ'
itab-webaz.
PERFORM bdc_field USING 'EBAN-EBAKZ'
itab-ebakz.
PERFORM bdc_field USING 'EBAN-PREIS'
itab-preis.
PERFORM bdc_field USING 'EBAN-WAERS'
itab-waers.
PERFORM bdc_field USING 'EBAN-PEINH'
itab-peinh.
PERFORM bdc_field USING 'EBAN-REPOS'
itab-repos.
PERFORM bdc_field USING 'EBAN-EKORG'
itab-ekorg.
CALL TRANSACTION 'ME52' USING bdcdata
MODE 'A'
UPDATE 'S'
MESSAGES INTO messtab.
PERFORM bdc_transaction USING 'ME52'.
PERFORM close_group.
ENDLOOP .
----
Start new screen
*
----
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "bdc_dynpro
----
Insert field *
----
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "BDC_FIELD
&----
*& Form f4_help
&----
text
----
--> p1 text
<-- p2 text
----
FORM f4_help .
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CHANGING
file_name = p_file
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
.
IF sy-subrc <> 0.
WRITE:/ 'FILE NAME NOT FOUND '.
ENDIF.
ENDFORM.
Regards,
Nihar Swain ........
‎2007 Sep 19 6:36 AM
I'm using enjoy transaction for my BDC program.
Thanks all for the help...!!