‎2008 Oct 10 7:59 AM
HI,
In the bdc program, after uploading a file in the selection screen using parameter selection, the screen gets refrehed and returns to the selection screen with no further action. How do I solve this error?
‎2008 Oct 10 8:02 AM
hi,
check if you are using session method in your program.
if it is the case then a session will be created in SM35 transaction.check there.
‎2008 Oct 10 8:03 AM
Hi,
What is transaction code for which you are writing a BDC.
May be it has failed the validation, so its coming back to initial screen.
Thanks & Regards,
Navneeth K.
‎2008 Oct 10 8:10 AM
‎2008 Oct 10 8:07 AM
Hi
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_flie TYPE localfile.
PARAMETERS: p_mode TYPE ctu_mode OBLIGATORY DEFAULT 'A' MODIF ID ch3.
SELECTION-SCREEN : END OF BLOCK b1.
In ur code u have declare file selection
FM: f4_filename
or
KD_GET_FILENAME_ON_F4
After u have to upload the file
Regrads:
Prabu
‎2008 Oct 10 8:09 AM
‎2008 Oct 10 8:11 AM
first debugg the program. or
if code is small then paste here
‎2008 Oct 10 8:14 AM
&----
*& Report ZSALES2
*&
&----
*&
*&
&----
REPORT ZSALES2.
tables:VBAK,
vbkd,
kuagv,
rv45a,
vbap.
types :begin of t_records,
AUART type VBAK-AUART,
BSTKD type VBKD-BSTKD,
BSTDK type VBKD-BSTDK,
KUNNR type KUAGV-KUNNR,
KETDAT type RV45A-KETDAT,
KPRGBZ type RV45A-KPRGBZ,
PRSDT type VBKD-PRSDT,
ZTERM type VBKD-ZTERM,
MABNR type RV45A-MABNR,
KWMENG type RV45A-KWMENG,
POSNR type VBAP-POSNR,
end of t_records.
data: it_records type table of t_records,
wa_records type t_records.
DATA : BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE.
PARAMETERS : P_FILE LIKE RLGRAP-FILENAME.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
PERFORM GET_FILE.
start-of-selection.
PERFORM GET_DATA.
PERFORM BDCDATA.
&----
*& Form GET_FILE
&----
text
----
form GET_FILE .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = P_FILE.
endform. " GET_FILE
form GET_DATA.
DATA:V_FILE TYPE STRING.
V_FILE = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = V_FILE
FILETYPE = 'DAT'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = it_records
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.
endform. " GET_DATA.
form BDCDATA.
loop at it_records into wa_records.
*CALL TRANSCATION "VA01" USING BDCDATA.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-SPART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBAK-AUART'
'OR'.
perform bdc_field using 'VBAK-VKORG'
''.
perform bdc_field using 'VBAK-VTWEG'
''.
perform bdc_field using 'VBAK-SPART'
''.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'07/12'.
perform bdc_field using 'BDC_OKCODE'
'=PICK'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-BSTKD'.
perform bdc_field using 'VBKD-BSTKD'
'123'.
perform bdc_field using 'VBKD-BSTDK'
'08.10.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'31970063'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'04/21'.
perform bdc_field using 'BDC_OKCODE'
'PICK'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'RV45A-KETDAT'
'08.10.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'08.10.2008'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'06/11'.
perform bdc_field using 'BDC_OKCODE'
'=PICK'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBKD-BSTKD'
'123'.
perform bdc_field using 'VBKD-BSTDK'
'08.10.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'31970063'.
perform bdc_field using 'KUWEV-KUNNR'
'31970063'.
perform bdc_field using 'RV45A-KETDAT'
'08.10.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'08.10.2008'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG(01)'.
perform bdc_field using 'RV45A-MABNR(01)'
'102'.
perform bdc_field using 'RV45A-KWMENG(01)'
' 5'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'05/08'.
perform bdc_field using 'BDC_OKCODE'
'=PICK'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'RV45A-MABNR(01)'
'83'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'16/04'.
perform bdc_field using 'BDC_OKCODE'
'=PICK'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'RV45A-MABNR(01)'
'121'.
perform bdc_field using 'VBAP-POSNR(01)'
' 1'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/EBAC1'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(01)'.
perform bdc_transaction using 'VA01' .
CALL TRANSCATION 'VA01' USING BDCDATA.
ENDLOOP.
endform. "BDCDATA
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
----
Insert field *
----
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> NODATA.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM.
&----
*& Form BDC_TRANSACTION
&----
text
----
-->P_0428 text
----
form BDC_TRANSACTION using value(p_0428).
endform. " BDC_TRANSACTION
‎2008 Oct 10 8:23 AM
Are you sure your internal table it_records isn't empty?
By the way, use:
data: lt_message type table of BDCMSGCOLL.
CALL TRANSCATION 'VA01' USING BDCDATA
mode 'A'
update 'S'
messages into lt_messages.With mode A you will see all screens; as if you are doing the transaction, and you will need to press enter to process each BDC code / screen.
In lt_messages you will have all messages that were triggered during the VA01.
‎2008 Oct 10 8:23 AM
How are running the program Foreground or Background mode. In Foreground mode GUI_UPLOAD will not work.
‎2008 Oct 10 8:34 AM
>
> In Foreground mode GUI_UPLOAD will not work.
You mean background.
‎2008 Oct 10 10:06 AM
yes, i checked. the internal table is not empty. how do i check whether my program i srunning in foreground or background mode. if its in foreground then how should i solve my error?
‎2008 Oct 10 10:09 AM
mode 'A' -> processing in foreground
mode 'S' -> processing in background
Try mode 'A' and see if the transaction is triggered. And did you use the MESSAGES INTO? If there are any error messages, you will find them there.
This is the only way to find out any porblems that may occur. And when you fnd your problem, you can solve it,
And do F1 on statement CALL TRANSACTION
‎2008 Oct 10 10:14 AM
if i write the message using call transaction it gives a syntax error saying put "." or ID after transaction. If i put a perios after call transaction then it shows the obvious error as thre should be object after transaction.
I dont know how to check the a and s mode. its my first bdc program.
‎2008 Oct 10 10:15 AM
parameters: DIS_MODE LIKE CTU_PARAMS-DISMODE DEFAULT 'N'.
CALL TRANSACTION 'KB15N' USING BDCDATA MODE DIS_MODE MESSAGES INTO MESSTAB .
‎2008 Oct 10 10:18 AM
>
> if i write the message using call transaction it gives a syntax error saying put "." or ID after transaction. If i put a perios after call transaction then it shows the obvious error as thre should be object after transaction.
> I dont know how to check the a and s mode. its my first bdc program.
There's a typo in my example: TRANSCATION. Obviously it should be TRANSACTION.
‎2008 Oct 10 10:19 AM
Sorry , Maen Anachronos i mean it wont work in background mode
‎2008 Oct 10 10:31 AM
it works now..but when the sales order opens, its empty!!! no data has been filled
‎2008 Oct 10 10:33 AM
Its generally not advisable to write BDCs for transactional data. Try to use BAPI for creating Sale Order its much easier and best way.
‎2008 Oct 10 10:35 AM
BAPI_SALESORDER_CREATEFROMDAT2
Edited by: Navneeth Bothra on Oct 10, 2008 11:35 AM
‎2008 Oct 10 10:37 AM
‎2008 Oct 10 10:41 AM
try to place a break point before call transaction is called and check whether data is present in bdcdata.