Problem in QP01 Bdc
Hi,
I am had made a BDC for the tcode QP01 few months back and i am facing a problem that it is not able to execute after 18 line items as i had commited a mistake by not presseing the Page down during recording. It is workng fine for the 18 lines items when there are more than that it is not uploading the data.
I want to is it possible to do changes in the code so that Page Down Concept can be used rather than doing again recording.
Please provide me guidelines for solving this problem.
but i want to try it out by modifying the existing code.
please provide me guidelines to solve this problem.
Similar Messages
-
PROBLEM IN QP01 BDC ( 19TH LINE ITEM IS NOT TAKING)
DEAR ALL,
I am working on a bdc of QP01 for inspection plan, my bdc is working prperly , problem is that in sceen there r 18 lines for line items , but i have 30 line items. after 18 line items no data is picking. and a message is coming no input data is there for screen no 0150. i tried a lot and unable to solve . if anybody can solve my problem . i send u the part of my code.
LOOP AT ITAB.
CHECK ITAB-MATNR = ITAB1-MATNR.
if flag = 1.
** QUALITATIVE **
if itab-QUALITAT = 'X' AND itab-QUANTITAT = ''.
IF I ge 18.
*CONCATENATE 'RQPAS-SEL_FLG(' I ')' INTO SCR.
*perform bdc_field using SCR
X = '17'..
CONCATENATE 'RQPAS-SEL_FLG(' X ')' INTO SCR.
perform bdc_field using SCR
X1 = '18'..
CONCATENATE 'RQPAS-SEL_FLG(' X ')' INTO SCR.
perform bdc_field using SCR
X2 = '340'.
CONCATENATE 'RQPAS-SEL_FLG(' X1 ')' INTO SCR.
perform bdc_field using SCR
PERFORM BDC_DYNPRO USING 'SAPLQPAA' '0150'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RQPAS-QUALITAT(02)'.
PERFORM BDC_FIELD USING 'RQPAS-ENTRY_ACT'
'1'.
i.
PERFORM BDC_FIELD USING 'RQPAS-AB_MKNR'
ITAB-MERKNR .
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
endif.
perform bdc_dynpro using 'SAPLQPAA' '0150'.
perform bdc_field using 'BDC_CURSOR'
'PLMKB-VERWMERKM(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RQPAS-ENTRY_ACT'
'1'.
k = i - 1.
CONCATENATE 'RQPAS-SEL_FLG(' k ')' INTO SCR.
perform bdc_field using SCR
CONCATENATE 'RQPAS-SEL_FLG(' i ')' INTO SCR.
perform bdc_field using SCR
'X'.
***perform bdc_field using 'BDC_OKCODE'
'/00'.
***'=QMLM'.
CONCATENATE 'PLMKB-VERWMERKM(' I ')' INTO SCR.
perform bdc_field using scr "'PLMKB-VERWMERKM(01)'
'DS-TH-01'.
itab-VERWMERKM.
CONCATENATE 'PLMKB-KURZTEXT(' I ')' INTO SCR.
perform bdc_field using scr
itab-KURZTEXT.
regards
banajabut i want to try it out by modifying the existing code.
please provide me guidelines to solve this problem. -
MULTIPLE ITEM PROBLEM IN VL31N BDC
hI FRIENDS ,
I AM POSTING A BDC OF TRANSACTION VL31N ,ie FOR SCHEDULE AGREEMENT INBOUND DELIVERY.I CREATE A FUNCTIONAL MODULE OF THE SAME AND CALL IT FROM AN ASP PAGE,IN THAT THERE IS PO NUMBER 5500000986 WHICH HAS TWO ITEMES 62 AND 95 RESPECTIVLY OF SAME MATARIAL NUMBER R010230123041002 AND DIE NUMBER 2304P,NOW THE PROBLEM IS THIS BDC IS WORKING WHEN THERE IS ONLY ONE ITEM BUT GIVES AN ERROR "CANT CREAT INBOUND DELIVERY FOR PO NO ...' WNEN IT HAS MULTIPLE ITEM.WHAT SHOULD I DO ? I ALSO USED LOOP BUT IT ALSO DOSENT WORK AS IT WILL ADD ALL OPEN QTY OF PO 986 AND UPDATE AGAINST ITEM NO 95.
CODE IS AS FOLLOWS:.........
FUNCTION y_synie_bdcinbdly.
""Local interface:
*" IMPORTING
*" VALUE(CTU) LIKE APQI-PUTACTIVE DEFAULT 'X'
*" VALUE(MODE) LIKE APQI-PUTACTIVE DEFAULT 'N'
*" VALUE(UPDATE) LIKE APQI-PUTACTIVE DEFAULT 'L'
*" VALUE(GROUP) LIKE APQI-GROUPID OPTIONAL
*" VALUE(USER) LIKE APQI-USERID OPTIONAL
*" VALUE(KEEP) LIKE APQI-QERASE OPTIONAL
*" VALUE(HOLDDATE) LIKE APQI-STARTDATE OPTIONAL
*" VALUE(NODATA) LIKE APQI-PUTACTIVE DEFAULT '/'
*" VALUE(EXTNID) LIKE MAKT-MAKTG
*" VALUE(VENDORNO) LIKE LFA1-LIFNR
*" VALUE(PONUMBER) LIKE EKKO-EBELN
*" VALUE(ITEMNUMBER) LIKE LIPS-VGPOS
*" VALUE(MATERIAL) LIKE MAKT-MAKTG
*" VALUE(DLYQTY) LIKE LIPS-LFIMG
*" VALUE(BTCHNO) LIKE LIPS-CHARG
*" VALUE(POSLR) LIKE EKES-EBELP OPTIONAL
*" EXPORTING
*" VALUE(SUBRC) LIKE SYST-SUBRC
*" VALUE(INDELYNO) LIKE SY-MSGV2
*" VALUE(MSG1) LIKE SY-MSGV1
*" VALUE(MSG2) LIKE SY-MSGV2
*" VALUE(MSG3) LIKE SY-MSGV3
*" VALUE(MSG4) LIKE SY-MSGV4
*" TABLES
*" MESSTAB STRUCTURE BDCMSGCOLL
*" ERRTAB STRUCTURE YSYNERRMSGS
*" INDLYTAB STRUCTURE YSYN_QTYTAB
Updated by ANAND SYNISE 19.1.2007
DATA: BEGIN OF bdctab OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdctab.
DATA: datenow(10) TYPE c,
fldvar(30) TYPE c,
fldno TYPE i,
flditoc(6) TYPE c,
qty(13) TYPE c.
DATA maxposnr LIKE lips-posnr.
DATA testposnr TYPE posnr.
DATA itemnoint TYPE i.
CONCATENATE sy-datum6(2) '.' sy-datum4(2) '.' sy-datum+0(4) INTO datenow.
CLEAR bdctab.
REFRESH bdctab.
PERFORM open_group USING group user keep holddate ctu.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '4007'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'RV50A-VERUR_LA'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '/00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-LIFNR'.
bdctab-fval = vendorno.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LV50C-BSTNR'.
bdctab-fval = ponumber.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-VERUR_LA'.
bdctab-fval = extnid.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=MKAL_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIKP-BLDAT'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=POPO_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-POSNR(01)'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '0111'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'RV50A-PO_MATNR'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = 'WEIT'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-PO_MATNR'.
bdctab-fval = material.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=POLO_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-POSNR(01)'.
APPEND bdctab.
*ADDED BY ANAND ON 22-01-2007
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = ITEMNUMBER . "ITEMNUMBER = LIPS-VGPOS
APPEND bdctab.
************ENDED***********************
ADDED BY MILIND 19.01.2007
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = poslr .
APPEND bdctab.
* ENDED * *
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LIPS_SELKZ(01)'.
bdctab-fval = ''.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '/00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-CHARG(01)'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
QTY = INDLYTAB-DLYQTY.
qty = dlyqty.
bdctab-fnam = 'LIPSD-G_LFIMG(01)'.
bdctab-fval = QTY.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIPS-CHARG(01)'.
* BDCTAB-FVAL = INDLYTAB-BTCHNO.
bdctab-fval = btchno.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=SICH_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-MATNR(02)'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CALL TRANSACTION 'VL31N' USING bdctab MODE 'N' MESSAGES INTO messtab.
subrc = sy-subrc.
PERFORM close_group USING ctu.
CLEAR bdctab.
REFRESH bdctab.
IF sy-subrc EQ 0.
indelyno = sy-msgv2.
ENDIF.
LOOP AT messtab.
MOVE: messtab-msgid TO errtab-msgid,
messtab-msgnr TO errtab-msgnr,
messtab-msgv1 TO errtab-msg1,
messtab-msgv2 TO errtab-msg2,
messtab-msgv3 TO errtab-msg3,
messtab-msgv4 TO errtab-msg4.
APPEND ERRtab.
ENDLOOP.
LOOP AT errtab.
SELECT SINGLE text FROM t100
INTO errtab-errmsg
WHERE msgnr EQ errtab-msgnr AND arbgb EQ errtab-msgid
AND sprsl EQ sy-langu.
MODIFY errtab.
ENDLOOP.
ENDFUNCTION.Hi,
Check this code:
REPORT Z_CUSTOMER_UPLOAD .
D A T A D E C L A R A T I O N S *
DATA:BEGIN OF IT_CUSTOMER OCCURS 0,
KUNNR LIKE MV10A-KUNNR,
VKORG LIKE MV10A-VKORG,
VTWEG LIKE MV10A-VTWEG,
MATNR LIKE MV10A-MATNR,
KDMAT LIKE MV10A-KDMAT,
MEGRU LIKE MV10A-MEGRU,
SELKZ TYPE C value 'X',
LPRIO LIKE MV10A-LPRIO,
ANTLF LIKE MV10A-ANTLF,
END OF IT_CUSTOMER.
DATA:BEGIN OF IT_success OCCURS 0,
KUNNR LIKE MV10A-KUNNR,
VKORG LIKE MV10A-VKORG,
VTWEG LIKE MV10A-VTWEG,
MATNR LIKE MV10A-MATNR,
KDMAT LIKE MV10A-KDMAT,
MEGRU LIKE MV10A-MEGRU,
SELKZ TYPE C value 'X',
LPRIO LIKE MV10A-LPRIO,
ANTLF LIKE MV10A-ANTLF,
END OF IT_success.
DATA:BEGIN OF IT_error OCCURS 0,
KUNNR LIKE MV10A-KUNNR,
VKORG LIKE MV10A-VKORG,
VTWEG LIKE MV10A-VTWEG,
MATNR LIKE MV10A-MATNR,
KDMAT LIKE MV10A-KDMAT,
MEGRU LIKE MV10A-MEGRU,
SELKZ TYPE C value 'X',
LPRIO LIKE MV10A-LPRIO,
ANTLF LIKE MV10A-ANTLF,
END OF IT_error.
DATA: L_INDEX TYPE SY-TABIX.
DATA:IT_BDC LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
IT_DATA TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
ERROR MESSAGE TABLE
DATA:IT_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA : C_S TYPE C VALUE 'S',
C_E TYPE C VALUE 'E'.
*DATA: IT_SUCCESS LIKE IT_CUSTOMER OCCURS 0,
IT_ERROR LIKE IT_CUSTOMER OCCURS 0.
DATA : V_RECTOT TYPE I,
V_RECERR TYPE I,
V_RECSUC TYPE I.
S E L E C T I O N - S C R E E N *
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER : P_FILE LIKE RLGRAP-FILENAME .
SELECTION-SCREEN : END OF BLOCK B1.
A T S E L E C T I O N - S C R E E N *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
to get F4 help for p_file
PERFORM F4_FILENAME USING P_FILE.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
Uploading data from flat file into it_tab
PERFORM BDC_UPLOAD USING P_FILE.
PERFORM PROCESS_DATA.
PERFORM POPULATE_BDC.
E N D O F S E L E C T I O N *
*END-OF-SELECTION.
PERFORM DISPLAY_REPORT.
*& Form F4_FILENAME
text
-->P_P_FILE text
FORM F4_FILENAME USING P_P_FILE.
DATA:L_FILE TYPE IBIPPARMS-PATH.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = L_FILE .
P_P_FILE = L_FILE.
ENDFORM. " F4_FILENAME
*& Form BDC_UPLOAD
text
-->P_P_FILE text
FORM BDC_UPLOAD USING P_P_FILE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_P_FILE
I_BEGIN_COL = 1
I_BEGIN_ROW = 1
I_END_COL = 8
I_END_ROW = 1000
TABLES
INTERN = IT_DATA
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 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_UPLOAD
*& Form PROCESS_DATA
text
--> p1 text
<-- p2 text
FORM PROCESS_DATA.
SORT IT_DATA BY ROW COL.
LOOP AT IT_DATA.
CASE IT_DATA-COL.
WHEN 1.
IT_CUSTOMER-KUNNR = IT_DATA-VALUE.
WHEN 2.
IT_CUSTOMER-VKORG = IT_DATA-VALUE.
WHEN 3.
IT_CUSTOMER-VTWEG = IT_DATA-VALUE.
WHEN 4.
IT_CUSTOMER-MATNR = IT_DATA-VALUE.
WHEN 5.
IT_CUSTOMER-KDMAT = IT_DATA-VALUE.
WHEN 6.
IT_CUSTOMER-MEGRU = IT_DATA-VALUE.
WHEN 7.
IT_CUSTOMER-LPRIO = IT_DATA-VALUE.
WHEN 8.
IT_CUSTOMER-ANTLF = IT_DATA-VALUE.
APPEND IT_CUSTOMER.
ENDCASE.
ENDLOOP.
ENDFORM. " PROCESS_DATA
*& Form POPULATE_BDC
text
--> p1 text
<-- p2 text
FORM POPULATE_BDC.
DATA:L_COUNTER TYPE N,
L_STRING TYPE STRING.
LOOP AT IT_CUSTOMER.
AT NEW KUNNR.
CLEAR L_COUNTER.
L_INDEX = SY-TABIX.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
perform bdc_dynpro using 'SAPMV10A' '0100'.
perform bdc_field using 'MV10A-KUNNR'
IT_CUSTOMER-KUNNR.
perform bdc_field using 'MV10A-VKORG'
IT_CUSTOMER-VKORG.
perform bdc_field using 'MV10A-VTWEG'
IT_CUSTOMER-VTWEG.
perform bdc_field using 'BDC_OKCODE'
'/00'.
ENDAT.
L_COUNTER = L_COUNTER + 1.
CLEAR L_STRING.
perform bdc_dynpro using 'SAPMV10A' '0200'.
CONCATENATE 'MV10A-MATNR(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-MATNR.
CONCATENATE 'MV10A-KDMAT(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-KDMAT.
CONCATENATE 'MV10A-MEGRU(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-MEGRU.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*-- For Page down in Call Transaction Mode
IF L_COUNTER = 14.
CLEAR L_COUNTER.
PERFORM BDC_DYNPRO USING 'SAPMV45A' '4001'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=P+'.
ENDIF.
perform bdc_dynpro using 'SAPMV10A' '0200'.
CONCATENATE 'MV10A-SELKZ(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-SELKZ.
perform bdc_field using 'BDC_OKCODE'
'=SELE'.
perform bdc_dynpro using 'SAPMV10A' '0300'.
perform bdc_field using 'MV10A-KDMAT'
IT_CUSTOMER-KDMAT.
perform bdc_field using 'MV10A-LPRIO'
IT_CUSTOMER-LPRIO.
perform bdc_field using 'MV10A-ANTLF'
IT_CUSTOMER-ANTLF.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/EBACK'.
at end of kunnr.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
CALL TRANSACTION 'VD51' USING IT_BDC MODE 'A' UPDATE 'S'
MESSAGES INTO IT_MESSAGES.
CLEAR IT_BDC.
REFRESH IT_BDC.
ENDAT.
IF NOT IT_MESSAGES[] IS INITIAL.
PERFORM FORMAT_MESSAGE.
ENDIF.
ENDLOOP.
ENDFORM. " POPULATE_BDC
*& Form bdc_dynpro
text
-->P_0273 text
-->P_0274 text
FORM bdc_dynpro USING VALUE(P_0273)
VALUE(P_0274).
IT_BDC-PROGRAM = P_0273.
IT_BDC-DYNPRO = P_0274.
IT_BDC-DYNBEGIN = 'X'.
APPEND IT_BDC.
CLEAR IT_BDC.
ENDFORM. " bdc_dynpro
*& Form bdc_field
text
-->P_0278 text
-->P_RECORD_KUNNR_001 text
FORM bdc_field USING VALUE(P_0278)
VALUE(P_0279).
IT_BDC-FNAM = P_0278.
IT_BDC-FVAL = P_0279.
APPEND IT_BDC.
CLEAR IT_BDC.
ENDFORM. " bdc_field
*& Form FORMAT_MESSAGE
text
--> p1 text
<-- p2 text
FORM FORMAT_MESSAGE.
DATA: L_MSG(100).
LOOP AT IT_MESSAGES.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = IT_MESSAGES-MSGID
LANG = SY-LANGU
NO = IT_MESSAGES-MSGNR
V1 = IT_MESSAGES-MSGV1
V2 = IT_MESSAGES-MSGV2
V3 = IT_MESSAGES-MSGV3
V4 = IT_MESSAGES-MSGV4
IMPORTING
MSG = L_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.
ENDIF.
write:/ l_msg.
ENDLOOP.
ENDFORM. " FORMAT_MESSAGE
reward if helpful,
keerthi -
Problem while doing bdc for fv60
Hi frends,
I got problem while doing BDC for fv60 tcode.i have given
header items:
vendor number
invoice date
posting date
amount
item data:
g/l acc no: 100000
amount 1000 whatever
these are all given in recording
in recording after all giving this data if we click on park it is telling "parking not possibe duiring batch input".
can any body tell me the process for recording shdb and after that in bdc how can we give multiple line items for fv60
thanks,
naveen.I don't think you can use FV60 in batch input. Your options are to use transaction FBV1 or bapi BAPI_INCOMINGINVOICE_PARK.
Rob -
Problem in fv50 BDC working manually giving err for BDC
Hi all,
I have one problem in fv50 BDC when I park document manually it works fine but when I try to park through my BDC it gives error
Parking not possible during batch input
Message no. FP140
Procedure
In Customizing, you can control whether an error message is issued.
my Question is.
how can i make it a warning message?
Thanks in Advance
Sachin Gautamhi,
have you tried F-63 too?
A. -
REAGRDING : Problem in executing BDC: QP01
Hi,
I am working on bdc made by someone and i had been told to test it whether it works properly or not.
But when i press F8 and try to execute it through Call Transaction Method (as it was mentioned in the Prg) and give the path for the data file it is not executing further.
plzz tell me how to execute it.Hi
Have u select the call trnsaction ?
If yes , Check the flat file path .
Make sure that ur internal table and
flat filestructure should be same ..
Reward if useful
Thanks
Jagadeesh.G -
Urgent: making multiple inspection characterstics in QP01 bdc
Hi,
I had made a BDC on QP01 in which i am able to upload 1 line for the
inspection characterstic of a single Operation .
Now the problem is there are around 10 to 15 lines for the inspection characterstic of a single Operation and i am not able to do it through it my bdc. now anybody can provide me some knowledge about it as how it is to be done?
plzz help me out as it is really urgent to me and help will be definately rewarded.Hi,
I had made bdc on transaction CA02. Its similiar to your requirement in which there are multiple inspection characterstics for single operation. Through BDC its possible. Please go through the below code.
LOOP AT i_route_file INTO wa_route_file.
AT NEW plnnr.
PERFORM : zf_prepare_bdcdata_prg USING 'SAPLCPDI' '1010',
zf_prepare_bdcdata_value USING 'BDC_OKCODE' '/00',
zf_prepare_bdcdata_value USING 'RC271-PLNNR'
wa_route_file-plnnr.
*--Conversion of date to internal format.
PERFORM zf_conv_date.
PERFORM zf_prepare_bdcdata_value USING 'RC271-STTAG' v_date.
ENDAT.
lv_arbpl = wa_route_file-arbpl.
lv_steus = wa_route_file-steus.
lv_ltxa1 = wa_route_file-ltxa1.
*--Operation data
AT NEW vornr.
v_inscounter = 1.
PERFORM : zf_prepare_bdcdata_prg USING 'SAPLCPDI' '1400',
zf_prepare_bdcdata_value USING 'BDC_OKCODE' '/00',
zf_prepare_bdcdata_value USING 'RC27X-ENTRY_ACT' '1'.
*--Conversion of vornr to internal format
PERFORM zf_conv_vornr.
READ TABLE i_opno INTO wa_opno WITH KEY plnnr = wa_route_file-plnnr
vornr = wa_route_file-vornr.
IF sy-subrc <> 0.
DESCRIBE TABLE i_opno LINES v_lines.
v_num = v_lines + 1.
ELSE.
v_num = sy-tabix.
ENDIF.
CLEAR v_fieldnm.
CONCATENATE 'PLPOD-ARBPL(' v_num ')' INTO v_fieldnm.
PERFORM : zf_prepare_bdcdata_value USING v_fieldnm lv_arbpl.
CLEAR v_fieldnm.
CONCATENATE 'PLPOD-STEUS(' v_num ')' INTO v_fieldnm.
PERFORM : zf_prepare_bdcdata_value USING v_fieldnm lv_steus.
CLEAR v_fieldnm.
CONCATENATE 'PLPOD-LTXA1(' v_num ')' INTO v_fieldnm.
PERFORM : zf_prepare_bdcdata_value USING v_fieldnm lv_ltxa1,
zf_prepare_bdcdata_prg USING 'SAPLCPDI' '1400',
zf_prepare_bdcdata_value USING 'BDC_OKCODE' '=QMUE',
zf_prepare_bdcdata_value USING 'RC27X-ENTRY_ACT' '1'.
CLEAR v_fieldnm.
CONCATENATE 'RC27X-FLG_SEL(' v_num ')' INTO v_fieldnm.
PERFORM: zf_prepare_bdcdata_value USING v_fieldnm 'X'.
ENDAT.
*--Inspection Characteristics
PERFORM: zf_prepare_bdcdata_prg USING 'SAPLQPAA' '0150',
zf_prepare_bdcdata_value USING 'BDC_OKCODE' '/00'.
CLEAR v_fieldnm.
CONCATENATE 'PLMKB-VERWMERKM(' v_inscounter ')' INTO v_fieldnm.
PERFORM: zf_prepare_bdcdata_value USING v_fieldnm
wa_route_file-verwmerkm.
CLEAR v_fieldnm.
CONCATENATE 'PLMKB-MKVERSION(' v_inscounter ')' INTO v_fieldnm.
PERFORM: zf_prepare_bdcdata_value USING v_fieldnm
wa_route_file-mkversion.
CLEAR v_fieldnm.
CONCATENATE 'PLMKB-PMETHODE(' v_inscounter ')' INTO v_fieldnm.
PERFORM: zf_prepare_bdcdata_value USING v_fieldnm
wa_route_file-pmethode.
CLEAR v_fieldnm.
CONCATENATE 'PLMKB-PMTVERSION(' v_inscounter ')' INTO v_fieldnm.
PERFORM: zf_prepare_bdcdata_value USING v_fieldnm
wa_route_file-pmtversion.
CLEAR v_fieldnm.
CONCATENATE 'PLMKB-STICHPRVER(' v_inscounter ')' INTO v_fieldnm.
PERFORM: zf_prepare_bdcdata_value USING v_fieldnm
wa_route_file-stichprver.
CLEAR v_fieldnm.
CONCATENATE 'QFLTP-SOLLWERT(' v_inscounter ')' INTO v_fieldnm.
PERFORM: zf_prepare_bdcdata_value USING v_fieldnm
wa_route_file-sollwert.
CLEAR v_fieldnm.
CONCATENATE 'QFLTP-TOLERANZUN(' v_inscounter ')' INTO v_fieldnm.
PERFORM: zf_prepare_bdcdata_value USING v_fieldnm
wa_route_file-toleranzun.
CLEAR v_fieldnm.
CONCATENATE 'QFLTP-TOLERANZOB(' v_inscounter ')' INTO v_fieldnm.
PERFORM: zf_prepare_bdcdata_value USING v_fieldnm
wa_route_file-toleranzob.
CLEAR v_fieldnm.
CONCATENATE 'PLMKB-DUMMY10(' v_inscounter ')' INTO v_fieldnm.
PERFORM: zf_prepare_bdcdata_value USING v_fieldnm
wa_route_file-dummy10.
PERFORM: zf_prepare_bdcdata_prg USING 'SAPLQPAA' '1501',
zf_prepare_bdcdata_value USING 'BDC_OKCODE' '=ENT1',
zf_prepare_bdcdata_value USING 'PLMKB-VERWMERKM'
wa_route_file-verwmerkm,
zf_prepare_bdcdata_value USING 'PLMKB-QPMK_WERKS'
wa_route_file-qpmk_werks,
zf_prepare_bdcdata_value USING 'PLMKB-MKVERSION'
wa_route_file-mkversion,
zf_prepare_bdcdata_value USING 'PLMKB-PMETHODE'
wa_route_file-pmethode,
zf_prepare_bdcdata_value USING 'PLMKB-QMTB_WERKS'
wa_route_file-qmtb_werks,
zf_prepare_bdcdata_value USING 'PLMKB-PMTVERSION'
wa_route_file-pmtversion.
PERFORM: zf_prepare_bdcdata_prg USING 'SAPLQPAA' '1502',
zf_prepare_bdcdata_value USING 'BDC_OKCODE' '=ENT1',
zf_prepare_bdcdata_value USING 'BDC_CURSOR' 'PLMKB-PMETHODE',
zf_prepare_bdcdata_value USING 'PLMKB-PMETHODE'
wa_route_file-pmethode,
zf_prepare_bdcdata_value USING 'PLMKB-QMTB_WERKS'
wa_route_file-qmtb_werks,
zf_prepare_bdcdata_value USING 'PLMKB-PMTVERSION'
wa_route_file-pmtversion.
PERFORM: zf_prepare_bdcdata_prg USING 'SAPLQPAA' '1502',
zf_prepare_bdcdata_value USING 'BDC_OKCODE' '=ENT1',
zf_prepare_bdcdata_value USING 'BDC_CURSOR' 'PLMKB-PMETHODE',
zf_prepare_bdcdata_value USING 'PLMKB-PMETHODE'
wa_route_file-pmethode,
zf_prepare_bdcdata_value USING 'PLMKB-QMTB_WERKS'
wa_route_file-qmtb_werks,
zf_prepare_bdcdata_value USING 'PLMKB-PMTVERSION'
wa_route_file-pmtversion.
PERFORM: zf_prepare_bdcdata_prg USING 'SAPLQPAA' '0150',
zf_prepare_bdcdata_value USING 'BDC_OKCODE' '=QMD1',
zf_prepare_bdcdata_value USING 'RQPAS-ENTRY_ACT' '1'.
CLEAR v_fieldnm.
CONCATENATE 'RQPAS-SEL_FLG(' v_inscounter ')' INTO v_fieldnm.
PERFORM: zf_prepare_bdcdata_value USING v_fieldnm 'X'.
PERFORM: zf_prepare_bdcdata_prg USING 'SAPLQPAA' '0160',
zf_prepare_bdcdata_value USING 'BDC_OKCODE' '=QMAM',
zf_prepare_bdcdata_value USING 'PLMKB-STICHPRVER'
wa_route_file-stichprver.
PERFORM: zf_prepare_bdcdata_prg USING 'SAPLQPAA' '0160',
zf_prepare_bdcdata_value USING 'BDC_OKCODE' '/00',
zf_prepare_bdcdata_value USING 'BDC_CURSOR'
'PLMKB-PROBENR',
zf_prepare_bdcdata_value USING 'PLMKB-PROBENR'
wa_route_file-probenr,
zf_prepare_bdcdata_value USING 'PLMKB-PMETHODE'
wa_route_file-pmethode,
zf_prepare_bdcdata_value USING 'PLMKB-QMTB_WERKS'
wa_route_file-qmtb_werks,
zf_prepare_bdcdata_value USING 'PLMKB-PMTVERSION'
wa_route_file-pmtversion.
PERFORM: zf_prepare_bdcdata_prg USING 'SAPLQPAA' '1502',
zf_prepare_bdcdata_value USING 'BDC_OKCODE' '=ENT1',
zf_prepare_bdcdata_value USING 'BDC_CURSOR' 'PLMKB-PMETHODE',
zf_prepare_bdcdata_value USING 'PLMKB-PMETHODE'
wa_route_file-pmethode,
zf_prepare_bdcdata_value USING 'PLMKB-QMTB_WERKS'
wa_route_file-qmtb_werks,
zf_prepare_bdcdata_value USING 'PLMKB-PMTVERSION'
wa_route_file-pmtversion.
PERFORM: zf_prepare_bdcdata_prg USING 'SAPLQPAA' '0160',
zf_prepare_bdcdata_value USING 'BDC_OKCODE' '=QMBU',
zf_prepare_bdcdata_value USING 'PLMKB-PROBENR'
wa_route_file-probenr,
zf_prepare_bdcdata_value USING 'PLMKB-PMETHODE'
wa_route_file-pmethode,
zf_prepare_bdcdata_value USING 'PLMKB-QMTB_WERKS'
wa_route_file-qmtb_werks,
zf_prepare_bdcdata_value USING 'PLMKB-PMTVERSION'
wa_route_file-pmtversion.
PERFORM: zf_prepare_bdcdata_prg USING 'SAPLQPAA' '1502',
zf_prepare_bdcdata_value USING 'BDC_OKCODE' '=ENT1',
zf_prepare_bdcdata_value USING 'BDC_CURSOR' 'PLMKB-PMETHODE',
zf_prepare_bdcdata_value USING 'PLMKB-PMETHODE'
wa_route_file-pmethode,
zf_prepare_bdcdata_value USING 'PLMKB-QMTB_WERKS'
wa_route_file-qmtb_werks,
zf_prepare_bdcdata_value USING 'PLMKB-PMTVERSION'
wa_route_file-pmtversion.
v_inscounter = v_inscounter + 1.
AT END OF plnnr.
*--Call transaction CA02- Change Routing
CALL TRANSACTION 'CA02' USING i_bdcdata
MESSAGES INTO i_messtab
MODE 'N'
UPDATE 'S'.
COMMIT WORK AND WAIT.
ENDAT.
ENDLOOP.
Please ask if any queries.... -
Problem in the BDC program to upload the data from a flat file.
Hi,
I am required to write a BDC program to upload the data from a flat file. The conditions are as mentioned below:-
1) Selection Screen will be prompted to user and user needs to provide:- File Path on presentation server (with F4 help for this obligatory parameter) and File Separator e.g. @,#,$,%,... etc(fields in the file will be separated by using this special character) or fields may be separated by tab(tab delimited).
2) Finally after the data is uploaded, following messages need to be displayed:-
a) Total Number of records successfully uploaded.
b) Session Name
c) Number of Sessions created.
Problem is when each record is fetched from flat file, the record needs to be split into individual fields separated by delimiter or in case tab separated, then proceeding in usual manner.
It would be great if you provide me either the logic, pseudocode, or sample code for this BDC program.
Thanks,Here is an example program, if you require the delimitor to be a TAB, then enter TAB on the selection screen, if you require the delimitor to be a comma, slash, pipe, whatever, then simply enter that value. This example is simply the uploading of the file, not the BDC, I assume that you know what to do once you have the data into the internal table.
REPORT zrich_0001.
TYPES: BEGIN OF ttab,
rec TYPE string,
END OF ttab.
TYPES: BEGIN OF tdat,
fld1(10) TYPE c,
fld2(10) TYPE c,
fld3(10) TYPE c,
fld4(10) TYPE c,
END OF tdat.
DATA: itab TYPE TABLE OF ttab.
data: xtab like line of itab.
DATA: idat TYPE TABLE OF tdat.
data: xdat like line of idat.
DATA: file_str TYPE string.
DATA: delimitor TYPE string.
PARAMETERS: p_file TYPE localfile.
PARAMETERS: p_del(5) TYPE c.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
DATA: ifiletab TYPE filetable.
DATA: xfiletab LIKE LINE OF ifiletab.
DATA: rc TYPE i.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
CHANGING
file_table = ifiletab
rc = rc.
READ TABLE ifiletab INTO xfiletab INDEX 1.
IF sy-subrc = 0.
p_file = xfiletab-filename.
ENDIF.
START-OF-SELECTION.
TRANSLATE p_del TO UPPER CASE.
CASE p_del.
WHEN 'TAB'.
delimitor = cl_abap_char_utilities=>horizontal_tab.
WHEN others.
delimitor = p_del.
ENDCASE.
file_str = p_file.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = file_str
CHANGING
data_tab = itab.
LOOP AT itab into xtab.
CLEAR xdat.
SPLIT xtab-rec AT delimitor INTO xdat-fld1
xdat-fld2
xdat-fld3
xdat-fld4.
APPEND xdat to idat.
ENDLOOP.
LOOP AT idat into xdat.
WRITE:/ xdat-fld1, xdat-fld2, xdat-fld3, xdat-fld4.
ENDLOOP.
Regards,
Rich Heilman -
Hi all,
i am doing BDC for XK01 with Line Item for Bank Details(Table Control..)
With 3 Internal table
IT_dummy to get the flat file
IT_vend for Header details
IT_bank for Item Details
in this there is a Nested loop
Loop at it_vend.
perform bdc
loop at it_bank.
concatenate................
endloop.
endloop.
because of the above nested loops..it's bit slow..
& i am trying to do with a single internal table..
The problem is..
with the header data it's not picking all the item data(it's picking only one..)..help me in resolving the problem..
Below the code..
REPORT ZMM_BDCTC1 NO STANDARD PAGE HEADING LINE-SIZE 255.
PARAMETER:P_FILE TYPE RLGRAP-FILENAME.
DATA BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF IT_DUMMY OCCURS 0,
TYP,
DES(255) TYPE C,
END OF IT_DUMMY.
DATA:DELIMITER VALUE ',',
cnt(4) TYPE N,
L_FNAM(30) TYPE C,
FILENAME TYPE STRING.
TYPES:BEGIN OF TY_FINAL,
N(4) TYPE C,
LIFNR TYPE RF02K-LIFNR,
BUKRS TYPE RF02K-BUKRS,
EKORG TYPE RF02K-EKORG,
KTOKK TYPE RF02K-KTOKK,
NAME1 TYPE LFA1-NAME1,
SORTL TYPE LFA1-SORTL,
LAND1 TYPE LFA1-LAND1,
AKONT TYPE LFB1-AKONT,
FDGRV TYPE LFB1-FDGRV,
WAERS LIKE LFM1-WAERS,
M(4) TYPE C,
BANKS TYPE LFBK-BANKS,
BANKL TYPE LFBK-BANKL,
BANKN TYPE LFBK-BANKN,
KOINH TYPE LFBK-KOINH,
END OF TY_FINAL.
DATA: IT_FINAL TYPE TABLE OF TY_FINAL,
WA_FINAL TYPE TY_FINAL.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
IMPORTING
FILE_NAME = P_FILE.
FILENAME = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = FILENAME
FILETYPE = 'ASC'
tables
data_tab = IT_DUMMY.
START-OF-SELECTION.
LOOP AT it_dummy.
IF it_dummy-typ = 'H'.
SPLIT it_dummy-des AT delimiter INTO WA_FINAL-lifnr "Populating Header Table
WA_FINAL-bukrs
WA_FINAL-ekorg
WA_FINAL-ktokk
WA_FINAL-name1
WA_FINAL-sortl
WA_FINAL-land1
WA_FINAL-akont
WA_FINAL-fdgrv
WA_FINAL-waers.
WA_FINAL-N = WA_FINAL-N + 1.
WA_FINAL-M = WA_FINAL-M + 1.
ELSEIF it_dummy-typ = 'I'.
SPLIT it_dummy-des AT delimiter INTO WA_FINAL-BANKS
WA_FINAL-BANKL
WA_FINAL-BANKN
WA_FINAL-KOINH.
APPEND WA_FINAL TO IT_FINAL.
ENDIF.
ENDLOOP.
LOOP AT IT_FINAL INTO WA_FINAL.
WRITE:/ WA_FINAL-N,
WA_FINAL-LIFNR,
WA_FINAL-BUKRS,
WA_FINAL-EKORG,
WA_FINAL-KTOKK,
WA_FINAL-NAME1,
WA_FINAL-SORTL,
WA_FINAL-LAND1,
WA_FINAL-AKONT,
WA_FINAL-FDGRV,
WA_FINAL-WAERS,
WA_FINAL-M,
WA_FINAL-BANKS,
WA_FINAL-BANKL,
WA_FINAL-BANKN,
WA_FINAL-KOINH.
ENDLOOP.
data: WA_FINAL1 like line of IT_FINAL.
clear WA_FINAL1.
******************BDC STARTS***********************
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'ZMM_BDCTAB'
KEEP = 'X'
USER = SY-UNAME.
Clear wa_final.
LOOP AT IT_FINAL INTO WA_FINAL.
WA_FINAL1 = WA_FINAL.
CLEAR BDCDATA[].
AT NEW N.
cnt = 1.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
WA_FINAL1-LIFNR.
perform bdc_field using 'RF02K-BUKRS'
WA_FINAL1-BUKRS.
perform bdc_field using 'RF02K-EKORG'
WA_FINAL1-EKORG.
perform bdc_field using 'RF02K-KTOKK'
WA_FINAL1-KTOKK.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-LAND1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-NAME1'
WA_FINAL1-NAME1.
perform bdc_field using 'LFA1-SORTL'
WA_FINAL1-SORTL.
perform bdc_field using 'LFA1-LAND1'
WA_FINAL1-LAND1.
perform bdc_dynpro using 'SAPMF02K' '0120'. "ERROR CLEARED
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-KOINH(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
ENDAT.
*ENDON.
IF WA_FINAL1-N = WA_FINAL1-M.
CONCATENATE 'LFBK-BANKS(' cnt ')' INTO L_FNAM.
perform bdc_field using L_FNAM
WA_FINAL1-BANKS.
CONCATENATE 'LFBK-BANKL(' cnt ')' INTO L_FNAM.
perform bdc_field using L_FNAM
WA_FINAL1-BANKL.
CONCATENATE 'LFBK-BANKN(' cnt ')' INTO L_FNAM.
perform bdc_field using L_FNAM
WA_FINAL1-BANKN.
CONCATENATE 'LFBK-KOINH(' cnt ')' INTO L_FNAM.
perform bdc_field using L_FNAM
WA_FINAL1-KOINH.
*ENDDO.
cnt = cnt + 1.
ENDIF.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02K' '0210'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-FDGRV'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*AT NEW LIFNR.
perform bdc_field using 'LFB1-AKONT'
WA_FINAL1-AKONT.
perform bdc_field using 'LFB1-FDGRV'
WA_FINAL1-FDGRV.
perform bdc_dynpro using 'SAPMF02K' '0215'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-ZTERM'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0220'.
perform bdc_field using 'BDC_CURSOR'
'LFB5-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0310'.
perform bdc_field using 'BDC_CURSOR'
'LFM1-WAERS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFM1-WAERS'
WA_FINAL1-WAERS.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
AT END OF M.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'XK01'
TABLES
DYNPROTAB = BDCDATA.
ENDAT.
CLEAR WA_FINAL1.
CLEAR WA_FINAL.
ENDLOOP.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
*********************BDC ENDS***********************
Start new screen *
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.
Flat File is..
HAAA45,1000,1000,0002,NAME45,N,IN,31000,A1,USD
IIN,1000,1021,Name45
IIN,1000,1022,Name45
HAAA50,1000,1000,0002,NAME50,N,IN,31000,A1,USD
IIN,1000,1023,Name50
IIN,1000,1024,Name50Regarding avoiding the loop I have a suggestion, though I have not tried this .
SAP help says " Using the internal table bdc_tab, you can provide any number of screens of the called transaction with input and user actions. " .
Above implies you can load all records in the itab bdc_tab when doing call transaction. Say, your bdc_tabl has 30 records for 1 pass of the transaction. You need to update 10 vendor records. You simply load up all 300 records into bdc_tab. After every 30 record loads, you simulate a 'SAVE' press in your program but do not leave the transaction. Rather you simulate the keystroke that takes you to the first screen of XK01 after the save if not aready there, and start loading up the next transaction. -
Problem in the BDC Table Control for the T.Code VA01
Hi,
I faced probelm in the BDC of the VA01. In the Table Control
the records are entered upto 12 line items. after 13th line item overwrites the first record. How to solve the Problem.
Please help me.or use this
Internal table definition *
data : begin of bdcdata occurs 0.
include structure bdcdata.
data : end of bdcdata.
data: begin of messtab occurs 0.
include structure bdcmsgcoll.
data: end of messtab.
data: v_chr_opengrp type c,
r_matnr like mara-matnr, "variable for material conversion
r_werks like marc-werks, "variable for plant
v_str_fname type string.
data: begin of count2,
inrec(9) type n, " input I_MATERIAL count
create(9) type n, " create count
error(9) type n, " error count
bdc(9) type n, " count of BDC creates
end of count2.
types: begin of ty_source,
partn_numb(10) type n ,"Customer Number 1
ref(035),
sales_org(4) , "Sales Organization
distr_chan(2) , "Distribution Channel
division(002), "DIVISION
doc_type(4) , "Sales Document Type
purch_no(020), "Purchase order
material like vbap-matnr,
reqqty(018),
reqdate(010),
end of ty_source,
begin of ty_header ,
partn_numb(10) ,"Customer Number 1
ref(035),
sales_org(4) , "Sales Organization
distr_chan(2) , "Distribution Channel
division(002), "DIVISION
doc_type(4) , "Sales Document Type
purch_no(020), "Purchase order
end of ty_header,
begin of ty_item,
partn_numb(10) ,"Customer Number 1
ref(035),
material like vbap-matnr,
reqqty(018),
reqdate(010),
end of ty_item.
data : msg(240) type c, " Return Message
e_rec(8) type c, " Error Records Counter
rec_no(8) type c, " Records Number Indicator
s_rec(8) type c, " Successful Records Counter
t_rec(8) type c, " Total Records Counter
v_matnr like mara-matnr.
data: val(2) type n value 01.
data : begin of bdc_itab occurs 0.
include structure bdcdata.
data : end of bdc_itab.
data : t_source type standard table of ty_source with header line,
t_header type standard table of ty_header initial size 1,
t_item type standard table of ty_item initial size 1,
t_target type standard table of bdcdata initial size 1.
data : w_source type ty_source,
w_source1 type ty_source,
w_header type ty_header,
w_item type ty_item,
w_target type bdcdata,
count type i,
count1 type n.
Variable Declaration
data: w_fname type string,
fnam(20),
date1(10),
i(2) type n,
v_count type i,
v_group type apqi-groupid.
*& selection screen
selection-screen :begin of block bl1 with frame title text-001.
parameters : p_fname type rlgrap-filename, "Input file
p_update(1) default 'N', "Input for update mode
p_bdcgrp(12) default 'SD_ORDERS'. "Input for session name
selection-screen end of block bl1.
**&SELECTION SCREEN VALIDATIONS
at selection-screen on value-request for p_fname.
call function 'KD_GET_FILENAME_ON_F4'
exporting
program_name = 'ZMATERIAL'
dynpro_number = '1000'
field_name = 'P_FNAME'
changing
file_name = p_fname.
*& Start of selection
start-of-selection.
if p_fname is initial.
message i016(rp) with 'Please enter a file name'.
leave list-processing.
else.
move p_fname to v_str_fname.
endif.
call function 'GUI_UPLOAD'
exporting
filetype = 'ASC'
filename = v_str_fname
has_field_separator = 'X'
tables
data_tab = t_source
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.
sort t_source by ref partn_numb.
loop at t_source into w_source.
add 1 to count2-inrec.
w_source1 = w_source.
AT NEW PARTN_NUMB. "10/31 KVB
at new ref.
w_header-doc_type = w_source1-doc_type..
w_header-sales_org = w_source1-sales_org . "'0001'
w_header-distr_chan = w_source1-distr_chan. "'01'
w_header-division = w_source1-division. " '01'
w_header-purch_no = w_source1-purch_no.
w_header-partn_numb = w_source1-partn_numb.
w_header-ref = w_source1-ref.
append w_header to t_header.
endat.
w_item-partn_numb = w_source1-partn_numb.
w_item-material = w_source1-material.
w_item-reqqty = w_source1-reqqty.
w_item-ref = w_source1-ref.
w_item-reqdate = w_source1-reqdate.
append w_item to t_item.
clear :w_item,w_header.
endloop.
loop at t_header into w_header.
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' w_header-doc_type.
perform bdc_field using 'VBAK-VKORG' w_header-sales_org.
perform bdc_field using 'VBAK-VTWEG' w_header-distr_chan.
perform bdc_field using 'VBAK-SPART' w_header-division.
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' w_header-purch_no.
perform bdc_field using 'KUWEV-KUNNR' w_header-partn_numb.
i = 1.
loop at t_item into w_item where partn_numb = w_header-partn_numb
and ref = w_header-ref.
at new partn_numb.
clear count1.
count = 0.
endat.
count = count + 1.
if count gt 5.
clear i.
i = 2.
perform bdc_dynpro using 'SAPMV45A' '4001' .
perform bdc_field using 'BDC_OKCODE' '=POAN'.
endif.
count1 = count1 + 1.
concatenate 'VBAP-POSNR(' i ')' into fnam.
perform bdc_field using fnam
count1.
concatenate 'RV45A-MABNR(' i ')' into fnam.
perform bdc_field using fnam w_item-material.
concatenate 'RV45A-KWMENG(' i ')' into fnam.
perform bdc_field using fnam w_item-reqqty..
concatenate 'RV45A-ETDAT(' i ')' into fnam.
perform bdc_field using fnam w_item-reqdate.
concatenate 'VBKD-BSTKD_E(' i ')' into fnam.
perform bdc_field using fnam w_item-ref.
i = i + 1.
clear: w_item.
endloop.
clear w_header.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform post_transaction.
refresh bdc_itab.
clear bdc_itab.
endloop.
*endloop.
end-of-selection.
perform finalization.
Start new screen *
form bdc_dynpro using program dynpro.
clear bdc_itab.
bdc_itab-program = program.
bdc_itab-dynpro = dynpro.
bdc_itab-dynbegin = 'X'.
append bdc_itab.
endform. "bdc_dynpro
Insert field *
form bdc_field using fnam fval.
if fval <> ''.
clear bdc_itab.
bdc_itab-fnam = fnam.
bdc_itab-fval = fval.
append bdc_itab.
endif.
endform. "bdc_field
**& Form get_filename
text
--> p1 text
<-- p2 text
*form get_filename .
*call function 'WS_FILENAME_GET'
exporting
def_filename = space
def_path = file
mask = ',.,..'
mode = 'N'
title = text-015
importing
filename = file
exceptions
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
others = 5.
*endform. " get_filename
*& Form post_transaction
text
--> p1 text
<-- p2 text
form post_transaction .
refresh messtab.
clear messtab.
call transaction 'VA01' using bdc_itab
mode p_update
update 'S'
messages into messtab.
read table messtab with key msgtyp = 'E'.
if sy-subrc eq 0.
perform process_error_messages.
add 1 to count2-bdc.
if v_chr_opengrp is initial.
perform bdc_open_group.
endif.
call function 'BDC_INSERT'
exporting
tcode = 'VA01'
tables
dynprotab = bdc_itab
exceptions
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
others = 5.
if sy-subrc <> 0.
case sy-subrc.
when 1.
write: / 'Internal error'.
when 2.
write: / 'Not open error'.
when 3.
write: / 'queue error'.
when 4.
write: / 'tcode invalid error'.
when others.
write: / 'other error'.
endcase.
endif.
else.
add +1 to count2-create.
format intensified off.
format color col_normal.
format color col_normal off.
endif.
clear bdc_itab.
refresh bdc_itab.
endform. " post_transaction
*& Form finalization
text
--> p1 text
<-- p2 text
form finalization .
if v_chr_opengrp = 'X'.
call function 'BDC_CLOSE_GROUP'
exceptions
not_open = 1
queue_error = 2
others = 3.
endif.
get time.
skip 2.
write: / 'Time', sy-uzeit.
skip.
format color col_total on.
write: / 'Total Records: ', 40 count2-inrec.
write: / 'PERNR not of Emp Group 6 ', 40 count2-error.
write: / 'Records Created: ', 40 count2-create.
write: / 'BDC Create in group: ', 40 count2-bdc.
if v_chr_opengrp = 'X'.
skip 1.
format intensified on.
format color col_negative on.
write: / 'PLEASE USE TRANSACTION "SM35" ',
'TO PROCESS THE GENERATED BDC SESSION ... ',
p_bdcgrp.
endif.
endform. " finalization
*& Form bdc_open_group
text
--> p1 text
<-- p2 text
form bdc_open_group .
call function 'BDC_OPEN_GROUP'
exporting
client = sy-mandt
group = p_bdcgrp
holddate = sy-datum
keep = 'X'
user = sy-uname
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 eq 0.
v_chr_opengrp = 'X'.
endif.
endform. " bdc_open_group
*& Form process_error_messages
text
--> p1 text
<-- p2 text
form process_error_messages .
data: begin of loc_aux_message.
include structure message.
data: end of loc_aux_message.
data : msgno type sy-msgno.
loop at messtab.
move messtab-msgnr to msgno.
call function 'WRITE_MESSAGE'
exporting
msgid = messtab-msgid
msgno = msgno
msgty = messtab-msgtyp
msgv1 = messtab-msgv1
msgv2 = messtab-msgv2
msgv3 = messtab-msgv3
msgv4 = messtab-msgv4
importing
messg = loc_aux_message
exceptions
others = 1.
if sy-subrc eq 0.
format color col_negative on.
write: /10 loc_aux_message.
format color col_negative off.
else.
format color col_negative on.
write: /10 t_source-partn_numb.
write: / 'Error creating message'.
format color col_negative off.
exit.
endif.
endloop.
endform. " process_error_messages -
Problem with creating BDC program
Hi All,
I was trying to create a BDC program for transaction SE63 (language translation). I am doing it for text modules translation. For this, screen contains two fields, one is source language and another is target language and both are input disabled. We can input entries only through F4 help.
Now the problem is while doing recording through transaction SHDB, it is not recognizing the F4 help and so i am not able to make any entry in that through BDC. Since field is input disabled so I can not make the entries directly.
Can anyone please help me, how to make entries in this type of field through BDC?
Regards,
AkhilThanks Keshav for your valueble reply but this function module is giving me error saying go to SE63 for translation. Can you mull over any other option and suggest me the same.
-
Hi,
I wrote a bdc about modification BOM's quantity of line item with ECM number. following is code:
report ZCS02_BDC
no standard page heading line-size 255.
BDC table
DATA: t_bdc LIKE bdcdata OCCURS 0 WITH HEADER LINE,
t_bdcmsg LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF t_log OCCURS 0,
information(289) TYPE c, "返回信息
END OF t_log.
DATA: v_mode TYPE c VALUE 'N'.
perform fm_set_bdc tables t_bdc using 'X' 'SAPLCSDI' '0100'.
perform fm_set_bdc:
tables t_bdc using ' ' 'BDC_CURSOR' 'RC29N-AENNR',
tables t_bdc using ' ' 'BDC_OKCODE' '/00',
tables t_bdc using ' ' 'RC29N-MATNR' '1224',
tables t_bdc using ' ' 'RC29N-STLAN' '2',
tables t_bdc using ' ' 'RC29N-AENNR' '500000000084',
tables t_bdc using ' ' 'RC29N-DATUV' '09.10.2008',
tables t_bdc using 'X' 'SAPLCSDI' '0150',
tables t_bdc using ' ' 'BDC_CURSOR' 'RC29P-MENGE(02)',
tables t_bdc using ' ' 'BDC_OKCODE' '=FCBU',
tables t_bdc using ' ' 'RC29P-MENGE(01)' '2',
tables t_bdc using ' ' 'RC29P-MENGE(02)' '3',
tables t_bdc using 'X' 'SAPLCSDI' '0130',
tables t_bdc using ' ' 'BDC_OKCODE' '/EENDE'.
CALL TRANSACTION 'CS02'
USING t_bdc
MODE 'N' "Background performance
UPDATE 'S' "local updata
MESSAGES INTO t_bdcmsg. "all message table
READ TABLE t_bdcmsg WITH KEY msgtyp = 'S'
msgid = 'V1'
msgnr = '311'.
"批导入成功的标志,可以自己debug表t_bdcmsg中去找.
IF sy-subrc EQ 0.
CONCATENATE '' '修改成功' INTO t_log.
APPEND t_log.
CLEAR t_log.
ELSE.
LOOP AT t_bdcmsg.
IF t_bdcmsg-msgtyp = 'E'
OR t_bdcmsg-msgv1 <> ''
OR t_bdcmsg-msgv2 <> ''
OR t_bdcmsg-msgv3 <> ''
OR t_bdcmsg-msgv4 <> ''.
MESSAGE ID t_bdcmsg-msgid
TYPE t_bdcmsg-msgtyp
NUMBER t_bdcmsg-msgnr
WITH t_bdcmsg-msgv1
t_bdcmsg-msgv2
t_bdcmsg-msgv3
t_bdcmsg-msgv4
INTO t_log-information.
CONCATENATE '出错:' t_log-information INTO t_log-information.
APPEND t_log.
CLEAR t_log.
ENDIF.
ENDLOOP.
ENDIF.
LOOP AT t_log. "显示出错信息
WRITE:/ t_log-information.
ENDLOOP.
*perform close_group.
FORM fm_set_bdc TABLES t_bdc STRUCTURE bdcdata
USING u_sign TYPE c
u_par1
u_par2.
CLEAR: t_bdc.
IF u_sign = 'X'.
t_bdc-program = u_par1.
t_bdc-dynpro = u_par2.
t_bdc-dynbegin = u_sign.
ELSE.
t_bdc-fnam = u_par1.
t_bdc-fval = u_par2.
ENDIF.
APPEND t_bdc.
ENDFORM. "fm_set_bdc
excuted the code,display 'error:Date 24.10.2008 copied from change number'
why didn't this warning skip in BDC?
How to solve this problem?
Best Regards.
PangyantingHi
I dont see any internal table in the code looping...you are executing the same values which are taken from recording..
For Example:
perform fm_set_bdc_field tables t_bdc using 'RC29N-MATNR'
'0000013107'. " this is the value given during recording
perform fm_set_bdc_field tables t_bdc using 'RC29N-MATNR'
itab-matnr. "it should be replaced like this,so the material number you want to upload will be entered in the field.
You are getting sy-subrc = 0,because it is creating with the same values again.
Further here is the sample code for BDC:
REPORT ZZPSALES_BDC1.
types: begin of itab,
b1(4) type c,
b2(4) type c,
b3(2) type c,
b4(2) type c,
b5(10) type c,
b6(10),
b7(10) type C,
b8(10) type c,
b9(8) type c,
b10(8) type c,
end of itab,
begin of itab1,
b8(10) type c,
i1(15) type c,
i2(4) type c,
i3(4) type c,
i4(15) type c,
end of itab1.
data: wa_itab type itab occurs 1 with header line.
data: wa_itab1 type itab1 occurs 1 with header line.
DATA: I_BDCDATA TYPE BDCDATA OCCURS 1 WITH HEADER LINE.
data: it_itab type alsmex_tabline occurs 1 with header line,
it_itab1 type alsmex_tabline occurs 1 with header line .
parameters: file1 type rlgrap-filename default 'C:\Documents and Settings\pri\Desktop\open SO1.xls' lower case.
DATA: CNT TYPE N,
cnt1 type n.
DATA:FNAM(20) TYPE C.
DATA: SAPDATE(10) TYPE C.
at selection-screen.
at selection-screen on value-request for file1.
CALL FUNCTION 'F4_FILENAME'
* EXPORTING
* PROGRAM_NAME = SYST-CPROG
** DYNPRO_NUMBER = SYST-DYNNR
** FIELD_NAME = ' '
IMPORTING
FILE_NAME = file1.
start-of-selection.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = file1
I_BEGIN_COL = 2
I_BEGIN_ROW = 9
I_END_COL = 11
I_END_ROW = 10
TABLES
INTERN = it_itab
* EXCEPTIONS
* INCONSISTENT_PARAMETERS = 1
* UPLOAD_OLE = 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.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = file1
I_BEGIN_COL = 1
I_BEGIN_ROW = 22
I_END_COL = 5
I_END_ROW = 25
TABLES
INTERN = it_itab1
* EXCEPTIONS
* INCONSISTENT_PARAMETERS = 1
* UPLOAD_OLE = 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.
loop at it_itab.
case it_itab-col.
when '1'.
wa_itab-b1 = it_itab-value.
when '2'.
wa_itab-b2 = it_itab-value.
when '3'.
wa_itab-b3 = it_itab-value.
when '4'.
wa_itab-b4 = it_itab-value.
when '5'.
wa_itab-b5 = it_itab-value.
when '6'.
wa_itab-b6 = it_itab-value.
when '7'.
wa_itab-b7 = it_itab-value.
when '8'.
wa_itab-b8 = it_itab-value.
when '9'.
wa_itab-b9 = it_itab-value.
when '10'.
wa_itab-b10 = it_itab-value.
append wa_itab.
endcase.
endloop.
loop at it_itab1.
case it_itab1-col.
when '1'.
wa_itab1-b8 = it_itab1-value.
when '2'.
wa_itab1-i1 = it_itab1-value.
when '3'.
wa_itab1-i2 = it_itab1-value.
when '4'.
wa_itab1-i3 = it_itab1-value.
when '5'.
wa_itab1-i4 = it_itab1-value.
append wa_itab1.
endcase.
endloop.
CLEAR SY-TABIX.
loop at wa_itab.
refresh i_bdcdata.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-AUART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBAK-AUART'
WA_ITAB-B1.
perform bdc_field using 'VBAK-VKORG'
WA_ITAB-B2.
perform bdc_field using 'VBAK-VTWEG'
WA_ITAB-B3.
perform bdc_field using 'VBAK-SPART'
WA_ITAB-B4.
CNT = 1.
CLEAR WA_ITAB1.
LOOP AT WA_ITAB1 WHERE B8 = WA_ITAB-B8.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBKD-BSTKD'
WA_ITAB-B8. "observe here, we are giving customized fields.
perform bdc_field using 'KUAGV-KUNNR'
WA_ITAB-B5.
perform bdc_field using 'KUWEV-KUNNR'
WA_ITAB-B6.
perform bdc_field using 'RV45A-KETDAT'
'06/25/2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
concatenate 'RV45A-KWMENG(0' CNT ')' INTO FNAM.
perform bdc_field using 'BDC_CURSOR'
FNAM.
CONCATENATE 'RV45A-MABNR(0' CNT ')' INTO FNAM.
perform bdc_field using FNAM
WA_ITAB1-I1.
CONCATENATE 'RV45A-KWMENG(0' CNT ')' INTO FNAM.
perform bdc_field using FNAM
WA_ITAB1-I2.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=ITEM'.
perform bdc_field using 'VBKD-BSTKD'
WA_ITAB-B8.
perform bdc_field using 'KUAGV-KUNNR'
WA_ITAB-B5.
perform bdc_field using 'KUWEV-KUNNR'
WA_ITAB-B6.
perform bdc_field using 'RV45A-KETDAT'
'06/25/2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-ZTERM'
'N45'.
perform bdc_field using 'VBKD-INCO1'
'FOB'.
perform bdc_field using 'VBKD-INCO2'
'New York'.
concatenate 'RV45A-KWMENG(0' cnt ')' into fnam.
perform bdc_field using 'BDC_CURSOR'
FNAM.
READ TABLE WA_ITAB1." INDEX '0' .
IF SY-TABIX = 1.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_OKCODE'
'=T\06'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG'.
*perform bdc_field using 'RV45A-KWMENG'
* WA_ITAB1-I2.
*perform bdc_field using 'VBAP-VRKME'
* 'EA'.
perform bdc_field using 'RV45A-ETDAT'
wa_itab-b7.
*perform bdc_field using 'RV45A-PRGBZ'
* 'D'.
ENDIF.
perform bdc_dynpro using 'SAPMV45A' '5003'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KBETR(07)'.
perform bdc_field using 'KOMV-KSCHL(07)'
WA_ITAB1-I3.
perform bdc_field using 'KOMV-KBETR(07)'
WA_ITAB1-I4.
perform bdc_dynpro using 'SAPMV45A' '5003'.
perform bdc_field using 'BDC_OKCODE'
'=HEAD'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KSCHL(08)'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=S\BACK'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-PRSDT'.
perform bdc_field using 'VBAK-AUDAT'
'06/18/2008'.
perform bdc_field using 'VBAK-VKBUR'
'0002'.
perform bdc_field using 'VBAK-WAERK'
'USD'.
perform bdc_field using 'VBKD-PRSDT'
'06/18/2008'.
perform bdc_field using 'VBKD-KDGRP'
'A1'.
*perform bdc_dynpro using 'SAPMV45A' '5003'.
*perform bdc_field using 'BDC_OKCODE'
* '=S\BACK'.
*perform bdc_field using 'BDC_CURSOR'
* 'KOMV-KSCHL(08)'.
cnt = cnt + 1.
ENDLOOP.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=KKNT'.
perform bdc_field using 'VBKD-BSTKD'
WA_ITAB-B8.
perform bdc_field using 'KUAGV-KUNNR'
WA_ITAB-B5.
perform bdc_field using 'KUWEV-KUNNR'
WA_ITAB-B6.
perform bdc_field using 'RV45A-KETDAT'
'06/30/2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-ZTERM'
'N45'.
perform bdc_field using 'VBKD-INCO1'
'FOB'.
perform bdc_field using 'VBKD-INCO2'
'New York'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(02)'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-TXT_VBELN'.
perform bdc_field using 'DKACB-FMORE'
'X'.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-PS_POSID'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'COBL-PS_POSID'
WA_ITAB-B9.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=KFPL'.
perform bdc_field using 'VBKD-BSTKD'
WA_ITAB-B8.
perform bdc_field using 'KUAGV-KUNNR'
WA_ITAB-B5.
perform bdc_field using 'KUWEV-KUNNR'
WA_ITAB-B6.
perform bdc_field using 'RV45A-KETDAT'
'06/30/2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-ZTERM'
'N45'.
perform bdc_field using 'VBKD-INCO1'
'FOB'.
perform bdc_field using 'VBKD-INCO2'
'New York'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(02)'.
perform bdc_dynpro using 'SAPLCNMS' '1300'.
perform bdc_field using 'BDC_CURSOR'
'MLSTS-AUFNR'.
perform bdc_field using 'BDC_OKCODE'
'=GO'.
perform bdc_field using 'MLSTS-SELPS'
'X'.
perform bdc_field using 'MLSTS-PSPNR'
WA_ITAB-B10.
perform bdc_dynpro using 'SAPLCNMS' '1310'.
perform bdc_field using 'BDC_OKCODE'
'=MRKS'.
perform bdc_dynpro using 'SAPLCNMS' '1310'.
perform bdc_field using 'BDC_OKCODE'
'=GET'.
perform bdc_dynpro using 'SAPLV60F' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=S\BACK'.
perform bdc_field using 'BDC_CURSOR'
'FPLA-BEDAT'.
perform bdc_field using 'FPLA-BEDAT'
'06/30/2008'.
perform bdc_field using 'FPLA-BEDAR'
'07'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_field using 'VBKD-BSTKD'
WA_ITAB-B8.
perform bdc_field using 'KUAGV-KUNNR'
WA_ITAB-B5.
perform bdc_field using 'KUWEV-KUNNR'
WA_ITAB-B6.
perform bdc_field using 'RV45A-KETDAT'
'06/30/2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-ZTERM'
'N45'.
perform bdc_field using 'VBKD-INCO1'
'FOB'.
perform bdc_field using 'VBKD-INCO2'
'New York'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(02)'.
perform bdc_dynpro using 'SAPLSPO2' '0101'.
perform bdc_field using 'BDC_OKCODE'
'=OPT1'.
CALL TRANSACTION 'VA01' USING i_bdcdata MODE 'A'.
endloop.
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR i_bdcdata.
i_bdcdata-program = PROGRAM.
i_bdcdata-dynpro = DYNPRO.
i_bdcdata-dynbegin = 'X'.
APPEND i_bdcdata.
ENDFORM.
* Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> SPACE.
CLEAR i_bdcdata.
i_bdcdata-fnam = FNAM.
i_bdcdata-fval = FVAL.
APPEND i_bdcdata.
ENDIF.
ENDFORM.
Regards,
Vishwa. -
Problem In Converting BDC recording to program
Hi to all,
I have recorded ZMM01 using t-code MM01 to create material with accounting codes. Here i am able to create material with accounting codes. But when I am converting that into program there i am getting problem(not creating any material and not showing any error). So please guide me.
Any help would be appreciated .Have you tried executing your BDC program in debug mode with mode A? Also, are you trapping errors in BDCMSGCOLL structure?
Thanks,
Santosh -
Error occured while uploading the data for Tocde QP01 (BDC)
Hi,
I am facing a strange problem i.e. when i try to upload the data for the Tcode QP01 i am able to upload the data for the 18 rows but when it is more than 18 ,it gives the following error and saves the data upto 18 rows only :-
CALL_TRANSACTION QP01 returncode: 0 RECORD: 0
S Field RC27X-FLG_SEL . not found in loop of screen SAPLCPDI 1400
S Cursor field PLMKB-VERWMERKM (18) does not exist in the screen
S Field PLMKB-VERWMERKM (18) does not exist in the screen SAPLQPAA 0150
S Field PLMKB-STICHPRVER (18) does not exist in the screen SAPLQPAA 0150
S Inspection plan with plan group 12775 for material 200999 is saved
Is there any way to solve this problem...hi,
Ok,i agree with you but the thing is it was allowing to upload the data for more than 18 rows as there was logic written. It is specified in the code:-
ELSEIF itab1-serial > 18 AND itab1-serial < 35.
IF index = 19.
index = 2.
ENDIF.
Edited by: nav009 on Sep 9, 2009 8:25 AM -
hello friends .
I am doing an bdc for ke51, my recording is all fine and so is the program according to the recording but I am getting one problem.
on the first screen where we put the profit center the previously loaded profit center is coming and then i am getting the error tat the profit center is already created.
what to do is this case , i am also trying to clear that screen field but its not helping. pls help its very urgent ....Hi Amit,
try with this code ( place your screen number and field values )
PERFORM BDC_DYNPRO USING 'programname' 'screen number'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'PRCT_V-PRCTR '
SPACE.
PERFORM BDC_FIELD USING 'PRCT_V-PRCTR '
place ur value.
this will solve ur problem.
regards,
muralidhar.
Maybe you are looking for
-
Is there anyway of tracking my ipad using only the apple id account that I used on it? It hadn't hardly been used for anything other than updating to iOS7 recently...
-
Form created with LiveCycle is not saving the data of a fillable form.
I had posted this in another forum, which got moved over to this forum. Forgive the double post, I wasn't sure if it was assumed that it was resolved. This document: http://www.southark.edu/employment/application-v5.pdf was created a couple of yea
-
Error when generate a new version for MSMP Process ID
Helly guys, again, I have created a new custom workflow. When I am trying to test the new workflow i have some errors: Incorect path and stage entry for process XXX. Can you help me? Thank you, Ovidiu
-
V11~ purchased albums not in cloud(?)
My MBA (10.8.2) iTunes has just been updated to v.11, and while I'm away from the library I thought I'd play some of what is in the cloud. Thusfar, I've only found one of my purchased albums (indicated with the cloud icon, and it plays correctly).
-
IOS5 iMessages won't allow me to register a second email address
I just installed pIOS 5 and have been trying to register a second email address in iMessages. When I do it returns an error saying the email address is already in use. Has anyone else had and solved the same problem?