BDC for AR Posting
Dear All,
I am unable to post multiple line items while posting AR Invoice using BDC recording of FB01.
Can anyone provide me the BDC program code to post multiple line items.
Thanks in Advance,
Harish
Hi,
Already created the program using BDC.
Last Document not getting saved due to screen error.
Is there any OK-CODE to post the final document and close the BDC session.
Suggestion will be very helpful from you all.
Thanks in advance.
Regards,
Harish
Similar Messages
-
BDC for AR Posting (Tcode - FB01)
Dear All,
I am unable to post multiple line items while postnig AR Invoice using BDC recording of FB01.
Can anyone provide me the BDC program code to post multiple line items.
Thanks in Advance,
Harishhi,
please check your document type with tcode oba7
field cust./vend. check (t003-XKKPR) -> set value = X
pls reward useful answers
thx.
Andreas -
Hi All Gurus,
does anyone have a bdc for (fb50)posting gl accounts? this is the first time Im writting one, with no technical specs... and its too crazy to work!!!!
Any help is most welcome!!!
Thanks, nina.Hi
See the documentation of RFBIBL00.
Anyway you have to create a program creates a file using these structure:
- BGR00 for session data;
- BBKPF for header data;
- BBSEG for items data
All fields of BBKPF and BBSEG you don't need has to fill with 'no data' character, i.e. /
So your file should be:
BGR00 <---- Session data
BBKPF <---- Start document data
BBSEG
BBSEG
BBKPF <---- New document
BBSEG
BBSEG
BBKPF <---- New document
BBSEG
BBSEG
After creating the file you have to submit the report RFBIBL00:
SUBMIT RFBIBL00 WITH DS_NAME = <FILE NAME>
WITH CALLMODE = 'B'
AND RETURN.
Max -
Post the lease rental charges for oprating lease asset using bdc for f-02
hi any can send me the programed for t code f-02
for post the lease rental charges for operating lease asset using bdc for f-02
This is not a place where you can get your entire work done by others. Please put some effort from your side before turning to the forums for help. Thread locked.
Locked by: kishan P on Aug 24, 2010 5:47 PMhi any can send me the programed for t code f-02
for post the lease rental charges for operating lease asset using bdc for f-02
This is not a place where you can get your entire work done by others. Please put some effort from your side before turning to the forums for help. Thread locked.
Locked by: kishan P on Aug 24, 2010 5:47 PM -
BDC for F - 43, Multiple posting keys,multiple line items
Dear gurus,
I need to develop a bdc for F-43, it it working for multiple posting keys with two line items, but not working for multiple line items, can you tell me where to loop the line items.
regards,
vidyasagar yadav.F-43 is actually FB01 (with two parameters, check it with SE93).
So you could use the following FMs in sequence to build the BDC :
POSTING_INTERFACE_START
POSTING_INTERFACE_DOCUMENT
POSTING_INTERFACE_END
Else
Re-execute transaction SHDB for a document with 2 items and for a document with a dozen items and analyze the result.
Use a BAPI like BAPI_ACC_INVOICE_RECEIPT_POST or BAPI_ACC_DOCUMENT_POST
Regards,
Raymond -
BDC for multiple line items (VA01)
Hi Experts,
I create a BDC for VA01 transaction for single line item in that now i want to upload multiple line items also with o/p of total no. of records uploaded, no. of records posted and the no. of error records...
Can any body explain with sample code...Hi,
if the flat file is containing header and item records...
first split those records tooo two internal tables header and item..
Loop at header ...
process of recording steps for header....
Loop at item...
here create a varialbe with char 2 .. for index value....
process of item recording steps..
increment the index value by 1....
here u have to pass 'p+' OK_CODE..
Endloop ..(item)
Endloop...(header)
for more info goo through this link...
http://www.sap-img.com/bdc.htm
hope helpful
Raghunath.S -
BDC for MIGO for GR OutBound Delivery( A01 & R05 ) from Movement Type 107 to 109
Hi,
I am stuck with a very typical situation need all your expertise and advices for a solution.
We are basically trying to create change the movement type from 107 to 109 through MIGO.
I have made a BDC recording for MIGO ( because we would like to track each delivery specifically under shipment , I know that there is a BAPI which is there to do this but it works fine if we do the shipment with Purchase Order as input which dont want in that manner )
Process:
1. Creating Production Order
2. Creating Purchase Order
3. Creating STO
4. Deliveries
5. PGI for Deliveries
6. Shipment for group of outbound Deliveries
I have created a z program where i am passing shipment number in the selection screen.
Then it would take all the deliveries for that shipment and pass each delivery to MIGO and process it and change the status from 107 to 109.
Interesting part here is, the code works absolutely perfect only from my ID. But when I test from other ID it is not executing, so to check where is the problem I have added mess_tab to the CALL TRANSACTION to capture what message is been populated for my ID comparing with others
Message Captured on Others ID's:
MSGID: 00
MSGNR: 344
MSGV1: SAPLMIGO
MSGV2: 1300
Message Captured on MY ID:
MSGID: MIGO
MSGNR: 012
MSGV1: 5000005802
MSGV2: (empty)
This is the problem this program is executing only on MY ID, rest all ID's it is not processing.
We have cross verified with security and basis regarding any authorization issues but nothing came up.
Please help me what could be the issue ( WHY it is processing successfully for my and WHY NOT for other ID's)
Below is the main code :
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL' " Converting Date format to DD/MM/YYYY
EXPORTING
DATE_INTERNAL = sy-datum
IMPORTING
DATE_EXTERNAL = lv_date_external
EXCEPTIONS
DATE_INTERNAL_IS_INVALID = 1
OTHERS = 2.
IF SY-SUBRC <> 0. "#EC NEEDED
* Implement suitable error handling here
ENDIF.
* Validating input shipment number with database table VTTP
SELECT VTTP~TKNUM
VTTP~TPNUM
VTTP~VBELN
FROM VTTP INNER JOIN VTTK
ON VTTP~TKNUM = VTTK~TKNUM
INTO TABLE IT_VTTP
WHERE VTTK~TKNUM = P_TKNUM
AND VTTK~STDIS = 'X'.
IF sy-subrc = 0.
* Validating all deliveries having same Delivery type or not
SELECT * FROM likp INTO TABLE it_likp FOR ALL ENTRIES IN it_vttp WHERE vbeln = it_vttp-vbeln
AND vbtyp = 'J'.
IF sy-subrc = 0.
CLEAR lv_lines.
LOOP AT it_likp INTO wa_likp.
REFRESH:it_vbfa,BDCDATA.
* Validating if Delivery Type = 109 (GR already done), or Delivery Type = 107 (must process for GR )
SELECT * FROM vbfa INTO TABLE it_vbfa WHERE vbelv = wa_likp-vbeln
* AND vbtyp_v = 'J'
AND bwart = '109'.
IF sy-subrc = 0.
lv_flag1 = 'X'.
ELSE.
SELECT * FROM vbfa INTO TABLE it_vbfa WHERE vbelv = wa_likp-vbeln
* AND vbtyp_v = 'J'
AND bwart = '107'.
IF sy-subrc NE 0.
MESSAGE 'No Deliveries with Movement Type "107" ' TYPE 'I'.
ELSE.
lv_flag2 = 'X'.
lv_lines = lv_lines + 1.
** BDC for MIGO
perform bdc_dynpro using 'SAPLMIGO' '0001'.
perform bdc_field using 'BDC_OKCODE'
'=OK_GO'.
perform bdc_field using 'GODYNPRO-ACTION'
'A01'.
perform bdc_field using 'GODYNPRO-REFDOC'
'R05'.
perform bdc_field using 'GODEFAULT_TV-BWART'
'109'.
perform bdc_field using 'BDC_CURSOR'
'GODYNPRO-OUTBOUND_DELIVERY'.
perform bdc_field using 'GODYNPRO-OUTBOUND_DELIVERY'
wa_likp-vbeln. "'80019574'.
perform bdc_field using 'GOHEAD-BLDAT'
lv_date_external. "'04/29/2015'.
perform bdc_field using 'GOHEAD-BUDAT'
lv_date_external. "'04/29/2015'.
perform bdc_field using 'GOHEAD-WEVER'
'1'.
perform bdc_dynpro using 'SAPLMIGO' '0001'.
perform bdc_field using 'BDC_OKCODE'
'=OK_POST1'.
perform bdc_field using 'GODEFAULT_TV-BWART'
'109'.
perform bdc_field using 'GOHEAD-BLDAT'
lv_date_external. "'04/29/2015'.
perform bdc_field using 'GOHEAD-LFSNR'
wa_likp-vbeln. "'0080019574'.
perform bdc_field using 'GOHEAD-BUDAT'
lv_date_external. "'04/29/2015'.
perform bdc_field using 'GOHEAD-WEVER'
'1'.
perform bdc_field using 'GODYNPRO-DETAIL_ZEILE'
' 1'.
perform bdc_field using 'GOITEM-ERFME'
'EA'.
perform bdc_field using 'GOITEM-ERFMG'
'1'.
perform bdc_field using 'GOITEM-LSMNG'
'1'.
perform bdc_field using 'GOITEM-LSMEH'
'EA'.
perform bdc_field using 'GOITEM-MIGO_ELIKZ'
'1'.
perform bdc_field using 'GOITEM-BWART'
'109'.
perform bdc_field using 'GOITEM-LGOBE'
'RX Cross-docking'.
perform bdc_field using 'BDC_CURSOR'
'GODYNPRO-DETAIL_TAKE'.
perform bdc_field using 'GODYNPRO-DETAIL_TAKE'
'X'.
PERFORM bdc_dynpro USING 'SAPLMIGO' '1300'.
PERFORM bdc_field USING 'BDC_CURSOR'
'G_TIP_DONT_SHOW_AGAIN'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=OK_TIP_GO'.
PERFORM bdc_field USING 'G_TIP_DONT_SHOW_AGAIN'
'X'.
*& Avoid unncessary screens to populate while processing background.
LV_OPTIONS-DISMODE = 'N'.
LV_OPTIONS-UPDMODE = 'S'.
LV_OPTIONS-NOBINPT = 'X'.
CALL TRANSACTION 'MIGO' USING BDCDATA OPTIONS FROM LV_OPTIONS MESSAGES INTO IT_MESSTAB1 .
WAIT UP TO 1 SECONDS.
DELETE IT_MESSTAB1 WHERE MSGTYP NE 'E'.
IF IT_MESSTAB1[] IS NOT INITIAL.
APPEND LINES OF IT_MESSTAB1 TO IT_MESSTAB.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ELSE.
MESSAGE 'Shipment Number does not exists Or not Planned' TYPE 'E'.
ENDIF.
ELSE.
MESSAGE 'Please insert Shipment Number' TYPE 'E'.
ENDIF.
IF lv_flag1 = 'X' AND lv_flag2 = 'X'.
MESSAGE 'This shipment is processed with an inconsistent goods receipt' TYPE 'I'.
ELSEIF lv_flag1 = 'X'.
MESSAGE 'Shipment already been processed for these deliveries' TYPE 'I'.
ELSEIF lv_flag2 = 'X'.
lv_lines1 = lv_lines.
CONDENSE lv_lines1 NO-GAPS .
CONCATENATE lv_lines1 'Goods Receipt are posted for the shipment '
INTO lv_message SEPARATED BY space.
MESSAGE lv_message TYPE 'I'.
ENDIF.
* Display Messages from Message TAB.
DELETE ADJACENT DUPLICATES FROM IT_MESSTAB.
DATA:lv_msg TYPE string.
LOOP AT IT_MESSTAB INTO WA_MESSTAB.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = WA_MESSTAB-MSGID
NO = WA_MESSTAB-MSGNR
V1 = WA_MESSTAB-MSGV1
V2 = WA_MESSTAB-MSGV2
V3 = WA_MESSTAB-MSGV3
V4 = WA_MESSTAB-MSGV4
IMPORTING
MSG = lv_msg
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
WRITE:/ lv_msg.
ENDLOOP.
* Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO. "#EC PF_NO_TYPE
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
* Insert field *
FORM BDC_FIELD USING FNAM FVAL. "#EC PF_NO_TYPE
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDFORM.
Thanks,
SriniHi Rob,
Thanks for quick reply.
I have checked the NOTE : 304122
But there in the NOTE it says ( " BAPI, BAPI_GOODSMVT_CANCEL, BAPI_GOODSMVT_CREATE, CNTL_ERROR" )
These BAPI's work perfectly for (purchase order as input type), but here out type is ( A01 & R05 ) we are giving DELIVERY NUMBER as input to MIGO.
So for this scenario we cannot use those BAPI's mentioned in the NOTE.
Also as stated earlier in the message interesting part is
"The code works absolutely perfect only from my ID. But when I test from other ID it is not executing. Code is working exactly as expected ONLY to my ID. When i try to execute the same code from another's ID it is not working"
So what do you think might be the issue? -
Problem in BDC for Transaction F-02
Hi Friends,
I am struck up in BDC for TransactionF-02.i am unable to load the data of my test data.when i am loading its loading the second record not the first record.
Below is the test data
H,RAWATEB,1
M,11072006,ZE,1000,11072006,20,SAR,,,,,RAWATIB,,SALARIES,1000
D,50,482000,3648.61,Z1,,,1000,1111,,,,,,
D,40,113001,3648.61,Z1,,,1000,,,,,,,
D,17,001011,3000000.00,Z1,,,1000,,,,,,,
D,40,113001,3000000.00,Z1,,,1000,,,,,,,
M,17082004,ZE,1000,11072006,20,SAR,,,,,RAWATIB,,SALARIES,1000
D,50,482000,3202.82,Z1,,,1000,1112,,,,,,
D,40,113001,3202.82,Z1,,,1000,,,,,,,
D,50,482000,2600000.00,Z1,,,1000,1111,,,,,,
D,40,001011,2600000.00,Z1,,,1000,,,,,,,
T,0000000002
<b></b>
the report is below
REPORT ZFGLDR0030 line-count 60
line-size 160
message-id 00.
====================================================================
****************************TABLES**********************************
====================================================================
tables: bkpf.
====================================================================
**************************RECORD LAYOUTS****************************
====================================================================
Data: begin of bdc_tab occurs 200.
include structure bdcdata.
data: end of bdc_tab.
Data: Begin of tmp_tab occurs 200,
fld1(255) type c,
end of tmp_tab.
DATA: BEGIN OF upload_tab OCCURS 200,
fld1(1) type c,
fld2(10) type c,
fld3(10) type c,
fld4(16) type c,
fld5(10) type c,
fld6(2) type c,
fld7(4) type c,
fld8(10) type c,
fld9(10) type c,
fld10(10) type c,
fld11(10) type c,
fld12(12) type c,
fld13(25) type c,
fld14(50) type c,
fld15(4) type c,
fld16(1) type c,
END OF upload_tab.
data : tmp_rec like upload_tab.
DATA: BEGIN OF upload1_tab OCCURS 200,
fld1(1) type c,
fld2(10) type c,
fld3(10) type c,
fld4(16) type c,
fld5(10) type c,
fld6(2) type c,
fld7(4) type c,
fld8(10) type c,
fld9(10) type c,
fld10(10) type c,
fld11(10) type c,
fld12(12) type c,
fld13(25) type c,
fld14(50) type c,
fld15(4) type c,
fld16(1) type c,
END OF upload1_tab.
Data: upload2_tab like tmp_rec occurs 200 with header line.
Data: Del_tab like tmp_rec occurs 200 with header line.
DATA: V_SYTABIX TYPE I,
v_kunnr like knb1-kunnr,
v_brsch like kna1-brsch,
v_datum like sy-datum,
v_tmp(1) type c,
v_flag type i,
v_ccode(10) type c,
v_glcd(10) type c,
v_len type n,
v_rem(50) type c,
v_docno(12) type c,
v_dtype(3) type c,
v_sno(8) type n,
v_upd_flag type i,
v_idx like sy-tabix,
v_budat like bkpf-budat,
v_fld5(10) type c,
v_date(10) type c.
====================================================================
*********************SELECTION-SCREEN******************************
====================================================================
selection-screen: begin of block b1 with frame .
parameters:p_fl_mct like rlgrap-filename
default 'C:\test' obligatory,
p_sesid like apqi-groupid default 'RAWATIB',
p_user like apqi-userid default sy-uname.
selection-screen: end of block b1.
selection-screen: begin of block b2 with frame .
parameters:p_opt1 radiobutton group grp1 default 'X',
p_opt2 radiobutton group grp1,
p_budat like bkpf-budat.
selection-screen: end of block b2.
====================================================================
Validate SELECTION-SCREEN **************************
====================================================================
At Selection-screen.
translate p_fl_mct to upper case.
if p_opt2 = 'X' and p_budat = '00000000'.
message e398(00) with 'Please enter date to use as Posting date'.
endif.
at selection-screen on value-request for p_fl_mct.
data : v_mask(120) type c.
v_mask = ',IT2 files (.),.'.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = ' '
MASK = v_mask
TITLE = 'File Selection for Upload'
IMPORTING
FILENAME = p_fl_mct
RC =
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
end-of-selection.
====================================================================
*****************************CONSTANTS******************************
====================================================================
====================================================================
*****************************VARIABLES******************************
====================================================================
====================================================================
TOP OF PAGE*******************************
====================================================================
top-of-page.
start-of-selection.
v_upd_flag = 0.
perform initialise_process.
perform bdc_open.
perform process_upload_tab.
perform terminate_process.
end-of-selection.
====================================================================
Form : Initialise_Process *
====================================================================
FORM initialise_process.
Initialises variables *
move : sy-repid to sy-tvar0,
sy-uname to sy-tvar1,
p_sesid to sy-tvar2,
sy-pagno to sy-tvar3.
write: sy-datum to sy-tvar4,
sy-uzeit to sy-tvar5.
Selecting the GL codes to be updated**********************
call function 'WS_UPLOAD'
EXPORTING
FILENAME = p_fl_mct
FILETYPE = 'ASC'
TABLES
data_tab = Tmp_tab
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
OTHERS = 10.
if sy-subrc <> 0.
message e398(00) with 'Unable to upload data'.
endif.
Validation for Upload file **********************
read table tmp_tab index 1.
split tmp_tab-fld1 at ',' into tmp_rec-fld1
tmp_rec-fld2
tmp_rec-fld3
tmp_rec-fld4
tmp_rec-fld5
tmp_rec-fld6
tmp_rec-fld7
tmp_rec-fld8
tmp_rec-fld9
tmp_rec-fld10
tmp_rec-fld11
tmp_rec-fld12
tmp_rec-fld13
tmp_rec-fld14
tmp_rec-fld15
v_tmp.
if tmp_rec-fld2 <> 'RAWATEB'.
message e398(00) with 'Invliad file format, cannot upload'.
endif.
loop at tmp_tab.
clear upload_tab.
v_tmp = tmp_tab-fld1+0(1).
if v_tmp = 'M' or v_tmp = 'D'.
split tmp_tab-fld1 at ',' into upload_tab-fld1
upload_tab-fld2
upload_tab-fld3
upload_tab-fld4
upload_tab-fld5
upload_tab-fld6
upload_tab-fld7
upload_tab-fld8
upload_tab-fld9
upload_tab-fld10
upload_tab-fld11
upload_tab-fld12
upload_tab-fld13
upload_tab-fld14
upload_tab-fld15
v_tmp.
if upload_tab-fld1 = 'M'.
clear tmp_rec.
move upload_tab to tmp_rec.
else.
clear upload1_tab.
move upload_tab to upload1_tab.
upload1_tab-fld10 = tmp_rec-fld2.
upload1_tab-fld12 = tmp_rec-fld12.
upload1_tab-fld15 = tmp_rec-fld15.
append upload1_tab.
endif.
append upload_tab.
endif.
endloop.
Mark the already uploaded Transaction to skip ***********
Loop at upload_tab.
if upload_tab-fld1 = 'M'.
v_idx = sy-tabix.
move upload_tab-fld24(4) to v_budat0(4).
move upload_tab-fld22(2) to v_budat4(2).
move upload_tab-fld20(2) to v_budat6(2).
Select single * from bkpf where BLART = upload_tab-fld3 and
BUKRS = upload_tab-fld4 and
XBLNR = upload_tab-fld12 and
budat = v_budat.
if sy-subrc = 0.
do 1000 times.
clear del_tab.
move upload_tab to del_tab.
append del_tab.
upload_tab-fld16 = '*'.
modify upload_tab index v_idx.
v_idx = v_idx + 1.
Read table upload_tab index v_idx.
if upload_tab-fld1 = 'M' or sy-subrc <> 0.
exit.
endif.
enddo.
endif.
endif.
endloop.
ENDFORM. "initialise_process
====================================================================
Form : Process_Ord_itab *
====================================================================
FORM process_upload_tab .
v_flag = 0.
loop at upload_tab where fld16 <> '*' .
Performing the Save at the end of Transaction *************
if upload_tab-fld1 = 'M' and v_flag = 1.
perform load_save.
perform bdc_insert.
endif.
Putting the Header information of the document ************
if upload_tab-fld1 = 'M'.
perform load_header.
v_date = v_fld5.
v_rem = upload_tab-fld14.
v_flag = 0.
endif.
Putting the Detail information of the document ************
if upload_tab-fld1 = 'D'.
if upload_tab-fld2 = '40' or upload_tab-fld2 = '50' .
perform Load_next.
v_tmp = v_glcd.
v_len = strlen( upload_tab-fld3 ).
If ( v_tmp = '2' or v_tmp = '4' or v_tmp = '0' ) .
Perform load_ccenter.
elseif v_flag = 1.
perform upload_blank.
endif.
perform load_Detail.
v_flag = 1.
v_glcd = upload_tab-fld3.
v_ccode = upload_tab-fld9.
else.
perform Load_next.
v_tmp = v_glcd.
v_len = strlen( upload_tab-fld3 ).
perform upload_blank.
perform load_Detail_301.
v_flag = 0.
v_glcd = '1'.
endif.
endif.
endloop.
if v_flag = 1.
perform load_save.
endif.
perform bdc_insert.
v_upd_flag = 1.
ENDFORM. "process_upload_tab
====================================================================
Form : BDC_OPEN *
====================================================================
FORM bdc_open.
call function 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = p_sesid
user = p_user
keep = 'X'.
ENDFORM. "bdc_open
====================================================================
Form : Fill_BDC_Tab *
====================================================================
FORM fill_bdc_tab using dynbegin
name
value.
if dynbegin = 'X'.
clear bdc_tab.
move: name to bdc_tab-program,
value to bdc_tab-dynpro,
'X' to bdc_tab-dynbegin.
append bdc_tab.
else.
clear bdc_tab.
move: name to bdc_tab-fnam,
value to bdc_tab-fval.
append bdc_tab.
endif.
ENDFORM. "fill_bdc_tab
====================================================================
Form : BDC_INSERT *
====================================================================
FORM bdc_insert .
call function 'BDC_INSERT'
EXPORTING
tcode = 'F-02'
TABLES
dynprotab = bdc_tab.
refresh bdc_tab.
clear bdc_tab.
ENDFORM. "bdc_insert
====================================================================
Form : BDC_CLOSE *
====================================================================
FORM bdc_close.
call function 'BDC_CLOSE_GROUP'.
ENDFORM. "bdc_close
====================================================================
Form : Terminate_Process *
====================================================================
FORM terminate_process.
perform bdc_close.
ENDFORM. "terminate_process
*& Form load_Header
FORM load_Header.
If upload_tab-fld1 = 'M'.
v_fld5 = upload_tab-fld5.
if p_opt2 = 'X'.
move p_budat6(2) to v_fld50(2).
move p_budat4(2) to v_fld52(2).
move p_budat0(4) to v_fld54(4).
endif.
perform fill_bdc_tab using:
'X' 'SAPMF05A' '0100',
' ' 'BDC_CURSOR' 'RF05A-NEWKO',
' ' 'BKPF-BLDAT' upload_tab-fld2,
' ' 'BKPF-BLART' upload_tab-fld3,
' ' 'BKPF-BUKRS' upload_tab-fld4,
' ' 'BKPF-BUDAT' v_fld5,
' ' 'BKPF-WAERS' upload_tab-fld7,
' ' 'BKPF-XBLNR' upload_tab-fld12,
' ' 'BKPF-BKTXT' upload_tab-fld13.
Endif.
ENDFORM. "load_Header
*& Form load_Detail
FORM load_Detail.
perform fill_bdc_tab using:
'X' 'SAPMF05A' '0300',
' ' 'BDC_CURSOR' 'BSEG-WRBTR',
' ' 'BSEG-WRBTR' upload_tab-fld4,
' ' 'BSEG-VALUT' v_date,
' ' 'BSEG-SGTXT' v_rem.
ENDFORM. " LOAD_DATA
*& Form load_Detail
FORM load_Detail_301.
perform fill_bdc_tab using:
'X' 'SAPMF05A' '0301',
' ' 'BDC_CURSOR' 'RF05A-NEWUM',
' ' 'BSEG-WRBTR' upload_tab-fld4,
' ' 'BSEG-VALUT' v_date,
' ' 'BSEG-SGTXT' v_rem.
ENDFORM. " LOAD_DATA
*& Form load_Next
FORM Load_next.
perform fill_bdc_tab using:
' ' 'RF05A-NEWBS' upload_tab-fld2,
' ' 'RF05A-NEWKO' upload_tab-fld3,
' ' 'BDC_OKCODE' '/00'.
ENDFORM. "Load_next
*& Form load_Save
FORM Load_save.
perform fill_bdc_tab using:
'X' 'SAPMF05A' '0300',
' ' 'BDC_OKCODE' '=BU'.
v_tmp = v_glcd.
v_len = strlen( upload_tab-fld3 ).
If ( v_tmp = '2' or v_tmp = '4' or v_tmp = '0' ) .
Perform load_ccenter.
elseif v_flag = 1.
perform upload_blank.
endif.
perform fill_bdc_tab using:
'X' 'SAPMF05A' '0700',
' ' 'BDC_OKCODE' '=BU'.
ENDFORM. "Load_save
*& Form load_CCenter
FORM Load_Ccenter.
perform fill_bdc_tab using:
'X' 'SAPLKACB' '0002',
' ' 'BDC_CURSOR' 'COBL-KOSTL',
' ' 'COBL-KOSTL' '4200-0451',
' ' 'COBL-KOSTL' v_ccode,
' ' 'COBL-KOSTL' '4200-0295',
' ' 'BDC_OKCODE' '/EENTE'.
ENDFORM. "Load_Ccenter
*& Form load_blank
FORM UpLoad_blank.
perform fill_bdc_tab using:
'X' 'SAPLKACB' '0002',
' ' 'BDC_OKCODE' '/EENTE'.
ENDFORM. "UpLoad_blankur code looking ok..
just change it..
call function <b>'WS_UPLOAD'</b>--->to <b>gui_upload</b>
EXPORTING
FILENAME = p_fl_mct
FILETYPE = 'ASC'
TABLES
data_tab = Tmp_tab
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
OTHERS = 10.
if sy-subrc <> 0.
message e398(00) with 'Unable to upload data'.
endif. -
BDC for FB50L...URGENT
Hi,
I am doing the BDC for FB50L but the code doesn't seem to execute...it is giving errors...
I am attaching the code...Please review it and help me....its really urgent...
Your help will be really appreciated...
REPORT ZTEST_BDC_PARK_ACC_GL.
DATA:
t_document_line_item_main LIKE bapiacgl09 OCCURS 100,
t_document_line_item_enhn LIKE bapiacextc OCCURS 100,
t_document_line_item_amnt LIKE bapiaccr09 OCCURS 100,
t_return LIKE bapiret2 OCCURS 100,
wa_document_header LIKE bapiache09,
wa_document_line_item_main LIKE bapiacgl09,
wa_document_line_item_enhn LIKE bapiacextc,
wa_document_line_item_amnt LIKE bapiaccr09,
wa_return LIKE bapiret2.
DATA: it_bdcdata TYPE TABLE OF bdcdata,
it_messages TYPE TABLE OF bdcmsgcoll,
wa_messages TYPE bdcmsgcoll,
options TYPE ctu_params.
DATA: idx TYPE i,
ch3(5) TYPE c,
fname(40) TYPE c.
DATA: indate TYPE d,
intdate TYPE D.
CLEAR wa_document_header.
wa_document_header-obj_type = space. "
wa_document_header-obj_key = space.
wa_document_header-obj_sys = space.
wa_document_header-bus_act = 'RFBU'.
wa_document_header-username = 'INFAUSRTEST'.
wa_document_header-header_txt = 'BAPI__POST'.
wa_document_header-comp_code = '1001'.
wa_document_header-doc_date = '20070814'.
wa_document_header-pstng_date = '20070814'.
CLEAR wa_document_header-trans_date.
CLEAR wa_document_header-fisc_year.
CLEAR wa_document_header-fis_period.
wa_document_header-doc_type = 'SY'.
wa_document_header-ref_doc_no = 'REQUIRED'.
wa_document_header-ac_doc_no = space.
wa_document_header-obj_key_r = space.
wa_document_header-reason_rev = space.
wa_document_header-compo_acc = space.
wa_document_header-ref_doc_no_long = space.
wa_document_header-acc_principle = 'LGAP'.
wa_document_header-neg_postng = space.
wa_document_header-obj_key_inv = space.
wa_document_header-bill_category = space.
Fill Line Item #1
CLEAR: wa_document_line_item_main, wa_document_line_item_enhn, wa_document_line_item_amnt.
Fill Main Portion Of Accounting Line Item
wa_document_line_item_main-itemno_acc = '1'. "Accounting Document Line Item Number
wa_document_line_item_main-gl_account = '2412001067'."HKONT - Account
wa_document_line_item_main-item_text = 'Test BAPI'. "SGTXT - Item Text
wa_document_line_item_main-doc_type = space. "BLART - Document Type
wa_document_line_item_main-comp_code = space. "BUKRS - Company Code
wa_document_line_item_main-pstng_date = '20070814'. "BUDAT - Posting Date
wa_document_line_item_main-alloc_nmbr = space. "ZUONR - Allocation Number
wa_document_line_item_main-costcenter = space. "KOSTL - Cost Center
wa_document_line_item_main-profit_ctr = space. "PRCTR - Profit Center
wa_document_line_item_main-de_cre_ind = 'D'. "NEWBS - Posting Key / Debit Credit Indicator
wa_document_line_item_main-trade_id = space. "RASSC - Company ID Of Trading Partner
Fill Amount Portion Of Accounting Line Item
wa_document_line_item_amnt-itemno_acc = '1'. "Accounting Document Line Item Number
wa_document_line_item_amnt-curr_type = '00'. "Currency Type
wa_document_line_item_amnt-currency = 'USD'. "WAERS - Currency Key
wa_document_line_item_amnt-amt_doccur = '239959'. "WRBTR - Amount In Document Currency Type
APPEND: wa_document_line_item_main TO t_document_line_item_main,
wa_document_line_item_amnt TO t_document_line_item_amnt.
Fill Next Line Item #2
CLEAR: wa_document_line_item_main, wa_document_line_item_enhn, wa_document_line_item_amnt.
Fill Main Portion Of Accounting Line Item
wa_document_line_item_main-itemno_acc = '2'. "Accounting Document Line Item Number
wa_document_line_item_main-gl_account = '2412001067'."HKONT - Account
wa_document_line_item_main-item_text = 'Test BAPI'. "SGTXT - Item Text
wa_document_line_item_main-doc_type = space. "BLART - Document Type
wa_document_line_item_main-comp_code = space. "BUKRS - Company Code
wa_document_line_item_main-pstng_date = '20070814'. "BUDAT - Posting Date
wa_document_line_item_main-alloc_nmbr = space. "ZUONR - Allocation Number
wa_document_line_item_main-costcenter = space. "KOSTL - Cost Center
wa_document_line_item_main-profit_ctr = space. "PRCTR - Profit Center
wa_document_line_item_main-de_cre_ind = 'C'. "NEWBS - Posting Key / Debit Credit Indicator
wa_document_line_item_main-trade_id = space. "RASSC - Company ID Of Trading Partner
Fill Enhancement Portion Of Accounting Line Item
Fill Amount Portion Of Accounting Line Item
wa_document_line_item_amnt-itemno_acc = '2'. "Accounting Document Line Item Number
wa_document_line_item_amnt-curr_type = '00'. "Currency Type
wa_document_line_item_amnt-currency = 'USD'. "WAERS - Currency Key
wa_document_line_item_amnt-amt_doccur = '-239959'. "WRBTR - Amount In Document Currency Type
APPEND: wa_document_line_item_main TO t_document_line_item_main,
wa_document_line_item_amnt TO t_document_line_item_amnt.
*************************BDC PROGRAM**************************************************************
PERFORM bdc_dynpro TABLES it_bdcdata USING 'SAPMF05A' wa_document_header-comp_code .
PERFORM bdc_field TABLES it_bdcdata USING 'BDC_OKCODE'
'=BP'.
MOVE wa_document_header-doc_date TO indate.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = indate
IMPORTING
date_internal = intdate.
PERFORM bdc_field TABLES it_bdcdata USING 'ACGL_HEAD-BLDAT'
INTDATE.
perform bdc_field TABLES it_bdcdata USING 'ACGL_HEAD-WAERS'
wa_document_line_item_amnt-currency.
MOVE wa_document_header-pstng_date TO indate.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = indate
IMPORTING
date_internal = intdate.
PERFORM bdc_field TABLES it_bdcdata USING 'ACGL_HEAD-BUDAT'
INTDATE.
perform bdc_field TABLES it_bdcdata USING 'ACGL_HEAD-XBLNR'
wa_document_header-ref_doc_no.
PERFORM bdc_field TABLES it_bdcdata USING 'ACGL_HEAD-BKTXT'
wa_document_header-header_txt.
LOOP AT t_document_line_item_main INTO wa_document_line_item_main.
idx = idx + 1.
ch3 = idx.
CONCATENATE 'ACGL_ITEM-HKONT(' ch3 ')' INTO fname.
CONDENSE fname.
PERFORM bdc_field TABLES it_bdcdata USING fname
wa_document_line_item_main-gl_account.
CONCATENATE 'ACGL_ITEM-SHKZG(' ch3 ')' INTO fname.
CONDENSE fname.
PERFORM bdc_field TABLES it_bdcdata USING fname
wa_document_line_item_main-de_cre_ind.
CONCATENATE 'ACGL_ITEM-WRBTR(' ch3 ')' INTO fname.
CONDENSE fname.
PERFORM bdc_field TABLES it_bdcdata USING fname
wa_document_line_item_amnt-amt_doccur.
CONCATENATE 'ACGL_ITEM-SGTXT(' ch3 ')' INTO fname.
CONDENSE fname.
PERFORM bdc_field TABLES it_bdcdata USING fname
wa_document_line_item_main-item_text .
ENDLOOP.
options-dismode = 'A'.
options-nobinpt = 'X'.
CALL TRANSACTION 'FB50' USING it_bdcdata MESSAGES INTO
it_messages OPTIONS FROM options.
Start new screen
FORM bdc_dynpro TABLES it_bdcdata STRUCTURE bdcdata USING program
dynpro
DATA: wa_bdcdata TYPE bdcdata.
wa_bdcdata-program = program.
wa_bdcdata-dynpro = dynpro.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field
FORM bdc_field TABLES it_bdcdata STRUCTURE bdcdata USING fnam fval.
DATA: wa_bdcdata TYPE bdcdata.
IF fval <> space.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = fnam.
wa_bdcdata-fval = fval.
APPEND wa_bdcdata TO it_bdcdata.
ENDIF.
ENDFORM. "BDC_FIELD
Please suggest....
Thanksdata : amount(16).
This below statement is not passing value wa_document_line_item_amnt-amt_doccur into it_bdcdata-fval. So try to move it to a character field and then use the perform statement.
PERFORM bdc_field TABLES it_bdcdata USING fname
wa_document_line_item_amnt-amt_doccur.
change it to:
WRITE wa_document_line_item_amnt-amt_doccur TO AMOUNT.
PERFORM bdc_field TABLES it_bdcdata USING fname AMOUNT.
-Kriss -
Program does BDC for transaction F-52 or f-53
Hi GuruI am functional person and working with a developer in a program . The program does BDC for transaction F-52 or f-53 . I am uploading a file ,so that the program picks it and o either F-52 or F-53 based on condition. When i try to upload the program with mulitple record ,i am getting the message difference is too large to clear . If i execute the same program without doing any changes again i can see few more records getting posted . when i do next time remaining records are posted . Insted of getting posted in one ,I have to execute the program more than once .can any one help me out why this is happening
i think you should ask your programmer to use transaction SM35 to process the BDC in foreground mode (first changing the mode to A). I would think you will see what's going wrong then. There are a few transactions that look different in foreground mode than in background and you will see where the difference is if you use this method to process
-
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 -
BDC for J1IEX is not working in production
HI,
i captured bdc for transaction J1IEX. its working in development client but not in production client.
it shows error message input fields not found. how could i resolve it.
<<text removed>>
Edited by: Matt on Jun 7, 2009 4:41 PM - "answer me quickly" text removed.In future, please do not post the subject in all capitals
I've edited it for you this time. Please take the time to read the Rules of Engagement.
matt -
Dear Experts ,
I am doing a BDC for MB1B...
In my selection screen I am having,
Plant, Vendor No, text and and options to enter 5 different materials and its corresponding qauntity.
When the user enter the above details and execute , these details should trigger in MB1B
( using BDC background ).
My problem is i the final stage where the document needs to get saved, as in my case
its getting saved and also if the user enters only 1 material the loop should happen only once, but here
its getting looped with balnk values.
I have pasted my code below, please have look and advice me.
REFRESH: BDCDATA, MESSTAB.
PERFORM DYNPRO USING:
'X' 'SAPMM07M' '0400',
' ' 'RM07M-BWARTWA' '941',
' ' 'RM07M-WERKS' itab-WERKS,
' ' 'RM07M-LGORT' itab-LGORT,
' ' 'MKPF-BKTXT' itab-BKTXT,
' ' 'BDC_OKCODE' '/00',
'X' 'SAPMM07M' '0421',
' ' 'MSEGK-UMWRK' itab-WERKS,
' ' 'MSEGK-LIFNR' itab-VEND,
' ' 'BDC_OKCODE' 'NLE',
'X' 'SAPLKACB' '0002',
' ' 'BDC_OKCODE' '/00'.
LOOP AT ITAB1.
QAN = ITAB1-ERFMG.
QTY = QAN+6(6).
CNT = CNT + 1.
CN = CNT.
CONCATENATE 'MSEG-MATNR(' CN ')' INTO FN1.
CONCATENATE 'MSEG-ERFMG(' CN ')' INTO FN2.
PERFORM DYNPRO USING:
'X' 'SAPMM07M' '0421',
' ' FN1 ITAB1-MATNR,
' ' FN2 QTY,
' ' 'BDC_OKCODE' '/00',
'X' 'SAPLKACB' '0002',
' ' 'BDC_OKCODE' '=ENTE'.
ENDLOOP.
CALL TRANSACTION 'MB1B' USING BDCDATA MODE 'A'Hi Naga,
Thanks a lot for ur valuable advice !!
Now my document is getting posted , while using:
*CALL TRANSACTION 'MB1B' USING BDCDATA MODE 'A' *
but when I am using
*CALL TRANSACTION 'MB1B' USING BDCDATA MODE 'N' *
I am getting 'S' message No batch input data for screen SAPLKACB 0002.
I am pasting my code please have a look and advice me.
REFRESH: BDCDATA, MESSTAB.
PERFORM DYNPRO USING:
'X' 'SAPMM07M' '0400',
' ' 'RM07M-BWARTWA' '941',
' ' 'RM07M-WERKS' S_WERKS,
' ' 'RM07M-LGORT' S_LGORT,
' ' 'MKPF-BKTXT' S_BKTXT,
' ' 'BDC_OKCODE' '/00',
'X' 'SAPMM07M' '0421',
' ' 'MSEGK-UMWRK' S_WERKS,
' ' 'MSEGK-LIFNR' S_VEND,
' ' 'BDC_OKCODE' 'NLE',
'X' 'SAPLKACB' '0002',
' ' 'BDC_OKCODE' '/00'.
LOOP AT ITAB.
DELETE ITAB WHERE MATNR IS INITIAL.
QAN = ITAB-ERFMG.
QTY = QAN+6(6).
CNT = CNT + 1.
CN = CNT.
CONCATENATE 'MSEG-MATNR(' CN ')' INTO FN1.
CONCATENATE 'MSEG-ERFMG(' CN ')' INTO FN2.
PERFORM DYNPRO USING:
'X' 'SAPMM07M' '0421',
' ' FN1 ITAB-MATNR,
' ' FN2 QTY,
' ' 'BDC_OKCODE' '/00'.
ENDLOOP.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BU'.
PERFORM BDC_FIELD USING 'DKACB-FMORE'
'X'.
PERFORM DYNPRO USING 'X' 'SAPLKACB' '0002'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTE'.
CALL TRANSACTION 'MB1B' USING BDCDATA MODE 'N'
MESSAGES INTO MESSTAB.
Rgds
Karthik -
Creating bdc for transaction f-02 ?
Hi People,
I am going a bdc for transaction f-02 ..... my template involves 7 posting keys ( 40 50 31 01 29 09 70 ) ... depending up
on the posting key the next screen will change .......... can you people tel me how to do this and what are all the logic
involved in this program ?
thanks u all in advance.
SivaHi,
Please use the following format for your upload file template
DocDate1 ComCd1 Currency1 pstky1
DocDate1 ComCd1 Currency1 pstky2
DocDate1 ComCd1 Currency1 pstky3
DocDate2 ComCd2 Currency2 pstky1
DocDate2 ComCd2 Currency2 pstky2
Then use the following logic.
At New Currency1
add the header data
DocDate1 ComCd1 Currency1
Thus this code will run only once for every new Header
and remain in the screen till posting key are entered.
Regards,
Lokesh
Edited by: Lokesh Tibbani on Sep 5, 2008 12:17 PM -
Hi Experts,
h3 We need a BDC for MMRV program.
1) The requirement is that we should be able to run this as a batch job with a Z transaction & the selection screen parameters should be a range of Company codes (MARV-BUKRS).
2) The batch job should remove the flag ;Allow posting to previous period;(MARV-XRUEM) for this range of company codes entered in the selection screen.
3) Currently we can enter only one company code in the standard MMRV transaction
4) But we want to be able to enter a range of company codes.
Can any one please suggest me whether it is possible or not. if possible how we can give ranges for company code in BDC.
Thanks in advance,
DhanuHi,
Yes it is perfectly pssible. First make it work for one company code. Then repeat the same process for the next company code captured in selection screen say s_bukrs. Repeat this process till you are thr'u with all company codes from s_bukrs.
I hope this helps,
Regards
Raju Chitale
Maybe you are looking for
-
How to create suitable aggregates for queries on multiprovider ?
hi all, goal reduce db time of query and improve performance i have queries on a multicube. I have 5 cubes under the multiprovider. I having performance issue with one of the cubes. it had high slection/transfer ratio. The same cube had high 94% DB
-
IPod is not read by itunes/computer
I own a 5gb 1st gen Ipod which is no longer connecting to the computer. It isnt read as a drive, and Itunes 5.0 isn't recognizing (it wasnt recognized by the prevous version either). I've tried menu/play holding to reset, that doesnt effect anything,
-
Have Premiere Pro CC, Need Encore, Can't Get to Premiere Pro CS6
I had CS6 subscription, upgraded to CC a while back. Until about a year ago, I hadn't downloaded Premiere Pro because I don't usually do that kind of video editing. Now I have a video project for my family (a lot of them elderly) that I finally compl
-
Nikon D1x - raw file size and sharpening in Aperture
Good day all: I have looked for several hours but can't find the answer to two questions: 1) How to set Aperture to use the full file size for the D1x, approx. 10.7 MB, vs the smaller Raw file size of 7.7 MB. The Nikon software all allows this functi
-
How do i get rid of a black window with text that types what I'm writing and beeps
how do i get rid of a black box that types what I'm doing?