BDC Programme
I am trying to create a BDC program to load data to the technical vault using transaction cv02n. It fails with the message "Select an original application file first".
This is because the BDC prog does not select a file from the "Originals" table at the bottom of the screen, and I cannot get it to select any of the items listed in this table.
The actual recording shows a field name of 'BDC_SUBSCR' with a value of 'SAPLCV110 0102SCR_MAIN''. When I convert this to a program, this step is ignored.
Can anyone suggest how I might overcome this?
hi
good
have you done the recording properly for vb02n,if you have done it properly than check with the recording data,
there must be one cursor missing somewhere that is the reason you r getting BDC_SUBSCR with a value of SAPLCV110 0102SCR_MAIN error.
do a demo recording and check each and every field with the recording that you have used in your BDC report.
thanks
mrutyun^
Similar Messages
-
How to write bdc programme to load the data in table control
Hi
i have to write a bdc programme and the data to be filled in table control fileds can any one help me with the code how i have to write it is for cs02 tcode
thanks and regards
naveenHi Naveen,
See the sample code
PERFORM bdc_dynpro USING 'SAPLCSDI' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29N-DATUV'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=KALL'.
PERFORM bdc_field USING 'RC29N-MATNR'
w_matnr.
PERFORM bdc_field USING 'RC29N-WERKS'
w_werks.
PERFORM bdc_field USING 'RC29N-STLAN'
'1'.
PERFORM bdc_field USING 'RC29N-DATUV'
'01/01/2004'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '2110'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCPU'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29K-BMENG'.
PERFORM bdc_field USING 'RC29K-BMENG'
w_testuph.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0150'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-MENGE(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCBU'.
PERFORM bdc_field USING 'RC29P-MENGE(01)'
w_testuph.
"For raw material.
IF NOT w_raw_mat_fg IS INITIAL.
PERFORM bdc_field USING 'RC29P-MENGE(02)'
w_testuph.
ENDIF.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSNR'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0131'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POTX1'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSNR'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0131'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POTX1'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0150'.
CALL TRANSACTION 'CS02' USING bdcdata MODE w_display_mode UPDATE 'S'
MESSAGES INTO t_message_tab.
Prabhudas -
hello,
there is two fields for VORNA,NACHN i.e. firstname and last name i want to upload the data for this two fields through BDC, kindly let me know how to do the same through BDC.
i am the beginner, this two fields i am using for testing prupose, please let me know the same in step by step with screen short then i can easily pickup.
please do the needful at your earliest please.
somebody already send me the sample programme of bdc i could not understanding the same, therefore please explain me in details please.
please rreply me soon and oblige.
thanks
sujathaHi,
First of all, i don't think that we can post screen shots in SDN!! you should send over your mail address for that purpose.
For BDC, do a transaction recording through transaction SHDB to simulate whatever processing you want to do in BDC. You will get table with values similar to the program below. please adapt according to your requirements
Try this sample code for BDC for transaction VB03,
*Work Areas for call transactions
data :wa_bdcdata type bdcdata ,
i_bdcdata like standard table of bdcdata .
clear :wa_bdcdata.
refresh:i_bdcdata.
move: 'SAPMV13A' to wa_bdcdata-program,
'0401' to wa_bdcdata-dynpro,
'X' to wa_bdcdata-dynbegin.
append wa_bdcdata to i_bdcdata.
clear wa_bdcdata.
move: 'BDC_CURSOR' to wa_bdcdata-fnam,
'RV13A-KNUMA_BO' to wa_bdcdata-fval.
append wa_bdcdata to i_bdcdata.
clear wa_bdcdata.
move: 'BDC_OKCODE' to wa_bdcdata-fnam,
'/00' to wa_bdcdata-fval.
append wa_bdcdata to i_bdcdata.
clear wa_bdcdata.
move: 'RV13A-KNUMA_BO' to wa_bdcdata-fnam,
'126' to wa_bdcdata-fval.
append wa_bdcdata to i_bdcdata.
clear wa_bdcdata.
move: 'SAPMV13A' to wa_bdcdata-program,
'0410' to wa_bdcdata-dynpro,
'X' to wa_bdcdata-dynbegin.
append wa_bdcdata to i_bdcdata.
clear wa_bdcdata.
move: 'BDC_CURSOR' to wa_bdcdata-fnam,
'KONA-BONEM' to wa_bdcdata-fval.
append wa_bdcdata to i_bdcdata.
clear wa_bdcdata.
move: 'BDC_OKCODE' to wa_bdcdata-fnam,
'=BUMS' to wa_bdcdata-fval.
append wa_bdcdata to i_bdcdata.
clear wa_bdcdata.
move: 'SAPMSSY0' to wa_bdcdata-program,
'0120' to wa_bdcdata-dynpro,
'X' to wa_bdcdata-dynbegin.
append wa_bdcdata to i_bdcdata.
call transaction 'VBO3' "Crt Outb.Del. w\Order Ref.
using i_bdcdata "structure BDCDATA
mode 'E'.
if sy-subrc = 0.
endif.
Thanks and Regards,
Sooness -
How to handle screen resolution in ME21 fro a bdc programme
I need to use BDC program for ME21 for that how to handle the screen resolution,
i know CTU_PARAMS structure is there ,but how to use them, please send the model code.
Thanks & Regards
krishnagot the solution
-
hi gurus,
i have a problem in bdc programm there is 3 screen using transaction f-27
there is two amount field as(wrbtr,wrbtr2)
two screen are run fine but the 3 screen does't take data automatically from flat file plz help me its urgent see my codes and give me solution.
TYPES: BEGIN OF it_output,
bldat(10) TYPE C, "Document Date
blart TYPE bkpf-blart, "Document Type
bukrs TYPE bkpf-bukrs, "Company Code
budat(10) TYPE C, "Posting Date
monat TYPE bkpf-monat, "Period
waers TYPE bkpf-waers, "Currency
xblnr TYPE bkpf-xblnr, "Reference Field
docid TYPE fs006-docid, "Document ID
newbs TYPE rf05a-newbs, "Posting Key
newko TYPE rf05a-newko, "Account Code
wrbtr(16) TYPE C, "Amount in Document currency
zfbdt(10) TYPE C, "Baseline Date
newbs2 TYPE rf05a-newbs, "Account Key2
newko2 TYPE rf05a-newko, "Account code2
wrbtr2(16) TYPE C, "Amount2
END OF it_output.
DATA lt_output TYPE it_output OCCURS 0 WITH HEADER LINE.
DATA it_bdc LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA it_messtab LIKE bdcmsgcoll OCCURS 1 WITH HEADER LINE.
D A T A *
DATA: message TYPE string.
DATA: p_file1 type string.
S E L E C T - O P T I O N S / P A R A M E T E R S *
SELECTION-SCREEN BEGIN OF BLOCK block0 WITH FRAME.
PARAMETERS : p_file LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK block0.
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.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
mask = space
CHANGING
file_name = p_file.
S T A R T - O F - S E L E C T I O N
START-OF-SELECTION.
PERFORM upload.
PERFORM bdc.
PERFORM write_message.
*& Form bdc
text
FORM bdc.
LOOP AT lt_output.
READ TABLE lt_output INDEX 1.
PERFORM bdc_dynpro USING 'SAPMF05A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RF05A-NEWKO'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'BKPF-BLDAT' lt_output-bldat.
PERFORM bdc_field USING 'BKPF-BLART' lt_output-blart.
PERFORM bdc_field USING 'BKPF-BUKRS' lt_output-bukrs.
PERFORM bdc_field USING 'BKPF-BUDAT' lt_output-budat.
PERFORM bdc_field USING 'BKPF-MONAT' lt_output-monat.
PERFORM bdc_field USING 'BKPF-WAERS' lt_output-waers.
PERFORM bdc_field USING 'BKPF-XBLNR' lt_output-xblnr.
PERFORM bdc_field USING 'FS006-DOCID' lt_output-docid.
PERFORM bdc_field USING 'RF05A-NEWBS' lt_output-newbs.
PERFORM bdc_field USING 'RF05A-NEWKO' lt_output-newko.
PERFORM bdc_dynpro USING 'SAPMF05A' '0302'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RF05A-NEWKO'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'BSEG-WRBTR' lt_output-wrbtr.
PERFORM bdc_field USING 'BSEG-ZFBDT' lt_output-zfbdt.
PERFORM bdc_field USING 'RF05A-NEWBS' lt_output-newbs2."newbs2
PERFORM bdc_field USING 'RF05A-NEWKO' lt_output-newko2."newko2
PERFORM bdc_dynpro USING 'SAPMF05A' '0301'.
PERFORM bdc_field USING 'BDC_CURSOR' 'BSEG-WRBTR'.
PERFORM bdc_field USING 'BDC_OKCODE' '=BU'.
PERFORM bdc_field USING 'BSEG-WRBTR' lt_output-wrbtr2."wrbtr2
PERFORM bdc_field USING 'BSEG-MWSKZ' '**'.
PERFORM bdc_field USING 'BSEG-ZTERM' 'C007'.
PERFORM bdc_field USING 'BSEG-ZBD1T' '7'.
CALL TRANSACTION 'F-27' USING it_bdc mode 'A'
MESSAGES INTO it_messtab.
CLEAR it_bdc. REFRESH it_bdc.
ENDLOOP.
ENDFORM. "bdc
*& Form write_message
text
FORM write_message.
LOOP AT it_messtab .
CLEAR message.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = sy-msgid
lang = 'EN'
no = sy-msgno
v1 = sy-msgv1
v2 = sy-msgv2
v3 = sy-msgv3
v4 = sy-msgv4
IMPORTING
msg = message.
CASE it_messtab-msgtyp.
WHEN 'S'.
WRITE:/ message.
CLEAR message.
WHEN 'E'.
FORMAT COLOR 6 ON.
WRITE:/ message.
CLEAR message.
ENDCASE.
ENDLOOP.
ENDFORM. "write_message
FORM BDC_DYNPRO *
--> PROGRAM *
--> DYNPRO *
FORM bdc_dynpro USING program dynpro.
it_bdc-program = program.
it_bdc-dynpro = dynpro.
it_bdc-dynbegin = 'X'.
APPEND it_bdc.
CLEAR it_bdc.
ENDFORM. "BDC_DYNPRO
FORM *
FORM bdc_field USING fnam fval.
it_bdc-fnam = fnam.
it_bdc-fval = fval.
APPEND it_bdc.
CLEAR it_bdc.
ENDFORM. "BDC_FIELD
*& Form upload
text
--> p1 text
<-- p2 text
FORM upload .
p_file1 = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_file1
FILETYPE = 'DAT'
tables
data_tab = lt_output
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " upload
i am also send u my flat file the client says that in amount filed of 3rd screen we will give the * asterick or other amount plz take it.
thank
plz help me.
jay
Edited by: jayant kumar on Apr 30, 2008 12:42 PMhi jayant,
Declare '**' as a character constant and pass this constant to the Subroutine.
data : c_astrick type char2 value '**'.
PERFORM bdc_field USING 'BSEG-MWSKZ c_astrick.
Reward points if it is helpful.
Regards,
srilatha. -
BDC OK CODE FOR ENTER NOT RECORDING
I m creating a BDC Programme for uploading OLD PO date from excel to SAP System.
All PO's are Service PO.
PO's date and Delivery Date is in back date.
My programme working fine.
But i have to press enter manually due to PO Date = back date and Delivery date is also back date.
SHDB unable to record this event.
How to record this event.
Is there any way to disable system messages during BDC Programme.
When I press enter two times my programme runs very well.
Kindly help me.
Its very much urgent.
Code is give below.
REPORT zbdcme21n
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA : l_file TYPE rlgrap-filename.
DATA: e_group_opened.
PARAMETERS session RADIOBUTTON GROUP ctu. "create session
*DATA : session RADIOBUTTON GROUP ctu.
DATA : group(12). "group name of session
group = 'BDC'.
*PARAMETERS: user(12) DEFAULT sy-uname. "user for session in batch
DATA : user(12).
user = sy-uname.
*DATA : keep AS CHECKBOX. "' ' = delete session if finished
DATA : keep TYPE checkbox.
keep = 'X'.
*PARAMETERS: holddate LIKE sy-datum. "'X' = keep session if finished
DATA : holddate LIKE sy-datum.
holddate = sy-datum.
PARAMETERS ctu RADIOBUTTON GROUP ctu. "call transaction
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF i_tab OCCURS 0, "excel data stored in this file.
row TYPE alsmex_tabline-row,
col TYPE alsmex_tabline-col,
value TYPE alsmex_tabline-value,
END OF i_tab.
DATA : BEGIN OF wa_line1 OCCURS 0, "excel data stored in this file.
row TYPE alsmex_tabline-row,
col TYPE alsmex_tabline-col,
value TYPE alsmex_tabline-value,
srno TYPE i,
END OF wa_line1.
DATA : wa_line2 LIKE wa_line1 OCCURS 0 WITH HEADER LINE .
DATA : wa_hdr1 LIKE wa_line1 OCCURS 0 WITH HEADER LINE .
DATA : wa_hdr LIKE i_tab OCCURS 0 WITH HEADER LINE .
DATA : wa_line LIKE i_tab OCCURS 0 WITH HEADER LINE .
DATA : w_cnt TYPE i . "store total no of pos
DATA : w_hdr_counter VALUE 1. "for header line count
DATA : w_line_counter VALUE 1. "for Line Item Counter.
w_cnt = 0.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
PARAMETER: dataset TYPE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR dataset.
PERFORM upload_file.
*include bdcrecx1.
START-OF-SELECTION.
PERFORM process_itab.
*include bdcrecx1.
START-OF-SELECTION.
PERFORM open_group.
**********************start for header
w_hdr_counter = 1.
WHILE w_hdr_counter <= w_cnt.
PERFORM bdc_dynpro USING 'SAPMM06E' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06E-BEDAT'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
READ TABLE wa_hdr1 WITH KEY col = 2 srno = w_hdr_counter.
PERFORM bdc_field USING 'EKKO-LIFNR'
wa_hdr1-value. "'800000'.
READ TABLE wa_hdr1 WITH KEY col = 3 srno = w_hdr_counter.
PERFORM bdc_field USING 'RM06E-BSART'
wa_hdr1-value. "'ZS'.
READ TABLE wa_hdr1 WITH KEY col = 4 srno = w_hdr_counter.
PERFORM bdc_field USING 'RM06E-BEDAT'
wa_hdr1-value. " '14.01.2008'.
PERFORM bdc_field USING 'RM06E-LPEIN'
'T'.
READ TABLE wa_hdr1 WITH KEY col = 13 srno = w_hdr_counter.
PERFORM bdc_field USING 'RM06E-EEIND'
wa_hdr1-value. "'14.01.2008'. "Delivery Date
PERFORM bdc_field USING 'RM06E-LPEIN'
'T'.
READ TABLE wa_hdr1 WITH KEY col = 6 srno = w_hdr_counter.
PERFORM bdc_field USING 'EKKO-EKORG'
wa_hdr1-value. "'serv'.
READ TABLE wa_hdr1 WITH KEY col = 7 srno = w_hdr_counter.
PERFORM bdc_field USING 'EKKO-EKGRP'
wa_hdr1-value. "'dce'. Purchase Group
READ TABLE wa_hdr1 WITH KEY col = 8 srno = w_hdr_counter.
PERFORM bdc_field USING 'RM06E-EPSTP'
wa_hdr1-value. "'d'. Item Category
READ TABLE wa_hdr1 WITH KEY col = 9 srno = w_hdr_counter.
PERFORM bdc_field USING 'RM06E-KNTTP'
wa_hdr1-value. "'p'. Account Asign Category
READ TABLE wa_hdr1 WITH KEY col = 10 srno = w_hdr_counter.
PERFORM bdc_field USING 'RM06E-WERKS'
wa_hdr1-value. "'1001'.Plant
READ TABLE wa_hdr1 WITH KEY col = 11 srno = w_hdr_counter.
PERFORM bdc_field USING 'RM06E-LGORT'
wa_hdr1-value. " '1101'. Store Location
READ TABLE wa_hdr1 WITH KEY col = 12 srno = w_hdr_counter.
PERFORM bdc_field USING 'RM06E-MATKL'
wa_hdr1-value. "'c003'. Material Group
PERFORM bdc_dynpro USING 'SAPLMLSP' '0200'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
********************end of Header Data*******************
data i type n value 1.
data bfield type string.
LOOP AT wa_line1 WHERE col = 1 AND srno = wa_hdr1-srno.
READ TABLE wa_line2 WITH KEY COL = 14 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
PERFORM bdc_field USING 'RM11P-HEADTEXT'
wa_line2-value. " 'Earthwork text'.
concatenate 'ESLL-SRVPOS(' i ')' into bfield.
PERFORM bdc_field USING 'BDC_CURSOR'
bfield. " 'ESLL-SRVPOS(01)'. "increase counter
PERFORM bdc_field USING 'RM11P-NEW_ROW'
'10'.
READ TABLE wa_line2 WITH KEY COL = 15 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
PERFORM bdc_field USING bfield "'ESLL-SRVPOS(01)'
wa_line2-value. "'5000000000'.
concatenate 'ESLL-MENGE(' i ')' into bfield.
READ TABLE wa_line2 WITH KEY COL = 16 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
PERFORM bdc_field USING bfield "'ESLL-MENGE(01)' "qty
wa_line2-value. "'15'.
concatenate 'ESLL-MEINS(' i ')' into bfield.
READ TABLE wa_line2 WITH KEY COL = 17 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
PERFORM bdc_field USING bfield "'ESLL-MEINS(01)'
wa_line2-value. "'ft3'.
concatenate 'ESLL-TBTWR(' i ')' into bfield.
READ TABLE wa_line2 WITH KEY COL = 18 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
PERFORM bdc_field USING bfield " 'ESLL-TBTWR(01)'
wa_line2-value. "'150'.
PERFORM bdc_field USING 'BDC_OKCODE' "Manually added
'/00'.
PERFORM bdc_dynpro USING 'SAPLMLSK' '0200'.
concatenate 'ESKN-PS_PSP_PNR' i ')' into bfield.
PERFORM bdc_field USING 'BDC_CURSOR'
'ESKN-PS_PSP_PNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'VRTKZ1'
'X'.
concatenate 'ESKN-SAKTO(' i ')' into bfield.
READ TABLE wa_line2 WITH KEY COL = 19 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
PERFORM bdc_field USING 'ESKN-SAKTO(01)' "GL Account No.
wa_line2-value. " '6010010'.
concatenate 'ESKN-PS_PSP_PNR(' i ')' into bfield.
READ TABLE wa_line2 WITH KEY COL = 20 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
PERFORM bdc_field USING 'ESKN-PS_PSP_PNR(01)'
wa_line2-value. " 'HR/KMP-KU'. "WBS Element
PERFORM bdc_dynpro USING 'SAPLMLSK' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR'
'ESLL-INTROW'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BACK'.
PERFORM bdc_field USING 'VRTKZ1'
'X'.
PERFORM bdc_dynpro USING 'SAPLMLSP' '0200'.
i = i + 1.
ENDLOOP.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BACK'.
PERFORM bdc_field USING 'VRTKZ1'
'X'.
PERFORM bdc_dynpro USING 'SAPLMLSP' '0200'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'RM11P-HEADTEXT'
'Earthwork text'.
*perform bdc_field using 'BDC_CURSOR' "Start Service Line 2
'ESLL-SRVPOS(02)'.
*perform bdc_field using 'RM11P-NEW_ROW'
'10'.
*perform bdc_field using 'ESLL-SRVPOS(02)'
'5000000006'.
*perform bdc_field using 'ESLL-MENGE(02)'
'10'.
*perform bdc_field using 'ESLL-MEINS(02)'
'kmk'.
*perform bdc_field using 'ESLL-TBTWR(02)'
'500'.
*perform bdc_dynpro using 'SAPLMLSK' '0200'.
*perform bdc_field using 'BDC_CURSOR'
'ESLL-INTROW'.
*perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'VRTKZ1'
'X'.
*perform bdc_dynpro using 'SAPLMLSK' '0200'.
*perform bdc_field using 'BDC_CURSOR'
'ESKN-PS_PSP_PNR(01)'.
*perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'VRTKZ1'
'X'.
*perform bdc_field using 'ESKN-SAKTO(01)'
'6010010'.
*perform bdc_field using 'ESKN-PS_PSP_PNR(01)'
'HR/KMP-KU'.
*perform bdc_dynpro using 'SAPLMLSK' '0200'.
*perform bdc_field using 'BDC_CURSOR'
'ESLL-INTROW'.
*perform bdc_field using 'BDC_OKCODE'
'=BACK'.
*perform bdc_field using 'VRTKZ1'
'X'.
*perform bdc_dynpro using 'SAPLMLSP' '0200'.
*perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'RM11P-HEADTEXT'
'Earthwork text'.
*perform bdc_field using 'BDC_CURSOR'
'ESLL-KTEXT1(01)'.
*perform bdc_field using 'RM11P-NEW_ROW'
'10'.
*perform bdc_dynpro using 'SAPLMLSP' '0200'.
*perform bdc_field using 'BDC_OKCODE'
'=ESB'.
*perform bdc_field using 'RM11P-HEADTEXT'
'Earthwork text'.
*perform bdc_field using 'BDC_CURSOR'
'ESLL-KTEXT1(01)'.
*perform bdc_field using 'RM11P-NEW_ROW'
'10'.
*perform bdc_dynpro using 'SAPMM06E' '0120'.
*perform bdc_field using 'BDC_CURSOR'
'RM06E-EBELP'.
*perform bdc_field using 'BDC_OKCODE'
'=MALL'.
*perform bdc_field using 'RM06E-EBELP'
'10'.
PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06E-EBELP'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=KOPF'.
PERFORM bdc_field USING 'RM06E-EBELP'
'10'.
PERFORM bdc_dynpro USING 'SAPMM06E' '0101'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EKKO-EKGRP'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TXK'.
*perform bdc_field using 'EKKO-EKGRP'
'DCE'.
*perform bdc_field using 'EKKO-PINCR'
'10'.
*perform bdc_field using 'EKKO-UPINC'
'1'.
*perform bdc_field using 'EKKO-WAERS'
'INR'.
*perform bdc_field using 'EKKO-WKURS'
' 1.00000'.
PERFORM bdc_dynpro USING 'SAPMM06E' '0103'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06E-LTEX1(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_field USING 'RM06E-LTEX1(01)'
'Old PO no.'.
*perform bdc_transaction using 'ME21'.
w_hdr_counter = w_hdr_counter + 1.
ENDWHILE.
CALL TRANSACTION 'ME21' USING bdcdata MODE 'A'.
PERFORM close_group.
***************forms************
FORM upload_file.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
*def_filename = ' '
*def_path = ' '
*mask = ' '
mode = '0'
title = 'Choose the Appropriate excel sheet for service PO upload'
IMPORTING
filename = dataset
*EXCEPTIONS
*inv_winsys = 01
*no_batch = 02
*selection_cancel = 03
*selection_error = 04
l_file = dataset.
PERFORM read_exceldata.
ENDFORM. "UPLOAD_FILE
*& Form READ_EXCELDATA
text
FORM read_exceldata.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = l_file
i_begin_col = 1
i_begin_row = 2
i_end_col = 25
i_end_row = 4
TABLES
intern = i_tab
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
ENDFORM. "READ_EXCELDATA
create batchinput session *
(not for call transaction using...) *
FORM open_group.
IF session = 'X'.
SKIP.
WRITE: /(20) 'Create group'(i01), group.
SKIP.
open batchinput group
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = group
user = user
keep = keep
holddate = holddate.
WRITE: /(30) 'BDC_OPEN_GROUP'(i02),
(12) 'returncode:'(i05),
sy-subrc.
ENDIF.
ENDFORM. "OPEN_GROUP
end batchinput session *
(call transaction using...: error session) *
FORM close_group.
IF session = 'X'.
close batchinput group
CALL FUNCTION 'BDC_CLOSE_GROUP'.
WRITE: /(30) 'BDC_CLOSE_GROUP'(i04),
(12) 'returncode:'(i05),
sy-subrc.
ELSE.
IF e_group_opened = 'X'.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
WRITE: /.
WRITE: /(30) 'Fehlermappe wurde erzeugt'(i06).
e_group_opened = ' '.
ENDIF.
ENDIF.
ENDFORM. "CLOSE_GROUP
*& Form BDC_DYNPRO
text
-->PROGRAM text
-->DYNPRO text
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
****bdc field************
FORM bdc_field USING fnam fval.
IF FVAL <> NODATA.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDIF.
ENDFORM. "BDC_FIELD
FORM process_itab.
APPEND LINES OF i_tab TO wa_hdr .
DELETE wa_hdr WHERE col > 13 .
APPEND LINES OF i_tab TO wa_line .
DELETE wa_line WHERE col <> 1 AND col < 14 .
DATA : w_sr TYPE i.
w_sr = 0.
LOOP AT wa_hdr.
IF wa_hdr-col = 1.
w_sr = wa_hdr-value.
ENDIF.
wa_hdr1-row = wa_hdr-row.
wa_hdr1-col = wa_hdr-col.
wa_hdr1-value = wa_hdr-value.
wa_hdr1-srno = w_sr.
APPEND wa_hdr1.
w_cnt = wa_hdr-row.
ENDLOOP.
w_sr = 0.
LOOP AT wa_line.
IF wa_line-col = 1.
w_sr = wa_line-value.
ENDIF.
wa_line1-row = wa_line-row.
wa_line1-col = wa_line-col.
wa_line1-value = wa_line-value.
wa_line1-srno = w_sr.
APPEND wa_line1.
ENDLOOP.
w_sr = 0.
CLEAR wa_line2.
LOOP AT wa_line1.
wa_line2-row = wa_line1-row.
wa_line2-col = wa_line1-col.
wa_line2-value = wa_line1-value.
wa_line2-srno = wa_line1-srno.
APPEND wa_line2.
ENDLOOP.
ENDFORM. "PROCESS_ITAB
***************forms************Hi Pradeep
I find there is a problem in your code
When ever you use
PERFORM bdc_field USING 'BDC_OKCODE'
you should follow it up with
PERFORM bdc_dynpro USING <prg name> <screen number>
Please find code below with changes from a part of your code
PERFORM bdc_field USING 'RM06E-MATKL'
wa_hdr1-value. "'c003'. Material Group
* comment this statement is not needed now.
* PERFORM bdc_dynpro USING 'SAPLMLSP' '0200'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
READ TABLE wa_line2 WITH KEY COL = 14 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
* Put the bdc_dynpro for the prg name and screen number (I might be wrong with prg name and
* Screen number
PERFORM bdc_dynpro USING 'SAPLMLSK' '0200'.
Reward points as this will definitely help you
Edited by: Sriram Chandran on Mar 15, 2008 4:39 PM -
Can any one explain me the relation between BDC and reports events?
hi experts.....
can any one explain me the relation between BDC and reports events? we are using report events in BDC programmes why?\
Is reports events occurs in each and every concept in ABAP i.e creating custom idocs, smart forms, sap scripts, dialog programmes, module pool technics?
thanks in advanceThe forums are expert forums. So the first thing I would do is change your name.
It's like entering a grand prix in a car with a "Student Driver" sign.
Rob -
HI All,
I am getting 'Formatting error in KETDAT(Required Delivery Date)' field while creating salesorder for given recording in BDC programm.i am giving data through a RFC which is having structures same as BAPI_SALESORDER_CREATEFROMDAT2 .
(i am getting error for the field ORDER_SCHEDULE_IN-REQ_DATE......Formating Error)
please give me a solution for this very urgentYour date must be in format YYYYMMDD (SAP internal format) for the field REQ_DATE.
If you are getting date as 04/30/2008 than convert it into 20080430.
You can use like:
L_DATE+0(4) = L_IN_DATE+6(4).
L_DATE+4(2) = L_IN_DATE+3(2).
L_dATE+6(2) = L_IN_DATE+0(2).
Regards,
Naimesh Patel -
How can we write BDC program to upload data in to line items(VA01) ?
Error in processing BDC table control program...
How can i populate data through bdc program dynamically, when some of the lines are in disable mode....
for e.g ...
in va01 transaction code ....
1 to 5 lines are not in disable mode....
but 5 to 10 lines are in disable mode...
so hw u process those remaining disable lines at runtime and populate data in to the fields of line items...through bdc program..hi..friends.,
yea actually this question has been raised by interviewer ...
but just the same i replied as you did...
but he told that we can upload the data....towards in to disabled line items
at run time..with using change trasaction va02..with implementing bdc programm...
so i just want to know the steps of how to perform it..
Can anyone....my friends..
byeeee..... -
" Thread in Bdc in uploading the data "
My scenario is to upload the data from the t-code WG21 . I HAVE WRITTEN A BDC PROGRAMME , HALF OF THE DATA IS UPLOADED , REMAINING DATA IS NOT UPLOADED . I AM GETTING THE ERROR MESSAGE AS FUNCTION CODE IS REQUIRED .
I AM SENDING MY BDC CODE AS AN EXAMPLE . CAN ANYBODY HELP ME IN SOLVING THE ISSUE.
report ZMC
no standard page heading line-size 255.
*include bdcrecx1.
INTERNAL TABLE DECLARATION ******
DATA : BEGIN OF ITAB OCCURS 0 ,
MATKL(9) TYPE C,
WGBEZ(20) TYPE C,
CLASS1(18) TYPE C,
WGBEZ60(60) TYPE C,
STATU(1) TYPE C,
MERKMA(1) TYPE C,
RELEV(01) TYPE C,
EINTRAG LIKE RMCLM-EINTRAG,
CLASS2(18) TYPE C,
END OF ITAB.
DATA: ITAB1 LIKE ITAB OCCURS 0 WITH HEADER LINE.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
**AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
PERFORM GET_FILE.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: file TYPE rlgrap-filename OBLIGATORY,
mode TYPE ctu_params-dismode OBLIGATORY DEFAULT 'A'.
SELECTION-SCREEN : END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
PERFORM GET_FILE.
START-OF-SELECTION.
CALL FUNCTION 'UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'C:'
FILETYPE = 'DAT'
ITEM = ' '
FILEMASK_MASK = ' '
FILEMASK_TEXT = ' '
FILETYPE_NO_CHANGE = ' '
FILEMASK_ALL = ' '
FILETYPE_NO_SHOW = ' '
LINE_EXIT = ' '
USER_FORM = ' '
USER_PROG = ' '
SILENT = 'S'
IMPORTING
FILESIZE =
CANCEL =
ACT_FILENAME =
ACT_FILETYPE =
TABLES
DATA_TAB = ITAB
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
perform open_group.
LOOP AT ITAB.
perform bdc_dynpro using 'SAPMWWG2' '1000'.
perform bdc_field using 'BDC_CURSOR'
'T023D-MATKL'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'T023D-MATKL'
ITAB-MATKL. "'120101114'.
perform bdc_dynpro using 'SAPMWWG2' '1100'.
perform bdc_field using 'BDC_CURSOR'
'WWGD-CLASS1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'T023TD-WGBEZ'
ITAB-WGBEZ. "'non food category'.
perform bdc_field using 'T023TD-WGBEZ60'
ITAB-CLASS1. "'non food category'.
perform bdc_field using 'WWGD-CLASS1'
ITAB-WGBEZ60. "'nonfoods'.
perform bdc_dynpro using 'SAPMWWG2' '1100'.
perform bdc_field using 'BDC_CURSOR'
'T023TD-WGBEZ'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
CALL TRANSACTION 'WG21' USING bdcdata
MODE mode
UPDATE 'S'
MESSAGES INTO messtab.
CLEAR BDCDATA.
REFRESH BDCDATA.
PERFORM BDC_DYNPRO using 'SAPMWWG2' '1000'.
perform bdc_field using 'BDC_CURSOR'
'T023D-MATKL'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'T023D-MATKL'
ITAB-MATKL. "'120101114'.
PERform bdc_field using 'T023TD-WGBEZ'
ITAB-WGBEZ. "'non food category'.
perform bdc_field using 'T023TD-WGBEZ60'
ITAB-CLASS1. "'non food category'.
perform bdc_field using 'WWGD-CLASS1'
ITAB-WGBEZ60. "'NONFOODS'.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-STATU'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
CALL TRANSACTION 'WG21' USING bdcdata
MODE mode
UPDATE 'S'
MESSAGES INTO messtab.
CLEAR BDCDATA.
REFRESH BDCDATA.
perform bdc_field using 'RMCLM-STATU'
ITAB-STATU. "'1'.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-RELEV(01)'.
perform bdc_field using 'RMCLM-MERKMA(01)'
ITAB-MERKMA. "'flavor'.
perform bdc_field using 'RMCLM-RELEV(01)'
ITAB-RELEV(01). "'1'.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'/EENDE'.
perform bdc_dynpro using 'SAPLSPO1' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-EINTRAG'.
perform bdc_field using 'RMCLM-EINTRAG'
ITAB-EINTRAG. "'1'.
perform bdc_dynpro using 'SAPMWWG2' '4000'.
perform bdc_field using 'BDC_CURSOR'
'WWGD-CLASS2'.
perform bdc_field using 'BDC_OKCODE'
'=BANL'.
perform bdc_field using 'T023D-MATKL'
ITAB-MATKL. "'120101114'.
perform bdc_field using 'WWGD-CLASS2'
ITAB-CLASS2. "'CHARAC'.
CALL TRANSACTION 'WG21' USING bdcdata
MODE mode
UPDATE 'S'
MESSAGES INTO messtab.
ENDLOOP.
perform close_group.
*& Form get_file
text
FORM GET_FILE.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'file '
FIELD_NAME = 'file '
STATIC = ' '
MASK = ' '
FILEOPERATION = 'R'
CHANGING
FILE_NAME = file
FILE_NAME = file
LOCATION_FLAG = 'P'
EXCEPTIONS
MASK_TOO_LONG = 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.
ENDFORM. "GET_FILE
Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM bdc_field USING fnam fval.
IF FVAL <> NODATA.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDIF.
ENDFORM. "BDC_FIELDHi,
Please post the question in the appropriate forum to get faster response.
-Vikram -
hi,
plz provide me example for a bdc program that i call two transaction code in one bdc programm
the two *T-CODE are FBS1 & F.81 *
FROM ANY ONE BY CALL TRANSACTION OR BY SESSION METHOD.
JUST GIVE ME EXAMPLE
THANKS
jayantCreate two Saperate T-codes for same program...
Then after the recording when u do call transaction ...Insert the followin code....
Case sy-tcode.
when 'TCODE1'
CALL TRANSACTION 1....
When 'TCODE2'
CALL TRANSACTION 2....
Endcase.
Raghav -
BDC F-03 (page down loading problem)
Sir,
I'm trying BDC for tcode ( clear G/L account.). With following code ..but I'm getting error
on screen number 0731 while page down loading. Please help me ...
REPORT CLEAR_ITEM.
TABLES :BKPF,RF05A.
DATA : BEGIN OF RECORD OCCURS 0,
index(001),
AGKON(16),
BUDAT(10),
MONAT(2),
BUKRS(4),
WAERS(3),
END OF RECORD.
DATA : BEGIN OF RECORD1 OCCURS 0,
index(002),
SEL01 LIKE RF05A-SEL01,
END OF RECORD1.
data dat like sy-datum.
data ibdc like bdcdata occurs 0 with header line.
dat = sy-datum - 1.
CALL FUNCTION 'UPLOAD'
EXPORTING
* CODEPAGE = ' '
FILENAME = 'C:\'
FILETYPE = 'DAT'
* ITEM = ' '
* FILEMASK_MASK = ' '
* FILEMASK_TEXT = ' '
* FILETYPE_NO_CHANGE = ' '
* FILEMASK_ALL = ' '
* FILETYPE_NO_SHOW = ' '
* LINE_EXIT = ' '
* USER_FORM = ' '
* USER_PROG = ' '
* SILENT = 'S'
* IMPORTING
* FILESIZE =
* CANCEL =
* ACT_FILENAME =
* ACT_FILETYPE =
TABLES
DATA_TAB = RECORD.
* EXCEPTIONS
* CONVERSION_ERROR = 1
* INVALID_TABLE_WIDTH = 2
* INVALID_TYPE = 3
* NO_BATCH = 4
* UNKNOWN_ERROR = 5
* GUI_REFUSE_FILETRANSFER = 6
* OTHERS = 7
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'UPLOAD'
EXPORTING
* CODEPAGE = ' '
FILENAME = 'C:\'
FILETYPE = 'DAT'
* ITEM = ' '
* FILEMASK_MASK = ' '
* FILEMASK_TEXT = ' '
* FILETYPE_NO_CHANGE = ' '
* FILEMASK_ALL = ' '
* FILETYPE_NO_SHOW = ' '
* LINE_EXIT = ' '
* USER_FORM = ' '
* USER_PROG = ' '
* SILENT = 'S'
* IMPORTING
* FILESIZE =
* CANCEL =
* ACT_FILENAME =
* ACT_FILETYPE =
TABLES
DATA_TAB = RECORD1.
* EXCEPTIONS
* CONVERSION_ERROR = 1
* INVALID_TABLE_WIDTH = 2
* INVALID_TYPE = 3
* NO_BATCH = 4
* UNKNOWN_ERROR = 5
* GUI_REFUSE_FILETRANSFER = 6
* OTHERS = 7
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*start-of-selection.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
* DEST = FILLER8
GROUP = 'F-03'
HOLDDATE = DAT
KEEP = 'X'
USER = SY-UNAME.
* RECORD = FILLER1
* PROG = SY-CPROG
* IMPORTING
* QID =
* EXCEPTIONS
* CLIENT_INVALID = 1
* DESTINATION_INVALID = 2
* GROUP_INVALID = 3
* GROUP_IS_LOCKED = 4
* HOLDDATE_INVALID = 5
* INTERNAL_ERROR = 6
* QUEUE_ERROR = 7
* RUNNING = 8
* SYSTEM_LOCK_ERROR = 9
* USER_INVALID = 10
* OTHERS = 11
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at record.
perform mapping.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'F-03'
* POST_LOCAL = NOVBLOCAL
* PRINTING = NOPRINT
* SIMUBATCH = ' '
* CTUPARAMS = ' '
TABLES
DYNPROTAB = IBDC.
* EXCEPTIONS
* INTERNAL_ERROR = 1
* NOT_OPEN = 2
* QUEUE_ERROR = 3
* TCODE_INVALID = 4
* PRINTING_INVALID = 5
* POSTING_INVALID = 6
* OTHERS = 7
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH IBDC.
ENDLOOP.
CALL FUNCTION 'BDC_CLOSE_GROUP'
* EXCEPTIONS
* NOT_OPEN = 1
* QUEUE_ERROR = 2
* OTHERS = 3
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
form mapping.
perform bdc_dynpro using 'SAPMF05A' '0131'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-XPOS1(03)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF05A-AGKON'
RECORD-AGKON.
perform bdc_field using 'BKPF-BUDAT'
RECORD-BUDAT.
perform bdc_field using 'BKPF-MONAT'
RECORD-MONAT.
perform bdc_field using 'BKPF-BUKRS'
RECORD-BUKRS.
perform bdc_field using 'BKPF-WAERS'
RECORD-WAERS.
perform bdc_field using 'RF05A-XPOS1(01)'
perform bdc_field using 'RF05A-XPOS1(03)'
'X'.
perform bdc_dynpro using 'SAPMF05A' '0731'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-SEL01(02)'.
perform bdc_field using 'BDC_OKCODE'
'=PA'.
data : A(20) type c,
IDX(2) TYPE C.
ADD 1 TO IDX.
LOOP AT RECORD1 WHERE INDEX = RECORD-index.
IF IDX > 10 .
perform bdc_dynpro using 'SAPMF05A' '0731'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-SEL01(02)'.
perform bdc_field using 'BDC_OKCODE'
'=P+'.
IDX = 1.
ENDIF.
CONCATENATE 'RF05A-SEL01(' IDX ')' INTO A.
ibdc-fnam = A .
IBDC-fval = RECORD1-SEL01.
append ibdc.
CLEAR IBDC.
CLEAR A.
IDX = IDX + 1.
ENDLOOP.
perform bdc_dynpro using 'SAPDF05X' '3100'.
perform bdc_field using 'BDC_OKCODE'
'=BS'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-ABPOS'.
perform bdc_field using 'RF05A-ABPOS'
'1'.
perform bdc_dynpro using 'SAPMF05A' '0700'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWBS'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
endform.
*& Form bdc_dynpro
* text
* -->P_0137 text
* -->P_0138 text
FORM bdc_dynpro using program type string screen type string.
ibdc-program = program.
ibdc-dynpro = screen.
ibdc-dynbegin = 'X'.
append ibdc.
clear ibdc.
ENDFORM. " bdc_dynpro
*& Form bdc_field
* text
* -->P_0142 text
* -->P_0143 text
FORM bdc_field USING fname type string fvale.
ibdc-fnam = fname.
ibdc-fval = fvale.
append ibdc.
clear ibdc.
ENDFORM. " bdc_field
Thanking you..
Manoj.Ramesh ,
I'll advise you, not to use a bdc-programm for ta's like fb50 - What woud you do, when SAP in future changes the table control to an alv grid control ??
So i advise you , to use Bapis or the standard interface
<b>RFBIBL00</b> to post fi-documents.
Andreas -
hi gurus,
i want a programm for update plant field in a table using bdc programm if i give a flat file like contains record as material no.
plant
mbrsh
when i used it then it update the tables plant field material no is same
it is used by call transaction
it means that extend the plant field from one plant of a company to another plant of company
for example as i show that one plant in delhi and other is in pune
then delhi plant contains an ipod and i extend it to pune plant .
plz help as i say u will receive it.
plz send the programm code for it.
thanks jayant.chk these links:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f026e990-0201-0010-498a-b5bc13dbe3b9
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f562eb90-0201-0010-5ba8-ecdce4de4132
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f562eb90-0201-0010-5ba8-ecdce4de4132 -
HI Experts
I have a BDC programme, how I can know the source field. of BDC Programme. Please guide.
Regards
Parkash chandMaybe you can find your source field in tcode SHDB.
-
Initial Entry of Stock Balances in Material Ledger
Hi,
we migrated the stock with MVT 561. In the test system in CKM3 it was shown correct in the receipts. In the productive System it was shown partially correct in the receipts (Special stock indicator W and O) and mostely wrong as a negative consumption ( No special stock indicator and K).
The follow up problem is, that we couldn't adjust the ACC with CKMCCC, cause we couldn't update the price with MR22 for the negative stock.
Thanks for Help.Hi,
As you said with LSMW we can do initial stock uploading but I suggest you better to go BDC programme
For uploading the opening stock in your system <b>T.code: MB1C</b>
With regards,
B.Ravindranath
Maybe you are looking for
-
Plz help me in running of server!!
Whenever i try to run tomcat server for the implementation of servlets it doesnot start. I have set the JAVA_HOME and TOMCAT_HOME path truely. i am using win2000 prof. the following message appears on the dos prompt when i execute it. D:\jakarta-tomc
-
Why won't my applications sync onto my iPhone?
The applications I buy from the apps store on my computer won't sync onto my iPhone when I connect it. It won't let me check the sync box or anything on the apps page of my iTunes. Anyone know how to fix it?
-
how do I difine a 24-bit numeric control in cluster?
-
I get an installation error when updating maps over the air and through Nokia Suite. it downloads and installs but then tries to download apps and stops with error message. tried it over wifi and through data OVA. I am unable to uninstall what has be
-
Can't save site, UIDs with multiple owner: imageframe owned by pagepageitem and baselink
I'm in a huge pickle and need help - I did all this work to a site and can't save it, when I do, it crashes with the following error: I can reopen muse and it recovers all my work, but how do I fix this? Is it because of the 2014.3 update? I can't e