Bdc extend
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
Similar Messages
-
How can we extent tablecontrol in bdc(extending logic)
hi
experts can u herlp me for thisThis is exactly similar like any other actions we do in a transaction..
Get a BDC recording done using SHDB & click on icons below table control to add extra lines..
This event will get recorded & accordingly u can write code to extend table control in BDC as well.. -
Need to extend vendor to a new Purchasing Org
Hello All,
I am getting a flat file with existing vendors in SAP System. I need to extend these vendor to the new specified Purchase Org. and also update the fields as per in the excel file (being uploaded).
One way is to use BDC and perform the desired functionality.
Second method is to use the BAPI BAPI_VENDOR_CREATE, which again uses CALL TRANSACTION.
Is there any other method to extend vendor's (except the other 2 stated above).
Thanks in advace..!!
Regards,
TarunHello,
Can be done using IDoc, by populating the various segments for basic type CREMAS05 using the new purchasing org and then passing the details to function module IDOC_INBOUND_SINGLE.
Pass the sender and receiving systems/ports both as the same.
Other alternative approach is using BDC; extending vendor using XK01 (for new purchasing org) and then update the extended vendor using XK02.
Regards,
Tarun -
Problem copying/extending materials (MM01) using BDC
Hi,
I am developing a program that will be used to copy/extend material from one plant to another plant by using BDC. When i did it manually in MM01, i selected 8 views (Purchasing, MRP1, MRP2, MRP3, MRP4, General Plant Data/Storage 1, General Plant Data/Storage 2, Accounting 1 and Accounting 2) and marked the "Create views selected" checkbox. Then, the system prompted me for the plant and storage location information (copy from & copy to). After that, the Purchasing view appears and i would just need to click the "SAVE" button and the new material was created.
When i ran the BDC program (by selecting the "Call Transaction - Show all screens" option), i found that i had to run it four times to have the material created. Basically, i found that it went through four views which were purchasing, MRP, General Plant Data / Storage and Accouting view.
I was wondering why it didn't create the selected views for me although i had recorded the "Mark the 'create views selected' option" in the BDC?
Thanks much in advance.Why choose BDC for MM01 ?
You've the BAPI 'BAPI_MATERIAL_SAVEDATA' at your service. Easy to use & simple to maintain.
Unless you give me specifics i am not convinced about the BDC approach.
BR,
Suhas -
Dynamic extending of table control in bdc
hi frnds
I want an example of dynamic extension of table control i.e
for example:In xk01 there is table control with bank details.
i have to upload upto 10 bank details of a record. I have searched in forum.I got the hint of 'p+' but i cant understand that.so please send me sample code
Thanks
RaghavHai,
Chech this sample code.
Check the below link.
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
THis is example to upload the Bank details of the Vendor which has the TC.
REPORT zprataptable2
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA : BEGIN OF itab OCCURS 0,
i1 TYPE i,
lifnr LIKE rf02k-lifnr,
bukrs LIKE rf02k-bukrs,
ekorg LIKE rf02k-ekorg,
ktokk LIKE rf02k-ktokk,
anred LIKE lfa1-anred,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
land1 LIKE lfa1-land1,
akont LIKE lfb1-akont,
fdgrv LIKE lfb1-fdgrv,
waers LIKE lfm1-waers,
END OF itab.
DATA : BEGIN OF jtab OCCURS 0,
j1 TYPE i,
banks LIKE lfbk-banks,
bankl LIKE lfbk-bankl,
bankn LIKE lfbk-bankn,
END OF jtab.
DATA : cnt(4) TYPE n.
DATA : fdt(20) TYPE c.
DATA : c TYPE i.
INCLUDE bdcrecx1.
START-OF-SELECTION.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\first1.txt'
filetype = 'DAT'
TABLES
data_tab = itab.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\second.txt'
filetype = 'DAT'
TABLES
data_tab = jtab.
LOOP AT itab.
PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-KTOKK'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02K-LIFNR'
itab-lifnr.
PERFORM bdc_field USING 'RF02K-BUKRS'
itab-bukrs.
PERFORM bdc_field USING 'RF02K-EKORG'
itab-ekorg.
PERFORM bdc_field USING 'RF02K-KTOKK'
itab-ktokk.
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-LAND1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFA1-ANRED'
itab-anred.
PERFORM bdc_field USING 'LFA1-NAME1'
itab-name1.
PERFORM bdc_field USING 'LFA1-SORTL'
itab-sortl.
PERFORM bdc_field USING 'LFA1-LAND1'
itab-land1.
PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-KUNNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
cnt = 0.
LOOP AT jtab WHERE j1 = itab-i1.
cnt = cnt + 1.
CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-banks.
CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankl.
CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankn.
IF cnt = 5.
cnt = 0.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-FDGRV'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFB1-AKONT'
itab-akont.
PERFORM bdc_field USING 'LFB1-FDGRV'
itab-fdgrv.
PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-ZTERM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB5-MAHNA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFM1-WAERS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFM1-WAERS'
itab-waers.
PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-LIFNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_transaction USING 'XK01'.
ENDLOOP.
PERFORM close_group.
Header file:
1 63190 0001 0001 0001 mr bal188 b in 31000 a1 inr
2 63191 0001 0001 0001 mr bal189 b in 31000 a1 inr
TC file:
1 in sb 11000
1 in sb 12000
1 in sb 13000
1 in sb 14000
1 in sb 15000
1 in sb 16000
1 in sb 17000
1 in sb 18000
1 in sb 19000
1 in sb 20000
1 in sb 21000
1 in sb 22000
2 in sb 21000
2 in sb 22000
REPORT zmm_pr_upload_mat
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Standard Include for Selection Screen
INCLUDE bdcrecx1.
Internal Table for Upload Data
DATA: BEGIN OF i_pr OCCURS 0,
Header Screen
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
lpein(001), " Category of Del Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
Item Details
matnr(018), " Material No
menge(017), " Quantity
badat(010),
frgdt(010),
preis(014), " Valuation Price
waers(005), " Currency
peinh(005),
wepos(001),
repos(001),
sakto(010), " GL Account
kostl(010), " Cost Center
bnfpo(005),
END OF i_pr.
Internal Table for header Data
DATA: BEGIN OF it_header OCCURS 0,
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
END OF it_header.
Internal Table for Item Data
DATA: BEGIN OF it_item OCCURS 0,
sno(3), " SNo
matnr(018), " Material No
menge(017), " Quantity
preis(014), " Valuation Price
sakto(010), " GL Account
kostl(010), " Cost Center
END OF it_item.
Data Variables & Constants
CONSTANTS : c_x VALUE 'X'. " Flag
DATA : v_l(2), " Counter
v_rowno(5), " Row No
v_2(2), " Counter
v_rows LIKE sy-srows, " Rows in TC
v_field(45). " String
Parameters
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start of Selection
START-OF-SELECTION.
Open the BDC Session
PERFORM open_group.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_pr
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.
SORT i_pr BY sno.
LOOP AT i_pr.
MOVE-CORRESPONDING i_pr TO it_item.
APPEND it_item.
CLEAR it_item.
AT END OF sno.
READ TABLE i_pr INDEX sy-tabix.
MOVE-CORRESPONDING i_pr TO it_header.
APPEND it_header.
CLEAR it_header.
ENDAT.
ENDLOOP.
SORT it_header BY sno.
SORT it_item BY sno.
v_rows = sy-srows - 6.
Upload the Data from Internal Table
LOOP AT it_header.
Header Data
PERFORM bdc_dynpro USING 'SAPMM06B' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-BEDNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-BSART'
it_header-bsart.
PERFORM bdc_field USING 'RM06B-EPSTP'
it_header-epstp.
PERFORM bdc_field USING 'EBAN-KNTTP'
it_header-knttp.
PERFORM bdc_field USING 'RM06B-EEIND'
it_header-eeind.
PERFORM bdc_field USING 'RM06B-LPEIN'
it_header-lpein.
PERFORM bdc_field USING 'EBAN-WERKS'
it_header-werks.
PERFORM bdc_field USING 'EBAN-LGORT'
it_header-lgort.
PERFORM bdc_field USING 'EBAN-EKGRP'
it_header-ekgrp.
PERFORM bdc_field USING 'EBAN-MATKL'
it_header-matkl.
PERFORM bdc_field USING 'EBAN-BEDNR'
it_header-bednr.
PERFORM bdc_field USING 'EBAN-AFNAM'
it_header-afnam.
Item Details
v_l = 0.
To add no. of rows
v_2 = 0 .
As the screen is showing 13 rows defaulted to 130
v_rowno = 130 .
LOOP AT it_item WHERE sno = it_header-sno.
v_l = v_l + 1.
IF v_l = 14 .
IF v_2 = 12 .
v_2 = 12 .
v_l = 2 .
From second time onwards it is displaying 12 rows only
v_rowno = v_rowno + 120 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ELSE.
V_2 initialized to 12 for second screen purpose
v_2 = 12 .
v_l = 2 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno .
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ENDIF.
ENDIF.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
CLEAR v_field.
CONCATENATE 'EBAN-MATNR(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-matnr.
CLEAR v_field.
CONCATENATE 'EBAN-MENGE(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-menge.
PERFORM bdc_dynpro USING 'SAPMM06B' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-PREIS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-PREIS'
it_item-preis.
PERFORM bdc_dynpro USING 'SAPMM06B' '0505'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBKN-SAKTO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'EBKN-SAKTO'
it_item-sakto.
Cost Center
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_CURSOR'
'COBL-KOSTL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'COBL-KOSTL'
it_item-kostl.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
Call The Transaction
PERFORM bdc_transaction USING 'ME51'.
ENDLOOP.
Close the BDC Session
PERFORM close_group.
with regards.
sowjanya.b. -
Extend vendors to a new company code
Hi,
We are creating a new company code and I want to know whether there is any standard transcation code to mass create the vendors master from the existing company code to the new company code without any BDC or LSMW.
Thanks,
SSHi,
Go to transaction XK99. Here you can extend vendors from one company code to another with below steps:-
1. In XK99 slect the LFB1 - Company code dat ,and press F8.( Do not select the fields like MM17).
2. Their will be 2 tab. select the check for DO not change for existing data.
3. In other tab (data to be created)...give the list of vendors or Balck and the TO comp code.
4. Bottem of this tab you have to mention the FROM company code.
5. Press F8 and save.
With the same method you can extend vendors from one Pur org. to another pur org. by selecting LFM1 instead of LFB1.
Regards,
Gaurav -
Hi,
I m doin BDC recording for tcode F-02, i m getting a pop-up screen stating as, Coding Block ...asking Transaction type....
This pop-up apperas only while recording, if i extend G/L without recording i m not getting this pop-up and the G/? will extending directly...
With this my flatfile getting mismatched and getting error while uploading....
Give me any slovable solution for this.....
Thanks,
BDK....Wrong question, Solved by recording....
-
To Extend material to plant using MATERIAL_MAINTAIN_DARK .
I am tryin to extend material into plants using MATERIAL_MAINTAIN_DARK function module.Can someone please check the code below and tell me how i should modify it to work.Is BDC a better option?
DATA: t_amara_ueb LIKE mara_ueb OCCURS 0 WITH HEADER LINE.
DATA: t_amarc_ueb LIKE marc_ueb OCCURS 0 WITH HEADER LINE.
t_amara_ueb-mandt = sy-mandt.
t_amara_ueb-matnr = it_reqdata-material.
t_amara_ueb-tcode = 'MM01'.
t_amara_ueb-tranc = 1.
APPEND t_amara_ueb.
CLEAR t_amara_ueb.
t_amarc_ueb-mandt = sy-mandt.
t_amarc_ueb-matnr = it_reqdata-material.
t_amarc_ueb-werks = it_reqdata-plant.
t_amarc_ueb-tranc = 1.
t_amarc_ueb-KZKRI = 'X'.
APPEND t_amarc_ueb.
CLEAR t_amarc_ueb.
call function 'MATERIAL_MAINTAIN_DARK'
exporting
flag_muss_pruefen = 'X'
p_kz_no_warn = 'N'
kz_prf = space
kz_verw = 'X'
kz_aend = 'X'
kz_dispo = 'X'
tables
amara_ueb = t_amara_ueb
AMARC_UEB = t_AMARC_UEB
EXCEPTIONS
KSTATUS_EMPTY = 1
TKSTATUS_EMPTY = 2
T130M_ERROR = 3
INTERNAL_ERROR = 4
TOO_MANY_ERRORS = 5
UPDATE_ERROR = 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.
ELSE.
COMMIT WORK.
ENDIF.
Thanks and Regards,
Pratima.Hi ,
Use the below code.
DATA : lt_mara_ueb TYPE TABLE OF mara_ueb INITIAL SIZE 0,
lt_marc_ueb TYPE TABLE OF marc_ueb INITIAL SIZE 0,
lt_errors TYPE TABLE OF merrdat INITIAL SIZE 0.
DATA : wa_mara_ueb TYPE mara_ueb,
wa_marc_ueb TYPE marc_ueb,
wa_messtab TYPE merrdat.
DATA : l_mstring(480).
parameters: l_matnr like mara-matnr.
* Set up I_MARA
REFRESH lt_mara_ueb.
wa_mara_ueb-mandt = sy-mandt.
wa_mara_ueb-tcode = 'MM01'.
wa_mara_ueb-matnr = l_matnr.
wa_mara_ueb-tranc = '0000000001'.
APPEND wa_mara_ueb TO lt_mara_ueb.
CLEAR wa_mara_ueb.
SELECT SINGLE * FROM marc INTO CORRESPONDING FIELDS OF wa_marc_ueb
WHERE matnr EQ l_matnr AND werks EQ '01FC'.
IF sy-subrc EQ 0.
MOVE '01BV' TO wa_marc_ueb-werks.
wa_marC_ueb-tranc = '0000000001'.
WA_MARC_UEB-PSTAT = SPACE.
APPEND wa_marc_ueb TO lt_marc_ueb.
ENDIF.
CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
EXPORTING
* FLAG_MUSS_PRUEFEN = 'X'
* SPERRMODUS = 'E'
* MAX_ERRORS = 0
p_kz_no_warn = 'N'
kz_prf = 'W'
* KZ_VERW = 'X'
* KZ_AEND = 'X'
* KZ_DISPO = 'X'
* KZ_TEST = ' '
* NO_DATABASE_UPDATE = ' '
* CALL_MODE = ' '
* CALL_MODE2 = ' '
* USER = SY-UNAME
* SUPPRESS_ARRAY_READ = ' '
* FLG_MASS = ' '
* IMPORTING
* MATNR_LAST =
* NUMBER_ERRORS_TRANSACTION =
TABLES
amara_ueb = lt_mara_ueb
* AMAKT_UEB =
amarc_ueb = lt_marc_ueb
* AMARD_UEB =
* AMFHM_UEB =
* AMARM_UEB =
* AMEA1_UEB =
* AMBEW_UEB =
* ASTEU_UEB =
* ASTMM_UEB =
* AMLGN_UEB =
* AMLGT_UEB =
* AMPGD_UEB =
* AMPOP_UEB =
* AMVEG_UEB =
* AMVEU_UEB =
* AMVKE_UEB =
* ALTX1_UEB =
* AMPRW_UEB =
* AMFIELDRES =
* AMERRDAT =
EXCEPTIONS
KSTATUS_EMPTY = 1
TKSTATUS_EMPTY = 2
T130M_ERROR = 3
INTERNAL_ERROR = 4
TOO_MANY_ERRORS = 5
UPDATE_ERROR = 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.
COMMIT WORK.
Regards,
Raghav -
Regarding the table control in bdc
Hi Abap Gurus,
my requirement is how to extend the table control in bdc? i have searched in the sdn but not found the proper code.
i think we have to use the =P+ code . if possible post the sample code.Use the search tool, or go to [How to scroll a table control?|http://wiki.sdn.sap.com/wiki/display/ABAP/BatchInputFAQ#BatchInputFAQ-Howtoscrollatablecontrol%3F] in [Batch Input FAQ |http://wiki.sdn.sap.com/wiki/display/ABAP/BatchInputFAQ] (not every transaction uses the same code)
Regards,
Raymond -
Problem in extended Transport control while setting up transport request.
I created a BDC program which will create a database table upon executing..
The problem is the program worked well since yesterday, But today when i executed it , it is showing a information message when creating a new transport request .
Extended transport control is not active:
Cannot specify target client
Since it s a recording ,and all the windows are processed using an OK CODE, this info box comes all of a sudden .I dont kno what went wrong , coz it was working fine the previous day.
i could not create a new workbench request even after ignoring that info message.
Pl suggest me what could be wrong.This message has a long text, please read it.
Check with your system administrators, if they have changed anything regarding the transport process.
In addition, instead of using "fragile" recordings, try using function modules like DDIF_TABL_PUT.
Thomas -
Extending the existing functional locations to a new plant?
Hi Sapiens,
The following is my concern:
Q1) I have a set of functional locations(roughly around 5000 records) assigned to say Plant A.
I would like to extend these existing functional locations to Plant B. I am not permitted to do this using LSMW. I should execute this operation in one shot.
How to accomplish this?
Q2) After attaching all the functional locations to Plant B, i should replace the first 4 characters of the functional location structure with the Plant Code itself. Again not through an lsmw. How to accomplish this in one shot?
Please let me know the procedure of doing it with some guidelines.
Thanks in Advance,
VijayaHi
1. You can extentd to the other plant with SCAT ,BDC etc
2. But You can not replace the first four letters from the FL with the New plant code.Remember this is a master data
Regardas
Jignesh -
GUI tran to delete shopping cart via BDC
I'm trying to find a GUI (not web) tran which can delete a shopping cart (set header status = I1040) and can be called via BDC:
1. I can enter "/n" to get out of the Easy Access Menu and then run tran BBP_MON_SC in the GUI to delete a shopping cart. However, is there a way to run the GUI tran BBP_MON_SC via BDC considering it has to be done out of the Easy Access Menu?
2. Is there some other GUI tran that can delete a shopping cart without having to worry about getting out of the Easy Access Menu?
We're running the EBP extended classic scenario with SRM 4.0 and SRM_SERVER 5.00.
Thanks,
BradHi,
You can delete form BBPSC04 as well.But all the GUI tcodes need to be run using "/n" only.
BR,
Disha.
<b>Pls reward points for useful answers.</b> -
Problem in BDC FOR uploading more than 1 insep. typ in QM view for MM01
Hi,
I had made a BDC in which i am trying to upload the data for the QM view which is being extended in it but the problem is when the program reaches the to QM view it is only able to upload only 1 inspection Type which is working fine but when there is more than 1 it gives error that its QM View has already maintained. Please provide me guiddlines how to solve this problem .
Here's is the link to the code which i am trying to modify:-
http://docs.google.com/Edit?id=dngp529_2fxwgmrgg
Edited by: ricx .s on Apr 16, 2009 2:30 PMhi,
But is it not possible that while creating the insepction type for the first it should simultaneously take the value of 2nd inspection type .
see,ina bdc of qp01 or ca01 we can insert the values at the screen but why can't we do d same in the bdc of mm01,
I had made a bdc for tcode MM02 in which i am able to upload the data but in that there is a problem that some of the materials have the Quality managmnt View at position no. 11 or 13 of the screen.
here's is d link for the code of the program :-
http://docs.google.com/Doc?id=dngp529_3wcgnjdf3
plzz provide me guidelines how to solve it .
Edited by: ricx .s on Apr 17, 2009 9:26 AM
Edited by: ricx .s on Apr 17, 2009 10:56 AM -
How to use table control in bdc, plz somebody tell me.
Hi Gurus,
Ples tell me
how to use table control in bdc, plz somebody tell me.
And send Sample CODE also. Thnaks in advance.hi,
Table control / step loop in BDC
Steploop and table contol is inevitable in certain transactions. When we run BDC for such transactions, we will face the situation: how many visible lines of steploop/tablecontrol are on the screen?
Although we can always find certain method to deal with it, such as function code 'NP', 'POPO', considering some extreme situation: there is only one line visible one the screen, our BDC program should display an error message. (See transaction 'ME21', we you resize your screen to let only one row visible, you can not enter mutiple lines on this screen even you use 'NP')
we can determine the number of visible lines on Transaction Screen from our Calling BDC program.
Demo ABAP code has two purposes:
1. how to determine number of visible lines and how to calculte page number;
(the 'calpage' routine has been modify to meet general purpose usage)
2. using field symbol in BDC program, please pay special attention to the difference
in Static ASSIGN and Dynamic ASSIGN.
Step1: go to screen painter to display the screen 121, then we can count the fixed line on this screen, there is 7 lines above the steploop and 2 lines below the steploop, so there are total 9 fixed lines on this screen. This means except these 9 lines, all the other line is for step loop.
Then have a look at steploop itselp, one entry of it will occupy two lines.
(Be careful, for table control, the head and the bottom scroll bar will possess another two fixed lines, and there is a maximum number for table line)
Now we have : FixedLine = 9
LoopLine = 2(for table control, LoopLine is always equal to 1)
Step2: go to transaction itself(ME21) to see how it roll page, in ME21, the first line of new page is always occupied by the last line of last page, so it begin with index '02', but in some other case, fisrt line is empty and ready for input.
Now we have: FirstLine = 0
or FirstLine = 1 ( in our case, FirstLine is 1 because the first line of new page is fulfilled)
Step3: write a subroutine calcalculating number of pages
(here, the name of actual parameter is the same as formal parameter)
global data: FixedLine type i, " number of fixed line on a certain screen
LoopLine type i, " the number of lines occupied by one steploop item
FirstLine type i, " possbile value 0 or 1, 0 stand for the first line of new " scrolling screen is empty, otherwise is 1
Dataline type i, " number of items you will use in BDC, using DESCRIBE to get
pageno type i, " you need to scroll screen how many times.
line type i, " number of lines appears on the screen.
index(2) type N, " the screen index for certain item
begin type i, " from parameter of loop
end type i. " to parameter of loop
*in code sample, the DataTable-linindex stands for the table index number of this line
form calpage using FixedLine type i (see step 1)
LoopLine type i (see step 1)
FirstLine type i (see step 2)
DataLine type i ( this is the item number you will enter in transaction)
changing pageno type i (return the number of page, depends on run-time visible line in table control/ Step Loop)
changing line type i.(visible lines one the screen)
data: midd type i,
vline type i, "visible lines
if DataLine eq 0.
Message eXXX.
endif.
vline = ( sy-srows - FixedLine ) div LoopLine.
*for table control, you should compare vline with maximum line of
*table control, then take the small one that is min(vline, maximum)
*here only illustrate step loop
if FirstLine eq 0.
pageno = DataLine div vline.
if pageno eq 0.
pageno = pageno + 1.
endif.
elseif FirstLine eq 1.
pageno = ( DataLine - 1 ) div ( vline - 1 ) + 1.
midd = ( DataLine - 1 ) mod ( vline - 1).
if midd = 0 and DataLine gt 1.
pageno = pageno - 1.
endif.
endif.
line = vline.
endform.
Step4 write a subroutine to calculate the line index for each item.
form calindex using Line type i (visible lines on the screen)
FirstLine type i(see step 2)
LineIndex type i(item index)
changing Index type n. (index on the screen)
if FirstLine = 0.
index = LineIndex mod Line.
if index = '00'.
index = Line.
endif.
elseif FirstLine = 1.
index = LineIndex mod ( Line - 1 ).
if ( index between 1 and 0 ) and LineIndex gt 1.
index = index + Line - 1.
endif.
if Line = 2.
index = index + Line - 1.
endif.
endif.
endform.
Step5 write a subroutine to calculate the loop range.
form calrange using Line type i ( visible lines on the screen)
DataLine type i
FirstLine type i
loopindex like sy-index
changing begin type i
end type i.
If FirstLine = 0.
if loopindex = 1.
begin = 1.
if DataLine <= Line.
end = DataLine.
else.
end = Line.
endif.
elseif loopindex gt 1.
begin = Line * ( loopindex - 1 ) + 1.
end = Line * loopindex.
if end gt DataLine.
end = DataLine.
endif.
endif.
elseif FirstLine = 1.
if loopindex = 1.
begin = 1.
if DataLine <= Line.
end = DataLine.
else.
end = Line.
endif.
elseif loop index gt 1.
begin = ( Line - 1 ) * ( loopindex - 1 ) + 2.
end = ( Line - 1 ) * ( loopindex - 1 ) + Line.
if end gt DataLine.
end = DataLine.
endif.
endif.
endif.
endform.
Step6
using field sysbol in your BDC, for example: in ME21, but you should calculate each item will correponding to which index in steploop/Table Control
form creat_bdc.
field-symbols: , , .
data: name1(14) value 'EKPO-EMATN(XX)',
name2(14) value 'EKPO-MENGE(XX)',
name3(15) value 'RM06E-SELKZ(XX)'.
assign: name1 to ,
name2 to ,
name3 to .
do pageno times.
if sy-index gt 1
*insert scroll page ok_code"
endif.
perform calrange using Line DataLine FirstLine sy-index
changing begin end.
loop at DataTable from begin to end.
perform calindex using Line FirstLine DataTable-LineIndex changing Index.
name1+11(2) = Index.
name2+11(2) = Index.
name3+12(2) = Index.
perform bdcfield using DataTable-matnr.
perform bdcfield using DataTable-menge.
perform bdcfield using DataTable-indicator.
endloop.
enddo.
example 1
BDC table control is an area on the screen in which you can display data in tabular form. You process it using a loop. Table controls are comparable to step loop tables. While a table control consists of a single definition row, step loop blocks may extend over more than one row. Table controls are more flexible than step loops, and are intended to replace them
When you need to handle a scenario like in sales order,it may contain more than one material,if you have more than one material We have to use table control,it will have number of columns and number of rows.
Table controls allow you to enter, display, and modify tabular data easily on the screen
Check this code,
PARAMETERS: file1 LIKE rlgrap-filename.
*Internal Table Declarations
DATA: BEGIN OF itab OCCURS 0,
matnr(18) TYPE c, "MaterialNumber
werks(4) TYPE c, "Plant
vdatu(10) TYPE c, "Valid From Date
bdatu(10) TYPE c, "Valid To Date
lifnr(10) TYPE c, "Vendor Number
ekorg(4) TYPE c, "Purchasing Organization
feskz TYPE c, "Fixed
autet TYPE c, "MRP Indicator
END OF itab.
DATA: bdcdata LIKE TABLE OF bdcdata WITH HEADER LINE.
*VARIABLES Declarations
DATA: wa1 LIKE LINE OF itab. "Workarea for ITAB
DATA: n TYPE i, "Check
count TYPE i.
DATA: cnt(2), "Counter
wa(15). "Workarea to hold concatenatedvalue
DATA v_msg(100).
DATA: flag.
DATA: file TYPE string.
*Initialization event
INITIALIZATION.
*At-selection-screen event
*To provide Input help for file name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR file1.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = file1.
*START-OF-SELECTION EVENT
START-OF-SELECTION.
MOVE file1 TO file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = itab
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.
*To populate BDCDATA and start data transfer
LOOP AT itab .
To validate Plant range
IF itab-werks = '1000' OR itab-werks = '2000'
OR itab-werks = '1008'.
AT NEW werks.
CLEAR: n.
cnt = 1.
PERFORM bdc_dynpro USING 'SAPLMEOR' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EORD-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EORD-MATNR'
itab-matnr.
PERFORM bdc_field USING 'EORD-WERKS'
itab-werks.
PERFORM bdc_dynpro USING 'SAPLMEOR' '0205'.
CONCATENATE 'EORD-EKORG(' cnt ')' INTO wa.
PERFORM bdc_field USING 'BDC_CURSOR'
wa.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
ENDAT.
IF n = 12.
READ TABLE bdcdata WITH KEY fval = '=BU'.
bdcdata-fval = '=NS'.
MODIFY bdcdata INDEX sy-tabix TRANSPORTING fval.
PERFORM bdc_dynpro USING 'SAPLMEOR' '0205'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EORD-VDATU(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
cnt = 2.
n = 2.
ENDIF.
CONCATENATE 'EORD-VDATU(' cnt ')' INTO wa.
PERFORM bdc_field USING wa
itab-vdatu.
CONCATENATE 'EORD-BDATU(' cnt ')' INTO wa.
PERFORM bdc_field USING wa
itab-bdatu.
CONCATENATE 'EORD-LIFNR(' cnt ')' INTO wa.
PERFORM bdc_field USING wa
itab-lifnr.
CONCATENATE 'EORD-EKORG(' cnt ')' INTO wa.
PERFORM bdc_field USING wa
itab-ekorg.
CONCATENATE 'RM06W-FESKZ(' cnt ')' INTO wa.
PERFORM bdc_field USING wa
itab-feskz.
CONCATENATE 'EORD-AUTET(' cnt ')' INTO wa.
PERFORM bdc_field USING wa
itab-autet.
IF n <> 12.
n = cnt.
ENDIF.
cnt = cnt + 1.
AT END OF werks.
CALL TRANSACTION 'ME01' USING bdcdata
UPDATE 'S'
MODE 'A'.
CLEAR:bdcdata,bdcdata[].
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 = v_msg.
WRITE:/ v_msg.
CLEAR: bdcdata,bdcdata[],flag.
ENDAT.
ENDIF.
ENDLOOP.
Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM.
Insert field values
FORM bdc_field USING fnam fval.
IF NOT fval IS INITIAL.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDIF.
CLEAR wa.
ENDFORM.
Sample code 2
THis is example to upload the Bank details of the Vendor which has the TC.
REPORT zprataptable2
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA : BEGIN OF itab OCCURS 0,
i1 TYPE i,
lifnr LIKE rf02k-lifnr,
bukrs LIKE rf02k-bukrs,
ekorg LIKE rf02k-ekorg,
ktokk LIKE rf02k-ktokk,
anred LIKE lfa1-anred,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
land1 LIKE lfa1-land1,
akont LIKE lfb1-akont,
fdgrv LIKE lfb1-fdgrv,
waers LIKE lfm1-waers,
END OF itab.
DATA : BEGIN OF jtab OCCURS 0,
j1 TYPE i,
banks LIKE lfbk-banks,
bankl LIKE lfbk-bankl,
bankn LIKE lfbk-bankn,
END OF jtab.
DATA : cnt(4) TYPE n.
DATA : fdt(20) TYPE c.
DATA : c TYPE i.
INCLUDE bdcrecx1.
START-OF-SELECTION.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\first1.txt'
filetype = 'DAT'
TABLES
data_tab = itab.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\second.txt'
filetype = 'DAT'
TABLES
data_tab = jtab.
LOOP AT itab.
PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-KTOKK'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02K-LIFNR'
itab-lifnr.
PERFORM bdc_field USING 'RF02K-BUKRS'
itab-bukrs.
PERFORM bdc_field USING 'RF02K-EKORG'
itab-ekorg.
PERFORM bdc_field USING 'RF02K-KTOKK'
itab-ktokk.
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-LAND1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFA1-ANRED'
itab-anred.
PERFORM bdc_field USING 'LFA1-NAME1'
itab-name1.
PERFORM bdc_field USING 'LFA1-SORTL'
itab-sortl.
PERFORM bdc_field USING 'LFA1-LAND1'
itab-land1.
PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-KUNNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
cnt = 0.
LOOP AT jtab WHERE j1 = itab-i1.
cnt = cnt + 1.
CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-banks.
CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankl.
CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankn.
IF cnt = 5.
cnt = 0.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-FDGRV'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFB1-AKONT'
itab-akont.
PERFORM bdc_field USING 'LFB1-FDGRV'
itab-fdgrv.
PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-ZTERM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB5-MAHNA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFM1-WAERS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFM1-WAERS'
itab-waers.
PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-LIFNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_transaction USING 'XK01'.
ENDLOOP.
PERFORM close_group.
Header file:
1 63190 0001 0001 0001 mr bal188 b in 31000 a1 inr
2 63191 0001 0001 0001 mr bal189 b in 31000 a1 inr
TC file:
1 in sb 11000
1 in sb 12000
1 in sb 13000
1 in sb 14000
1 in sb 15000
1 in sb 16000
1 in sb 17000
1 in sb 18000
1 in sb 19000
1 in sb 20000
1 in sb 21000
1 in sb 22000
2 in sb 21000
2 in sb 22000
Regards -
Material Data Extend to New Plant
Hi,
This is understandable how to extend data to new plant; however, is there any way material master can be extended with whole range or material group or material can be extended individually only.
Thankshi
See you have to record the values through SHDB. The recording is send to ABAPER for BDC programme. This prog needs CSV, or tab delimited file with values which can be uploaded
Maybe you are looking for
-
DPS 6.3 backend configuration
Hello all, I've got some problems when I tried to configure datasources with dps6.3 . I've created 2 dps running at different servers but the same configuration. Interestingly, one of the dps shows the operational status of the datasources as "*Could
-
Creative Cloud app (installer) does not show all installed apps - do I get updates?
Hi, with the installer, I've installed CC-versions of several apps (InDesign, Lightroom, PS, Premiere etc). They all work as expected, and start registered to me etc. When I now open the Creative Cloud app, I see only "Photoshop CC" listed under "You
-
Spry Horizontal Menu problem with YouTube
I am trying to place YouTube videos in my website. With a YouTube video embedded, the dropdown menu is behind YouTube and most of the links are note accessible.: http://gigharborrealestate.com/youtube/ Is there a way to have the Spry menu dropdown on
-
Receiver determination is not showing communication channel
HI, I am working on file adpater scenario. I have created communication channel and later deleted it. Then created new communication channel and completed other steps like - creating- receiver determination and interface determination. But when I am
-
Two Different Data Sources in EIS
<p>Hi -</p><p> </p><p>Can we have 2 different Data Sources in the OLAP model.</p><p>Example:</p><p>We have our Fact table in Teradata and Dimension table inOracle.</p><p>Can we create a model with this kind of scenario?</p><p>WIll it be a maintenance