2021 Sep 27 10:49 AM
Hi friends,
I am uploading VA01 using BDC session method . This is my first BDC. I have created GROUP3 session and processing it. While processing this error is coming. How to solve it. Please check the code and the screenshots.
report ZVA01_5_SESS
no standard page heading line-size 255.
TYPES : BEGIN OF ty_final,
vkorg TYPE vbak-vkorg,
vtweg TYPE vbak-vtweg,
kunnr TYPE kuagv-kunnr,
kunnr_we TYPE kuwev-kunnr,
bstkd TYPE vbkd-bstkd,
END OF ty_final.
DATA : it_final TYPE TABLE OF ty_final,
wa_final TYPE ty_final,
it_bdcdata TYPE TABLE OF bdcdata WITH HEADER LINE,
wa_bdcdata TYPE bdcdata.
DATA : bdcmsg TYPE TABLE OF bdcmsgcoll.
* file type string.
PARAMETERS : p_file TYPE rlgrap-filename.
TYPES : fs_struct(4096) TYPE c OCCURS 0.
DATA : w_struct TYPE fs_struct.
include bdcrecx1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
* FIELD_NAME = ' '
IMPORTING
FILE_NAME = p_file.
*file = p_file.
*AT SELECTION-SCREEN.
*perform open_group.
* Upload excel file into SAP
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
I_LINE_HEADER = 'X'
I_TAB_RAW_DATA = w_struct
I_FILENAME = p_file
TABLES
I_TAB_CONVERTED_DATA = it_final
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
start-of-selection.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
* DEST = FILLER8
GROUP = 'GROUP3'
* HOLDDATE = sy-datum
KEEP = 'X'
USER = sy-uname
* RECORD = FILLER1
* PROG = SY-CPROG
* DCPFM = '%'
* DATFM = '%'
* IMPORTING
* QID =
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
LOOP AT it_final INTO wa_final.
*perform open_group.
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'
wa_final-vkorg.
perform bdc_field using 'VBAK-VTWEG'
wa_final-vtweg.
perform bdc_field using 'VBAK-SPART'
''.
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'
wa_final-bstkd.
perform bdc_field using 'KUAGV-KUNNR'
wa_final-kunnr.
perform bdc_field using 'KUWEV-KUNNR'
wa_final-kunnr_we.
*perform bdc_dynpro using 'SAPMSSY0' '0120'.
*perform bdc_field using 'BDC_CURSOR'
* '05/10'.
*perform bdc_field using 'BDC_OKCODE'
* '=CHOO'.
*perform bdc_dynpro using 'SAPMV45A' '4001'.
*perform bdc_field using 'RV45A-KETDAT'
* '06.10.2021'.
*perform bdc_field using 'RV45A-KPRGBZ'
* 'D'.
*perform bdc_field using 'VBKD-PRSDT'
* '25.09.2021'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBKD-BSTKD'
wa_final-bstkd.
perform bdc_field using 'KUAGV-KUNNR'
wa_final-kunnr.
perform bdc_field using 'KUWEV-KUNNR'
wa_final-kunnr_we.
*perform bdc_field using 'RV45A-KETDAT'
* '06.10.2021'.
*perform bdc_field using 'RV45A-KPRGBZ'
* 'D'.
*perform bdc_field using 'VBKD-PRSDT'
* '25.09.2021'.
*perform bdc_field using 'VBKD-ZTERM'
* 'ZB01'.
*perform bdc_field using 'VBKD-INCO1'
* 'FOB'.
*perform bdc_field using 'VBKD-INCO2'
* 'From the Plant'.
*perform bdc_field using 'BDC_CURSOR'
* 'RV45A-MABNR(01)'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBKD-BSTKD'
wa_final-bstkd.
perform bdc_field using 'KUAGV-KUNNR'
wa_final-kunnr.
perform bdc_field using 'KUWEV-KUNNR'
wa_final-kunnr_we.
*perform bdc_field using 'RV45A-KETDAT'
* '06.10.2021'.
*perform bdc_field using 'RV45A-KPRGBZ'
* 'D'.
*perform bdc_field using 'VBKD-PRSDT'
* '25.09.2021'.
*perform bdc_field using 'VBKD-ZTERM'
* 'ZB01'.
*perform bdc_field using 'VBKD-INCO1'
* 'FOB'.
*perform bdc_field using 'VBKD-INCO2'
* 'From the Plant'.
*perform bdc_field using 'BDC_CURSOR'
* 'RV45A-MABNR(01)'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_field using 'VBKD-BSTKD'
wa_final-bstkd.
perform bdc_field using 'KUAGV-KUNNR'
wa_final-kunnr.
perform bdc_field using 'KUWEV-KUNNR'
wa_final-kunnr_we.
*perform bdc_field using 'RV45A-KETDAT'
* '06.10.2021'.
*perform bdc_field using 'RV45A-KPRGBZ'
* 'D'.
*perform bdc_field using 'VBKD-PRSDT'
* '25.09.2021'.
*perform bdc_field using 'VBKD-ZTERM'
* 'ZB01'.
*perform bdc_field using 'VBKD-INCO1'
* 'FOB'.
*perform bdc_field using 'VBKD-INCO2'
* 'From the Plant'.
*perform bdc_field using 'BDC_CURSOR'
* 'RV45A-MABNR(01)'.
**perform bdc_transaction using 'VA01'.
*perform close_group.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'VA01'
* POST_LOCAL = NOVBLOCAL
* PRINTING = NOPRINT
* SIMUBATCH = ' '
* CTUPARAMS = ' '
TABLES
DYNPROTAB = it_bdcdata
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
REFRESH it_bdcdata.
*perform close_group.
ENDLOOP.
* perform close_group.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
"BDC_DYNPRO
"BDC_FIELD


Regards,
Saurav Lahiry
Could you use screenshot software to just capture the area you want and not the whole screen? SAP Community it not designed for zooming the screenshots. For instance, I use greenshot but there are many other software.
2021 Sep 27 11:27 AM
I think you have nothing it your table IT_FINAL.
Did you try to debug the program ?
2021 Sep 27 1:58 PM
The message says: "Batch input queue error. Check the system log."
So, I suggest that you check the system log.
2021 Sep 27 2:49 PM
2021 Sep 27 6:04 PM
Hi Raymond,
Thanks a lot for the prompt reply. I checked the program and on debugging, i found that I_BDCDATA is coming empty. If you check my code, I have given wa_final at all of the appropriate places, but still I_BDCDATA is coming empty. Also I checked the system log. There is some error which I am unable to understand. please guide me as to how to correct the error respectively.
Regards,
Saurav Lahiry

2021 Sep 27 6:54 PM
saurav.lahiry Each "PERFORM bdc_field" appends a line to BDCDATA, not IT_BDCDATA. It's normal that IT_BDCDATA is empty, you never initialize it.
2021 Sep 27 6:50 PM
Could you use screenshot software to just capture the area you want and not the whole screen? SAP Community it not designed for zooming the screenshots. For instance, I use greenshot but there are many other software.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |