FM MATERIAL_BTCI_SELECTION_NEW
Hi all,
Can anyone tell me that in FM 'MATERIAL_BTCI_SELECTION_NEW' what is the indicator to select MRP4 view.
Regards,
Anil N.
Hi
Check the below thread
In that Fm SELECTION parameter is the indicator for entering the VIEW CODE
FOR Basic data code is 'K'.
For MRP1 code is 'D'.
Re: Select view
Re: mm02 view position
Regards
Pavan
Similar Messages
-
How to perform Error Handling in this Bdc Code
Hi,
I had created this BDC for the tcode MB1B and i want to know how to perform the ERROR HANDLING in it ..
Plzz provide me guidelines for doing it . here's d code:-
report ZBDC_MB1B
no standard page heading line-size 255.
include bdcrecx1.
data: begin of record OCCURS 0,
WERKS_001(004), "Plant
MATNR_002(018), "ItemId
ERFMG_003(013), "Quantity in Unit of Entry
ERFME_004(003), "Unit of Entry
LGORT_005(004), "Storage Location
CHARG_006(010), "BatchId
KDAUF_007(010), "Sales Order Number
KDPOS_008(006), "Item Number in Sales Order
end of record.
PARAMETERS : P_FILNAM LIKE RLGRAP-FILENAME.
initialization.
CTUMODE = 'A'.
CUPDATE = 'A'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILNAM.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
MASK = ',. '
MODE = 'O'
IMPORTING
FILENAME = P_FILNAM
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.
start-of-selection.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_FILNAM
FILETYPE = 'DAT'
TABLES
DATA_TAB = RECORD
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT RECORD.
BEGIN OF SCREEN 1
perform bdc_dynpro using 'SAPMM07M' '0400'.
perform bdc_field using 'BDC_CURSOR'
'RM07M-SOBKZ'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'MKPF-BLDAT'
'22.12.2008'.
*perform bdc_field using 'MKPF-BUDAT'
'22.12.2008'.
perform bdc_field using 'RM07M-BWARTWA'
'411'.
perform bdc_field using 'RM07M-SOBKZ'
'E'.
perform bdc_field using 'RM07M-WERKS'
RECORD-WERKS_001. "Plant
perform bdc_field using 'XFULL'
'X'.
perform bdc_field using 'RM07M-WVERS2'
'X'.
BEGIN OF SCREEN 2
perform bdc_dynpro using 'SAPMM07M' '0421'.
perform bdc_field using 'BDC_CURSOR'
'MSEG-CHARG(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MSEG-MATNR(01)'
RECORD-MATNR_002. "ITEMID
perform bdc_field using 'MSEG-ERFMG(01)'
RECORD-ERFMG_003. "QTY.
perform bdc_field using 'MSEG-ERFME(01)'
RECORD-ERFME_004. "UOM
perform bdc_field using 'MSEG-LGORT(01)'
RECORD-LGORT_005. "ST.LOC
perform bdc_field using 'MSEG-CHARG(01)'
RECORD-CHARG_006. "BATCHID
perform bdc_field using 'MSEGK-MAT_KDAUF'
RECORD-KDAUF_007. "S.O.
perform bdc_field using 'MSEGK-MAT_KDPOS'
RECORD-KDPOS_008. "S.O.LINE ITEM
perform bdc_field using 'DKACB-FMORE'
'X'.
BEGIN OF SCREEN 3
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'DKACB-FMORE'
'X'.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_dynpro using 'SAPMM07M' '0421'.
perform bdc_field using 'BDC_CURSOR'
'MSEG-ERFMG(01)'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'DKACB-FMORE'
'X'.
BEGIN OF SCREEN 4
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_transaction using 'MB1B'.
ENDLOOP.hi,
check this code in bold letters.
INCLUDE BDCRECX1.
TABLES : MARC.
TYPES : BEGIN OF TY_UPLOAD,
MATNR TYPE MARA-MATNR,
WERKS TYPE MARC-WERKS,
STEUC TYPE MARC-STEUC,
END OF TY_UPLOAD.
TYPES : BEGIN OF TY_MARC,
MATNR TYPE MARA-MATNR,
WERKS TYPE MARC-WERKS,
END OF TY_MARC.
TYPES : BEGIN OF TY_MTART,
MATNR TYPE MARA-MATNR,
MTART TYPE MARA-MTART,
END OF TY_MTART.
DATA : T_MARC TYPE STANDARD TABLE OF TY_MARC,
: T_UPLOAD TYPE STANDARD TABLE OF TY_UPLOAD,
: T_BASIC TYPE STANDARD TABLE OF TY_UPLOAD,
: T_SALES TYPE STANDARD TABLE OF TY_UPLOAD,
: T_ERROR TYPE STANDARD TABLE OF TY_UPLOAD.
DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
IT_BDCDATA_VIEW LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
IT_DATA(3200) OCCURS 0 WITH HEADER LINE,
IT_FIELD(3200) OCCURS 0 WITH HEADER LINE,
IT_BDCMSG TYPE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA GI_MSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA : CHAR1(500),
CHAR2(500),
CHAR3 TYPE STRING,
V_SELECTION TYPE STRING. " For View Selection
DATA : W_MARC TYPE TY_MARC,
WA_UPLOAD TYPE TY_UPLOAD,
WA_BASIC TYPE TY_UPLOAD,
WA_SALES TYPE TY_UPLOAD,
WA_ERROR TYPE TY_UPLOAD,
WA_MTART TYPE TY_MTART.
DATA : VAR TYPE N,
VAR1 TYPE STRING.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001. "SELECTION SCREEN
PARAMETERS: P_FNAM LIKE RLGRAP-FILENAME.
PARAMETERS: P_BAS LIKE RLGRAP-FILENAME.
PARAMETERS: P_SAL LIKE RLGRAP-FILENAME.
PARAMETERS: P_ERR LIKE RLGRAP-FILENAME.
SELECTION-SCREEN : END OF BLOCK B1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAM.
PERFORM SEARCH USING P_FNAM.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BAS.
PERFORM SEARCH USING P_BAS.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_SAL.
PERFORM SEARCH USING P_SAL.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_ERR.
PERFORM SEARCH USING P_ERR.
*& Form SEARCH
text
-->PFNAME text
FORM SEARCH USING PFNAME.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
STATIC = 'X'
CHANGING
FILE_NAME = PFNAME.
ENDFORM. "SEARCH
START-OF-SELECTION.
PERFORM UPLOAD_PROCESS USING P_FNAM.
PERFORM OPEN_GROUP.
PERFORM PROCESS.
PERFORM CLOSE_GROUP.
IF NOT T_BASIC[] IS INITIAL.
PERFORM DOWNLOAD TABLES T_BASIC[] USING P_BAS .
ENDIF.
IF NOT T_SALES[] IS INITIAL.
PERFORM DOWNLOAD TABLES T_SALES[] USING P_SAL .
ENDIF.
IF NOT T_ERROR[] IS INITIAL.
PERFORM DOWNLOAD TABLES T_ERROR[] USING P_ERR.
ENDIF.
*& Form PROCESS
text
FORM PROCESS.
LOOP AT T_UPLOAD INTO WA_UPLOAD.
PERFORM CONV_ROUTINE USING WA_UPLOAD-MATNR
CHANGING WA_UPLOAD-MATNR.
SELECT COUNT(*) FROM MARA WHERE MATNR = WA_UPLOAD-MATNR.
IF SY-SUBRC NE 0.
MOVE-CORRESPONDING WA_UPLOAD TO WA_BASIC.
APPEND WA_BASIC TO T_BASIC.
CLEAR WA_BASIC.
CONTINUE.
ENDIF.
SELECT COUNT(*) FROM MARC WHERE MATNR = WA_UPLOAD-MATNR
AND WERKS = WA_UPLOAD-WERKS
AND PSTAT LIKE '%V%'.
IF SY-SUBRC NE 0.
MOVE-CORRESPONDING WA_UPLOAD TO WA_SALES.
APPEND WA_SALES TO T_SALES.
CLEAR WA_SALES.
CONTINUE.
ENDIF.
CLEAR : WA_MTART.
SELECT SINGLE MATNR MTART FROM MARA INTO WA_MTART WHERE MATNR = WA_UPLOAD-MATNR.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0060'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=AUSW'.
PERFORM BDC_FIELD USING 'RMMG1-MATNR'
WA_UPLOAD-MATNR.
CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW' " Function module
EXPORTING
MATERIAL = WA_UPLOAD-MATNR " Material number
MATERIALART = WA_MTART-MTART " Material Type
SELECTION = 'V' "
TCODE = 'MM02' " Tcode where view's are called.
TABLES
BTCI_D0070 = IT_BDCDATA_VIEW
EXCEPTIONS
MATERIAL_NOT_FOUND = 1
MATERIAL_NUMBER_MISSING = 2
MATERIAL_TYPE_MISSING = 3
MATERIAL_TYPE_NOT_FOUND = 4
NO_ACTIVE_DYNPRO_SELECTED = 5
NO_AUTHORITY = 6
OTHERS = 7.
READ TABLE IT_BDCDATA_VIEW WITH KEY FVAL = 'X'.
IF SY-SUBRC = 0.
V_SELECTION = IT_BDCDATA_VIEW-FNAM.
ELSE.
CONTINUE.
ENDIF.
VAR = IT_BDCDATA_VIEW-FNAM+17(2).
VAR = VAR + 3.
CONCATENATE 'MSICHTAUSW-KZSEL(' '0' VAR ')' INTO VAR1.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0070'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(06)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
PERFORM BDC_FIELD USING VAR1
'X'.
CLEAR VAR.
CLEAR VAR1.
PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(06)'
'X'.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0080'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RMMG1-VKORG'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
PERFORM BDC_FIELD USING 'RMMG1-WERKS'
WA_UPLOAD-WERKS.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4004'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BU'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
'MTI_ESE_HALB_01'.
PERFORM BDC_FIELD USING 'MARC-STEUC'
WA_UPLOAD-STEUC.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MARC-HERKR'.
PERFORM BDC_FIELD USING 'MARC-HERKL'
'IN'.
PERFORM BDC_FIELD USING 'MARC-HERKR'
'MAH'.
PERFORM BDC_TRANSACTION USING 'MM02'.
move the error record into seperate internal table nad down load it ****
IF MESSTAB-MSGTYP = 'E'.
MOVE-CORRESPONDING WA_UPLOAD TO WA_ERROR.
APPEND WA_ERROR TO T_ERROR.
CLEAR WA_ERROR.
ENDIF.
ENDLOOP.
ENDFORM. "PROCESS
*& Form UPLOAD_PROCESS
text
-->PFNAME text
FORM UPLOAD_PROCESS USING PFNAME.
DATA : PFNAME1 TYPE STRING.
PFNAME1 = PFNAME.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = PFNAME1
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = T_UPLOAD[].
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. "UPLOAD_PROCESS
*& Form CONV_ROUTINE
text
-->P_INPUT text
-->P_OUTPUT text
FORM CONV_ROUTINE USING P_INPUT
CHANGING P_OUTPUT.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = P_INPUT
IMPORTING
OUTPUT = P_OUTPUT.
ENDFORM. "CONV_ROUTINE
*& Form DOWNLOAD
text
-->GI_FINAL text
-->PFNAME text
FORM DOWNLOAD TABLES
GI_FINAL
USING PFNAME .
DATA : FNAME TYPE STRING.
FNAME = PFNAME.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = FNAME
FILETYPE = 'DAT'
WRITE_FIELD_SEPARATOR = 'x'
HEADER = '00'
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = GI_FINAL[]
FIELDNAMES = GI_FIELDNAMES[]
IF SY-SUBRC = 0.
MESSAGE 'FILE DOWNLOADED SUCCESSFULLY' TYPE 'I'.
ENDIF.
ENDFORM. " DOWNLOAD
Regards
Siva Prasad -
MM02 Upload Problem in BDC in Quality
Hello Experts ,
Currently I have situation here with BDC for MM02 . In sandbox I have recoded for only Quality Management View (which is at the 10th position). For all material types this is working fine.
But , when in Quality Server , the position of the views are changing dynamically with each material type. Hence BDC fails to select only Quality View during Upload.
Can anybody tell me if there is a way to encounter this ?
Thanks ,
TrishnaHi!
use fm 'MATERIAL_BTCI_SELECTION_NEW' to get view positon
FORM GET_POSITION USING P_MATNR LIKE MARA-MATNR
CHANGING P_POSITION TYPE N.
DATA:
S_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW'
EXPORTING
MATERIAL = P_MATNR
SELECTION = 'D' <-- put here you view
TCODE = 'MM02'
* IMPORTING
* SELSTATUS =
* SELSTATUS_IN =
TABLES
BTCI_D0070 = S_BDCDATA
EXCEPTIONS
MATERIAL_NOT_FOUND = 1
MATERIAL_NUMBER_MISSING = 2
MATERIAL_TYPE_MISSING = 3
MATERIAL_TYPE_NOT_FOUND = 4
NO_ACTIVE_DYNPRO_SELECTED = 5
NO_AUTHORITY = 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.
*-> in der Annahme, dau043F der Dispobereich immer auf der Sicht
*-> 'Dispositon 1' zu finden ist.
READ TABLE S_BDCDATA WITH KEY FVAL = K_CHAR_X.
P_POSITION = SY-TABIX - 1.
ENDIF.
ENDFORM. " GET_POSITION
Search forum for MATERIAL_BTCI_SELECTION_NEW and you find more examples. -
Problem in BDC for selecting the QM View in MM02
Hi,
I am facing a problem that when the material is entered select view screen opens and the positioning of QM view is 11 or 13 sometimes. i want the processing should of QM should be irespective of position.
report ZBDC_MM02_QM_VIEW
no standard page heading line-size 255.
include bdcrecx1.
data: begin of record OCCURS 0,
MATNR_001(018),
WERKS_002(004),
ART_003(008),
APA_004(001),
AKTIV_005(001),
end of record.
PARAMETERS : P_FILNAM LIKE RLGRAP-FILENAME.
initialization.
CTUMODE = 'A'.
CUPDATE = 'A'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILNAM.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
MASK = ',.'
MODE = 'O'
IMPORTING
FILENAME = P_FILNAM
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.
start-of-selection.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_FILNAM
FILETYPE = 'DAT'
TABLES
DATA_TAB = RECORD
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT RECORD.
ON CHANGE OF RECORD-MATNR_001.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
record-MATNR_001.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(11)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(11)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-WERKS'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
record-WERKS_002.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=PB01'.
perform bdc_dynpro using 'SAPLQPLS' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RMQAM-ARGUMENT'.
perform bdc_field using 'BDC_OKCODE'
'=NEU'.
perform bdc_field using 'RMQAM-INSMK'
'X'.
perform bdc_field using 'RMQAM-QKZVERF'
'06'.
perform bdc_field using 'RMQAM-PPL'
'X'.
perform bdc_field using 'RMQAM-APP'
'X'.
perform bdc_field using 'RMQAM-DYN'
'X'.
perform bdc_field using 'RMQAM-MER'
'X'.
perform bdc_field using 'RMQAM-AVE'
'X'.
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)'
record-ART_003.
perform bdc_field using 'RMQAM-AKTIV(01)'
'X'.
perform bdc_transaction using 'MM02'.
ENDON.
ENDLOOP.Hi,
Use following code
CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW'
EXPORTING
MATERIAL = IT_UPLOAD-MATNR " Material number
MATERIALART = GI_MARA-MTART " Material Type
SELECTION = 'Q' " PSTAT(maintenance status) value for Quality Managemant.
TCODE = 'MM01' " Tcode where view's are called.
TABLES
BTCI_D0070 = IT_BDCDATA_VIEW
EXCEPTIONS
MATERIAL_NOT_FOUND = 1
MATERIAL_NUMBER_MISSING = 2
MATERIAL_TYPE_MISSING = 3
MATERIAL_TYPE_NOT_FOUND = 4
NO_ACTIVE_DYNPRO_SELECTED = 5
NO_AUTHORITY = 6
OTHERS = 7.
READ TABLE IT_BDCDATA_VIEW WITH KEY FVAL = 'X'.
IF SY-SUBRC = 0.
V_SELECTION = IT_BDCDATA_VIEW-FNAM.
VAR = IT_BDCDATA_VIEW-FNAM+17(2).
IF VAR > '17'.
VAR = VAR - 17.
IF VAR NE '2'.
CONCATENATE '0' VAR INTO VAR.
ENDIF.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=P+'.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0070'.
CONCATENATE 'MSICHTAUSW-DYTXT(' VAR ')' INTO VAR1.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
VAR1.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
CLEAR VAR1.
CONCATENATE 'MSICHTAUSW-KZSEL(' VAR ')' INTO VAR1.
PERFORM BDC_FIELD USING VAR1
'X'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
IF VAR < '17'.
CONCATENATE 'MSICHTAUSW-DYTXT(' VAR ')' INTO VAR1.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
VAR1.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
CLEAR VAR1.
CONCATENATE 'MSICHTAUSW-KZSEL(' VAR ')' INTO VAR1.
PERFORM BDC_FIELD USING VAR1
'X'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
Regards,
Pritish -
REgarding view selection in mm02 while using bdc
hi,
i m using function module 'MATERIAL_BTCI_SELECTION_NEW'' for selecting the single view automatically in bdc,its working fine..but for another scenario i have to select the multiple views so for this what sud i do i how cud i pass multiple views in single parameter 'selection'.
plz help me.
thnx in advance.We had to make a BDC recently for multiple views. For most of them we used BAPI_MATERIAL_SAVEDATA, but there are some views which are not available (Accounting 2 for example).
For others there are some other BAPIs, as BAPI_MATINSPCTRL_SAVEREPLICA for Quality Management, or BAPI_OBJCL_CHANGE fo Classification.
Anyway, for those views that need to be filled using BDC, the better way we have seen is to select at the beginning of BDC the Basic Data 1 view (which is always at the top of the list and is not dependent of the views that are available for a particular material) and then navigate between views with the following OK_CODEs:
Basic data 1 = SP01
Basic data 2 = SP02
External Objects = SP03
Classification = SP04
Sales: Sales Org. Data 1 = SP05
Sales: Sales Org. Data 2 = SP06
Sales: General/Plant Data = SP07
Foreign Trade: Export Data = SP08
Sales and Distribution Text = SP09
Purchasing = SP10
Foreign Trade: Import Data = SP11
Purchase order text = SP12
MRP 1 = SP13
MRP 2 = SP14
MRP 3 = SP15
MRP 4 = SP16
Forecast = SP17
Work scheduling = SP18
Production resources and tools = SP19
General Plant Data / Storage 1 = SP20
General Plant Data / Storage 2 = SP21
Warehouse Management 1 = SP22
Warehouse Management 2 = SP23
Quality Management = SP24
Accounting 1 = SP25
Accounting 2 = SP26
Cost Estimate 1 = SP27
Costing 2 = SP28
Plant stock = SP29
Storage location stock = SP30 -
REgarding view selection mm02 in bdc
hi,
i m usung function module 'MATERIAL_BTCI_SELECTION_NEW'' for selecting the single view automatically in bdc,its working fine..but for another scenario i have to select the multiple views so for this what sud i do i how cud i pass multiple views in single parameter 'selection'.
plz help me.
thnx in advance.
nullWe had to make a BDC recently for multiple views. For most of them we used BAPI_MATERIAL_SAVEDATA, but there are some views which are not available (Accounting 2 for example).
For others there are some other BAPIs, as BAPI_MATINSPCTRL_SAVEREPLICA for Quality Management, or BAPI_OBJCL_CHANGE fo Classification.
Anyway, for those views that need to be filled using BDC, the better way we have seen is to select at the beginning of BDC the Basic Data 1 view (which is always at the top of the list and is not dependent of the views that are available for a particular material) and then navigate between views with the following OK_CODEs:
Basic data 1 = SP01
Basic data 2 = SP02
External Objects = SP03
Classification = SP04
Sales: Sales Org. Data 1 = SP05
Sales: Sales Org. Data 2 = SP06
Sales: General/Plant Data = SP07
Foreign Trade: Export Data = SP08
Sales and Distribution Text = SP09
Purchasing = SP10
Foreign Trade: Import Data = SP11
Purchase order text = SP12
MRP 1 = SP13
MRP 2 = SP14
MRP 3 = SP15
MRP 4 = SP16
Forecast = SP17
Work scheduling = SP18
Production resources and tools = SP19
General Plant Data / Storage 1 = SP20
General Plant Data / Storage 2 = SP21
Warehouse Management 1 = SP22
Warehouse Management 2 = SP23
Quality Management = SP24
Accounting 1 = SP25
Accounting 2 = SP26
Cost Estimate 1 = SP27
Costing 2 = SP28
Plant stock = SP29
Storage location stock = SP30 -
How to handle views in material master while doing BDC
Hi,
I am doing BDC for three material types and the views are different for all the three types. Please anyone tell me how to handle the views for all these three material types.
Thanks in advance.Hi,
Refer following code which i have used for MRP 1-2-3-4 view selection
CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW'
EXPORTING
MATERIAL = IT_UPLOAD-MATNR " Material number
MATERIALART = GI_MARA-MTART " Material Type
SELECTION = 'D' " PSTAT(maintenance status) value for MRP.
TCODE = 'MM01' " Tcode where view's are called.
TABLES
BTCI_D0070 = IT_BDCDATA_VIEW
EXCEPTIONS
MATERIAL_NOT_FOUND = 1
MATERIAL_NUMBER_MISSING = 2
MATERIAL_TYPE_MISSING = 3
MATERIAL_TYPE_NOT_FOUND = 4
NO_ACTIVE_DYNPRO_SELECTED = 5
NO_AUTHORITY = 6
OTHERS = 7.
READ TABLE IT_BDCDATA_VIEW WITH KEY FVAL = 'X'.
IF SY-SUBRC = 0.
V_SELECTION = IT_BDCDATA_VIEW-FNAM.
VAR = IT_BDCDATA_VIEW-FNAM+17(2).
CONCATENATE 'MSICHTAUSW-KZSEL(' VAR ')' INTO VAR1."MRP1
PERFORM BDC_FIELD USING VAR1 "'MSICHTAUSW-KZSEL(12)'
'X'.
VAR = VAR + 1.
CONCATENATE 'MSICHTAUSW-KZSEL(' VAR ')' INTO VAR1."MRP1
PERFORM BDC_FIELD USING VAR1 "'MSICHTAUSW-KZSEL(13)'
'X'.
VAR = VAR + 1.
CONCATENATE 'MSICHTAUSW-KZSEL(' VAR ')' INTO VAR1."MRP1
PERFORM BDC_FIELD USING VAR1 "'MSICHTAUSW-KZSEL(14)'
'X'.
VAR = VAR + 1.
CONCATENATE 'MSICHTAUSW-KZSEL(' VAR ')' INTO VAR1."MRP1
PERFORM BDC_FIELD USING VAR1 "'MSICHTAUSW-KZSEL(15)'
'X'.
Regards,
Pritish -
Hi Experts,
I have to call a subscreen MRP1 of MM03 with corresponding value on click of a materials number in my interactive ALV report.
When we Open MM03 it askes for subscreen, if we select MRP1 it askes for Plant entry & then it opens the MRP1 subscreen, I need tht screen to be open on click of a material Number.
DO anyone have any idea regarding this?
Regards,
NikHi Eswar,
I used the CALL TRANSACTION & passed the paramenter matnr. But it is not skipping any screen. It shows th e1st screen of MM03 with the materials Number i am passing. Code is as below.
IF rs_selfield-fieldname = 'MATNR'.
SET PARAMETER ID 'MAT' FIELD gt_final-MATNR.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
It skipps the ALV screen only & give me the MM03 screen with the material Number.
I dont want MM03 screen I want the subscreen MRP1, which comes after selecting MRP1 & passing the plant in MM03 for a material.
I tried the BDC code you had given. as it was for MM03 only I did a BDC for MM03 by passing plant also.
I added the code in my report But it askes for me to pass OK code, means says to press enter when i am execution the report & clicking on the material. It opens MM03 with OK code pop up.
Code is as below:
IF rs_selfield-fieldname = 'MATNR'.
SET PARAMETER ID 'MAT' FIELD gt_final-MATNR.
GET PARAMETER ID 'MAT' FIELD p_matnr.
Perform BDC_CALL_MRP1.
FORM BDC_CALL_MRP1 .
*START-OF-SELECTION.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE' '=AUSW'.
PERFORM bdc_field USING 'RMMG1-MATNR' p_matnr.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(09)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ENTR'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(09)' 'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RMMG1-WERKS'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ENTR'.
PERFORM bdc_field USING 'RMMG1-WERKS' 'BP22'.
CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW'
EXPORTING
material = p_matnr
materialart = 'ROH'
selection = 'D' " --> MRP Data
tcode = 'MM03'
TABLES
btci_d0070 = bdcdata1
EXCEPTIONS
material_not_found = 1
material_number_missing = 2
material_type_missing = 3
material_type_not_found = 4
no_active_dynpro_selected = 5
no_authority = 6
OTHERS = 7.
APPEND LINES OF bdcdata1 TO bdcdata.
CALL TRANSACTION 'MM03' USING bdcdata MODE 'A'.
CLEAR p_matnr.
ENDFORM. " BDC_CALL_MRP1
start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "prepare_attachment
insert field *
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "prepare_attachment
Could you please tell me how to solve this problem. if i resolve this we can then call the MRP1 directly
Regards,
Nik -
hi gurus.......
What is he difference between using 'MATERIAL_BTCI_SELECTION_NEW' function module and 'SELECTION_VIEWS_FIND' in updating the material master (MM02)Hello Chakri,
go through the below thread entierly
Update of material master in SRM
Arshad -
Hi All,
Is there any Function Module to directly go to the accounting tab of MM03.
If not what is the other way of doing this.
Helpful Answers will be rewarded,
KushagraHi,
To select the views in M03 use FM MATERIAL_BTCI_SELECTION_NEW.
CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW'
EXPORTING
material = wa_mara-matnr "Material to which char.values are attached
materialart = wa_mara-mtart "Material type
selection = ' ' "Indicator for Accounting view Pass proper value
tcode = 'MM03' "Transaction code
TABLES
btci_d0070 = it_bdcdata1 "Internal table from which position of
EXCEPTIONS
material_not_found = 1
material_number_missing = 2
material_type_missing = 3
material_type_not_found = 4
no_active_dynpro_selected = 5
no_authority = 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.
Maybe you are looking for
-
How can i move pictures from the phone to the pc?
How do I move pictures from my cell phone to my PC?
-
My ISP is one big huge failure, however, because it is the only game in town, we have no choice but to subscribe to their overly-expensive poor service. Well, that is no more. I recently bought a WiMax USB dongle, and it works on my iMac without any
-
Belkin support is now useless ( WPSM54G question)
I talked with one of the live chat people and they couldn't even link me to the latest firmware for this thing. "Not supported...buzz off" was pretty much what I was told to do. I have this thing working with Windows 8.1 using the manual method (LPR1
-
Error in inbound q in CRM System
Hello, The data sent from R/3 system to BBP CRM 4.0 has errors for the q R3AD_DNL_COND_A512. ie we are having errors for the conditions table and also for R3AI_CUSTOMER_MAIN q in inbound q of CRM system. R/3 is 4.6c. Error in R3AD_DNL_COND_A512 : Sta
-
Can't modify the advanced Java setting
I can't modify the advanced Java setting in Windows Vista if the UAC is on. If I disable the UAC the setting can be modified but when I turn the UAC on again return the old setting. This is a big problem because the jre in IE7 results deactivate and