VK15 BDC issues
Hi,
In VK15, I am uploading Condition record through BDC,
where Its only updating the 14 line items,If its excedding more than 14 lines I am getting error...
How to upload all excel data at a time ..
Can anybody suggest me ...with simple example coding
Thanks
Kumar
hi kumar,
try the below sample code for data upload ,with your transaction.
TYPES: BEGIN OF T_CDATA,
ATKLA LIKE CABN-ATKLA,
ATNAM LIKE CABN-ATNAM,
ATFOR LIKE CABN-ATFOR,
END OF T_CDATA.
TYPES: BEGIN OF T_CCHAR,
ATWRT(30),
ATWTB(30),
END OF T_CCHAR.
DATA: IT_CDATA TYPE STANDARD TABLE OF T_CDATA,
IT_CCHAR TYPE STANDARD TABLE OF T_CCHAR,
IT_BDC TYPE STANDARD TABLE OF BDCDATA WITH HEADER LINE.
DATA: WA_CDATA TYPE T_CDATA,
WA_BDC TYPE BDCDATA,
WA_CCHAR TYPE T_CCHAR.
PARAMETERS: P_ATKLA LIKE CABN-ATKLA OBLIGATORY,
P_FNAME LIKE RLGRAP-FILENAME OBLIGATORY.
CONSTANTS: C_TCODE LIKE TSTC-TCODE VALUE 'CT04'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
PERFORM f_get_f4_help USING p_fname.
START-OF-SELECTION.
SELECT ATKLA ATNAM ATFOR INTO TABLE IT_CDATA
FROM CABN
WHERE ATKLA = P_ATKLA.
IF NOT IT_CDATA[] IS INITIAL.
PERFORM UPLOAD_DATA.
PERFORM BDC_OPEN_GROUP.
LOOP AT IT_CDATA INTO WA_CDATA.
REFRESH: IT_BDC.
PERFORM BDC_UPLOAD_DATA.
PERFORM BDC_CALL_TRANS.
PERFORM BDC_UPLOAD.
CLEAR WA_CDATA.
ENDLOOP.
PERFORM BDC_CLOSE_GROUP.
ENDIF.
*& Form UPLOAD_DATA
text
--> p1 text
<-- p2 text
FORM UPLOAD_DATA .
UPLOAD DATA USING GUI_UPLOAD
DATA: l_v_filename TYPE string.
CONSTANTS: l_c_asc TYPE filetype VALUE 'ASC',
l_c_x TYPE char1 VALUE 'X'.
l_v_filename = p_fname.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = l_v_filename
FILETYPE = l_c_asc
HAS_FIELD_SEPARATOR = l_c_x
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = ','
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = IT_CCHAR
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. " UPLOAD_DATA
*& Form BDC_OPEN_GROUP
text
--> p1 text
<-- p2 text
FORM BDC_OPEN_GROUP .
OPEN GROUP
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
DEST = FILLER8
GROUP = 'ZCHARU'
HOLDDATE = FILLER8
KEEP = 'X'
USER = SY-UNAME
RECORD = FILLER1
PROG = SY-CPROG
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " BDC_OPEN_GROUP
*& Form BDC_UPLOAD_DATA
text
--> p1 text
<-- p2 text
FORM BDC_UPLOAD_DATA .
CLEAR: WA_CCHAR.
PERFORM bdc_dynpro USING 'SAPLCTMV' '2100'.
PERFORM BDC_FIELD USING 'RCTAV-ATNAM' WA_CDATA-ATNAM.
perform bdc_field using 'BDC_OKCODE' '=ANDE'.
PERFORM bdc_dynpro USING 'SAPLCTMV' '2100'.
perform bdc_field using 'BDC_OKCODE' '=WERT'.
LOOP AT IT_CCHAR INTO WA_CCHAR.
PERFORM bdc_dynpro USING 'SAPLCTMV' '2100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'CAWN-ATWRT(01)'.
perform bdc_field using 'BDC_OKCODE' '=INSE'.
IF WA_CDATA-ATFOR = 'CHAR'.
PERFORM bdc_dynpro USING 'SAPLCTMV' '2100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'CAWN-ATWRT(01)'.
PERFORM BDC_FIELD USING 'CAWN-ATWRT(01)' WA_CCHAR-ATWRT.
PERFORM BDC_FIELD USING 'CAWN-ATWTB(01)' WA_CCHAR-ATWTB.
perform bdc_field using 'BDC_OKCODE' '=/00'.
ELSE.
PERFORM bdc_dynpro USING 'SAPLCTMV' '2100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'CAWN-ATWRT(01)'.
PERFORM BDC_FIELD USING 'CAWN-ATWRT(01)' WA_CCHAR-ATWRT.
perform bdc_field using 'BDC_OKCODE' '=/00'.
ENDIF.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPLCTMV' '2100'.
perform bdc_field using 'BDC_OKCODE' '=SICH'.
PERFORM bdc_dynpro USING 'SAPLCTMV' '2100'.
perform bdc_field using 'BDC_OKCODE' '=BACK'.
ENDFORM. " BDC_UPLOAD_DATA
*& Form BDC_CLOSE_GROUP
text
--> p1 text
<-- p2 text
FORM BDC_CLOSE_GROUP .
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_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. " BDC_CLOSE_GROUP
*& Form BDC_FIRST_SCREEN
text
--> p1 text
<-- p2 text
form bdc_dynpro using program dynpro.
CLEAR IT_BDC.
IT_BDC-program = program.
IT_BDC-dynpro = dynpro.
IT_BDC-dynbegin = 'X'.
append IT_BDC.
ENDFORM. " bdc_dynpro
Insert field *
form bdc_field using fnam fval.
clear IT_BDC.
IT_BDC-fnam = fnam.
IT_BDC-fval = fval.
append IT_BDC.
endform.
*& Form BDC_UPLOAD
text
--> p1 text
<-- p2 text
FORM BDC_UPLOAD .
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = C_TCODE
POST_LOCAL = NOVBLOCAL
PRINTING = NOPRINT
SIMUBATCH = ' '
CTUPARAMS = ' '
TABLES
DYNPROTAB = IT_BDC
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " BDC_UPLOAD
*& Form f_get_f4_help
text
-->P_P_FILE text
FORM f_get_f4_help USING P_P_FILE.
*F4 help for file path
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_p_file.
ENDFORM. " f_get_f4_help
*& Form BDC_CALL_TRANS
text
--> p1 text
<-- p2 text
FORM BDC_CALL_TRANS .
DATA: IT_BDCMSGCOLL TYPE STANDARD TABLE OF BDCMSGCOLL.
CLEAR: IT_BDC.
CALL TRANSACTION 'CT04' USING IT_BDC
MODE 'A'
MESSAGES INTO IT_BDCMSGCOLL.
IF SY-SUBRC EQ 0.
ENDIF.
ENDFORM. " BDC_CALL_TRANS
hope it helps.try this and if not let us knw where exactly u face the problem.
Regards,
Leena.
Similar Messages
-
Dear All,
I have got a issue in VK15 BDC, here we are using the same to upload price for a condition type where in price is maintained time wise. However some times, we face a typical problem wherein, if a price of 100 USD is uploaded in SAP, then in the scales it goes as 100 and at the header its something different.
Regards,
Dantham Conpolwedson
hfghfghfghHi,
Check your program what values are passing to KOMG-WAERK, this is the document currency field at harder level.
In your case it shoud be USD.
Regards
Praveen -
Hi All,
we have written a bdc for material upload for Tcode MMZ1. all works fine till the Accounting screen where we have to give the valuation type as D. (MBEW-BWTTY). and the Costing Screen we have to manually give enter to cross these screens and then save it. How can i overcome this issue.
Points vl be rewarded for all suggestions.
This is the Program - (Problem area is in bold)
*& Report Z_GMM
REPORT Z_GMM.
TABLES : RMMG1,MAKT,MARA,MVKE,MG03STEUER,MARC,MPOP,MBEW,RM03M.
DATA: BEGIN OF IT_MATE OCCURS 1,
MATNR(16) TYPE C,
MBRSH(1) TYPE C,
MTART(4) TYPE C,
WERKS(4) TYPE C,
LGORT(4) TYPE C,
BWTAR(10) TYPE C,
VKORG(4) TYPE C,
VTWEG(2) TYPE C,
REF_MATNR(16) TYPE C,
REF_WERKS(4) TYPE C,
REF_LGORT(4) TYPE C,
REF_BWTAR(10) TYPE C,
REF_VKORG(4) TYPE C,
REF_VTWEG(2) TYPE C,
VERSG(1) TYPE C,
KTGRM(2) TYPE C,
MTPOS(4) TYPE C,
PRMOD(1) TYPE C,
TAXKM(1) TYPE C,
KLART(3) TYPE C,
BWTTY(1) TYPE C,
END OF IT_MATE.
DATA: BEGIN OF IT_MATE_ERR OCCURS 1,
MATNR(16) TYPE C,
MBRSH(1) TYPE C,
MTART(4) TYPE C,
WERKS(4) TYPE C,
LGORT(4) TYPE C,
BWTAR(10) TYPE C,
VKORG(4) TYPE C,
VTWEG(2) TYPE C,
REF_MATNR(16) TYPE C,
REF_WERKS(4) TYPE C,
REF_LGORT(4) TYPE C,
REF_BWTAR(10) TYPE C,
REF_VKORG(4) TYPE C,
REF_VTWEG(2) TYPE C,
VERSG(1) TYPE C,
KTGRM(2) TYPE C,
MTPOS(4) TYPE C,
PRMOD(1) TYPE C,
TAXKM(1) TYPE C,
KLART(3) TYPE C,
BWTTY(1) TYPE C,
MSG(100) TYPE C,
END OF IT_MATE_ERR.
DATA: IT_BDCDATA LIKE BDCDATA OCCURS 1 WITH HEADER LINE.
DATA: IT_MSGS LIKE BDCMSGCOLL OCCURS 1 WITH HEADER LINE.
DATA: V_MSG(100) TYPE C,
V_MODE,
V1(20) TYPE C.
DATA: V_FILE TYPE STRING.
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-H01.
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME OBLIGATORY DEFAULT 'C:\'.
SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-H02.
PARAMETERS: P_ALL RADIOBUTTON GROUP G1,
P_NO RADIOBUTTON GROUP G1 DEFAULT 'X',
P_ERR RADIOBUTTON GROUP G1.
SELECTION-SCREEN: END OF BLOCK B2.
SELECTION-SCREEN: END OF BLOCK B1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
PERFORM SHOW_OPEN_DIALOG.
START-OF-SELECTION.
PERFORM READ_DATA.
IF NOT IT_MATE[] IS INITIAL.
IF P_ALL = 'X'.
V_MODE = 'A'.
ELSEIF P_NO = 'X'.
V_MODE = 'N'.
ELSE.
V_MODE = 'E'.
ENDIF.
PERFORM POPULATE_BDCDATA.
ENDIF.
END-OF-SELECTION.
IF NOT IT_MATE_ERR[] IS INITIAL.
PERFORM DOWNLOAD_ERR_REC.
ENDIF.
*& Form SHOW_OPEN_DIALOG
text
FORM SHOW_OPEN_DIALOG .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = P_FILE.
ENDFORM. " SHOW_OPEN_DIALOG
*& Form READ_DATA
text
FORM READ_DATA.
DATA: V_FILE TYPE STRING.
V_FILE = P_FILE.
IF NOT V_FILE IS INITIAL.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = V_FILE
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = IT_MATE
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.
ENDIF.
ENDFORM. " READ_DATA
*& Form POPULATE_BDCDATA
text
FORM POPULATE_BDCDATA .
LOOP AT IT_MATE.
perform bdc_dynpro using 'SAPMM03M' '0060'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'RM03M-MATNR' IT_MATE-MATNR.
perform bdc_field using 'RM03M-MBRSH' IT_MATE-MBRSH.
perform bdc_field using 'RM03M-MTART' IT_MATE-MTART.
perform bdc_field using 'RM03M-REF_MATNR' IT_MATE-REF_MATNR.
perform bdc_dynpro using 'SAPMM03M' '0070'.
perform bdc_field using 'BDC_OKCODE' '=SELA'.
perform bdc_dynpro using 'SAPMM03M' '0070'.
perform bdc_field using 'BDC_OKCODE' '=SCHL'.
perform bdc_field using 'RM03M-KZAU1(01)' 'X'.
perform bdc_field using 'RM03M-KZAU1(03)' 'X'.
perform bdc_field using 'RM03M-KZAU1(04)' 'X'.
perform bdc_field using 'RM03M-KZAU1(05)' 'X'.
perform bdc_field using 'RM03M-KZAU1(06)' 'X'.
perform bdc_field using 'RM03M-KZAU1(08)' 'X'.
perform bdc_field using 'RM03M-KZAU1(09)' 'X'.
perform bdc_field using 'RM03M-KZAU1(11)' 'X'.
perform bdc_field using 'RM03M-KZAU1(12)' 'X'.
perform bdc_field using 'RM03M-KZAU2(02)' 'X'.
perform bdc_field using 'RM03M-KZAU2(05)' 'X'.
perform bdc_field using 'RM03M-KZAU2(06)' 'X'.
perform bdc_dynpro using 'SAPMM03M' '0080'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'RM03M-WERKS' IT_MATE-WERKS.
perform bdc_field using 'RM03M-LGORT' IT_MATE-LGORT.
perform bdc_field using 'RM03M-VKORG' IT_MATE-VKORG.
perform bdc_field using 'RM03M-VTWEG' IT_MATE-VTWEG.
perform bdc_field using 'RM03M-REF_WERKS' IT_MATE-REF_WERKS.
perform bdc_field using 'RM03M-REF_LGORT' IT_MATE-REF_LGORT.
perform bdc_field using 'RM03M-REF_VKORG' IT_MATE-REF_VKORG.
perform bdc_field using 'RM03M-REF_VTWEG' IT_MATE-REF_VTWEG.
perform bdc_dynpro using 'SAPMM03M' '0210'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMM03M' '0215'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMM03M' '0216'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMM03M' '0212'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMM03M' '0248'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMM03M' '0249'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMM03M' '0252'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMM03M' '0260'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMM03M' '0270'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMM03M' '0275'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMM03M' '0280'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMM03M' '0290'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'BDC_OKCODE' '=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE' '=YES'.
CALL TRANSACTION 'MMZ1' USING IT_BDCDATA
MODE V_MODE
UPDATE 'S' "SYNCHRONOUS
MESSAGES INTO IT_MSGS.
IF SY-SUBRC = 0.
PERFORM HANDLE_SUCCESS_RECS.
REFRESH IT_MSGS.
CLEAR: V_MSG.
ELSE.
PERFORM HANDLE_ERROR_RECS.
REFRESH IT_MSGS.
CLEAR: V_MSG,
IT_MATE_ERR.
ENDIF.
CLEAR: IT_BDCDATA,
IT_BDCDATA[].
ENDLOOP.
ENDFORM. " POPULATE_BDCDATA
*& Form BDC_DYNPRO
text
-->PROGRAM text
-->DYNPRO text
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR IT_BDCDATA.
IT_BDCDATA-PROGRAM = PROGRAM.
IT_BDCDATA-DYNPRO = DYNPRO.
IT_BDCDATA-DYNBEGIN = 'X'.
APPEND IT_BDCDATA.
ENDFORM. "BDC_DYNPRO
*& Form BDC_FIELD
text
-->FNAM text
-->FVAL text
FORM BDC_FIELD USING FNAM FVAL.
IF NOT FVAL IS INITIAL.
CLEAR IT_BDCDATA.
IT_BDCDATA-FNAM = FNAM.
IT_BDCDATA-FVAL = FVAL.
APPEND IT_BDCDATA.
ENDIF.
ENDFORM. "BDC_FIELD
*& Form HANDLE_SUCCESS_RECS
text
FORM HANDLE_SUCCESS_RECS .
READ TABLE IT_MSGS WITH KEY MSGTYP = 'S'.
IF SY-SUBRC = 0.
*--Formatting the message
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = IT_MSGS-MSGID
LANG = SY-LANGU
NO = IT_MSGS-MSGNR
V1 = IT_MSGS-MSGV1
V2 = IT_MSGS-MSGV2
V3 = IT_MSGS-MSGV3
V4 = IT_MSGS-MSGV4
IMPORTING
MSG = V_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
WRITE:/ V_MSG.
CLEAR: V_MSG,
IT_MSGS.
ENDIF.
ENDIF.
ENDFORM. " HANDLE_SUCCESS_RECS
*& Form HANDLE_ERROR_RECS
*text
FORM HANDLE_ERROR_RECS .
READ TABLE IT_MSGS WITH KEY MSGTYP = 'E'.
IF SY-SUBRC = 0.
*--Formatting the message
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = IT_MSGS-MSGID
LANG = SY-LANGU
NO = IT_MSGS-MSGNR
V1 = IT_MSGS-MSGV1
V2 = IT_MSGS-MSGV2
V3 = IT_MSGS-MSGV3
V4 = IT_MSGS-MSGV4
IMPORTING
MSG = IT_MATE_ERR-MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
MOVE-CORRESPONDING IT_MATE TO IT_MATE_ERR.
APPEND IT_MATE_ERR.
DELETE IT_MATE INDEX SY-TABIX.
CLEAR IT_MATE_ERR.
ENDIF.
ENDIF.
ENDFORM. " HANDLE_ERROR_RECS
*& Form DOWNLOAD_ERR_REC
*text
FORM DOWNLOAD_ERR_REC .
V1 = P_FILE(3).
SHIFT P_FILE BY 3 PLACES LEFT.
CONCATENATE 'ERR_' P_FILE INTO P_FILE.
CONCATENATE V1 P_FILE INTO P_FILE.
V_FILE = P_FILE.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = 'C:\ERR_MMZ1.XLS'
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
WRITE_EOL = ABAP_TRUE
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = IT_MATE_ERR
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
IF SY-SUBRC = 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
MESSAGE I000(Z00) WITH 'Error File downloaded at' V_FILE.
ENDIF.
ENDFORM. " DOWNLOAD_ERR_RECHi,
In your code just try and replace the lines
perform bdc_dynpro using 'SAPMM03M' '0290'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'BDC_OKCODE' '=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE' '=YES'.
with this code and see if it helps.Please add you itab fields at necessary places in this code.
perform bdc_dynpro using 'SAPMM03M' '0290'.
perform bdc_field using 'BDC_CURSOR'
'MARA-MEINS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MARA-MEINS'
record-MEINS_014.
perform bdc_field using 'MBEW-EKALR'
record-EKALR_015.
perform bdc_field using 'MARC-LOSGR'
record-LOSGR_016.
perform bdc_field using 'MBEW-BKLAS'
record-BKLAS_017.
perform bdc_field using 'MBEW-BWTTY'
record-BWTTY_018.
perform bdc_field using 'MBEW-VPRSV'
record-VPRSV_019.
perform bdc_field using 'MBEW-PEINH'
record-PEINH_020.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
Reward points if useful
Regards,
Bhavin P Shah -
Reg : BDC issue while updating infotype 40 inside BADI class method
Hi Friends,
Actually in my badi class, there is a method where i need to save the infotype fields including comment fields.. So with BDC recording i recorded screen fields and passing the pernr internal table values to recorded pernr values.. by doing this im getting error and so BDC is not upadting the data.. moreover if i pass directly pernr number within single quotes, BDC is working fine and data is getting updated..
bdc_field 'RP50G-PERNR' pernr. --> Error Message while calling transaction through BDC
bdc_field 'RP50G-PERNR' '00001234' ---> updating successfully..
1. Tell me whether the issue is with BADI or wat ? means we cant able to use BDC inside badi ?
2. I also tried changing my internal table value of pernr to type 'C' of length 8.. eventhough its showing error..
Please tell me what i need to do .... ?Hi Dilek Ersoz Adak ,
I also tried with that, but getting same error.. Below is my error im getting while updating BDC through call transaction,
1 PA30 SAPMP50A 1000 E K PBAS_SERVICE 001 HRADMIN EPPRELE 00000121 HRAdministrator CTU RP50G-PERNR
Person is treated already by the HR Administrator -
BDC issues in FB60 while posting through proxy
Hi All,
I have created a BDC for FB 60 & FB65. Now, the requirement is that Data will come from XI as inbound proxy and the code will get executed. XI sends a separate file for each record. That is if 10 documents are to be created from FB 60 , then XI will send 10 separate files at the same time to ECC. This particular design is creating the issue.
What happens is 10 files are getting executed at the same time in ECC and few records are getting created properly and few are failing. The error status shows that it is holding a wrong company code. Probably the reason for this failure is the company code that needs to be set everytime in FB60 or 65 . As we know these are two tcodes where once we set the Co. Code it holds the value for that logon . I have written the code in such a way that everytime the co. code will be reset but since all the files are getting executed right at the same moment, somehow there is some clash.
If I send the records as a single file from XI, it works out perfectly. But the need from Xi is to send them in separate files and at the same time.
Please suggest me is there any way to handle this issue.Hi
Try making your Inbound interface in XI as Synchronous so that you will receive files one by one. In case of any error return the reposne back to XI so that you know which records failed. This seems a good option for you.
Else You can also make your proxy behave EOIO. Refer below link. But error handling will be an issue. If any message fails youe queue will be stucked till somebody clears that one.
http://help.sap.com/saphelp_nw04/helpdata/en/65/40c9a4a1fa476288ac61b5fcc6bbde/frameset.htm
Regards
Vinit -
BDC issue background and foreground
Hiii
i have already write bdc code using batch input. The data is taken from an excel file .
How the program work now is it create a session in SM35 and i can decide to execute the session either in background or foreground.
The reson why i did batch input and not call transaction is because i am told that with call transaction you can't execute batch input program in background since the excel file will be loaded from the user desktop. With call transaction and background execution the file need to be loaded on server first and then take the file from the server to BDC tcode.
My problem is I need my program to execute automatically without passing though the SM35. I also need to give the option to user to either execute is in foreground or background.
BDC code look this:
Call function "OPEN_BDC"
group = "ztest" I use constant
keep = "X'
perform dynpro
perform fillfield
call fuction "CLOSE_BDC"
1) I am told to use the FM file_open / file_submit / file_close but I dont really know hat parameter to pass in those FM the file_submit is giving me exception error.
2) I tried to use submit program RSBDCSUB . it create a session in sm35 and have status background job but the session havent executed
3) All the No1 and No2 is to execute the BDC in background then what about the solution if user what to execute in foreground.
Please i need precise answer??Job_submit is not functioning plzzz ess sample code below because of invalid_jobdata = 3
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobgroup = Ztest //Session name in SM35
jobname = v_jobname
IMPORTING
jobcount = v_jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4
IF sy-subrc <> 0.
ENDIF.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = sy-uname
jobcount = v_jobcount
jobname = v_jobname
language = sy-langu
report = sy-repid
VARIANT = ' '
IMPORTING
STEP_NUMBER =
EXCEPTIONS
bad_priparams = 1
bad_xpgflags = 2
invalid_jobdata = 3
jobname_missing = 4
job_notex = 5
job_submit_failed = 6
lock_failed = 7
program_missing = 8
prog_abap_and_extpg_set = 9
OTHERS = 10
IF sy-subrc <> 0.
ENDIF.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = v_jobcount
jobname = v_jobname
sdlstrtdt = sy-uzeit
sdlstrttm = sy-datum
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
invalid_target = 8
OTHERS = 9
IF sy-subrc <> 0.
ENDIF. -
Hi, expert:
The customer mass update is planned to be done using a BDC session. It is required that all updated fields go through XD02 validation with the exception of Address Management validation. Is it possible to skip the Address Management validation for certain fields like House#, Street, Province, etc.
Thanks in advance!if a field is mandatory or there is a check table for the field.... BDC program will validate it. You can not bypass the validation... BDC is actually the recording of what you do manually.
If you want to bypass validation then you have to use some enhancements or exits before writting the BDC.. -
Hi experts,
Can anybody trouble shoot this,... program.. and suggest me the remedy ?
My issue is, After giving the file name in call transaction, I was unable to execute further.
So please suggest me what to do.....
regards
Ram Kumar
<< Unformatable code removed >>
Edited by: Rob Burbank on Jul 8, 2009 9:16 AMThat sounds like a problem between your hardware and Java3D - have you checked your OpenGL drivers?
-
Issue while inserting a BDC program in Inbound Proxy.JDBC-- PI-- SAP.
The scenerio is jdbcsender-sappi-inboundproxy(ECC6.0).
The issue is related to SAP Plant Maintenance Module where We have a requirement for creating Maintenance item
programmatically from (SQLDatabase)Legacy Data for one of the interface.
since there are no standard BAPIS/Idocs or function modules available from SAP side for creating the maintenance item. So I
have written BDC program and with the help of submit statement in inbound proxy program, I am calling BDC program for
creation of the maintenance item.
When I tested the program independently on proxy side the Maintenance Item is getting created successfully but when I
executed from end-to-end ie. SQLDATABASE->SAP PI-->SAP. The message is getting strucked into the queue and queue got stopped on SAP.
ECC side and the status of the message is scheduled state on SXMB_MONI transaction of SAP ECC.
As the message is in scheduled state multiple number of Maintenance Items are getting created with the same values.
Has any one of our SAP friends, encountered this type of issue while inserting a BDC program in inbound proxy, please help
in fixing this issue. FYI... I am using sap pi7.0 with service pack 24 and ecc6.0
Waiting for your kind expert guidance...
cheers,
RamRaj,
Thanks for the reply. I have tried registering the queues but still the same problem. the message got stuck in the queue of ECC and showing below message in queue.
function module StatusText
SXMS_ASYNC_EXEC connection closed (no data)
I have checked in the forums especially for this issue but no one has provided the answer for this.
Thanks and Regards
Ram -
Issue with BDC of ME22N to change gross price of service.
Hi,
I have a requirement where I have to undelete the PO > services tab of the item details > change the gross price to the value thats calculated by the program for each of the services of the PO > set the deletion indicator to the PO.
The spec says to use a BDC of ME22N to acheive this but after creating the recording I have had several issues with some PO's that interrupt the BDC because they bejave differently from the recording I did.
On most cases when im running the BDC in foreground after changing the gross price and pressing enter I get a new windowthat appears asking for the account assingment of service, on this window the G/L account information is ussualy passed automatically then the bdc clicks back and the process continues normally. On other services after changing the gross price and pressing enter I get the account assignment of service window but the G/L information is not passed and when the bdc clicks back the G/L account information gets passed instead of going back and the BDC stops, if I manually click back again the process will continue.
With single service PO's the process is completing, this issue is happening with PO's that have multiple services.
I know ME22 should be used for BDC and not ME22N, but the functional insists to correct the issues with the BDC of ME22N. Also I atempted to use BAPI_PO_CHANGE but I dont think this bapi can not update the gross price of each of the services, it can change the net price but this is not my requirement.
Is there a bapi that can change the gross price of each of the services of the PO?
Please advice me on this.
Edited by: bodyboarder1 on Dec 2, 2010 3:33 PMHi
If you really need a BDC program, try to simulate ME22 instead of ME22N
Max -
Issue with BDC processing of F-65 after upgrade to ECC 6.0
Dear ABAP gurus,
We have upgraded our SAP system from version 4.7 to ECC 6.0.
We are facing issue when processing BDC sessions for transaction code F-65.
The screen which appears for Assignment to a profitability segment creates issue when processing BDC for F-65.
The screen name is SAPLKEAK and the corresponding screen number is 0300.
This screen displays the characteristic and its corrsponding values. The characteristics and its values are pulled in from FICO Config at runtime when you execute F-65 and all relevant Tcodes of business transaction RFBU.
We checked for the characteristics maintained for Characteristic group via std. transaction code KEPA. It shows 4 characteristics listed of which 2 are optional and 2 are mandatory. The same settings are available in older version as well as in ECC 6.0. Also validated the assignment of characteristic group to the actual data i.e to the business transaction RFBU via Tcode KE4G.
When we do recording in SHDB in both the systems, the older version shows it correctly displaying 4 fields(2 optional and 2 mandatory) in the Assignment to a profitability segment screen whereas the new system displays some 12 additional fields. Also none of the fields appear mandatory.
The issue is we are still not able to identify whether this is a technical issue or functional issue.
Searched for relevant OSS notes but couldn't find any.
Anyone of you who have faced this issue, please respond immediately.
We have this issue to be resolved on high priority.
Help will be highly appreciated.
Regards,
KavitaThis issue was also posted with an OSS-message to SAP, and the solution was to run this program SD_PLANVALUE_UPDATE
Berit -
Issue with ALV sceen called using BDC in new task and in background mode
Hi Gurus,
Need your expert advice. I am trying to call one transaction (IS AUTO - VELO) which has ALVs on screen. VELO is being called through BDC in NEW TASK in background. So, the new session is a Dialog session and SY-BATCH is initial here.
In two different scenarios, I am getting error at two different places:
a) As I can't call ALV directly, I am using docking container. This is giving issue during 'CREATE OBJECT' -> CONSTRUCTOR for cl_gui_alv_grid -> if offline( ) is initial. (AS SY-BATCH is initial) -> call method me->set_registered_events_internal exporting events = lt_events. -> call method get_registered_events importing events = lt_events. -> IF H_CONTROL IS INITIAL. RAISE CNTL_ERROR. ENDIF.
b) Call to OLE_FLUSH_CALL is happening, which is resulting into dump.
I tried to search SDN and google, but couldn't find the solution. Thanks for your help :).
Regards,
AlokI'm not sure what is eating up your system resources, but .wmv files
are considered to be a delivery format, and are not ideal for editing.
I have never tried to edit screen capture video from any source, but you might consider
upgrading to Expression Encoder 4 Pro (with codecs)... at least it includes H.264.
Expression Encoder 4 Pro -
Screen Resolution issue - BDC Grid
Hi All,
I am facing an issue with BDC for PRMM transaction.
If we look at the PRMM transaction, the very first screen consist of GRid forAction type.
The records in the grid of PRMM transaction is changing as per the screen resolution of User desktop.
Example: In my screen, I am able to see 16 rows in Grid and in user desktop i can see 10 or 20 rows. Because of this the Pagedown option and BDC is not behaving properly.
Please suggest what should be done to resolve it.
Thanks,
ShilpaHi Shilpa,
during recording from SHDB, use check box for Default Size.
in call transaction syntax: use
data: wa_opt type ctu_params.
wa_opt-dismode = w_mode. [N OR A OR E]
wa_opt-defsize = c_check.[X]
wa_opt-updmode = 'A'.
CALL TRANSACTION c_me41 USING i_bdcdata
OPTIONS FROM wa_opt [INSTEAD OF HARD CODING MODE]
MESSAGES INTO i_msgcoll.
Hope this can solve your problems.
Regards,
Tutun -
Hi all,
Im facing a issue in BDC:
In a loop there is a select query called and if sy-subrc = 0 the call transaction using mode N is called in the next step.
first time if the sy-subrc is ne 0 then call transaction is done which updates( considered as new entry )
the table used in the select query.
when the loop executes the second time the sy-subrc is still 4 instead of 0( previous data is not updated in DB ).
So after all the execution only the last record exists in the transaction,
that is the table control index is always 1 due to the select query failure.
Here the problem is when using mode N, when mode A is used its working fine.
The data is not getting updated in db in first loop cycle, so the select query in second loop cycle fails.
The select query gets executed for the same material no's.
I have also tried with explicit commit and synchrounous update is used
Thanks,
KeshavHi Suhas,
This applies when we open a cursor for select, use fetch to get the data. Ater the fetch if we commit, then it closes all the open cursors. So next fetch on the previously opened cursor will lead to dump.
Perfect example could be.
SELECT......
Do processing.
COMMIT WORK.
ENDSELECT.
Keshav,
I beleive you are not using SELECT ENDSELECT in your case. If it is SELECT SIGLE/SELECT INTO TABLE, OPEN, FETCH and CLOSE CURSOR operations happens at the back end during the select query execution. ( We can see ST05 trace for this). So as per my understanding COMMIT after the CALL TRANSACTION shouldn't cause any problem.
Please correct if i am wrong any where.
Thanks,
Vinod. -
When performing a Call Transaction, is it better to use a synchronous or asynchronous update mode for a large number of records? Right now, we have a BDC that is running on synchronous update but is taking forever to update. Sometimes it even causes system problems.
I'm also looking into using a BAPI instead of the BDC. I think using a BAPI is preferable than a BDC.
Comments and suggestions on these 2 issues are highly appreciated.For many cases BDC is required to run in synchronous transaction,
so the result will be able to be processed for further action ( for ex: to be displayed ).
If possible, find an existing BAPI to replace the BDC.
This will save time and maintenance effort.
What kind of transaction are you using in the BDC ?
Maybe you are looking for
-
My wife has the iPhone 4 and rarely syncs (1 time in the last 6 months) to our PC, so I updated her phone when she synced. I have the iPhone 4S and sync everyday to the same PC and same iTunes account. She synced her phone to our PC yesterday and a
-
BFG 8800GTX NOT working for me in my mac pro.
Well Da**it guys. I can NOT get the BFG 8800GTX to work in my mac pro. The machine will boot but you do not hear the apple chime. After that it just sits there and makes the cd rom drive click and the hard drives click and spinup as well. It is NOT a
-
I deleted Imovie And I NEED IT BACK NOW!
today i accidently deleted my imovie app and i dont have a time machine set up so i dont know how to get it back. PLEASE HELP NOW!!!! IM DESPERATE TO GET IT BACK!!!
-
S_ALR_87012089-Display changes to Vendor:does not show details of change
Hi Experts, S_ALR_87012089 report displays the changes to vendor master. However in ECC 6.0, the same report is not displaying the details of the change ('old' and 'new' ) value, wheras it was in 4.6 C. Now in ECC 6.0 it just says whether 'Created' /
-
Microsoft Office 2008 Powerpoint "cannot open the file because it has been moved or deleted"
I am trying to open some slides my professor posted on Desire 2 Learn. It is a .pptx file. Everytime I try to open it I get an error message that says, "Powerpoint cannot access +I (drive) beacuse the file has been moved or deleted" I have uninstalle