Bdc urgent
Hi
This is my first BDC program t.code vl01n where in i need to pass data from selection screen insted of flat file,and i need it to pass it in ranges
suppose at slection screen
i.e exidv 1700000001 to 17000000066
and similar field
can anyone help me with this or provide me with sample coding for bdc which is passing data from selection screen in ranges.
thanks in advance.
Hi,
you have the select options here
take the difference between these two values
( you can have it if it is either numeric or character )
so in this case it will come for 66 records,
take an internal table.
which will have this exidv as one of the field
do 66 times..
if sy-tabix ne 1 and sy-tabix ne 66.
itab-exidv = selop-low + sy-tabix.
endif.
append itab.
enddo.
so now in your itab all it wil have
from
1700000001 to 17000000066
now loop this table and pass these values
but declare your internal of character type...
regards,
Venkatesh
Similar Messages
-
QTY in BDC --Urgent...
Hi experts,
I am stuck up in a very typical problem. requirement is to create Z screen and call the sapstandrad screen from there to post the data.
I have created a proxy screen for MB01 having 7 fields like Sloc, PO no, Qty, Unit, PLant, Movement Type. From this zscreen, i am calling MB01 transction through BDC.
When i call in my program (Screen) and enter the values of all 7 fields, this data is passed to MB01. ALl the values are being passed execpt for the Quantity Field.
When i give the MSEG-ERFMG as constant, it is passed on to MB01, but when i pass it though a variable 'ITAB-ERFMG', its not passing. And MB01 is picking the default open qty from PO.
When i try to debug it, i can see that
(wa_bdcdata-fnam = fnam.
wa_bdcdata-fval = fval.
append wa_bdcdata to bdcdata.)
in FVAL data is there, but when i check wa_bdcdata-fval , its blank. This is not the case with other 5 fields, there i can see the value in wa_bdcdata-fval .
Pls help, its urgent...
Thanks,Hi,
This is also not working. I dont understand when with the same code 5 fields are updated, why just this Qty field is not.
This is the form statement that i wrote.
form bdc_field using fnam fval.
clear wa_bdcdata.
wa_bdcdata-fnam = fnam.
wa_bdcdata-fval = fval.
write fval to wa_bdcdata-fval.
append wa_bdcdata to bdcdata.
ENDFORM. " WRITE_MESSAGE
Performs statement is :
perform bdc_field1 using 'MSEG-ERFMG(01)'
ITAB-ERFMG. "qty
perform bdc_field using 'MSEG-ERFME(01)'
ITAB-ERFME. "unit
perform bdc_field using 'MSEG-LGORT(01)'
ITAB-LGORT. "sloc
itab is the internale table getting data from proxy screen.
Unit and Storage Location is working fine, qty is not passsing.
Pls help.. -
Facing problem during uploadation of Routing data using CA01-BDC - URGENT
Dear All,
When I am trying to upload Routing data using CA01 in the Table Control scenario, then I am facing problem as my last 2 records are not getting uploaded from my Test file.
For example, I am having 47 records in my Test File and after setting Default size parameters (to avoid screen resolution problem)
I have 15 table control line items data per page. The Page down logic ('=P+') is working fine, but my below BDC code failed to take
the remainder last 2 records from the Test File.
Analysis: When I am running my Call Transaction bdc in foreground, then the 1st page down occurs after 15th record, 2nd page down occurs after 29th record( as in Table Control 1st pages 15th record is coming on the Top of 2nd page). 3rd page down occurs after 43rd record
(as 2nd pages 29th record is coming on the top of 3rd page). In the 4th Table Control Page 43rd record of previous page is coming on top, and then its taking 44th & 45th records from the Test File and then it is triggering SAVE (=BU). Thus, our last 2 records
(i.e. 46th, 47th record) are not getting uploaded in the routing screen from our Test File.
If anybody has encountered this scenario previously, please help me URGENTLY in fixing the bugs here. Its VERY, VERY URGENT
FYI. For others 45 successful records already uploaded, all the screen fields values are coming properly in the routing screen, and here there is no issue.
Thanks very much
Thanks & Regards
Sudipta Project Lead
Volvo Client Location
I am pasting my BDC source code below:
REPORT ZRT1_UPLOAD_CA01_F
NO STANDARD PAGE HEADING
LINE-SIZE 255.
I N C L U D E S *
Include for Data Declarations
INCLUDE zrout_top.
Include for Forms
INCLUDE zrout_form.
INCLUDE zrout_include_f_ca01.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field>
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
Attaching F4 help with filename
PERFORM F1001_GET_F4.
S T A R T - O F - S E L E C T I O N *
START-OF-SELECTION.
Perform to read the input file
PERFORM f_read_file.
Perform to fill the BDC data
PERFORM f_fill_bdctab.
E N D - O F - S E L E C T I O N *
END-OF-SELECTION.
FREE: i_bdcdata,
i_messtab,
i_record.
x----
*& Include ZROUT_TOP *
D A T A B A S E T A B L E S *
TABLES: t100. "Messages
D A T A D E C L A R A T I O N S *
T A B L E T Y P E S *****************************
For input data
TYPES: BEGIN OF ty_record,
matnr(18), "Material Number
werks(4), "Plant
verwe(3), "Usage
statu(3), "Status
arbpl(8), "Work Center
steus(4), "Control Key
ltxa1(40), "Description of Operation
bmsch(13), "Base Quantity
meinh(3), "Unit of Measure
vgw01(11), "Machine
vge01(3), "Unit of measure of activity
END OF ty_record.
I N T E R N A L T A B L E S ***********************
Internal Table for input file name
DATA: i_file_tab TYPE STANDARD TABLE OF sdokpath INITIAL SIZE 0.
Internal Table for BDC Data
DATA: i_bdcdata TYPE STANDARD TABLE OF bdcdata INITIAL SIZE 0.
Internal Table for BDC Messages
DATA: i_messtab TYPE STANDARD TABLE OF bdcmsgcoll INITIAL SIZE 0.
Internal Table for Input file
DATA: i_record TYPE STANDARD TABLE OF ty_record INITIAL SIZE 0.
W O R K A R E A S *************************
Work Area for input file name
DATA: wa_file_tab LIKE sdokpath.
Work Area for BDC Data
DATA: wa_bdcdata LIKE bdcdata.
Work Area for BDC Messages
DATA: wa_messtab LIKE bdcmsgcoll.
Work Area for Input file
DATA: wa_record TYPE ty_record.
V A R I A B L E S ****************************
DATA: v_filename TYPE string,
v_fnam(40) TYPE c.
DATA: wa_opt TYPE ctu_params.
C O N S T A N T S ***************************
CONSTANTS: c_werks TYPE rc27m-werks VALUE 'tp',
c_steus TYPE plpod-steus VALUE 'PP01'.
*Selection Screen.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS:
Input file name
P_FILE TYPE rlgrap-filename OBLIGATORY. " DEFAULT 'C:\'.
SELECTION-SCREEN END OF BLOCK B1.
x----
*& Include ZROUT_FORM *
*& Form f_fill_bdctab
Form to fill the BDC Data
FORM f_fill_bdctab.
TABLES mapl. "Assignment of Task Lists to Materials
DATA: l_cnt_item(3) TYPE n VALUE 1. "Line item counter
DATA: first(3) TYPE n VALUE 16. "Line item counter
DATA: next(3) TYPE n . "Line item counter
DATA: lin(3) TYPE n . "Line item counter
DATA: l_v_bmsch(13), "Base qty
l_v_meinh(3), "Unit of Measure
l_v_vgw01(11), "Machine
l_v_vgw02(11), "Labour
l_v_vge01(3). "Unit of measure of activity
DATA l_v_nextline TYPE sy-tabix.
DATA wa_temp TYPE ty_record.
Initialize Counter
l_cnt_item = 1.
SORT i_record BY matnr.
LOOP AT i_record INTO wa_record.
AT NEW matnr.
REFRESH: i_bdcdata,
i_messtab.
SET PARAMETER ID 'PLN' FIELD space.
SET PARAMETER ID 'PAL' FIELD space.
PERFORM f_bdc_dynpro USING 'SAPLCPDI' '1010'.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'/00'.
Material Number
PERFORM f_bdc_field USING 'RC27M-MATNR'
wa_record-matnr.
Plant
PERFORM f_bdc_field USING 'RC27M-WERKS'
c_werks.
PERFORM f_bdc_field USING 'RC271-PLNNR'
Check if routing already exits for the material
SELECT * FROM mapl
INTO mapl
WHERE matnr EQ wa_record-matnr
AND werks EQ c_werks
AND plnty EQ 'N'.
IF sy-subrc EQ 0.
PERFORM f_bdc_dynpro USING 'SAPLCPDI' '1200'.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=ANLG '.
ENDIF.
ENDSELECT.
perform f_bdc_dynpro USING 'SAPLCPDA' '1200'.
perform f_bdc_field USING 'BDC_OKCODE'
'=VOUE'.
Group Counter
perform f_bdc_field USING 'PLKOD-PLNAL'
Usage
PERFORM f_bdc_field USING 'PLKOD-VERWE'
'1'.
Status
PERFORM f_bdc_field USING 'PLKOD-STATU'
'4'.
ENDAT.
PERFORM f_bdc_dynpro USING 'SAPLCPDI' '1400'.
Check if page is full
IF l_cnt_item EQ '16'.
Page down
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=P+'.
l_cnt_item = 1.
ELSE.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'/00'.
ENDIF.
CLEAR v_fnam.
Populate item level details
Work Center
CONCATENATE 'PLPOD-ARBPL(' l_cnt_item ')' INTO v_fnam.
PERFORM f_bdc_field USING v_fnam
wa_record-arbpl.
Control Key
CONCATENATE 'PLPOD-STEUS(' l_cnt_item ')' INTO v_fnam.
PERFORM f_bdc_field USING v_fnam
c_steus.
Description of Operation
CONCATENATE 'PLPOD-LTXA1(' l_cnt_item ')' INTO v_fnam.
PERFORM f_bdc_field USING v_fnam
wa_record-ltxa1.
Base Quantity
CONCATENATE 'PLPOD-BMSCH(' l_cnt_item ')' INTO v_fnam.
PERFORM f_bdc_field USING v_fnam
wa_record-bmsch.
Unit of Measure
CONCATENATE 'PLPOD-MEINH(' l_cnt_item ')' INTO v_fnam.
PERFORM f_bdc_field USING v_fnam
wa_record-meinh.
Machine
CONCATENATE 'PLPOD-VGW01(' l_cnt_item ')' INTO v_fnam.
PERFORM f_bdc_field USING v_fnam
wa_record-vgw01.
Labour
CONCATENATE 'PLPOD-VGW02(' l_cnt_item ')' INTO v_fnam.
PERFORM f_bdc_field USING v_fnam
wa_record-vgw02.
Unit of measure of activity
CONCATENATE 'PLPOD-VGE01(' l_cnt_item ')' INTO v_fnam.
PERFORM f_bdc_field USING v_fnam
wa_record-vge01.
l_cnt_item = l_cnt_item + 1.
CLEAR wa_record.
AT END OF matnr.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=BU'.
wa_opt-DISMODE = 'A'.
wa_opt-DEFSIZE = 'X'.
wa_opt-UPDMODE = 'S'.
PERFORM f_bdc_transaction USING 'CA01'.
Initialize Counter
l_cnt_item = 1.
ENDAT.
ENDLOOP.
ENDFORM. " f_fill_bdctab
x----
*& Include ZROUT_INCLUDE_F_CA01 *
*& Form f_read_file
Form to read the file from presentation server
FORM f_read_file .
To get the file name
DATA l_v_file TYPE string.
l_v_file = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_v_file
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = i_record
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.
ENDIF.
ENDFORM. " f_read_file
*& Form f_bdc_dynpro
Form to populate BDC Tab for new screen
-->fp_program Screen program name
-->fp_dynpro Screen Number
Start new screen *
FORM f_bdc_dynpro USING fp_program fp_dynpro.
CLEAR wa_bdcdata.
wa_bdcdata-program = fp_program.
wa_bdcdata-dynpro = fp_dynpro.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO i_bdcdata.
ENDFORM. "f_bdc_dynpro
*& Form f_bdc_field
Insert field *
FORM f_bdc_field USING fp_fnam fp_fval.
IF NOT fp_fval IS INITIAL.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = fp_fnam.
wa_bdcdata-fval = fp_fval.
APPEND wa_bdcdata TO i_bdcdata.
ENDIF.
ENDFORM. "f_bdc_field
*& Form f_bdc_transaction
Call transaction and error handling
-->fp_tcode Transaction code
FORM f_bdc_transaction USING fp_tcode.
DATA: l_mstring(480),
l_color TYPE i,
l_mode TYPE c.
REFRESH i_messtab.
CALL TRANSACTION fp_tcode USING i_bdcdata
OPTIONS FROM wa_opt
MESSAGES INTO i_messtab.
Messages during upload
LOOP AT i_messtab INTO wa_messtab.
CASE wa_messtab-msgtyp.
WHEN 'S'.
l_color = 5.
WHEN 'E'.
l_color = 6.
WHEN 'W'.
l_color = 3.
ENDCASE.
FORMAT COLOR = l_color.
SELECT SINGLE * FROM t100 WHERE sprsl = wa_messtab-msgspra
AND arbgb = wa_messtab-msgid
AND msgnr = wa_messtab-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH wa_messtab-msgv1 INTO l_mstring.
REPLACE '&2' WITH wa_messtab-msgv2 INTO l_mstring.
REPLACE '&3' WITH wa_messtab-msgv3 INTO l_mstring.
REPLACE '&4' WITH wa_messtab-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH wa_messtab-msgv1 INTO l_mstring.
REPLACE '&' WITH wa_messtab-msgv2 INTO l_mstring.
REPLACE '&' WITH wa_messtab-msgv3 INTO l_mstring.
REPLACE '&' WITH wa_messtab-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
WRITE: / wa_messtab-msgtyp, l_mstring(250).
ELSE.
WRITE: / wa_messtab.
ENDIF.
FORMAT COLOR OFF.
ENDLOOP.
SKIP.
ENDFORM. " f_bdc_transaction
FORM F1001_GET_F4.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SY-REPID
DYNPRO_NUMBER = SY-DYNNR
FIELD_NAME = P_FILE
CHANGING
FILE_NAME = P_FILE
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
File is not selected
MESSAGE I000 WITH TEXT-M01.
ENDIF.
ENDFORM. " F1001_GET_F4Sudipta,
Would request you to post this to ABAP-Forum for Immediate response.
I had this problem, but the ABAP guy did something to correct this...it was more of screen resoultion difference between the recorded system and uploading system. Please try to use the same system which was used to record and try.
Regards,
Prasobh -
Use of CTU_PARAMS in bdc Urgent
Hi, Experts,
As I know from source that we can use CTU_PARAMS for bdc table controll having line items more than one screen.
I am using this structure for mode and update. How can i use it for multiple lines handle.
I have too much idea for bdc and created several. but for more data than one screen this structure can help me.
If any one know, please share it.
It is urgent now for me .
Regards
Rajiv singh.Hi Rajiv,
Inorder to avoid this screen resolution problem we use CTU-PARAMS Structure.
It contains:
DISMODE : Display mode
RACOMMIT: Do not end transaction at COMMIT WORK
UPDMODE: Update mode
DEFSIZE : Use default window size
CATTMODE: CATT mode
NOBINPT : No batch input mode
NOBIEND : No batch input mode after the end of BDC data.
Kindly check this and get back to me incase of any queries.
Dont forget to reward points if found useful.
Thanks,
Satyesh -
Unable to incorporate multiple data in BDC * URGENT*
Hi EveryOne .
See the code. This code can do BDC for a single value of store and bonus buy no., in transaction WPMA
The current requirement is for a given store all bonus buy values should get populated and then executed each time store wise.
Eg
Store bonus buy values
1001 1
1001 2
1001 4
1002 A
1002 L
1003 6
1003 7
1003 H.
See the code below, and tell me the necessary changes required!!
report zwpma1
no standard page heading line-size 255.
type-pools slis.
data: wt_fcat type slis_fieldcat_alv.
data: it_fcat type slis_t_fieldcat_alv.
data: cnt type sy-tabix.
*include bdcrecx1.
types: begin of ty_final,
store(10) type c,
docnum type docnum,
bbynr type bbynr,
end of ty_final.
types: begin of ty_final1,
store(10),
bbynr type bbynr,
end of ty_final1.
data: wa_bonusbuy type zbonusbuy,
it_bonusbuy type standard table of zbonusbuy with header line,
it_bonusbuy1 type standard table of ty_final1 with header line,
it_t001w type standard table of t001w with header line,
it_edidc type standard table of edidc with header line,
it_edid4 type standard table of edid4 with header line,
it_final type standard table of ty_final with header line,
*Work areas:
wa_edidc type edidc,
wa_edid4 type edid4,
wa_final type ty_final.
data : it_bdcmsgcoll like bdcmsgcoll occurs 0 with header line.
data: bdcdata like table of bdcdata with header line.
data: lv_mode(1) value 'N'.
data : mtext(100) type c,
mvar1 like balm-msgv1,
w_msg(200) type c.
data : l_startt type sy-uzeit, " Time before Recording
l_endt type sy-uzeit, " time after recording
l_cdate type sy-datum. " Current date
start-of-selection.
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
percentage = 100
text = 'Extracting Data....... '.
select werks from t001w into corresponding fields of table it_t001w.
delete adjacent duplicates from it_t001w comparing werks.
if not it_t001w[] is initial.
select store bbynr mmid from zbonusbuy into corresponding fields of table it_bonusbuy for all
entries in it_t001w where store = it_t001w-werks.
if sy-subrc = 0.
sort it_bonusbuy by store.
endif.
endif.
refresh it_t001w.
loop at it_bonusbuy.
move-corresponding it_bonusbuy to it_bonusbuy1.
append it_bonusbuy1.
clear: it_bonusbuy, it_bonusbuy1.
endloop.
l_cdate = sy-datum.
clear l_startt .
l_startt = sy-uzeit.
loop at it_bonusbuy.
*break retaildev.
*perform open_group.
perform bdc_dynpro using 'RWDPOSAN' '1000'.
perform bdc_field using 'BDC_CURSOR'
'SO_BBUY-LOW'.
perform bdc_field using 'BDC_OKCODE'
'=ONLI'.
perform bdc_field using 'PA_VKORG'
'HB00'.
perform bdc_field using 'PA_VTWEG'
'H2'.
perform bdc_field using 'SO_FISEL-LOW'
'1001'.
it_bonusbuy-store.
LOOP AT it_bonusbuy1 WHERE store = it_bonusbuy-store.
if sy-subrc = 0.
perform bdc_field using 'PA_BBUY'
'X'.
perform bdc_field using 'SO_BBUY-LOW'
'TEST_00035'.
it_bonusbuy1-bbynr.
it_bonusbuy-bbynr.
endif.
clear it_bonusbuy1.
ENDLOOP.
*Refresh: it_bonusbuy1.
clear bdcdata.
call transaction 'WPMA' using bdcdata
mode lv_mode
UPDATE 'S'
messages into it_bdcmsgcoll.
refresh bdcdata.
clear it_bonusbuy.
endloop.
l_endt = sy-uzeit.
break retaildev.
select docnum
direct
credat
cretim
mestyp
idoctp
from edidc into corresponding fields of table it_edidc
where
credat = l_cdate and
( cretim ge l_startt and cretim le l_endt ) and
mestyp = 'WPDBBY' and
idoctp = 'WPDBBY01'. " " l_startt and l_endt and
break retaildev.
if sy-subrc = 0.
select docnum
counter
segnum
segnam
sdata
from edid4 into corresponding fields of table it_edid4 for all entries in it_edidc
where
docnum = it_edidc-docnum.
endif.
*Loop at it_final into wa_final.
loop at it_edid4 into wa_edid4 where segnam = 'E1WPBB01'.
wa_final-store = wa_edid4-sdata(10).
wa_final-docnum = wa_edid4-docnum.
wa_final-bbynr = wa_edid4-sdata+10(12).
append wa_final to it_final.
endloop.
delete adjacent duplicates from it_final comparing docnum store bbynr.
sort it_final by store.
clear: wa_final,wa_edidc, wa_edid4.
refresh : it_edid4, it_edidc.
*ALV OutPut
write :'Following are the Idocs posted successfully Storewise' .
loop at it_final.
write : it_final-store , it_final-docnum , it_final-bbynr .
endloop.
*Break retaildev.
perform top_of_page.
perform alv_layout-settings.
perform zalv_fieldcatpopn using it_fcat.
perform z_reuse_alv_grid_display.Have you tried serialization and sendingas an object using something like Zend AMF?
Please mark this question as answered if this works for you.
-Mr.12 -
iam running vf46 transaction using bdc. it is an alv report .after displaying the output of a report, i need to select the line and do further process. selecting the row of alv report is not reflecting in bdc recording.how to go about this
how to select alv report row in backgroundShankar ,
this is not the right to do so , first get the logic of this report then Create Upload program using BAPI's or FM's. no need to write a BDC.
check this FM
<b>SD_REV_REC_COLLECTIVE_RUN_NEW</b> in that VF46.
Regards
prabhu -
Hi experts,
if i schedule my BDC(call transaction) program in sm36 it shows the error as frontend function cannot be execute in background. message number (FES002) .
please guide me
Thanks,
ashokHi,
Why you want to upload the file from "Presentation Server". It is common practice to get the file from "Application Server".
You can get the file from "Application server" using <b>OPEN DATASET</b> and <b>READ DATASET</b>.
Check this link to see how to handle file
http://help.sap.com/saphelp_46c/helpdata/EN/fc/eb3c72358411d1829f0000e829fbfe/frameset.htm
Check this link for more information, how to read file from "Application server".
http://help.sap.com/saphelp_46c/helpdata/EN/fc/eb3c7f358411d1829f0000e829fbfe/frameset.htm
Can you please tell me why you want to read file from "Presentation Server"?I suggest you read file from "Application server".
Regards,
RS -
Hi,
I'm doing BDC of fbcj.
But one information message comes as soon as i run my BDC.
S Field ISCJ_E_POSTINGS-H_PAYMENTS (1) input value is longer than screen field.
and my amount is not coming there due to this msg.
How to do this??
Thanks,
GauravHi Sam
It would be better if we can get the detailed info of the problem. well anyway I will try answering ur Question....
The bestthing while doing a BDC is as said by others, thats Doing a Recording of the transaction used through TCODE 'SHDB'. here you get all the scrren numbers and source program name.
and regarding the part of code you mentioned
'' The below screen is not there for change info record.
'' But I need to update for changing info record.
PERFORM bdc_screen USING 'SAPMM06I' '103'.
PERFORM bdc_table USING 'RM06I-SELKZ(01)' 'X'.
PERFORM bdc_table USING 'RM06I-LTEX1(01)' int_me12-ztd.
it all depends on the requirement of the change. we would have not given a field while creating a record but may have to change it if required so is this LTEX1 which you are changing also there while creating? I guess not as the code for the same is missing -
HI
EXPERTS CAN U HELP ME FOR THIS
<b>IF SUPPOSE THERE ARE 10 RECORDS IN FLATFILE THEN HOW MANY TIMES BDC_OPEN_GROUP.BDC_INSERT,BDC_CLOSE_GROUP EXCUTED
</b>Hi!
During the recording, you might try out the following:
- fill in the first 5 bank accounts (with the right row indexes (ROW(1), ROW(2), etc..))
- press a PAGEDOWN button
- fill in the next 4 accounts
- press PAGEDOWN again
- fill the rest...
Regards
Tamá -
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. -
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.... -
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 -
hi,
i am new to bdc and i am working on report of it and when i press F8 the execution gives d runtime error.and d in dat msg is displayed dat file ven.txt is not opened.
if any body provides d solution to dis problem he or she will be definately rewarded..
plzz reply as it is urgent for me.
Message was edited by:
ric .shi,
i had tried all what u said by chaning INFILE into NFILE ,but is still is giving d runtime error:-
REPORT ZTEST1.
DATA: BDC_TAB LIKE BDCDATA OCCURS 6 WITH HEADER LINE,
NFILE(20) VALUE 'C:\Document and Settings\sysasst.ii\desktop\VEN.txt'.
DATA: BEGIN OF INREC,
VENDNUM LIKE LFA1-LIFNR,
STREET LIKE LFA1-STRAS,
END OF INREC.
PARAMETERS : DISPMODE DEFAULT 'A',
UPDAMODE DEFAULT 'S'.
START-OF-SELECTION.
OPEN DATASET NFILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
USER = SY-UNAME
CLIENT = SY-MANDT
GROUP = SESSION
EXCEPTIONS
CLIENT_INVALID = 1
OTHERS =5.
DO.
READ DATASET NFILE INTO INREC.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
PERFORM FILL_BDC_TAB.
CALL TRANSACTION 'FK02'
USING BDC_TAB
MODE 'N'
UPDATE 'A'.
IF SY-SUBRC <> 0.
WRITE: /'ERROR'.
ENDIF.
ENDDO.
CLOSE DATASET NFILE.
Short text
File "C:\Document and Sett" is not open.
What happened?
Error in the ABAP Application Program
The current ABAP program "ZTEST1" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_FILE_OPEN_MODE', was not
caught and
therefore caused a runtime error.
The reason for the exception is:
When accessing the file "C:\Document and Sett", the system recognized that this
file is
not open. Therefore, the file cannot be accessed.
If u help me out of dis problem den i will definately give points ,dats promise. -
Urgent - BDC program to update technical objects using transaction VA42
Hi,
Currently my program updates technical objects details at item level as well as BOM header level.
But my client insists on updating at contract level i.e when u go to va42 transaction and without selecting any item, we need to go to menu,technical objects where the client wants all the items to be displayed.
How to do this way?, is it possible, please advise on this regard.
Very urgent!
Thanks in advance
Anandh.BI went into va42 and tried to extras->technical objects but it saying to select the item. Without selecting any item it is not going into technical objects.
You can only do BDC if is possible manually, since its not possible you cannot do BDC for that.
Cheers,
Satya -
Hi All, How we can handle a table control in bdc - in detail its urgent pls
Hi All, How we can handle a table control in bdc - in detail its urgent. Please send me the explanation in detail.
Thanks®ards.
Bharathi,
Create Table Control
Step 1 (Create new structure for table control)
Type is name of structure (ZTC_EKKO) and press create
Step 2 (Create Program)
Goto transaction SE80(Object Navigator) -> Repository Browser -> Program.
Enter your program name, please ensure that is begins with SAPMZ as this is a module pool (dialog program).
Press enter to create, and press yes!
Ensure that you create a top include, and press Enter.
Accept the name created for the top include.
Press Enter.
Press Save
Step 3 (Create TOP include)
Double click on the top include and enter following ABAP code:
Tables: ZTC_EKKO.
controls: tc100 type tableview using screen 100.
data: ok_code type sy-ucomm.
data: it_ekko type standard
table of ZTC_EKKO initial size 0,
wa_ekko type ZTC_EKKO.
data: ok_code type sy-ucomm.
Press Save and Activate
Step 4 (Create screen)
Right click the program to create a screen 100 for the dialog. Enter Short description, set screen type to Normal and enter 0 or blank into Next screen. Then move to Element List tab and enter the OK code as OK_CODE (i.e. the same as what you declared in the top include with data: ok_code type sy-ucomm).
Step 5 (Create table control)
Press the Layout button to bring up the screen painter editor.
Press table control button and drag it on to the screen, enter the name of table control created in TOP include (TC100). Now press the yellow button for attributes and set the table control as below options
Step 6 (Populate table control )
Press the orange button (Fields). On the next screen enter ZTC_EKKO and press the Get from Dict button. Select the fields you want (all) and press enter. Now drag them onto your Table Control.
Below is the result, there will been syntax errors if we check now! So Save and go back into the flow logic tab.
Step 7 (Create flow control )
Within the flow logic of screen 100 and create two modules, one to select the data from the database and the other to move the selected fields into the table control. Also insert the two loop statements to populate and retrieve the lines of the table control.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
module data_retrieval.
loop at it_ekko into wa_ekko with control TC100.
module populate_screen.
endloop.
PROCESS AFTER INPUT.
loop at it_ekko.
endloop.
MODULE USER_COMMAND_0100.
Double click the module data_retrieval to create and click yes to get past the popup. Ensure that a new include is created to hold all the PBO modules (default). Press enter.
Select 10 rows of data from the EKKO table and load into the internal table it_ekko. Go back to the flow logic to load this data into the Table Control.
check this one
REPORT ZCALL_TRANS_TAB1 .
TABLES: LFA1,LFBK,lfb1.
data: BEGIN OF it_vendor occurs 0,
LIFNR LIKE LFA1-LIFNR,
bukrs like lfb1-bukrs,
END OF it_vendor.
DATA: BEGIN OF IT_BANK occurs 0,
LIFNR LIKE LFA1-LIFNR,
BANKS LIKE LFBK-BANKS,
BANKL LIKE LFBK-BANKL,
BANKN LIKE LFBK-BANKN,
koinh like lfbk-koinh,
END OF IT_BANK.
data: it_bdcdata like bdcdata occurs 0 with header line.
data: it_messages like bdcmsgcoll occurs 0 with header line.
*selection screen.
selection-screen: begin of block b1 with frame.
parameters: p_file like rlgrap-filename default 'c:/vendor.txt'
obligatory.
parameters: p_file1 like rlgrap-filename default 'c:/xyz.txt'
obligatory.
selection-screen: end of block b1.
*at selection screen.
at selection-screen on value-request for p_file.
perform f4_help using p_file.
at selection-screen on value-request for p_file1.
perform f4_help1 using p_file1.
*start of selection
start-of-selection.
*******uploading file
perform upload_file using p_file P_FILE1.
******open session.
perform populate_data.
*& Form f4_help
form f4_help using p_p_file.
data: l_file type ibipparms-path.
call function 'F4_FILENAME'
importing
file_name = l_file.
p_file = l_file.
endform. " f4_help
*& Form POPULATE_DATA
form populate_data .
DATA: L_STRING TYPE STRing.
DATA: L_COUNTER(2) TYPE n.
loop at it_vendor.
perform bdc_dynpro using 'SAPMF02K' '0106'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-D0130'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
it_vendor-lifnr.
perform bdc_field using 'RF02K-BUKRS'
it_vendor-bukrs.
perform bdc_field using 'RF02K-D0130'
'X'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-bankn(03)'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
*********bank details
CLEAR l_COUNTER.
LOOP AT IT_BANK WHERE LIFNR = IT_VENDOR-LIFNR.
l_COUNTER = l_COUNTER + 1.
clear l_string.
CONCATENATE 'lfbk-banks(' l_counter ')' into l_string.
perform bdc_field using l_string
it_bank-banks.
clear l_string.
CONCATENATE 'lfbk-bankl(' l_counter ')' into l_string.
perform bdc_field using l_string
it_bank-bankl.
clear l_string.
CONCATENATE 'lfbk-bankn(' l_counter ')' into l_string.
perform bdc_field using l_string
it_bank-bankn.
endloop.
******CALL TRANSACTION.
call transaction 'FK02' using it_bdcdata mode 'A'
messages into it_messages.
write:/ sy-subrc.
perform format_messages.
clear it_bdcdata.
refresh it_bdcdata.
endloop.
endform. " POPULATE_DATA
*& Form FORMAT_MESSAGES
form format_messages .
data: l_msg(100).
loop at it_messages.
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
write:/ l_msg.
endloop.
endform. " FORMAT_MESSAGES
*& Form bdc_dynpro
form bdc_dynpro using value(p_program)
value(p_screen).
it_bdcdata-program = p_program.
it_bdcdata-dynpro = p_screen.
it_bdcdata-dynbegin = 'X'.
append it_bdcdata.
clear it_bdcdata.
endform. " bdc_dynpro
*& Form bdc_field
form bdc_field using value(p_fnam)
value(p_fval).
it_bdcdata-fnam = p_fnam.
it_bdcdata-fval = p_fval.
append it_bdcdata.
clear it_bdcdata.
endform. " bdc_field
*& Form upload_file
form upload_file using p_p_file
p_p_file1.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = P_P_FILE
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = IT_VENDOR
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
STOP.
ENDIF.
*******UPLOADING BANK DETAILS
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = P_P_FILE1
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = IT_BANK
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
STOP.
ENDIF.
endform. " upload_file
*& Form f4_help1
-->P_P_FILE1 text
form f4_help1 using p_p_file1.
data:l_file1 type ibipparms-path.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = l_file1.
p_file1 = l_file1.
endform. " f4_help1
http://sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
Regards,
Sankar
Maybe you are looking for
-
I want to run two .avi files on top of each other at the same time in one movie - can i do that in idvd or imovie? Sort of like in 24, where they show four scenes in four boxes, i want to show two scenes, one on top of the screen, and one on the bott
-
HP LJ 1320 only prints blank pages
The printer will only print blank pages. Test pages are also blank (including from the Green Button). This is a recurring issue. It was solved in the past by fiddling with the cartridge and mechanical parts inside (we don't know what exactly sovled t
-
8220 Flip - trying to update OS from 570 error - constant BB restart - HELP
Hi All, New to BB and have a problem here. I have an 8220 Flip and it started producing JVM errors now and again but reboot cleared them and all worked a couple of hours BUT this morning after rebooting I get the 507 error. I have researched this and
-
[EDIT 20140207]: I found that the default domain policy sets "run these programs at user logon" and (other than I expected) not BOTH GPO settings become active, but the setting from the default domain policy overrides the setting from my new GPO. So
-
I have a carrier but no signal
My iphone 4s was working fine then stopped making calls. It shows 02 as carrier but no signal bars. I swapped out the sim and tried it in my husbands spare iphone 4s and it works fine. I have done a reset 3 times now. Any fixes for this problem? Than