MM02 BDC
Hi ,
can anyone pls give a program for MM02 BDC and in that only selecting forecast screen and given forecast values.
THX
Hi
Go through the link given below for the program of MM02.
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/sample%2bbdc%2bprogram%2bfor%2bmm02
With Regards
Nikunj Shah
Similar Messages
-
Selection view in MM02 BDC program
Hi Experts,
I am doing BDC Session method for Tcode MM02.There i am getting selection View screen for different material.But if i select a material in Sales view i need to select Sales :Sales org dAta.
It's coming third position.
But for some material it's coming fourth view.
If i record bdc in third position it'll take third view some other. how i can select the view in selection view.
Please,Anybody knows give me the suggestion.
Thanks & Regards,
NandhaHi,
use this Function module <b>SELECTION_VIEWS_FIND</b> to find the view position.
This One of functional modules for those who still has to use BDC for Material Master transactions (MM01 and MM02). Allows to determine line number for desired view in the "Select View(s)" window, to prepare BDC for the view access
Find the positon of the View based on this function module and write the code to select that perticular view.
Hope this solves your problem
Thanks
Sudheer -
Message-ABAP/4 processor: DYNPRO_SEND_IN_BACKGROUND in BDC
Hi all,
BDC is written for MM02 and when execcuted from z report the inspection data bdc (mm02) BDC is getting executed successfully.
Later a badi is written to block mm02 from command prompt but allow from called programs(call transaction) in BADI
MATN1_OUTPUT_001 implmentation of BADI-MATN1.
DATA: it_zemail_mdm TYPE STANDARD TABLE OF zemail_mdm,
wa_zemail_mdm TYPE zemail_mdm.
DATA: v_x1,v_c,v_x.
IF sy-tcode = 'MM06' OR sy-tcode = 'MM02' OR sy-tcode = 'MM01'
OR sy-tcode = 'MMAM' OR sy-tcode = 'CL20N' OR sy-tcode = 'C223'
OR sy-tcode = 'MM17'.
CONSTANTS : c_msg1(45) TYPE c VALUE 'You are not authorised for this transaction.'.
DATA: c_err TYPE c VALUE 'S'.
IF ( ( sy-uname NE 'MDCC' ) AND ( sy-uname NE 'MDT_01' ) AND ( sy-uname NE '150891' ) AND ( sy-uname NE 'DESIGN' ) ).
IF syst-calld = ''.
MESSAGE c_msg1 TYPE c_err.
LEAVE TO SCREEN 0.
ENDIF.
ENDIF.
ENDIF.
But now when i execute BDC i get following message-
Message-ABAP/4 processor: DYNPRO_SEND_IN_BACKGROUND
Th message is success meassage but data is not getting created in database now.
Please guide to resolve the issue.
Thnaks.
Edited by: sanjivrd on Dec 12, 2009 12:36 PMHi sanjivrd,
in Batch-Input, just leave the BADI, put this at begin of BADI methold:
IF SY-BINPT IS NOT IITIAL.
RETURN.
ENDIF.
Regards,
Clemens -
hi gurus
I am narayan having 3 years of functional experience in SAP SD module.
Now i am interesting to learn ABAP Concepts of BDC, ALE.
so if any one please send me meterial of these concepts.
my mail id is : <REMOVED BY MODERATOR>
Thanks
narayan
Edited by: Alvaro Tejada Galindo on Mar 10, 2008 3:44 PMALE (Application Linking and Enabling )
ALE is technology for SAP mainly use to transfer data between SAP systems.
A means of creating and operating distributed applications.
Application Link Enabling (ALE) guarantees a distributed, but integrated, R/3 installation. This involves business-controlled message exchange using consistent data across loosely linked SAP applications.
Applications are integrated using synchronous and asynchronous communication - not by using a central database.
ALE consists of the following layers:
Application services
Distribution services
Communication services
Refer
http://www.dataxstream.com/doclib/ALESuccessfullyLeverageIDocs.pdf
http://www.erpgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
ALE Configuration 1
1 ALE Introduction Transaction SALE
2 The 3 ALE methods
2.1 Push
2.1.1 First create logical system (In SPRO / SALE)
2.1.2 Assign Client to Logical System (In SPRO)
2.1.3 Create RFC Destination SM59
2.1.4 Create Distribution Model BD64
2.1.5 Send Material BD10 9
2.1.6 Check IDOC sent WE02
2.2 Pull
2.2.1 Create Model View BD64
2.2.2 Login to 810
2.2.3 Get Material BD11
2.2.4 Check IDOCs WE02
2.2.5 Check Material MM02
2.3 Change Pointer
2.3.1 Activate change pointers for message type BD50
2.3.2 Activate Change Pointers BD61
2.3.3 Execute RBDMIdoc SE38
2.3.4 Check IDOCs WE02
2.3.5 Check Material MM02
BDC
The batch input program must build all of the input to execute the SAP transaction.
Two main steps are required:
To build an internal table containing every screen and every field to be filled in during the execution of an SAP transaction.
To pass the table to SAP for processing.
Prerequisite for Data Transfer Program
Writing a Data Transfer Program involves following prerequisites:
Analyzing data from local file
Analyzing transaction
Analyzing transaction involves following steps:
The transaction code, if you do not already know it.
Which fields require input i.e., mandatory.
Which fields can you allow to default to standard values.
The names, types, and lengths of the fields that are used by a transaction.
Screen number and Name of module pool program behind a particular transaction.
To analyze a transaction::
Start the transaction by menu or by entering the transaction code in the command box.
(You can determine the transaction name by choosing System Status.)
Step through the transaction, entering the data will be required for processing your batch input data.
On each screen, note the program name and screen (dynpro) number.
(dynpro = dyn + pro. Dyn = screen, pro = number)
Display these by choosing System Status. The relevant fields are Program (dynpro) and Dynpro number. If pop-up windows occur during execution, you can get the program name and screen number by pressing F1 on any field or button on the screen.
The technical info pop-up shows not only the field information but also the program and screen.
For each field, check box, and radio button on each screen, press F1 (help) and then choose Technical Info.
Note the following information:
The field name for batch input, which youll find in its own box.
The length and data type of the field. You can display this information by double clicking on the Data Element field.
Find out the identification code for each function (button or menu) that you must execute to process the batch-input data (or to go to new screen).
Place the cursor on the button or menu entry while holding down the left mouse button. Then press F1.
In the pop-up window that follows, choose Technical info and note the code that is shown in the Function field.
You can also run any function that is assigned to a function key by way of the function key number. To display the list of available function keys, click on the right mouse button. Note the key number that is assigned to the functions you want to run.
Once you have program name, screen number, field name (screen field name), you can start writing.
DATA TRANSFER program.
Check out the link below: You will get all the info. to start with BDC
http://help.sap.com/saphelp_erp2005/helpdata/en/fa/097119543b11d1898e0000e8322d00/frameset.htm
http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
http://www.sap-img.com/abap/learning-bdc-programming.htm
http://www.sap-img.com/bdc.htm
www.sappoint.com/abap/bdcconcept.pdf
http://www.sap-img.com/abap/learning-bdc-programming.htm
http://www.sapdevelopment.co.uk/bdc/bdchome.htm
http://www.planetsap.com/bdc_main_page.htm
Also chk this link
bdc -
Hi All...
The work scheduling view was created due to the BDC program. This view is not required. Can anyone suggest how to delete this particular view keeping the rest as-it-is.
FYI.. the maintainence status of the screen is A.
Thanks in advance...
SriBhi
i think u want to delete the views from bdc program
check this link and take help of abaper
http://help-abap.blogspot.com/2008/09/mm02-bdc-select-specific-material.html
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d62292b3-0301-0010-df98-aaac31cd4a41
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d62292b3-0301-0010-df98-aaac31cd4a41
regards
kunal -
BDC- To add ABC indicator in MM02-- MRP1
Hi,
I am working on BDC- To add ABC indicator in MM02--> MRP1.
Problem -->
In some material+ plant - Reorder point is there. In this case I need to take additional 'BDC_okcode' for ENTER.
HOW CAN I DO THIS?
I tried it with 'Select statement' between the Perform statement, but it's not working?
IF wa_file-matnr IS NOT INITIAL.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-MATNR'
wa_file-matnr.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(11)'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(11)'
'X'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-WERKS'.
PERFORM bdc_field USING 'RMMG1-WERKS'
wa_file-werks.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_field USING 'MARC-MAABC'
wa_file-maabc.
SELECT SINGLE minbe INTO v_minbe FROM marc
WHERE matnr = wa_file-matnr
AND werks = wa_file-werks.
IF v_minbe GT 0.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ENDIF.
ENDIF.
CALL TRANSACTION 'MM02' USING it_bdcdata MODE p_mode MESSAGES INTO it_msg.Hi,
Try to use Bapi and see ..Please find the sample code.
LOOP AT t_itab INTO wa_itab.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = wa_itab-matnr
IMPORTING
output = wa_headdata-material
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.
prepare the follwing structres ( plantdata,headdata, plantdatax) .
* Select the MRP view
wa_headdata-mrp_view = 'X'.
* Call the Bapi to create the MRP view.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = wa_headdata
plantdata = wa_plantdata
plantdatax = wa_plantdatax
TABLES
returnmessages = t_return.
ENDLOOP
Regards,
Nagaraj -
Hello everyone!
I have developed a BDC program to batch input data into MM02 / MRP area.
It's working perfectly fine when I use mode 'A' in CALL TRANSACTION statement, but when I change it to 'N', so I can give this for the customer to test, it stops working, giving me an error in one of the screens, saying the "MRP area is not assigned to plant CH01" (when running with mode "E" it also gives me the error).
Here's my coding:
REPORT zload_mrp_areas.
Data and variables definition
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF t_header OCCURS 0,
link LIKE mara-matnr,
matnr LIKE mara-matnr,
werks LIKE marc-werks,
mstae(2) TYPE c,
perkz(2) TYPE c,
END OF t_header.
DATA: BEGIN OF t_details OCCURS 0,
muvbr(5) TYPE c,
unvbr(5) TYPE c,
matnr LIKE mara-matnr,
priod(6) TYPE c,
gsvbr(5) TYPE c,
END OF t_details.
DATA: v_count(3) TYPE n,
v_week LIKE scal-week,
v_week1(6) TYPE n,
v_week2(6) TYPE n,
v_page(5) TYPE p DECIMALS 2,
v_index(3) TYPE n,
v_field(19) TYPE c,
v_mode TYPE c,
v_date1 LIKE sy-datum,
v_date2 LIKE sy-datum,
v_date3 TYPE i.
Screen definition
SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-001.
PARAMETERS: headfile LIKE rfpdo1-febauszf OBLIGATORY,
detsfile LIKE rfpdo1-febauszf OBLIGATORY.
SELECTION-SCREEN END OF BLOCK 1.
File selection
AT SELECTION-SCREEN ON VALUE-REQUEST FOR headfile.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
mask = ',Multicash,*.txt'
static = 'X'
CHANGING
file_name = headfile.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR detsfile.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
mask = ',Multicash,*.txt'
static = 'X'
CHANGING
file_name = detsfile.
START-OF-SELECTION *
START-OF-SELECTION.
Load files
PERFORM load_files.
PERFORM process_file.
*& Form LOAD_FILES
Load files from network to SAP
FORM load_files .
File upload
DATA: l_filename TYPE string.
l_filename = headfile.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_filename
filetype = 'ASC'
TABLES
data_tab = t_header.
IF sy-subrc <> 0.
ENDIF.
l_filename = detsfile.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_filename
filetype = 'ASC'
TABLES
data_tab = t_details.
IF sy-subrc <> 0.
ENDIF.
ENDFORM. " LOAD_FILES
*& Form process_file
Load files into Material Master
FORM process_file .
LOOP AT t_header.
REFRESH bdcdata.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'RMMG1-MATNR' t_header-matnr.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SELA'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ENTR'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'RMMG1-WERKS' t_header-werks.
PERFORM bdc_field USING 'BDC_OKCODE' '=ENTR'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SP12'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE' '=PB42'.
PERFORM bdc_dynpro USING 'SAPLMD_MGD1' '0010'.
PERFORM bdc_field USING 'SMDMA-BERID(01)' 'X'.
PERFORM bdc_field USING 'BDC_OKCODE' '=AEND'.
PERFORM bdc_dynpro USING 'SAPLMD_MGD1' '0020'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SP04'.
CLEAR v_week.
CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'
EXPORTING
date = sy-datum
IMPORTING
week = v_week.
CALL FUNCTION 'WEEK_GET_FIRST_DAY'
EXPORTING
week = v_week
IMPORTING
date = v_date1.
LOOP AT t_details WHERE matnr = t_header-matnr.
CLEAR: v_week1, v_week2.
v_week1 = v_week.
v_week = t_details-priod.
CALL FUNCTION 'WEEK_GET_FIRST_DAY'
EXPORTING
week = v_week
IMPORTING
date = v_date2.
v_date3 = v_date1 - v_date2.
v_page = v_date3 / 7.
IF v_page > 11.
v_index = v_page MOD 11.
v_page = v_page / 11.
COMPUTE v_count = TRUNC( v_page ).
ELSE.
v_index = v_page.
ENDIF.
IF v_index IS INITIAL.
v_index = 11.
v_count = v_count - 1.
ELSE.
v_index = v_index + 1.
ENDIF.
Paging
IF v_count NE 0.
v_count = v_count + 1.
DO v_count TIMES.
PERFORM bdc_dynpro USING 'SAPLMD_MGD1' '0020'.
PERFORM bdc_field USING 'BDC_OKCODE' '=P-'.
ENDDO.
PERFORM bdc_dynpro USING 'SAPLMD_MGD1' '0020'.
PERFORM bdc_field USING 'BDC_OKCODE' '=P++'.
v_count = v_count - 1.
DO v_count TIMES.
PERFORM bdc_dynpro USING 'SAPLMD_MGD1' '0020'.
PERFORM bdc_field USING 'BDC_OKCODE' '=P-'.
ENDDO.
ENDIF.
PERFORM bdc_dynpro USING 'SAPLMD_MGD1' '0020'.
v_field = 'RM03M_DB-KOVBW(*)'.
REPLACE '*' WITH v_index INTO v_field.
PERFORM bdc_field USING v_field t_details-muvbr.
v_field = 'RM03M_DB-VBWRT(*)'.
REPLACE '*' WITH v_index INTO v_field.
PERFORM bdc_field USING v_field t_details-unvbr.
PERFORM bdc_dynpro USING 'SAPLMD_MGD1' '0020'.
PERFORM bdc_field USING 'BDC_OKCODE' '=WEIT'.
PERFORM bdc_dynpro USING 'SAPLMD_MGD1' '0020'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_dynpro USING 'SAPLMD_MGD1' '0020'.
PERFORM bdc_field USING 'BDC_OKCODE' '=P++'.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPLMD_MGD1' '0020'.
PERFORM bdc_field USING 'BDC_OKCODE' '=UEBE'.
PERFORM bdc_dynpro USING 'SAPLMD_MGD1' '0010'.
PERFORM bdc_field USING 'BDC_OKCODE' '=UEBE'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE' '=BU'.
DATA: ITAB TYPE TABLE OF BDCMSGCOLL.
v_mode = 'N'.
CALL TRANSACTION 'MM02' USING bdcdata
MODE v_mode
UPDATE 'S'
MESSAGES INTO ITAB.
if sy-subrc is initial.
endif.
ENDLOOP.
ENDFORM. " process_file
*& Form BDC_DYNPRO
text
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
*& Form BDC_FIELD
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "BDC_FIELD
Can anyone help? Please!
Thanks and regards,
FernandaYou are trying to access one of the MRP area which is not yet assigned to CH01 plant. You need to make sure wheather the MRP view was already created for that material for CH01 plant.
So, first check your data against the MARC for material and plant. If you don't fine any material for that plant than don't run BDC for that plant.
Regards,
Naimesh Patel -
BDC - MM02 _long text for material PO upload
Hi experts,
I want to upload Long text for material PO in MM02 (Purchase order text view)
throuh BDC upload. I have successfully done recording for this transaction. But in the recording it show no table field for that particular long text.
Pls help me to do this issue.
Thanks.Hi
See the sample program for this and modify as per your requirement.
REPORT zmm_longtext
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab1 OCCURS 0,
matnr LIKE mara-matnr, " Material
text1 LIKE tline-tdline, " Long Text
END OF itab1.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr, " Material
text LIKE tline-tdline, " Long Text
END OF itab.
To create Long Text lines for CREATE_TEXT function module
DATA:BEGIN OF dt_lines OCCURS 0.
INCLUDE STRUCTURE tline. " Long Text
DATA:END OF dt_lines.
Variable declarations for CREATE_TEXT function module
DATA : dl_name TYPE thead-tdname, " Object Name
dl_lan TYPE thead-tdspras, " Language
gv_matnr TYPE matnr.
Constants
CONSTANTS:
Object ID for Long Text of Material Basic Data 1
c_best TYPE thead-tdid VALUE 'GRUN',
c_material TYPE thead-tdobject VALUE 'MATERIAL'. " Object
Parameters
PARAMETERS p_file LIKE rlgrap-filename.
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start Of Selection
START-OF-SELECTION.
*To Upload Flat file
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = itab1
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
SORT itab1 BY matnr.
LOOP AT itab1.
CLEAR gv_matnr.
SELECT SINGLE matnr INTO gv_matnr
FROM mara WHERE bismt = itab1-matnr.
IF itab1-text1 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text1.
APPEND itab.
ENDIF.
CLEAR itab.
ENDLOOP.
DELETE itab WHERE matnr EQ ' '.
Upload the Texts
SORT itab BY matnr.
LOOP AT itab.
dt_lines-tdformat = 'ST'.
dt_lines-tdline = itab-text.
APPEND dt_lines.
dl_lan = sy-langu.
dl_name = itab-matnr.
Call the Function Module to Create Text
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = c_best
flanguage = dl_lan
fname = dl_name
fobject = c_material
save_direct = 'X'
fformat = '*'
TABLES
flines = dt_lines
EXCEPTIONS
no_init = 1
no_save = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/ 'Long Text Creation failed for Material'(001),
itab-matnr.
ELSE.
WRITE:/ 'Long Text Created Successfully for Material'(002),
itab-matnr.
ENDIF.
AT END OF matnr.
REFRESH dt_lines.
ENDAT.
ENDLOOP.
<b>Reward points for useful Answers</b>
Regards
Anji -
BDC for Purchase order text updation in MM02 Transaction
Hi ALL,
I am updating purchase order text of a material in MM02 using BDC program.
I have done recording, and the program is updating text if the text field already contains some value. but,
when the field is empty and if the program tries to feed new data then it is not working.
Please help me!
regds,
RajanHi
material master purchase order long text
you can use through BDC or LSMW it is possible,
here we need to check in lsmw Direct input mentod Program name "/SAPDMC/SAP_LSMW_IMPORT_TEXTS" object name (0001) method(0001) program type (D).
Header we have --- MATNR and TEXT ID
Item ---LINE(Text line).
in header- for NAME and ID map the source fields MATNR and TEXID respectively.
OBJECT and SPRAS pass the constants.
in Item--for TEXTFORMAT pass the constant '*' and for the TEXTLINE map the input field LINE of the ITEM structure.
or else u can check in SE37 'CREATE_TEXT' , in that function module check it object Id , name , spras, lineitem, language "E"
here i mention example of text flat file,
H 100-100 best
longtext1 -
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. -
How to find the position of view in MM02 transaction for coding BDC?
Hi Guys,
Is there any FM or BAPI Available to find the position of the view in MM02 transaction. I tried FM SELECTION_VIEWS_FIND. But getting inconsistent results
i.e Some materials it is giving correct positions but for others i am getting wrong position. So my BDC is getting failed.
Thanks in advance.
Vinod.Hi,
data : i_t133a like t133a occurs 0 with header line,
ch(1),
viewno(2) type n.
clear viewno.
select * from t133a into corresponding fields of table i_t133a
where bilds = '21' and guifu like 'SP%' .
loop at i_t133a .
ch = i_t133a-pstat.
if mara-vpsta na ch .
delete i_t133a .
continue .
endif .
endloop.
sort i_t133a by guifu ascending .
loop at i_t133a .
viewno = viewno + 1 .
if i_t133a-guifu = 'SP01'. "FOR BASIC DATA1 CHANGES ACCORDINGLY REFER TABLE T133A TO FIND VTHE VALUE
exit .
endif .
endloop .
reward if usefull -
BDC with MM01/ MM02 from MARA table
Can anybody suggest me for the following problem.
I want to construct a BDC with MM01/ MM02 from MARA table.
And I want the source file to be a notepad or Excel sheet. But i am not
getting, that how to write the data in Notepad/Excel sheet, to feed to the
master table according to the MM01/MM02 fields .This is the sample code for creation of flatfile for MM01 this will be definetly helping you to create a flatfile.
REPORT ZBDC_FF MESSAGE-ID BCTRAIN .
TYPES: BEGIN OF STU,
MATNR LIKE RMMG1-MATNR,
MBRSH LIKE RMMG1-MBRSH,
MTART LIKE RMMG1-MTART,
MAKTX LIKE MAKT-MAKTX,
MEINS LIKE MARA-MEINS,
END OF STU.
DATA WA_ITAB TYPE STU.
DATA ITAB TYPE TABLE OF STU.
WA_ITAB-MATNR = 'T1'. "MATERIAL NUMBER"
WA_ITAB-MBRSH = 'K'. "INDUSTRY SECTOR"
WA_ITAB-MTART = 'VKHM'. "MATERIAL TYPE"
WA_ITAB-MAKTX = 'TOOLEMATERIAL'. "MATERIAL DESCRIPTION"
WA_ITAB-MEINS = 'EE'. "BASE UNIT OF MEASURE"
APPEND WA_ITAB TO ITAB.
CLEAR WA_ITAB.
*WA_ITAB-MATNR = 'TOL2'. "MATERIAL NUMBER"
*WA_ITAB-MBRSH = 'M'. "INDUSTRY SECTOR"
*WA_ITAB-MTART = 'VKHM'. "MATERIAL TYPE"
*WA_ITAB-MAKTX = 'TOOLEMATERIAL'. "MATERIAL DESCRIPTION"
*WA_ITAB-MEINS = 'EA'. "BASE UNIT OF MEASURE"
*APPEND WA_ITAB TO ITAB.
*CLEAR WA_ITAB.
*WA_ITAB-MATNR = 'TOL3'. "MATERIAL NUMBER"
*WA_ITAB-MBRSH = 'M'. "INDUSTRY SECTOR"
*WA_ITAB-MTART = 'VKHM'. "MATERIAL TYPE"
*WA_ITAB-MAKTX = 'TOOLEMATERIAL'. "MATERIAL DESCRIPTION"
*WA_ITAB-MEINS = 'EA'. "BASE UNIT OF MEASURE"
*APPEND WA_ITAB TO ITAB.
*CLEAR WA_ITAB.
*WA_ITAB-MATNR = 'TOL4'. "MATERIAL NUMBER"
*WA_ITAB-MBRSH = 'M'. "INDUSTRY SECTOR"
*WA_ITAB-MTART = 'VKHM'. "MATERIAL TYPE"
*WA_ITAB-MAKTX = 'TOOLEMATERIAL'. "MATERIAL DESCRIPTION"
*WA_ITAB-MEINS = 'EA'. "BASE UNIT OF MEASURE"
*APPEND WA_ITAB TO ITAB.
*CLEAR WA_ITAB.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:\Documents and Settings\chiranjeevi\Desktop\BDC.TXT'
TABLES
DATA_TAB = ITAB
IF SY-SUBRC <> 0.
MESSAGE S999 WITH 'EXECUTED'.
ENDIF.
Cheers!!! -
How to upload material text in mm02 using bdc table control
i have problem to upload material Description in mm02 using bdc.
my text file is like
2000251 AF A12345
2000251 AR B12345
2000251 BG C12345
2000252 AF F12345
2000252 AR G12345
2000252 AF H12345
i want to upload material number, language, and material description, how can i upload pls help me.Hi,
Try with bapi , bapi_material_save_data.. didn't exactly remember it,Please check the same.
Regards,
Nagaraj -
How to do BDC in mm02 ? as different materials have different view.
hi,
refer to the threads.
mm01/mm02 different views, bdc
BDC on MM02 with user view
regards,
srelakshmi -
Hi,
I am working on a BDC for the tcode MM02 in which i have to insert the Inspection Type in the Quality Managment View of materials. i had executed the code which was working fine,but when i executed it ,it remains on the same screen where the after specifying on the file path. I dont know why it is happening ,plzz provide me guidelines for solving this problem.report ZMM02 no standard page heading line-size 255.
include bdcrecx1.
DATA: BEGIN OF ZVBM OCCURS 0,
MATNR(18) TYPE C,
BRGEW(16) TYPE C,
NTGEW(16) TYPE C,
END OF ZVBM.
start-of-selection.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'c:\vijay.txt'
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = ZVBM
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
perform open_group.
LOOP AT ZVBM.
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'
zvbm-matnr.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'MAKT-MAKTX'
'VIJAY3'.
perform bdc_field using 'MARA-MEINS'
'KG'.
perform bdc_field using 'MARA-MATKL'
'01'.
perform bdc_field using 'MARA-SPART'
'01'.
perform bdc_field using 'BDC_CURSOR'
'MARA-NTGEW'.
perform bdc_field using 'MARA-BRGEW'
zvbm-brgew.
perform bdc_field using 'MARA-GEWEI'
'KG'.
perform bdc_field using 'MARA-NTGEW'
zvbm-ntgew.
perform bdc_transaction using 'MM02'.
ENDLOOP.
perform close_group.
Maybe you are looking for
-
Different Apple IDs for iTunes and iCloud
As a legacy from MobileMe, I have one Apple ID for iTunes (around 10 years old) that has all of my purchases, and another for iCloud (created later as a requirement of MobileMe) that has all the email, syncing, etc. Apparently now I can't use Famil
-
Document could not be saved error while using BAPI_BUSPROCESSND_SAVE
Hi All, I am using BAPI_BUSPROCESSND_CHANGEMULTI and BAPI_BUSPROCESSND_SAVE to change the status of the CRM Service Order. The BAPI_BUSPROCESSND_CHANGEMULTI is working fine without any errors, in return table(zero entries), so after this I call the B
-
Security in ADF Jdeveloper 11.1.2.1.0
Hi community, I've been tasked with the mission to develop a good practices manual for developing SECURE applications in JDev. I decided to come to the forums first to ask for whatever resource you have on the matter, if there's anything already writ
-
Unable to sort songs on iPad or iPod in iTunes
I used to be able to sort songs on my iPod using the column browser in iTunes; I recently got an iPad and noticed that the column browser option was greyed out. I puzzled over this for a bit but didn't mind since I don't listen to music from the iPad
-
Aperture Brushes - mouse/pointer is jumping/skipping/delayed
I'm having an issue using the brushes in aperture 3. The mouse slows down and speeds up rapidly while I'm trying to brush. An example - I add the black and white adjustment, and then start to brush black & white away, leaving one area in color. The f