BDC for F4 help in MM01
Hi
I have done a BDC for mm01 but when I am selecting sales Org view and trying to click on F4 the transaction hangs. I further checked the BDC of F4 does not get recorded. I tried to use Ok code 04 but it only picks the first value in the search help and populates without showing the F4. I am attaching my Code. Please can you have a look how to accomplish the requirement
PERFORM F_POPULATE_BDCTAB USING:
'1' 'SAPLMGMM' '0060',
' ' 'BDC_CURSOR' 'RMMG1-MTART',
' ' 'BDC_OKCODE' '=AUSW',
' ' 'RMMG1-MBRSH' l_c_3,
' ' 'RMMG1-MTART' mtart,
'1' 'SAPLMGMM' '0070',
' ' 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(01)',
' ' 'BDC_OKCODE' '=SELA',
' ' 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(01)',
' ' 'BDC_OKCODE' '=ENTR',
'1' 'SAPLMGMM' '0080',
' ' 'BDC_CURSOR' 'RMMG1-WERKS',
' ' 'BDC_OKCODE' '=ENTR',
'1' 'SAPLMGMM' '0080',
' ' 'BDC_CURSOR' 'RMMG1-WERKS',
' ' 'BDC_OKCODE' '=04',
'1' 'SAPMMG01' '0700',
' ' 'BDC_OKCODE' '=12',
' ' 'BDC_OKCODE' '=04',
' ' 'MSICHTAUSW-KZSEL(01)' c_x,
'1' 'SAPLMGMM' '4004',
' ' 'BDC_OKCODE' '=BU',
' ' 'MAKT-MAKTX' maktx,
' ' 'MARA-MEINS' meins,
' ' 'MARA-MATKL' matkl,
' ' 'MARA-MTPOS_MARA' 'NORM'.
Any help is appreciable.
Thanks
Arghadip
The requirement is such that the User is going to enter the Material Type, Industry Sector,UOM and short text in Portal and I need to provide the MM01 screen to the user with the following data. Now when he is trying to select all the views to create in the Sales Org view and some other views another screen is appearing for Plant and Sales Org where it has a Value help which on clicking it gets stopped. The user wants the look and feel of MM01 through BDC including the Value help features and also those entry he has entered in Portal.
Thanks
Arghadip
Similar Messages
-
hi there,
can some one help me out with a BDC for the transaction me51n, i am not able to create a BDC for this.
Kindly suggest.
thanksusing the BAPI, BAPI_REQUISITION_CREATE to create your purchase reqs. ME51N is an enjoy transaction and will not get along with BDC very well.
For ME51N, use bapi BAPI_REQUISITION_CREATE
See the below thread to see the example programs for this BAPI,
Re: BAPI_REQUISITION_CREATE -
Hi all.
I need BDC code for MM01,i need to populate values depending upon "Material type",Because view changing depending upon material type.
please give me code for that.
To be reward all helpfull answers.
Regards.
jayHi,
This is a BDC for MM for T-code MM01.I hope this will help u.
Below is the coding.
Reward if helpful.
Regards,
Seevangi
REPORT ZMMBDC_MATERIAL_MASTER_UPD
LINE-SIZE 255 NO STANDARD PAGE HEADING LINE-COUNT 65.
Tables
Structure declaration
Work Variables and internal tables
Constants
Parameters
Events: Start-Of-Selection
data : begin of i_mara occurs 0,
matnr like mara-matnr,
end of i_mara.
data : begin of ty_matdata,
matnr like mara-matnr, "material number
mbrsh like rmmg1-mbrsh, "Industry sector
mtart like rmmg1-mtart, "Material Type
werks like rmmg1-werks, "Plant
lgort like rmmg1-lgort, "Storage Location
vkorg like rmmg1-vkorg, "Sales Organization
vtweg like rmmg1-vtweg, "Distribution Channel
maktx like makt-maktx, "Material Description (Short Text)
meins like mara-meins, "Base Unit of Measure
matkl like mara-matkl, "Material Group
bismt like mara-bismt, "Old material number
spart like mara-spart, "Division
brgew(15) ," like mara-brgew, "Gross Weight
ntgew(15), " like mara-ntgew, "Net Weight
ekgrp like marc-ekgrp, "Purchasing Group
gewei like mara-gewei, "Weight Unit
klart like rmclf-klart, "Class Type
taxkm like MG03STEUER-TAXKM, "Tax classification material
ladgr like marc-ladgr, "Loading Group
tragr like mara-tragr, "Transportation Group
dismm like marc-dismm, "MRP Type
dispo like marc-dispo, "MRP Controller (Materials Planner)
fhori like marc-fhori, "Scheduling margin key
disls like marc-disls, " lot size
prmod like mpop-prmod, "Forecast model
peran(3)," like mpop-peran, "Number of historical periods
anzpr(3)," like mpop-anzpr, "Number of forecast periods
kzini like mpop-kzini, "Initialization indicator
siggr(9)," like mpop-siggr, "Tracking limit
autru like marc-autru, "Reset Forecast Model Automatically
modav like mpop-modav, "Model selection procedure
perkz like marc-perkz, "Period Indicator
verpr(13), " like mbew-verpr, "Moving Average Price/Periodic Unit Price
prctr like marc-prctr, "Profit Center
mtvfp like marc-mtvfp, "Checking Group for Availability Check
bklas like mbew-bklas, "Valuation Class
vprsv like mbew-vprsv, "Price control indicator
stprs(13) ," like mbew-stprs, "Standard price
peinh(5) ,"like mbew-peinh, "Price Unit
end of ty_matdata,
begin of ty_matdata1,
matnr like mara-matnr, "material number
mbrsh like rmmg1-mbrsh, "Industry sector
mtart like rmmg1-mtart, "Material Type
werks like rmmg1-werks, "Plant
lgort like rmmg1-lgort, "Storage Location
vkorg like rmmg1-vkorg, "Sales Organization
vtweg like rmmg1-vtweg, "Distribution Channel
maktx like makt-maktx, "Material Description (Short Text)
meins like mara-meins, "Base Unit of Measure
matkl like mara-matkl, "Material Group
bismt like mara-bismt, "Old material number
spart like mara-spart, "Division
brgew(15) ," like mara-brgew, "Gross Weight
ntgew(15), " like mara-ntgew, "Net Weight
ekgrp like marc-ekgrp, "Purchasing Group
gewei like mara-gewei, "Weight Unit
klart like rmclf-klart, "Class Type
taxkm like MG03STEUER-TAXKM, "Tax classification material
ladgr like marc-ladgr, "Loading Group
tragr like mara-tragr, "Transportation Group
dismm like marc-dismm, "MRP Type
dispo like marc-dispo, "MRP Controller (Materials Planner)
fhori like marc-fhori, "Scheduling margin key
prmod like mpop-prmod, "Forecast model
peran(3)," like mpop-peran, "Number of historical periods
anzpr(3)," like mpop-anzpr, "Number of forecast periods
kzini like mpop-kzini, "Initialization indicator
siggr(9)," like mpop-siggr, "Tracking limit
autru like marc-autru, "Reset Forecast Model Automatically
modav like mpop-modav, "Model selection procedure
perkz like marc-perkz, "Period Indicator
verpr(13), " like mbew-verpr, "Moving Average Price/Periodic Unit Price
prctr like marc-prctr, "Profit Center
mtvfp like marc-mtvfp, "Checking Group for Availability Check
bklas like mbew-bklas, "Valuation Class
vprsv like mbew-vprsv, "Price control indicator
stprs(13) ," like mbew-stprs, "Standard price
peinh(5) ,"like mbew-peinh, "Price Unit
message like bapiret2-message, "Error Message.
end of ty_matdata1,
begin of ty_error,
matnr like mara-matnr,
mbrsh like rmmg1-mbrsh, "Industry sector
mtart like rmmg1-mtart, "Material Type
werks like rmmg1-werks, "Plant
message like bapiret2-message,
end of ty_error.
Data Begin with W_ *
data : i_matdata like standard table of ty_matdata with header line.
BAPIMATHEAD - Header Segment with Control Information
data : i_headdata like bapimathead occurs 0 with header line.
bapi_makt - Material Descriptions.
data : i_bapi_makt like bapi_makt occurs 0 with header line.
*bapi_mlan - Tax data
data : i_bapi_mlan like bapi_mlan occurs 0 with header line.
bapi_mara - Material Data at Client Level.
data : i_clientdata like bapi_mara occurs 0 with header line.
bapi_marax - Checkbox Structure for BAPI_MARA.
data : i_clientdatax like bapi_marax occurs 0 with header line.
bapi_marc - Material Data at Plant Level.
data : i_plantdata like bapi_marc occurs 0 with header line.
bapi_marcx - Checkbox Structure for BAPI_MARA.
data : i_plantdatax like bapi_marcx occurs 0 with header line.
BAPI_MARD - Material Data at Storage Location Level.
data : i_storagelocationdata like bapi_mard occurs 0 with header line.
bapi_mardx - Checkbox Structure for BAPI_MARD
data : i_storagelocationdatax like bapi_mardx occurs 0 with header line.
*bapi_mpop - Forecast Parameters
data : i_forcastingparameter like BAPI_MPOP occurs 0 with header line.
*bapi_mpopx - Checkbox Structure for BAPI_MPOP
data : i_forcastingparameterx like BAPI_MPOPX occurs 0 with header line.
*bapi_mbew - Valuation Data
data : i_valuationdata like BAPI_MBEW occurs 0 with header line.
*bapi_mbewx - Checkbox Structure for BAPI_MBEW
data : i_valuationdatax like BAPI_MBEWX occurs 0 with header line.
*bapi_mvke - Sales Data
data : i_salesdata like BAPI_MVKE occurs 0 with header line.
*bapi_mvkex - Checkbox Structure for BAPI_MVKE
data : i_salesdatax like BAPI_MVKEX occurs 0 with header line.
bapiret2 - Return parameter
data : i_return like bapiret2 occurs 0 with header line.
Errors displayed on screen.
data : i_error like standard table of ty_error with header line.
*Error data to be loaded after correction.
data : i_matdata1 like standard table of ty_matdata1 with header line.
*bapi_marm - Unit of measure
data : i_bapi_marm like bapi_marm occurs 0 with header line.
*bapi_marmx - unit of measurex
data : i_bapi_marmx like bapi_marmx occurs 0 with header line.
To determine error.
data : w_flg(1).
S E L E C T I O N S C R E E N / P A R A M E T E R S
selection-screen: begin of block b1 with frame.
parameters: p_file like rlgrap-filename obligatory.
selection-screen: end of block b1.
selection-screen skip 1.
selection-screen: begin of block b2 with frame.
parameters: p_file1 like rlgrap-filename .
selection-screen: end of block b2.
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.
WS_FILENAME_GET - Determination of a file name on the presentation
server using a file selection dialog.
call function 'WS_FILENAME_GET'
exporting
def_filename = '*.TXT'
def_path = 'C:\'
mask = ',.TXT,.*.'
mode = 'O'
TITLE = ' '
importing
filename = p_file
RC =
exceptions
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
others = 5
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
T O P O F P A G E *
top-of-page.
skip.
write : /01 'Material Number', 30 'Error Message'.
S T A R T O F S E L E C T I O N
start-of-selection.
perform read_data.
perform create_material.
perform display_error.
*& Form read_data
text
--> p1 text
<-- p2 text
form read_data.
Uploads a file from the presentation server into an internal table.
call function 'WS_UPLOAD'
exporting
codepage = 'IBM'
filename = p_file
filetype = 'DAT'
tables
data_tab = i_matdata
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
others = 10.
if sy-subrc <> 0.
write:/ 'File Not Uploaded'.
endif.
endform. " read_data
*& Form create_material
text
--> p1 text
<-- p2 text
form create_material.
loop at i_matdata.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = i_matdata-matnr
IMPORTING
OUTPUT = i_matdata-matnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = i_matdata-prctr
IMPORTING
OUTPUT = i_matdata-prctr
*select matnr from mara into table i_mara .
*sort i_mara by matnr descending.
*read table i_mara index 1.
*i_mara-matnr = i_mara-matnr + 1.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = i_mara-matnr
IMPORTING
OUTPUT = i_mara-matnr
EXCEPTIONS
LENGTH_ERROR = 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.
*CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = i_matdata-matnr
IMPORTING
OUTPUT = i_matdata-matnr
EXCEPTIONS
LENGTH_ERROR = 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.
i_headdata-material = i_matdata-matnr.
i_headdata-material = i_mara-matnr.
i_headdata-ind_sector = i_matdata-mbrsh.
i_headdata-matl_type = i_matdata-mtart.
i_headdata-basic_view = 'X'.
i_headdata-mrp_view = 'X'.
i_headdata-storage_view = 'X'.
i_headdata-SALES_VIEW = 'X'.
i_headdata-PURCHASE_VIEW = 'X'.
i_headdata-FORECAST_VIEW = 'X'.
i_headdata-ACCOUNT_VIEW = 'X'.
i_headdata-COST_VIEW = 'X'.
i_headdata-prt_view = 'X'.
i_headdata-work_sched_view = 'X'.
i_headdata-quality_view = 'X'.
append i_headdata.
clear i_headdata.
i_bapi_makt-langu = sy-langu.
i_bapi_makt-matl_desc = i_matdata-maktx.
append i_bapi_makt.
clear i_bapi_makt.
i_clientdata-matl_group = i_matdata-matkl.
i_clientdata-old_mat_no = i_matdata-bismt.
i_clientdata-base_uom = i_matdata-meins.
i_clientdata-division = i_matdata-spart.
i_clientdata-UNIT_OF_WT = i_matdata-gewei.
i_clientdata-TRANS_GRP = i_matdata-tragr.
i_clientdata-NET_WEIGHT = i_matdata-ntgew.
append i_clientdata.
clear i_clientdata.
i_clientdatax-matl_group = 'X'.
i_clientdatax-old_mat_no = 'X'.
i_clientdatax-base_uom = 'X'.
i_clientdatax-division = 'X'.
i_clientdatax-UNIT_OF_WT = 'X'.
i_clientdatax-TRANS_GRP = 'X'.
i_clientdatax-NET_WEIGHT = 'X'.
append i_clientdatax.
clear i_clientdatax.
i_plantdata-plant = i_matdata-werks.
i_plantdata-mrp_type = i_matdata-dismm.
i_plantdata-mrp_ctrler = i_matdata-dispo.
i_plantdata-availcheck = i_matdata-mtvfp.
i_plantdata-profit_ctr = i_matdata-prctr.
i_plantdata-LOADINGGRP = i_matdata-ladgr.
i_plantdata-PUR_GROUP = i_matdata-ekgrp.
i_plantdata-AUTO_RESET = i_matdata-autru.
i_plantdata-PERIOD_IND = i_matdata-perkz.
i_plantdata-MRP_CTRLER = i_matdata-dispo.
i_plantdata-SM_KEY = i_matdata-fhori.
i_plantdata-LOTSIZEKEY = i_matdata-disls.
append i_plantdata.
clear i_plantdata.
i_plantdatax-plant = i_plantdata-plant.
i_plantdatax-mrp_type = 'X'.
i_plantdatax-mrp_ctrler = 'X'.
i_plantdatax-availcheck = 'X' .
i_plantdatax-profit_ctr = 'X' .
i_plantdatax-LOADINGGRP = 'X' .
i_plantdatax-PUR_GROUP = 'X' .
i_plantdatax-AUTO_RESET = 'X'.
i_plantdatax-PERIOD_IND = 'X'.
i_plantdatax-MRP_CTRLER = 'X'.
i_plantdatax-SM_KEY = 'X'.
i_plantdatax-LOTSIZEKEY = 'X'.
append i_plantdatax.
clear i_plantdatax.
clear i_forcastingparameter.
i_forcastingparameter-PLANT = i_matdata-werks.
i_forcastingparameter-HIST_VALS = i_matdata-peran.
i_forcastingparameter-FORE_PDS = i_matdata-anzpr.
i_forcastingparameter-INITIALIZE = i_matdata-kzini.
i_forcastingparameter-TRACKLIMIT = i_matdata-siggr.
i_forcastingparameter-MODEL_SP = i_matdata-modav.
i_forcastingparameter-FORE_MODEL = i_matdata-prmod.
append i_forcastingparameter.
clear i_forcastingparameterx.
i_forcastingparameterx-PLANT = i_matdata-werks.
i_forcastingparameterx-HIST_VALS = 'X'.
i_forcastingparameterx-FORE_PDS = 'X'.
i_forcastingparameterx-INITIALIZE = 'X'.
i_forcastingparameterx-TRACKLIMIT = 'X'.
i_forcastingparameterx-MODEL_SP = 'X'.
i_forcastingparameterx-FORE_MODEL = 'X'.
append i_forcastingparameterx.
i_valuationdata-MOVING_PR = i_matdata-verpr.
i_valuationdata-STD_PRICE = i_matdata-stprs.
i_valuationdata-PRICE_CTRL = i_matdata-VPRSV.
i_valuationdata-VAL_CLASS = i_matdata-bklas.
i_valuationdata-PRICE_UNIT = i_matdata-peinh.
i_valuationdata-VAL_AREA = i_matdata-werks.
append i_valuationdata.
i_valuationdatax-VAL_AREA = i_matdata-werks.
i_valuationdatax-MOVING_PR = 'X'.
i_valuationdatax-STD_PRICE = 'X'.
i_valuationdatax-PRICE_CTRL = 'X'.
i_valuationdatax-VAL_CLASS = 'X'.
i_valuationdatax-PRICE_UNIT = 'X'.
append i_valuationdatax.
i_salesdata-SALES_ORG = i_matdata-vkorg.
i_salesdata-DISTR_CHAN = i_matdata-vtweg.
i_salesdata-DELY_UOM = i_matdata-meins.
append i_salesdata.
i_salesdatax-SALES_ORG = i_matdata-vkorg.
i_salesdatax-DISTR_CHAN = i_matdata-vtweg.
i_salesdata-DELY_UOM = 'X'.
append i_salesdatax.
i_bapi_marm-ALT_UNIT = i_matdata-meins.
i_bapi_marm-GROSS_WT = i_matdata-brgew.
append i_bapi_marm.
i_storagelocationdata-plant = i_plantdatax-plant.
i_storagelocationdata-stge_loc = i_matdata-lgort.
append i_storagelocationdata.
clear i_storagelocationdata.
i_storagelocationdatax-plant = i_plantdatax-plant.
i_storagelocationdatax-stge_loc = i_storagelocationdata-stge_loc.
append i_storagelocationdatax.
clear i_storagelocationdatax.
i_bapi_mlan-TAXCLASS_1 = i_matdata-TAXKM.
append i_bapi_mlan.
BAPI - BAPI_MATERIAL_SAVEDATA is used to Create and Change Material
Master Data.
call function 'BAPI_MATERIAL_SAVEDATA'
exporting
headdata = i_headdata
clientdata = i_clientdata
clientdatax = i_clientdatax
plantdata = i_plantdata
plantdatax = i_plantdatax
FORECASTPARAMETERS = i_forcastingparameter
FORECASTPARAMETERSX = i_forcastingparameterx
PLANNINGDATA =
PLANNINGDATAX =
storagelocationdata = i_storagelocationdata
storagelocationdatax = i_storagelocationdatax
VALUATIONDATA = i_valuationdata
VALUATIONDATAX = i_valuationdatax
WAREHOUSENUMBERDATA =
WAREHOUSENUMBERDATAX =
SALESDATA = i_salesdata
SALESDATAX = i_salesdatax
STORAGETYPEDATA =
STORAGETYPEDATAX =
FLAG_ONLINE = ' '
FLAG_CAD_CALL = ' '
importing
return = i_return
tables
materialdescription = i_bapi_makt
UNITSOFMEASURE = i_bapi_marm
UNITSOFMEASUREX = i_bapi_marmx
INTERNATIONALARTNOS =
MATERIALLONGTEXT =
TAXCLASSIFICATIONS = i_bapi_mlan
RETURNMESSAGES =
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
if i_return-type = 'E'.
i_error-matnr = i_mara-matnr.
i_error-mbrsh = i_matdata-mbrsh.
i_error-mtart = i_matdata-mtart.
i_error-werks = i_matdata-werks.
i_error-message = i_return-message.
append i_error.
clear i_error.
w_flg = 'X'.
*else.
Execute external Commit when using BAPIs
When you call BAPIs in your program that change data in the R/3
System afterwards you must call this method to write the changes to *
the database.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'
importing
return = i_return
endif.
refresh : i_headdata , i_bapi_makt, i_clientdata, i_clientdatax ,
i_plantdata, i_plantdatax,
i_storagelocationdata,i_storagelocationdatax,
i_salesdata , i_salesdatax ,
i_valuationdata , i_valuationdatax,
i_bapi_marm,i_bapi_marmx,
i_bapi_mlan.
clear : i_headdata , i_bapi_makt, i_clientdata, i_clientdatax ,
i_plantdata, i_plantdatax, i_storagelocationdata,
i_storagelocationdatax,
i_valuationdata , i_valuationdatax,
i_bapi_marm,i_bapi_marmx,
i_bapi_mlan.
endloop.
endform. " create_material
*& Form display_error
text
--> p1 text
<-- p2 text
form display_error.
loop at i_error.
read table i_matdata with key matnr = i_error-matnr.
if sy-subrc = 0.
i_matdata1-matnr = i_mara-matnr.
i_matdata1-mbrsh = i_matdata-mbrsh.
i_matdata1-mtart = i_matdata-mtart.
i_matdata1-maktx = i_matdata-maktx.
i_matdata1-meins = i_matdata-meins.
i_matdata1-matkl = i_matdata-matkl.
i_matdata1-bismt = i_matdata-bismt.
i_matdata1-zeinr = i_matdata-zeinr.
i_matdata1-spart = i_matdata-spart.
i_matdata1-werks = i_matdata-werks.
i_matdata1-dismm = i_matdata-dismm.
i_matdata1-dispo = i_matdata-dispo.
i_matdata1-beskz = i_matdata-beskz.
i_matdata1-sobsl = i_matdata-sobsl.
i_matdata1-lgpro = i_matdata-lgpro.
i_matdata1-lgfsb = i_matdata-lgfsb.
i_matdata1-eprio = i_matdata-eprio.
i_matdata1-mtvfp = i_matdata-mtvfp.
i_matdata1-lgort = i_matdata-lgort.
i_matdata1-lgpbe = i_matdata-lgpbe.
i_matdata1-prctr = i_matdata-prctr.
i_matdata1-message = i_error-message.
append i_matdata1.
clear i_matdata1.
endif.
endloop.
loop at i_error.
write :/01 i_error-matnr , 30 i_error-message.
endloop.
if i_error is initial.
write :/01 text-001.
endif.
if w_flg = 'X'.
call function 'WS_DOWNLOAD'
exporting
BIN_FILESIZE = ' '
codepage = 'IBM'
filename = p_file1
filetype = 'DAT'
MODE = ' '
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
COL_SELECT = ' '
COL_SELECTMASK = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
tables
data_tab = i_error
FIELDNAMES =
exceptions
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
others = 10
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. " display_error7 -
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 -
BDC for MM01(Material creation)
Hello Please anybody send me code for creating materials with reference to reference material and plant in sselection screen in version ECC 6.0?
My selection screen will be::
Reference material: Plant:Plz User <b>BAPI_MATERIAL_SAVEDATA</b>
Why So :
you will never get it to work correctly in all cases every time for all material types, it is just much easier to work with an API that is not screen dependent. Then you don't have to worry about all of the exceptions when dealing with certain material types, and such. For example, say you have a material which you want to update the po text, and you did your recording for another material, which didn't have a specific view, so now when doing BDC for this material, the screen where you select the view you want to process, may be in a different place in the table control, see what I'm getting at? Its just very much easier to work with BAPIs and is suggest to use BAPI over BDC whenever possible.
Also still u want to go for it, check this code :
REPORT Y730_BDC5 .
*HANDLING TABLE CONTROL IN BDC
DATA : BEGIN OF IT_DUMMY OCCURS 0,
DUMMY(100) TYPE C,
END OF IT_DUMMY.
DATA : BEGIN OF IT_XK01 OCCURS 0,
LIFNR(10) TYPE C,
BUKRS(4) TYPE C,
EKORG(4) TYPE C,
KTOKK(4) TYPE C,
NAME1(30) TYPE C,
SORTL(10) TYPE C,
LAND1(3) TYPE C,
SPRAS(2) TYPE C,
AKONT(6) TYPE C,
FDGRV(2) TYPE C,
WAERS(3) TYPE C,
END OF IT_XK01,
BEGIN OF IT_BANK OCCURS 0,
BANKS(3) TYPE C,
BANKL(10) TYPE C,
BANKN(10) TYPE C,
KOINH(30) TYPE C,
LIFNR(10) TYPE C,
END OF IT_BANK.
DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
IT_BDCMSGCOLL LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = 'C:\VENDOR.TXT'
FILETYPE = 'ASC'
TABLES
DATA_TAB = IT_DUMMY.
LOOP AT IT_DUMMY.
IF IT_DUMMY-DUMMY+0(2) = '11'.
IT_XK01-LIFNR = IT_DUMMY-DUMMY+2(10).
IT_XK01-BUKRS = IT_DUMMY-DUMMY+12(4).
IT_XK01-EKORG = IT_DUMMY-DUMMY+16(4).
IT_XK01-KTOKK = IT_DUMMY-DUMMY+20(4).
IT_XK01-NAME1 = IT_DUMMY-DUMMY+24(30).
IT_XK01-SORTL = IT_DUMMY-DUMMY+54(10).
IT_XK01-LAND1 = IT_DUMMY-DUMMY+64(3).
IT_XK01-SPRAS = IT_DUMMY-DUMMY+67(2).
IT_XK01-AKONT = IT_DUMMY-DUMMY+69(6).
IT_XK01-FDGRV = IT_DUMMY-DUMMY+75(2).
IT_XK01-WAERS = IT_DUMMY-DUMMY+77(3).
APPEND IT_XK01.
ELSE.
IT_BANK-BANKS = IT_DUMMY-DUMMY+2(3).
IT_BANK-BANKL = IT_DUMMY-DUMMY+5(10).
IT_BANK-BANKN = IT_DUMMY-DUMMY+15(10).
IT_BANK-KOINH = IT_DUMMY-DUMMY+25(30).
IT_BANK-LIFNR = IT_DUMMY-DUMMY+55(10).
APPEND IT_BANK.
ENDIF.
ENDLOOP.
LOOP AT IT_XK01.
REFRESH IT_BDCDATA.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-REF_LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
IT_XK01-LIFNR.
perform bdc_field using 'RF02K-BUKRS'
IT_XK01-BUKRS.
perform bdc_field using 'RF02K-EKORG'
IT_XK01-EKORG.
perform bdc_field using 'RF02K-KTOKK'
IT_XK01-KTOKK.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-TELX1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-NAME1'
IT_XK01-NAME1.
perform bdc_field using 'LFA1-SORTL'
IT_XK01-SORTL.
perform bdc_field using 'LFA1-LAND1'
IT_XK01-LAND1.
perform bdc_field using 'LFA1-SPRAS'
IT_XK01-SPRAS.
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-KOINH(02)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
DATA : FNAM(20) TYPE C,
IDX TYPE C.
MOVE 1 TO IDX.
LOOP AT IT_BANK WHERE LIFNR = IT_XK01-LIFNR.
CONCATENATE 'LFBK-BANKS(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-BANKS.
CONCATENATE 'LFBK-BANKL(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-BANKL.
CONCATENATE 'LFBK-BANKN(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-BANKN.
CONCATENATE 'LFBK-KOINH(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-KOINH.
IDX = IDX + 1.
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'
IT_XK01-AKONT.
perform bdc_field using 'LFB1-FDGRV'
IT_XK01-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'
IT_XK01-WAERS.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR'
'WYT3-PARVW(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
CALL TRANSACTION 'XK01' USING IT_BDCDATA
MODE 'A'
UPDATE 'S'
MESSAGES INTO IT_BDCMSGCOLL.
ENDLOOP.
FORM BDC_DYNPRO USING PROG SCR.
CLEAR IT_BDCDATA.
IT_BDCDATA-PROGRAM = PROG.
IT_BDCDATA-DYNPRO = SCR.
IT_BDCDATA-DYNBEGIN = 'X'.
APPEND IT_BDCDATA.
ENDFORM.
FORM BDC_FIELD USING FNAM FVAL.
CLEAR IT_BDCDATA.
IT_BDCDATA-FNAM = FNAM.
IT_BDCDATA-FVAL = FVAL.
APPEND IT_BDCDATA.
ENDFORM.
All things r available in SDN, please search.
Reward points if useful.
Thanks
vinsee -
Help for bdc for transfer of asset plant wise stock transfer(urgent)
hi all,
if anyone has done BDC for this scenario ie.,
bdc for transfer of asset plant wise stock transfer
then plz share its code with me.and if someone has done any modification regarding this scenario then plz let me know that what modification he/she has carried out in this & share the code for the same.
i will be grateful to u for this and promise that i will give points to all ur effort.
Thanks & regards
SanjeevHi Sanjeev,
Do a recording for the transaction using SHDB. Once you are done with the recording save the recording into a zprogram. You have the code.
Regards
Arun -
Please help in finding the bug in this BDC for FB01
Please find the bug in the following BDC for FB01 of mine. It picks up the entries from the very first record of the excel file, every time.
report ZFI_BDC
no standard page heading line-size 255.
data: bdcdata1 like bdcdata occurs 0 with header line.
data : vf_index type i.
DATA: BEGIN OF ENTRIES occurs 0,
BLDAT(8),
BUKRS(4),
BLART(2),
WAERS(5),
BUDAT(8),
RECNO(5),
NEWBS(2),
NEWKO(17),
NEWNUM(1),
WRBTR(13),
GSBER(4),
SECCO(4),
zuonr(18),
SGTXT(50),
NEWBS_2(2),
NEWKO_2(17),
NEWNUM_2(1),
WRBTR_2(13),
GSBER_2(4),
SECCO_2(4),
zuonr_2(18),
SGTXT_2(50),
no type i,
END OF ENTRIES.
DATA: BEGIN OF ENTRIES2 OCCURS 0 ,
BLDAT(8),
BUKRS(4),
BLART(2),
WAERS(5),
BUDAT(8),
RECNO(5),
NEWBS(2),
NEWKO(17),
NEWNUM(1),
WRBTR(13),
GSBER(4),
SECCO(4),
zuonr(18),
SGTXT(50),
NEWBS_2(2),
NEWKO_2(17),
NEWNUM_2(1),
WRBTR_2(13),
GSBER_2(4),
SECCO_2(4),
zuonr_2(18),
SGTXT_2(50),
no type i,
END OF ENTRIES2.
DATA: TEMP(8),
DOCDATE(8),
SPLGL(1),
PKEY(2),
GL(17),
VCHAMT(13),
BUSAREA(4),
SECCODE(4),
zzuonr(18),
COSTCEN(10),
AUFNR(3),
SGTXT(50),
item(50) TYPE c,
DS TYPE I,
DS2 TYPE I.
data : vf_start_col type i value '1', "start column
vf_start_row type i value '1', "start row
vf_end_col type i value '256', "maximum column
vf_end_row type i value '65536', "maximum row
p_text(20). "stores error messages
Internal Table
data : it_excel type kcde_cells occurs 0 with header line.
*/ Field symbol
field-symbols : <fs>.
parameters: p_file LIKE rlgrap-filename MEMORY ID M01,
NOHEADER AS CHECKBOX.
parameters: COMPANY(4) TYPE C DEFAULT 'SCL',
GROUP(12) TYPE C DEFAULT 'BDCTEST',
USER(12) TYPE C DEFAULT SY-UNAME,
KEEP(1) TYPE C DEFAULT 'X',
POSTDATE LIKE SY-DATUM DEFAULT SY-DATUM,
DOC_TYPE(2) TYPE C DEFAULT 'SA',
HOLDDATE LIKE SY-DATUM.
***********************************************upload data from excel
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename = p_file
i_begin_col = VF_START_COL
i_begin_row = VF_START_ROW
i_end_col = VF_END_COL
i_end_row = VF_END_ROW
tables
intern = IT_EXCEL
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3 .
IF sy-subrc <> 0.
WRITE: / 'EXCEL UPLOAD FAILED :', p_file, SY-SUBRC.
else.
sort it_excel by row col.
loop at it_excel.
IF NOHEADER = 'X'
AND It_EXCEL-row = 1.
CONTINUE.
ENDIF.
vf_index = it_excel-col.
assign component vf_index of structure ENTRIES to <fs>.
move it_excel-value to <fs>.
at end of row.
append ENTRIES.
clear ENTRIES.
endat.
endloop.
endif.
start-of-selection.
DS = 1.
LOOP AT ENTRIES.
ENTRIES-NO = DS.
MODIFY ENTRIES.
DS = DS + 1.
*ON CHANGE OF ENTRIES-zuonr.
*DS = 1.
*ENTRIES-NO = DS.
*MODIFY ENTRIES.
*DS = DS + 1.
*ENDON.
ENDLOOP.
LOOP AT ENTRIES where no = 1.
MOVE-CORRESPONDING ENTRIES TO ENTRIES2.
APPEND ENTRIES2.
CLEAR ENTRIES2.
ENDLOOP.
DS2 = 1.
LOOP AT ENTRIES2.
ENTRIES2-NO = DS2.
MODIFY ENTRIES2.
DS2 = DS2 + 1.
*ON CHANGE OF ENTRIES2-zuonr.
*DS2 = 1.
*ENTRIES2-NO = DS2.
*MODIFY ENTRIES2.
*DS2 = DS2 + 1.
*ENDON.
ENDLOOP.
LOOP AT ENTRIES.
REFRESH BDCDATA1.
WRITE: / ENTRIES-RECNO,
ENTRIES-NEWBS,
ENTRIES-NEWKO,
ENTRIES-NEWNUM,
ENTRIES-WRBTR,
ENTRIES-GSBER,
ENTRIES-SECCO,
ENTRIES-ZUONR,
ENTRIES-SGTXT.
ENDLOOP.
WRITE: / 'THIS IS THE BDC PROGRAM FOR SAMTEL'.
TEMP = POSTDATE.
DOCDATE = TEMP+6(2).
DOCDATE2(2) = TEMP4(2).
DOCDATE4(4) = TEMP0(4).
*delete ENTRIES where no = 1.
delete ENTRIES2 where no = 2.
clear ENTRIES.
clear ENTRIES2.
LOOP AT ENTRIES .
if ENTRIES-no = 2.
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' "DOCDATE.
ENTRIES-BLDAT.
perform bdc_field using 'BKPF-BLART' "DOC_TYPE.
ENTRIES-BLART.
perform bdc_field using 'BKPF-BUKRS' "COMPANY.
ENTRIES-BUKRS.
perform bdc_field using 'BKPF-BUDAT' "DOCDATE.
ENTRIES-BUDAT.
perform bdc_field using 'BKPF-WAERS' "INR'.
ENTRIES-WAERS.
perform bdc_field using 'RF05A-NEWBS'
ENTRIES-NEWBS.
perform bdc_field using 'RF05A-NEWKO'
ENTRIES-NEWKO.
perform bdc_dynpro using 'SAPMF05A' '0300'.
perform bdc_field using 'BDC_CURSOR'
'BSEG-SGTXT'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-GSBER'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'COBL-GSBER'
ENTRIES-GSBER.
perform bdc_dynpro using 'SAPMF05A' '0300'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWKO'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT.
perform bdc_field using 'RF05A-NEWBS'
ENTRIES-NEWBS.
perform bdc_field using 'RF05A-NEWKO'
ENTRIES-NEWKO.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-GSBER'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'COBL-GSBER'
ENTRIES-GSBER.
perform bdc_dynpro using 'SAPMF05A' '0301'.
*perform bdc_field using 'BDC_CURSOR'
'BSEG-SGTXT_2'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR_2.
perform bdc_field using 'BSEG-GSBER'
ENTRIES-GSBER_2.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT_2.
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'
ENTRIES-WRBTR_2.
perform bdc_field using 'BSEG-GSBER'
ENTRIES-GSBER_2.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT_2.
call transaction 'F-02' using bdcdata1 mode 'A'.
else.
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' "DOCDATE.
ENTRIES-BLDAT.
perform bdc_field using 'BKPF-BLART' "DOC_TYPE.
ENTRIES-BLART.
perform bdc_field using 'BKPF-BUKRS' "COMPANY.
ENTRIES-BUKRS.
perform bdc_field using 'BKPF-BUDAT' "DOCDATE.
ENTRIES-BUDAT.
perform bdc_field using 'BKPF-WAERS' "INR'.
ENTRIES-WAERS.
perform bdc_field using 'RF05A-NEWBS'
ENTRIES-NEWBS.
perform bdc_field using 'RF05A-NEWKO'
ENTRIES-NEWKO.
perform bdc_dynpro using 'SAPMF05A' '0300'.
perform bdc_field using 'BDC_CURSOR'
'BSEG-SGTXT'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-GSBER'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'COBL-GSBER'
ENTRIES-GSBER.
perform bdc_dynpro using 'SAPMF05A' '0300'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWKO'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT.
perform bdc_field using 'RF05A-NEWBS'
ENTRIES-NEWBS_2.
perform bdc_field using 'RF05A-NEWKO'
ENTRIES-NEWKO_2.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-GSBER'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'COBL-GSBER'
ENTRIES-GSBER_2.
perform bdc_dynpro using 'SAPMF05A' '0301'.
**perform bdc_field using 'BDC_CURSOR'
'BSEG-SGTXT_2'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR_2.
perform bdc_field using 'BSEG-GSBER'
ENTRIES-GSBER_2.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT_2.
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'
ENTRIES-WRBTR_2.
perform bdc_field using 'BSEG-GSBER'
ENTRIES-GSBER_2.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT_2.
call transaction 'F-02' using bdcdata1 mode 'A'.
endif.
ENDLOOP.
clear entries.
refresh entries.
Start new screen *
form bdc_dynpro using program dynpro.
clear bdcdata1.
bdcdata1-program = program.
bdcdata1-dynpro = dynpro.
bdcdata1-dynbegin = 'X'.
append bdcdata1.
endform.
Insert field *
form bdc_field using fnam fval.
clear bdcdata1.
bdcdata1-fnam = fnam.
bdcdata1-fval = fval.
append bdcdata1.
endform.Alok,
1) Write upload data from excel in Start of selection
2) I could not find any need for table entries2 in the logic.
3) I feel the data mapping from the uploaded file is wrong. Can you look into http://www.sapdevelopment.co.uk/file/file_upexcelalt1.htm for the proper usage. Actually, this logic will work. Similar way you can map the data to your internal table <b>entries</b>
4) BDC part I feel its ok.
Let me know if you have still error after these steps.
Rgds,
TM -
Need help on BDC for MB1A transaction.
Hello Abapers,
I need to create a BDC for t-code MB1A to do the Goods Issue with reference to reservation.
I am not able to use the BAPI 'BAPI_GOODSMVT_CREATE' to do the goods issue as there are some additional functionalities (Stock Determination) to be included.
The problem I am facing is, The stock determination will determine the Quantity, Storage Location and Valuation type for every item of the reservation. The quantity will be picked up from multiple storage locations and as a result the line item of reservation will be split into two or more for Goods Issue.
When this happens, If the reservation is having multiple line items, tracking the next item becomes a problem.
Please suggest a way to approach this problem.
Usefull answers will be rewarded.
Thanks in Advance,
Vinutha.Hi
The COMMIT before and after CALL TRANSACTION is useless, The transaction FB01 calls the commit by itself, so u need only:
CALL TRANSACTION 'FB01' USING BDC_TAB
MODE 'N'
UPDATE 'S'
MESSAGE ITAB.
Now ITAB is like structure BDCMSGCOLL, so after CALL Transaction u can use message statament in order to show a popup with message:
CALL TRANSACTION 'FB01' USING BDC_TAB
MODE 'N'
UPDATE 'S'
MESSAGE ITAB.
LOOP AT ITAB.
MESSAGE ID ITAB-MSGID TYPE 'I' NUMBER ITAB-MSGNR
WITH ITAB-MSGV1 ITAB-MSGV2 ITAB-MSGV3 ITAB-MSGV4.
ENDLOOP.
Max -
Need help in BDC for Customer master change
I have an interface for Changing Customer master data and I am using BDC for that. I have three scenarios:
1. Insert new data.
2. Change the existing data.
3. Delete the existing data.
The BDC is working fine in the first two scenarios, but if i want to delete an the existing data, lets say for e.g. Name3 or Email Id its not working because i need to pass the value as blank in the BDC for this field.How would i check? i thought i would first get the existing value in customer master and check if the interface value is blank then make this field value to blank in BDC.
But this is not working because in case the interface wants to remove only the email id, the other fields would still be blank.
How to handle this scenario, please advice.What is the difference between 2 and 3? Isn't "deleting data" in your context the same as changing to a blank value?
Why can you not just fill the value as received in the input data into the BDC data?
Thomas -
How to handle bdc for more than one transaction?
how to handle bdc for more than one transaction?
Hi srk,
I am providing you with some references below. Hope this prove to be helpful to you.
Method 1:
Use one BDC_OPEN_GROUP
Multiple BDC_INSERT
One BDC_CLOSE_GROUP.
Call function BDC_OPENGROUP.
Build BDC data and call lBDC_INSERT for transaction 1
Build BDC data and call lBDC_INSERT for transaction 2
Build BDC data and call lBDC_INSERT for transaction 3
paas the tcodes to bdc_insert.
call function BDC_CLOSE_GROUP.
Also check this out:
Here we need to record 2 transactions (shdb).
Once completion of the recording. Populate the data into input internal table .
Loop the internal table and process the 2 transactions
like
1. BDC_OPEN_GROUP
2. LOOP AT ITAB
a. Populate first transaction recording data
and pass transaction to the BDC_INSERT_GROUP.
BDC_INSERT_GROUP.
b. Populate second transaction recording data
and pass transaction to the BDC_INSERT_GROUP.
BDC_INSERT_GROUP.
ENDLOOP.
3. BDC_CLOSE_GROUP
the above info can be found at : How to use 2 transactions in BDC?
Also check this out:
Suppose u have created recordings for transactions 'MM01' 'XK01' and 'VA01'.
Then do this:
bdc_open_group.
after this we have to fill the bdcdata structure for one transaction.here 'MM01'.
bdc_insert.
refresh bdcdata.
after this we have to fill the bdcdata structure for one transaction.here 'xk01'.
bdc_insert .
refresh bdcdata.
after this we have to fill the bdcdata structure for one transaction.here 'va01'.
bdc_insert.
bdc_close_group.
Hope these are useful to you.
Please reward if any of the above are useful.
Regards,
Kalyan -
Hi ,
I am developing the BI program for Material Master (MM01) and change MM02(Both create and change).
Can you let me know how do i select particular views before creating/changing the material .
Is there any specific function module available to do this ..
If you help me with any sample coding ,that would be great.
Thanks
Raj& Description : This program is used to create material
*& master (tcode MM01) . Material data is available in tab delimited *
*& flat file. *
*& The Following is the flat file Structure: *
MATNR(018) "Material Number
MBRSH(001) "Industry Sectory
MTART(004) "Material Type
WERKS(004) "Plant
LGORT(004) "Storage Location
MAKTX(040) "Material Text
MEINS(003) "Basic Unit of Measurement
MATKL(009) "Material Group
PRDHA(018), "Product Hierarchy
MTPOS_MARA(004), "General Item Categoy Group
ZEINR(022) "Document
ZEIVR(002) "Doc Version
SPART(002) "Division
DWERK(004) "Delivery Plant
TAXKM(001) "Tax
KTGRM(002) "Account Assignemnt Group
MTPOS_MARA(004), "General. Item Category Group
MTPOS(004), "Item Category Group
MTVFP(002) "Availability check
*/ Begin of changes by Anoop for Sales Text Date: 17 feb 2004
s_ltex1(40), "Sales Text line 1
s_ltex2(40), "Sales Text line 2
s_ltex3(40), "Sales Text line 3
s_ltex4(40), "Sales Text line 4
s_ltex5(40), "Sales Text line 5
s_ltex6(40), "Sales Text line 6
**/ End of changes by Anoop for Sales Text Date: 17 feb 2004
**/ Begin of changes by Anoop for Purchase Order Text Date: 17 feb 2004
po_ltex1(40), "Purchase Order Text line 1
po_ltex2(40), "Purchase Order Text line 2
po_ltex3(40), "Purchase Order Text line 3
po_ltex4(40), "Purchase Order Text line 4
po_ltex5(40), "Purchase Order Text line 5
po_ltex6(40), "Purchase Order Text line 6
MAKTX(040) "Sales text
EKGRP(003) "Purchasing Group
DISMM(002) "MRP Type
DISPO(003) "MRP Controller
DISLS(002) "Lot Size
EKGRP(003) "Purchasing group
BSTFE(017) "Fixed Lot Size
BESKZ(001) "Procurement Type
LGPRO(004) "Prod. Storage Location
DZEIT(003) "In house production
PLIFZ(003) "Planned Delivery Time
FHORI(003) "Sch. Margin Key
STRGR(002) "Planning Strategy Group
MTVFP(002) "Availabilty Check
SBDKZ(001) "Ind/Collective
SERNP(004) "Serial Number Profile
LGPBE(010) "Storage Bin
GROES(032) "Size and Dimension
WEBAZ(003) "GR Processing Time
BKLAS(004) "Valuation Class
VPRSV(001) "Price Control
VERPR(015) "Moving Average Price
STPRS(015) "Standard Price
MYPOL(004) "LIFO Pool
EKALR(001) "With Qty structure
HKMAT(001) "Material Origin
ZPLP1(014) "Planned Price 1
ZPLD1(010) "Planned Price Date 1
*Include
INCLUDE bdcrecx1.
*Variables
DATA : v_filename TYPE string,
v_flag(1) TYPE c,
v_counter(2) TYPE c,
v_lines TYPE i,
v_count TYPE i VALUE 0.
*Selection-screen
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETER : filename LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
PARAMETER : v_basic1 TYPE checkbox,
v_basic2 TYPE checkbox,
v_sales1 TYPE checkbox,
v_sales2 TYPE checkbox,
v_salesg TYPE checkbox,
v_salest TYPE checkbox,
v_purcha TYPE checkbox,
Begin of changes by Anoop Date: 18 feb 2004.
v_potext TYPE checkbox,
*End of changes by Anoop Date: 18 feb 2004
v_mrp1 TYPE checkbox,
v_mrp2 TYPE checkbox,
v_mrp3 TYPE checkbox,
v_mrp4 TYPE checkbox,
v_wrksch TYPE checkbox,
v_gplnt1 TYPE checkbox,
v_gplnt2 TYPE checkbox,
v_qality TYPE checkbox,
v_acct1 TYPE checkbox,
v_acct2 TYPE checkbox,
v_testi TYPE checkbox,
v_cost2 TYPE checkbox.
SELECTION-SCREEN END OF BLOCK blk2.
SELECTION-SCREEN END OF BLOCK blk1.
*/ Comments given are the view names that have been incorporated into
the BDC for the transaction MM01.
**Internal Tables
DATA: BEGIN OF record,
*/ Basic Data 1..
data element: MATNR
matnr_001(018), "Material Number
data element: MBRSH
mbrsh_002(001), "Industry Sectory
data element: MTART
mtart_003(004), "Material Type
data element: WERKS_D
werks_019(004), "Plant
data element: LGORT_D
lgort_020(004), "Storage Location
*DATA ELEMENT : vkorg
vkorg(004), "Sales Organisation
*DATA ELEMENT : VTWEG
vtweg(002), "Distribution channel
data element: MAKTX
maktx_021(040), "Material Text
data element: MEINS
meins_022(003), "Basic Unit of Measurement
data element: MATKL
matkl_023(009), "Material Group
data element: PRODH_D
prdha_015(018),
data element: MTPOS_MARA
mtpos_mara_016(004),
data element: MTPOS_MARA
MTPOS_MARA_024(004),
*/ Basic Data 2...
data element: DZEINR
zeinr_026(022), "Document
data element: DZEIVR
zeivr_027(002), "Doc Version
data element: MEINS
MEINS_029(003),
*/ Sales : Sales Org. Data 1
data element: SPART
spart_020(002),
data element: DWERK_EXT
dwerk_021(004),
data element: TAXKM
taxkm_01_024(001),
*/ Sales : Sales Org. Data 2
data element: KTGRM
ktgrm_033(002),
data element: MTPOS_MARA
mtpos_mara_034(004),
data element: MTPOS
mtpos_035(004),
*/ Sales : General Plant/Data
data element: MTVFP
mtvfp_040(002),
data element: PRCTR
prctr_041(007),
*/ Sales Text
*/commented by Anoop
data element: MAKTX
maktx_041(040),
*/commented up to here by Anoop
*/ Begin of changes by Anoop for Sales Text Date: 17 feb 2004
s_ltex1(40),
s_ltex2(40),
s_ltex3(40),
s_ltex4(40),
s_ltex5(40),
s_ltex6(40),
*/ End of changes by Anoop for Sales Text Date: 17 feb 2004
*/ Purchasing..
data element: EKGRP
ekgrp_030(003),
data element: MEINS
MEINS_033(003),
data element: EKGRP
EKGRP_034(003),
*/ Begin of changes by Anoop for Purchase Order Text Date: 17 feb 2004
*/ Purchase Order Text
po_ltex1(40),
po_ltex2(40),
po_ltex3(40),
po_ltex4(40),
po_ltex5(40),
po_ltex6(40),
*/ MRP1..
data element: DISMM
dismm_035(002), "MRP Type
data element: DISPO
dispo_036(003), "MRP Controller
data element: DISLS
disls_037(002), "Lot Size
data element : EKGRP
ekgrp(003),
data element: MEINS
MEINS_039(003),
data element: EKGRP
EKGRP_040(003),
data element: DISMM
DISMM_041(002),
data element: DISPO
DISPO_042(003),
data element: DISLS
DISLS_043(002), "Proc. Type
data element: BSTFE
bstfe_044(017),
*/ MRP2..
data element: BESKZ
beskz_046(001),
data element: LGPRO
lgpro_047(004),
data element: DZEIT
dzeit_048(003),
data element: PLIFZ
plifz_049(003),
data element: FHORI
fhori_050(003),
data element: PERKZ
PERKZ_052(001),
*/ MRP3..
data element: STRGR
strgr_053(002),
data element: MTVFP
mtvfp_054(002),
*/ MRP4
data element: SBDKZ
sbdkz_056(001),
data element: MEINS
MEINS_058(003),
data element: LGPRO
LGPRO_059(004),
*/ Work Scheduling
data element: SERAIL
sernp_060(004),
data element: DZEIT
DZEIT_061(003),
data element: MEINS
MEINS_063(003),
*/ Plant Data/Str1
data element: LGPBE
lgpbe_064(010),
data element: DATTP
IPRKZ_065(001),
*/ Plant Data/Str2
data element: GROES
groes_067(032),
data element: SERAIL
SERNP_068(004),
data element: MEINS
MEINS_070(003),
*/ Quality Management
data element: WEBAZ
webaz_071(003),
data element: MEINS
MEINS_073(003),
*/ Accounting 1
data element: BKLAS
bklas_074(004),
data element: VPRSV
vprsv_075(001),
data element: PEINH
PEINH_076(006),
data element: VERPR
verpr_077(015),
data element: STPRS
stprs_078(015),
*/ Accounting 2
data element: MYPOOL
mypol_080(004),
data element: MEINS
MEINS_082(003),
*/ Cost Estimate 1.
data element: CK_EKALREL
ekalr_083(001),
data element: HKMAT
hkmat_084(001),
data element: CK_LOSGR
LOSGR_085(017),
*/ Costing 2..
data element: DZPLP1
zplp1_087(014),
data element: DZPLD1
zpld1_088(010),
data element: BKLAS
BKLAS_089(004),
data element: VPRSV
VPRSV_090(001),
data element: PEINH
PEINH_091(006),
data element: VERPR
VERPR_092(015),
data element: STPRS
STPRS_093(015),
END OF record.
*/ Begin of changes by Anoop Date: 17 feb 2004
*/ intermediate internal table for Sales Text and Purchase Order Text
*DATA: BEGIN OF s_tab OCCURS 0,
matnr LIKE mara-matnr,
s_ltex1 LIKE makt-maktx,
s_ltex2 LIKE makt-maktx,
s_ltex3 LIKE makt-maktx,
s_ltex4 LIKE makt-maktx,
s_ltex5 LIKE makt-maktx,
s_ltex6 LIKE makt-maktx,
END OF s_tab.
*DATA: BEGIN OF po_tab OCCURS 0,
matnr LIKE mara-matnr,
po_ltex1 LIKE makt-maktx,
po_ltex2 LIKE makt-maktx,
po_ltex3 LIKE makt-maktx,
po_ltex4 LIKE makt-maktx,
po_ltex5 LIKE makt-maktx,
po_ltex6 LIKE makt-maktx,
END OF po_tab.
*/ End of changes by Anoop Date: 17 feb 2004
DATA : itab LIKE record OCCURS 0 WITH HEADER LINE.
DATA : ok_code(5) TYPE c.
*AT SELECTION-SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
field_name = filename
CHANGING
file_name = filename.
*START-OF-SELECTION
START-OF-SELECTION.
v_filename = filename.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_filename
filetype = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = itab.
*/ Begin of changes by Anoop Date: 17 feb 2004
LOOP AT itab.
move itab-s_ltext+0(40) to itab-s_ltex1.
move itab-s_ltext+40(40) to itab-s_ltex2.
move itab-s_ltext+80(40) to itab-s_ltex3.
move itab-s_ltext+120(40) to itab-s_ltex4.
move itab-s_ltext+160(40) to itab-s_ltex5.
move itab-s_ltext+200(40) to itab-s_ltex6.
move itab-po_ltext+0(40) to itab-po_ltex1.
move itab-po_ltext+40(40) to itab-po_ltex2.
move itab-po_ltext+80(40) to itab-po_ltex3.
move itab-po_ltext+120(40) to itab-po_ltex4.
move itab-po_ltext+160(40) to itab-po_ltex5.
move itab-po_ltext+200(40) to itab-po_ltex6.
modify itab.
ENDLOOP.
*/ End of changes by Anoop Date: 17 feb 2004
DELETE itab WHERE matnr_001 = ' '.
DESCRIBE TABLE itab LINES v_lines.
PERFORM open_group.
LOOP AT itab.
v_count = v_count + 1.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
IF v_count = v_lines.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BACK'.
ENDIF.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RMMG1-MATNR'
itab-matnr_001.
PERFORM bdc_field USING 'RMMG1-MBRSH'
itab-mbrsh_002.
PERFORM bdc_field USING 'RMMG1-MTART'
itab-mtart_003.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(17)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
TRANSLATE itab-mtart_003 TO UPPER CASE.
*/ IF the data to be uploaded is of Material type 'Trading Goods'
the following view selection
IF itab-mtart_003 = 'HAWA'.
PERFORM view_sel3.
ENDIF.
*/ IF the data to be uploaded is of Material type 'Finished Goods'
the following view selection
IF itab-mtart_003 = 'FERT'.
PERFORM view_sel1.
ENDIF.
*/ IF the data to be uploaded is of Material type 'Semi-Finished Goods'
the following view selection
IF itab-mtart_003 = 'HALB'.
PERFORM view_sel2.
ENDIF.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR'
'T001L-LGOBE'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-WERKS'
itab-werks_019.
PERFORM bdc_field USING 'RMMG1-LGORT'
itab-lgort_020.
PERFORM bdc_field USING 'RMMG1-VKORG'
itab-vkorg.
PERFORM bdc_field USING 'RMMG1-VTWEG'
itab-vtweg.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
IF v_basic1 = 'X'.
*/ Basic Data 1
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARA-MATKL'.
PERFORM bdc_field USING 'MARA-MEINS'
itab-meins_022.
PERFORM bdc_field USING 'MARA-MATKL'
itab-matkl_023.
PERFORM bdc_field USING 'MARA-PRDHA'
itab-prdha_015.
PERFORM bdc_field USING 'MARA-MTPOS_MARA'
itab-mtpos_mara_016.
perform bdc_field using 'MARA-MTPOS_MARA'
itab-MTPOS_MARA_024.
ENDIF.
IF v_basic2 = 'X'.
*/ Basic Data 2
PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARA-ZEIVR'.
PERFORM bdc_field USING 'MARA-ZEINR'
itab-zeinr_026.
PERFORM bdc_field USING 'MARA-ZEIVR'
itab-zeivr_027.
ENDIF.
IF itab-vkorg(004) <> ' '.
IF v_sales1 = 'X'.
*/ Sales : Sales Org. Data 1
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'MARA-MEINS'
itab-meins_022.
PERFORM bdc_field USING 'MARA-SPART'
itab-spart_020.
PERFORM bdc_field USING 'MVKE-DWERK'
itab-dwerk_021.
PERFORM bdc_field USING 'MARA-MATKL'
itab-matkl_023.
****perform bdc_field using 'MVKE-SKTOF'
record-SKTOF_023.
IF itab-taxkm_01_024 <> ' '.
PERFORM bdc_field USING 'BDC_CURSOR'
'MG03STEUER-TAXKM(01)'.
PERFORM bdc_field USING 'MG03STEUER-TAXKM(01)'
itab-taxkm_01_024.
*/ After entering tax another screen in which no data has to be *
populated
PERFORM bdc_dynpro USING 'SAPLMGMM' '4200'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM bdc_field USING 'MAKT-MAKTX'
record-maktx_021.
ENDIF.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'MARA-MEINS'
itab-meins_022.
PERFORM bdc_field USING 'MARA-SPART'
itab-spart_020.
PERFORM bdc_field USING 'MVKE-DWERK'
itab-dwerk_021.
PERFORM bdc_field USING 'MARA-MATKL'
itab-matkl_023.
ENDIF.
IF v_sales2 = 'X'.
*/ Sales : Sales Org. Data 2
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
*/commented by Anoop
*/ itab-maktx_041.
*/commented up to here by Anoop
*/ Begin of changes by Anoop Date: 17 feb 2004
itab-maktx_021.
*/ End of changes by Anoop Date: 17 feb 2004
PERFORM bdc_field USING 'BDC_CURSOR'
'MVKE-MTPOS'.
PERFORM bdc_field USING 'MVKE-KTGRM'
itab-ktgrm_033.
IF itab-mtpos_mara_034 <> ' '.
PERFORM bdc_field USING 'MARA-MTPOS_MARA'
itab-mtpos_mara_034.
ENDIF.
IF itab-mtpos_035 <> ' '.
PERFORM bdc_field USING 'MVKE-MTPOS'
itab-mtpos_035.
ENDIF.
ENDIF.
IF v_salesg = 'X'.
*/ Sales : General/Plant Data
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-MTVFP'.
PERFORM bdc_field USING 'MARA-MEINS'
itab-meins_022.
***perform bdc_field using 'MARA-GEWEI'
record-GEWEI_039.
PERFORM bdc_field USING 'MARC-MTVFP'
itab-mtvfp_040.
IF itab-prctr_041 <> ' '.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-PRCTR'.
PERFORM bdc_field USING 'MARC-PRCTR'
itab-prctr_041.
ENDIF.
ENDIF.
IF v_salest = 'X'.
*/ Sales Text
PERFORM bdc_dynpro USING 'SAPLMGMM' '4040'.
IF itab-mtart_003 = 'HAWA' OR itab-mtart_003 = 'HALB'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SP09'.
ok_code = '=SP09'.
ELSEIF itab-mtart_003 = 'FERT'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SP12'.
ok_code = '=SP12'.
ENDIF.
*/commented by Anoop
PERFORM bdc_field USING 'MAKT-MAKTX'
*/ itab-maktx_041.
*/commented up to here by Anoop
*/ Begin of changes by Anoop for Sales Text Date: 17 feb 2004
PERFORM bdc_field USING 'BDC_OKCODE' '=LTEX'.
PERFORM bdc_dynpro USING 'SAPLSTXX' '1100'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RSTXT-TXLINE(02)' .
PERFORM bdc_field USING 'BDC_OKCODE' '=TXBA' .
PERFORM bdc_field USING 'RSTXT-TXLINE(02)' itab-s_ltex1.
perform bdc_field using 'RSTXT-TXLINE(03)' itab-s_ltex2.
perform bdc_field using 'RSTXT-TXLINE(04)' itab-s_ltex3.
perform bdc_field using 'RSTXT-TXLINE(05)' itab-s_ltex4.
perform bdc_field using 'RSTXT-TXLINE(06)' itab-s_ltex5.
perform bdc_field using 'RSTXT-TXLINE(07)' itab-s_ltex6.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE' '=YES' .
*/ End of changes by Anoop for Sales Text Date: 17 feb 2004
PERFORM bdc_dynpro USING 'SAPLMGMM' '4040'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
ENDIF.
ENDIF.
IF v_purcha = 'X' AND ok_code = '=SP09'.
CLEAR ok_code.
*/ Purchasing
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'SP11'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-EKGRP'.
PERFORM bdc_field USING 'MARA-MEINS'
itab-meins_022.
PERFORM bdc_field USING 'MARC-EKGRP'
itab-ekgrp_030.
PERFORM bdc_field USING 'MARA-MATKL'
itab-matkl_023.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'ENTR'.
perform bdc_field using 'MAKT-MAKTX'
itab-maktx_021.
perform bdc_field using 'MARA-MEINS'
itab-meins_022.
perform bdc_field using 'MARC-EKGRP'
itab-ekgrp_030.
perform bdc_field using 'BDC_CURSOR'
'MARC-DISMM'.
perform bdc_field using 'MARC-DISMM'
itab-DISMM_035.
perform bdc_field using 'MARC-DISPO'
itab-DISPO_036.
perform bdc_field using 'MARC-DISLS'
itab-DISLS_037.
ENDIF.
*/ Begin of changes by Anoop for Purchase Order Text Date: 18 feb 2004
PERFORM bdc_dynpro USING 'SAPLMGMM' '4040'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
IF v_potext = 'X' .
CLEAR ok_code.
*Purchase Order Text
PERFORM bdc_dynpro USING 'SAPLMGMM' '4040'.
PERFORM bdc_field USING 'BDC_OKCODE' '=LTEX'.
PERFORM bdc_dynpro USING 'SAPLSTXX' '1100'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RSTXT-TXLINE(02)' .
PERFORM bdc_field USING 'BDC_OKCODE' '=TXBA' .
PERFORM bdc_field USING 'RSTXT-TXLINE(02)' itab-po_ltex1.
perform bdc_field using 'RSTXT-TXLINE(03)' itab-po_ltex2.
perform bdc_field using 'RSTXT-TXLINE(04)' itab-po_ltex3.
perform bdc_field using 'RSTXT-TXLINE(05)' itab-po_ltex4.
perform bdc_field using 'RSTXT-TXLINE(06)' itab-po_ltex5.
perform bdc_field using 'RSTXT-TXLINE(07)' itab-po_ltex6.
PERFORM bdc_field USING 'RSTXT-TXLINE(02)' itab-po_ltex1 .
PERFORM bdc_field USING 'BDC_CURSOR' 'RSTXT-TXPARGRAPH(03)'.
PERFORM bdc_field USING 'RSTXT-TXPARGRAPH(03)' '*'.
PERFORM bdc_field USING 'RSTXT-TXLINE(03)' itab-po_ltex2 .
PERFORM bdc_field USING 'BDC_CURSOR' 'RSTXT-TXPARGRAPH(04)'.
PERFORM bdc_field USING 'RSTXT-TXPARGRAPH(04)' '*'.
PERFORM bdc_field USING 'RSTXT-TXLINE(04)' itab-po_ltex3 .
PERFORM bdc_field USING 'BDC_CURSOR' 'RSTXT-TXPARGRAPH(05)'.
PERFORM bdc_field USING 'RSTXT-TXPARGRAPH(05)' '*'.
PERFORM bdc_field USING 'RSTXT-TXLINE(05)' itab-po_ltex4 .
PERFORM bdc_field USING 'BDC_CURSOR' 'RSTXT-TXPARGRAPH(06)'.
PERFORM bdc_field USING 'RSTXT-TXPARGRAPH(06)' '*'.
PERFORM bdc_field USING 'RSTXT-TXLINE(06)' itab-po_ltex5 .
PERFORM bdc_field USING 'BDC_CURSOR' 'RSTXT-TXPARGRAPH(07)'.
PERFORM bdc_field USING 'RSTXT-TXPARGRAPH(07)' '*'.
PERFORM bdc_field USING 'RSTXT-TXLINE(07)' itab-po_ltex6 .
PERFORM bdc_field USING 'BDC_CURSOR' 'RSTXT-TXPARGRAPH(08)'.
PERFORM bdc_field USING 'RSTXT-TXPARGRAPH(08)' '*'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE' '=YES' .
PERFORM bdc_dynpro USING 'SAPLMGMM' '4040'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
endif.
*/ End of changes by Anoop for Purchase Order Text Date: 18 feb 2004
IF v_mrp1 = 'X'.
*/ MRP 1
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'ENTR'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'MARA-MEINS'
itab-meins_022.
PERFORM bdc_field USING 'MARC-EKGRP'
itab-ekgrp_030.
PERFORM bdc_field USING 'MARC-DISMM'
itab-dismm_035.
PERFORM bdc_field USING 'MARC-DISPO'
itab-dispo_036.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-DISLS'.
PERFORM bdc_field USING 'MARC-DISLS'
itab-disls_037.
IF itab-ekgrp <> ' '.
PERFORM bdc_field USING 'MARC-EKGRP'
itab-ekgrp.
ENDIF.
PERFORM bdc_field USING 'MARC-BSTFE'
itab-bstfe_044.
ENDIF.
IF v_mrp2 = 'X'.
*/ MRP 2
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'MARC-BESKZ'
itab-beskz_046.
PERFORM bdc_field USING 'MARC-LGPRO'
itab-lgpro_047.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-DZEIT'.
PERFORM bdc_field USING 'MARC-DZEIT'
itab-dzeit_048.
PERFORM bdc_field USING 'MARC-PLIFZ'
itab-plifz_049.
PERFORM bdc_field USING 'MARC-FHORI'
itab-fhori_050.
ENDIF.
IF v_mrp3 = 'X'.
*/ MRP 3
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
perform bdc_field using 'MARC-PERKZ'
itab-PERKZ_052.
PERFORM bdc_field USING 'MARC-STRGR'
itab-strgr_053.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-MTVFP'.
PERFORM bdc_field USING 'MARC-MTVFP'
itab-mtvfp_054.
ENDIF.
IF v_mrp4 = 'X'.
*/ MRP 4
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-SBDKZ'.
PERFORM bdc_field USING 'MARC-SBDKZ'
itab-sbdkz_056.
ENDIF.
IF v_wrksch = 'X'.
*/ WORK SCHEDULES
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-SERNP'.
PERFORM bdc_field USING 'MARA-MEINS'
itab-meins_022.
PERFORM bdc_field USING 'MARC-LGPRO'
itab-lgpro_047.
PERFORM bdc_field USING 'MARC-SERNP'
itab-sernp_060.
PERFORM bdc_field USING 'MARC-DZEIT'
itab-dzeit_048.
ENDIF.
IF v_gplnt1 = 'X'.
*/ PLANT DATA/STR1
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARD-LGPBE'.
PERFORM bdc_field USING 'MARA-MEINS'
itab-meins_022.
PERFORM bdc_field USING 'MARD-LGPBE'
itab-lgpbe_064.
perform bdc_field using 'MARA-IPRKZ'
itab-IPRKZ_065.
ENDIF.
IF v_gplnt2 = 'X'.
*/ PLANT DATA/STR2
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARA-GROES'.
PERFORM bdc_field USING 'MARA-GROES'
itab-groes_067.
PERFORM bdc_field USING 'MARC-SERNP'
itab-sernp_060.
ENDIF.
IF v_qality = 'X'.
*/ QUALITY MANAGEMENT
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=PB01'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-WEBAZ'.
PERFORM bdc_field USING 'MARA-MEINS'
itab-meins_022.
PERFORM bdc_field USING 'MARC-WEBAZ'
itab-webaz_071.
Addition done by Hymavathi on 24-01-2005
PERFORM bdc_dynpro USING 'SAPLQPLS' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMQAM-ARGUMENT'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=NEU'.
PERFORM bdc_dynpro USING 'SAPLQPLS' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMQAM-AKTIV(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=WEIT'.
PERFORM bdc_field USING 'RMQAM-ART(01)'
'01'.
PERFORM bdc_field USING 'RMQAM-AKTIV(01)'
'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-WEBAZ'.
PERFORM bdc_field USING 'MARA-MEINS'
itab-meins_022.
PERFORM bdc_field USING 'MARC-WEBAZ'
itab-webaz_071.
End Of Addition Done By Hymavathi
ENDIF.
IF v_acct1 = 'X'.
*/ ACCOUNTING 1
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx_021.
PERFORM bdc_field USING 'MARA-MEINS'
itab-meins_022.
PERFORM bdc_field USING 'BDC_CURSOR'
'MBEW-STPRS'.
PERFORM bdc_field USING 'MBEW-BKLAS'
itab-bklas_074.
PERFORM bdc_field USING 'MBEW-VPRSV'
-
Follow-up question for Chris H on longtext in BDC for IW31
Chris -
Here's the relevant part of my code:
PERFORM DYNPRO USING:
'X' 'SAPLCOIH' '3000', "
' ' 'CAUFVD-KTEXT ' SCRN_PROBLEM1, " 1st line problem text
' ' 'CAUFVD-ANLZU ' CAUFVD-ANLZU, " System condition
' ' 'BDC_OKCODE' '=LTXK'. "
LOOP AT i_txt INTO wa_txt.
v_txtln_ctr_n = sy-tabix + 2. " Chris - note that I'm bumping to "3" here
v_txtln_ctr_c = v_txtln_ctr_n.
CONCATENATE 'RSTXT-TXLINE('
v_txtln_ctr_c
INTO v_bdc_txtln_lit.
CONDENSE v_bdc_txtln_lit NO-GAPS.
PERFORM DYNPRO USING:
'X' 'SAPLSTXX' '1100', "
' ' v_bdc_txtln_lit wa_txt, " line of problem text
' ' 'BDC_OKCODE' '=ENTR'. "
ENDLOOP.
This actually works - it creates an order in which the long text begins with what is in the variable SCRN_PROBLEM1 and continues with what is in i_txt concatenated together. So I get, for example:
"This is the short description. a b c d e"
where:
scrn_problem1 = 'This is the short description'
row 1 of i_txt = 'a'
row 2 of i_txt = 'b'
row 3 of i_txt = 'c'
row 4 of i_txt = 'd'
row 5 of i_txt = 'e'
The only problem is that the BDC doesn't go thru on its own. When I change 'N' to 'E', the BDC brings up a screen with the title:
"Change order text header Alternative Language EN"
Then, when I just "back-arrow" from this, the BDC does complete successfully and I can see the correct text saved for the order in IW32.
What am I doing wrong to cause this "change order text header" screen to come up? Is it the "LTXK" value of the OK-CODE in the first dynpro call above?
Or maybe something with my default user parameters? I had to set quite a few of these in order to get the BDC to go with just a system, priority, and short text/long text.
I'm really hoping you can see what's going on here because I'm at a loss.
Thanks for whatever help you can provide. You seem to have coded this BDC before, so that's why I'm directing this question to you.
BTW, I'd try the BAPI except the documentation specifically says it won't observe user default parameters and this is a must in our situation.
Thanks again
DaveChris/Rich -
My suspicion was correct. In the last loop over the longtext itab, the ok_code must be 'TXBA', not 'ENTR'.
Here's the code that works without any 'E' interruptions:
PERFORM DYNPRO USING:
'X' 'SAPLCOIH' '3000', "
' ' 'CAUFVD-KTEXT ' SCRN_PROBLEM1, " 1st line problem text
' ' 'CAUFVD-ANLZU ' CAUFVD-ANLZU, " System condition
' ' 'BDC_OKCODE' '=LTXK'. "
DESCRIBE TABLE i_txt LINES v_txt_cnt.
LOOP AT i_txt INTO wa_txt.
v_txtln_ctr_n = sy-tabix + 2.
v_txtln_ctr_c = v_txtln_ctr_n.
CONCATENATE 'RSTXT-TXLINE('
v_txtln_ctr_c
INTO v_bdc_txtln_lit.
CONDENSE v_bdc_txtln_lit NO-GAPS.
IF sy-tabix = v_txt_cnt.
v_txt_ok = '=TXBA'. " no more text lines coming
ELSE.
v_txt_ok = '=ENTR'. " more text lines coming
ENDIF.
PERFORM DYNPRO USING:
'X' 'SAPLSTXX' '1100',
' ' v_bdc_txtln_lit wa_txt, " line of problem text
' ' 'BDC_OKCODE' v_txt_ok. " ok_code
ENDLOOP.
The result is that the longtest display in IW32 will be what's in "SCRN_PROBLEM1" followed by all the lines that are in i_txt.
Reagrds
djh -
Hello All,
A code has been written in the User exit for Tcode ME22N, Which sets the indicator on PO line item. This has been done by modifying the standard itab POT by using field symbols, because the fields to be modified are shown in display mode in the tcode ME22N and cannot be done in BDC. See the below code in user exit ZXM06U43.
DATA char(50) VALUE '(SAPLMEPO)POT[]'.
CLEAR wa_ind.
FIELD-SYMBOLS <f1> TYPE ANY.
Move memory of internal table POT to field symbol f1.
ASSIGN (char) TO <f1>.
Move content of f1 to internal table i_ind
i_ind[] = <f1> .
LOOP AT i_ind INTO wa_ind.
IF wa_ind-pstyp = '9'. " Service PO - item category
IF PO Line item has History per Purchasing Document as 'D'
Set indicators on, for the line item.
CLEAR v_cnt.
SELECT COUNT( * ) INTO v_cnt FROM ent5100
WHERE ebeln = wa_ind-ebeln
AND ebelp = wa_ind-ebelp
AND bewtp = 'D'.
IF sy-subrc = 0.
wa_ind-wepos = 'X'. " Set Goods Receipt Indicator
wa_ind-webre = 'X'. " Set GR-based IV Indicator
wa_ind-lebre = 'X'. " Set Srv-based IV Indicator
ELSE.
*End of addition SAP-20070910104025 - SL36 - D01K963369
wa_ind-wepos = ' '. " Clear Goods Receipt Indicator
wa_ind-webre = ' '. " Clear GR-based IV Indicator
wa_ind-lebre = ' '. " Clear Srv-based IV Indicator
wa_ind-xersy = ' '. " Clear ERS Indicator
ENDIF.
MODIFY i_ind FROM wa_ind INDEX sy-tabix.
ENDIF.
ENDLOOP.
<f1> = i_ind[].
ENDIF.
ENDIF.
This code is in production and has been working fine.
The requirnment is now to make this indicator work for all the Purchase order before this code has been written in the Exit. For this my functional suggests that to write a separate program using BDC for PO change and jus add a period/dot in the short text and save it. The code has been written, the user exit and the above code is getting triggrred values are updated in internal table correctly.
However the flags was not set or cleared when seen in the tcode ME22N . This works fine if the tcode me22n is run directly and not working in BDC.
I have tried with ME22 without enjoy transaction in BDC changing the POT Program to SAPMM06E. It does not work.
Please help me as why it is not uodating in the table when using BDC.
Thanks in Advance.
Senthil KumarHi All,
Any luck on this??
Thanks -
Problem in BDC for VA01 transaction TEXTS tab(Upgrading from 4.5b to ECC6)
Hi All,
I am working in upgrade project from 4.5b version to ECC6 version.
I am facing problem in TEXTS tab of VA01 transaction. In earlier version it is a table control containing of Language, Description & First line but, in ECC6 the screen is modified with texteditor, a list box for language key and a Text type at the left.
Now my problem is how to record this in BDC and how to read the text in the texteditor?
Thanks in Advance,
Ravi Kiran.Hi Seshagiri,
In this case i would suggest the use of BAPI if there's no compulsion to use BDC.
BAPI_SALESORDER_CHANGE Sales order: Change Sales Order
BAPI_SALESORDER_CONFIRMDELVRY
BAPI_SALESORDER_CREATEFROMDAT1 Sales order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDAT2 Sales order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDATA Create Sales Order, No More
BAPI_SALESORDER_GETLIST Sales order: List of all Orders for Customer
BAPI_SALESORDER_GETSTATUS Sales Order: Display Status
BAPI_SALESORDER_SIMULATE Sales Order: Simulate Sales Order
try using these for creation or change of orders instead of bdcs.
hope this helps and revert for more clarifications if any.
<b>Always reward points to useful suggestions.</b>
regards,
Vikas -
BDC for multiple line items (VA01)
Hi Experts,
I create a BDC for VA01 transaction for single line item in that now i want to upload multiple line items also with o/p of total no. of records uploaded, no. of records posted and the no. of error records...
Can any body explain with sample code...Hi,
if the flat file is containing header and item records...
first split those records tooo two internal tables header and item..
Loop at header ...
process of recording steps for header....
Loop at item...
here create a varialbe with char 2 .. for index value....
process of item recording steps..
increment the index value by 1....
here u have to pass 'p+' OK_CODE..
Endloop ..(item)
Endloop...(header)
for more info goo through this link...
http://www.sap-img.com/bdc.htm
hope helpful
Raghunath.S
Maybe you are looking for
-
WHy do my pinned tabs not come up when I reopen Firefox?
I have pinned my email and internet radio in the tab bar. After I exit Firefox 4 and then return - the pinned tabs are no longer there. Also the "ghost" tab with the + sign (to open a new tab) is missing at the right side of the tabs in the tab bar..
-
Passing video through the mini (HTPC)
I currently send video out to my television via HDMI from a receiver. I would like to instead input this video signal to a mac mini and output from the mini to the television (i.e. pass the video signal through the mini on the way to the television).
-
Requirement specs for high-res end product
I am producing a short corporate in Premiere Elements 8 using a combination of an existing MPEG and a series of JPEGs. I have only ever produced videos for the web before, but the the finished product will be projected onto a large screen. I would li
-
Hi, Where can I see the data in fnd_labguages_tl and fnd_territories_tl from the forms front end interface ? Thanks, Amit
-
Internet Accounts Preference pane corrupted after 10.9.5 update
After loading the 10.9.5 update I noticed that my Internet Accounts preferences pane in System Preferences is corrupted. The pane shows mostly blank, but will show graphic corruption if I move the window around. It has the list of accounts even thoug