‎2007 Oct 26 3:03 PM
Hi,
I am trying to upload the ie02 master table , warranty field from a db table.
but it is showing me an error that the material num is incorrect even though i am testing with a num from the same system. so pls let me know if i am wrong anywhere.
FORM UPLOAD_MASTER.
data: t_date(10),
p_mode(1).
data: bdc_msg(80).
data: lfdat like zequi-lfdat,
equnr like zequi-equnr.
refresh: messtab,bdctab.
p_mode = 'A'.
clear t_date.
clear itab.
loop at itab.
write itab-activ_date to t_date.
perform dynpro using:
'X' 'SAPMIEQ0' '0100',
' ' 'RM63E-EQUNR' itab-EQUNR,
' ' 'BDC_OKCODE' '/00',
'X' 'SAPMIEQ0' '0101',
' ' 'BDC_OKCODE' '=T\05', "warranty info tab
update customer warranty
'X' 'SAPMIEQ0' '0101',
' ' 'WCHECK_V_H-GWLDT_O' t_date,
' ' 'BDC_OKCODE' '=BU'.
call transaction 'IE02' using bdctab
mode p_mode
update 'S'.
messages into messtab.
endloop.
ENDFORM. " UPLOAD_MASTER
&----
*& Form DYNPRO
&----
text
----
-->P_0867 text
-->P_0868 text
-->P_0869 text
----
*FORM DYNPRO USING VALUE(P_0867)
VALUE(P_0868)
VALUE(P_0869).
form dynpro using dynbegin name value.
if dynbegin eq 'X'.
clear bdctab.
move : name to bdctab-program,
value to bdctab-dynpro,
'X' to bdctab-dynbegin.
append bdctab.
else.
clear bdctab.
move : name to bdctab-fnam,
value to bdctab-fval.
append bdctab.
endif.
ENDFORM. " DYNPRO
‎2007 Oct 26 3:12 PM
You will have to run the equipment number through FM CONVERSION_EXIT_ALPHA_INPUT
Rob
‎2007 Oct 26 3:12 PM
You will have to run the equipment number through FM CONVERSION_EXIT_ALPHA_INPUT
Rob
‎2007 Oct 26 3:38 PM
HI Rob,
i have already used it and converted the format.
Could u tell me the okcode for SAVE pls!
‎2007 Oct 26 3:44 PM
Try 'BU'.
Just put your cursor over the "Save" command on the menu and press F1 to find any OK code.
Rob
Message was edited by:
Rob Burbank
‎2007 Oct 26 3:54 PM
Rob,
I am debugging it and it is updating only the first field in the db table to the master .
so cud u pls help me how all the records can be updated? i did the loop as u can c in the code above.
‎2007 Oct 26 3:59 PM
Are you saying your original problem is solved (incorrect equipment number)?
Rob
‎2007 Oct 26 4:08 PM
YES Rob,
Equipment num is fine. With the BDC i have, i am not able to uload the db field into the master table. pls help!
‎2007 Oct 26 4:12 PM
Then you should close this thread and open a new one with the next problem. this makes it easier for people to search the forum looking for answers to specific problems.
Rob
‎2007 Oct 26 4:16 PM
Rob, the topic was updating the master table. So could u pls help me out in the complete process till i am successful in updating the master table.
If you can let me know how to upload it with the BDC i have specified and can tell me if i have done any mistakes in that, it wud be great!
‎2007 Oct 26 3:12 PM
Hi
see the sample code for IE01 and change it for IE02 with the required fields and do
REPORT zpm_equipment_master_upload
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Standard Include for Selection Screen
INCLUDE bdcrecx1.
Internal Table for Upload Data
DATA: BEGIN OF i_equip OCCURS 0,
Initial Screen
equnr(018), " Equipment Number
datsl(010), " Valid From
eqtyp(001), " Equipment Category
General Data
shtxt(040), " Description
eqart(010), " Object Type
brgew(017), " Weight
gewei(003), " Weight Unit
groes(018), " Size & Dimension
invnr(025), " Inventory No
inbdt(010), " Start up Date
answt(017), " Acquisition Value
waers(005), " Currency
ansdt(010), " Acquis.Date
herst(030), " Manufacturer
herld(003), " Manufact.Country
typbz(020), " Model Number
baujj(004), " Constr.Year
baumm(002), " Construct.Month
mapar(030), " Manufact.Part No
serge(030), " Manufact.Serial No
Location Data
swerk(004), " Maintenance Plant
msgrp(008), " Room
beber(003), " Plant Section
abckz(001), " ABC Indicator
eqfnr(030), " Sort Field
Organization Data
bukrs(004), " Company Code
kostl(010), " Cost Center
iwerk(004), " Planning Plant
ingrp(003), " Planner Group
gewrk(008), " Main Work Center
wergw(004), " Plant(Work Center)
rbnr(009), " Catalog Profile
Structure
tidnr(025), " Technical Indent No
Others
gwldt(010), " Vendor Guarranty Begin Date
gwlen(010), " Vendor Guarranty End Date
Class Overview
klart(003), " Class Type
class(018), " Class
END OF i_equip.
Data Variables & Constants
CONSTANTS : c_x VALUE 'X'. " Flag
Parameters
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start of Selection
START-OF-SELECTION.
Open the BDC Session
PERFORM open_group.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_equip
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Upload the Data from Internal Table
LOOP AT i_equip.
PERFORM bdc_dynpro USING 'SAPMIEQ0' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM63E-EQUNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RM63E-EQUNR'
i_equip-equnr.
PERFORM bdc_field USING 'RM63E-DATSL'
i_equip-datsl.
PERFORM bdc_field USING 'RM63E-EQTYP'
i_equip-eqtyp.
General Data
PERFORM bdc_dynpro USING 'SAPMIEQ0' '0101'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=T\02'.
PERFORM bdc_field USING 'ITOB-SHTXT'
i_equip-shtxt.
PERFORM bdc_field USING 'ITOB-EQART'
i_equip-eqart.
PERFORM bdc_field USING 'ITOB-BRGEW'
i_equip-brgew.
PERFORM bdc_field USING 'ITOB-GEWEI'
i_equip-gewei.
PERFORM bdc_field USING 'ITOB-GROES'
i_equip-groes.
PERFORM bdc_field USING 'ITOB-INVNR'
i_equip-invnr.
PERFORM bdc_field USING 'ITOB-INBDT'
i_equip-inbdt.
PERFORM bdc_field USING 'ITOB-ANSWT'
i_equip-answt.
PERFORM bdc_field USING 'ITOB-WAERS'
i_equip-waers.
PERFORM bdc_field USING 'ITOB-ANSDT'
i_equip-ansdt.
PERFORM bdc_field USING 'ITOB-HERST'
i_equip-herst.
PERFORM bdc_field USING 'ITOB-HERLD'
i_equip-herld.
PERFORM bdc_field USING 'ITOB-TYPBZ'
i_equip-typbz.
PERFORM bdc_field USING 'ITOB-BAUJJ'
i_equip-baujj.
PERFORM bdc_field USING 'ITOB-BAUMM'
i_equip-baumm.
PERFORM bdc_field USING 'ITOB-MAPAR'
i_equip-mapar.
PERFORM bdc_field USING 'ITOB-SERGE'
i_equip-serge.
Location Data
PERFORM bdc_dynpro USING 'SAPMIEQ0' '0101'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=T\03'.
PERFORM bdc_field USING 'BDC_CURSOR'
'ITOB-EQFNR'.
PERFORM bdc_field USING 'ITOB-SWERK'
i_equip-swerk.
PERFORM bdc_field USING 'ITOB-MSGRP'
i_equip-msgrp.
PERFORM bdc_field USING 'ITOB-BEBER'
i_equip-beber.
PERFORM bdc_field USING 'ITOB-ABCKZ'
i_equip-abckz.
PERFORM bdc_field USING 'ITOB-EQFNR'
i_equip-eqfnr.
Organization Data
PERFORM bdc_dynpro USING 'SAPMIEQ0' '0101'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=T\04'.
PERFORM bdc_field USING 'ITOB-BUKRS'
i_equip-bukrs.
PERFORM bdc_field USING 'ITOB-KOSTL'
i_equip-kostl.
PERFORM bdc_field USING 'BDC_CURSOR'
'ITOB-RBNR'.
PERFORM bdc_field USING 'ITOB-IWERK'
i_equip-iwerk.
PERFORM bdc_field USING 'ITOB-INGRP'
i_equip-ingrp.
PERFORM bdc_field USING 'ITOBATTR-GEWRK'
i_equip-gewrk.
PERFORM bdc_field USING 'ITOBATTR-WERGW'
i_equip-wergw.
PERFORM bdc_field USING 'ITOB-RBNR'
i_equip-rbnr.
Structure data
PERFORM bdc_dynpro USING 'SAPMIEQ0' '0101'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=CIPL'.
PERFORM bdc_field USING 'BDC_CURSOR'
'ITOB-SUBMT'.
PERFORM bdc_dynpro USING 'SAPLIEL2' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'IEQINSTALL-DATUM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=EXIT'.
PERFORM bdc_dynpro USING 'SAPMIEQ0' '0101'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=T\05'.
PERFORM bdc_field USING 'BDC_CURSOR'
'ITOB-SUBMT'.
PERFORM bdc_field USING 'ITOB-TIDNR'
i_equip-tidnr.
Others
PERFORM bdc_dynpro USING 'SAPMIEQ0' '0101'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=KL'.
PERFORM bdc_field USING 'BDC_CURSOR'
'WCHECK_V_H-GWLEN_I'.
PERFORM bdc_field USING 'WCHECK_V_H-GWLDT_I'
i_equip-gwldt.
PERFORM bdc_field USING 'WCHECK_V_H-GWLEN_I'
i_equip-gwlen.
PERFORM bdc_field USING 'GF_ALLE'
c_x. "i_equip-gf_alle.
Class Overview
PERFORM bdc_dynpro USING 'SAPLCLCA' '0602'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMCLF-KLART'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'RMCLF-KLART'
i_equip-klart.
PERFORM bdc_dynpro USING 'SAPLCLFM' '0500'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMCLF-STATU(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENDE'.
PERFORM bdc_field USING 'RMCLF-CLASS(01)'
i_equip-class.
PERFORM bdc_field USING 'RMCLF-STATU(01)'
i_equip-statu_01_057.
PERFORM bdc_dynpro USING 'SAPMIEQ0' '0101'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=MEPO'.
PERFORM bdc_dynpro USING 'SAPLIMR0' '4110'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/ERW'.
PERFORM bdc_field USING 'BDC_CURSOR'
'IMPT-PSORT(01)'.
PERFORM bdc_dynpro USING 'SAPMIEQ0' '0101'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
Call The Transaction
PERFORM bdc_transaction USING 'IE01'.
ENDLOOP.
Close the BDC Session
PERFORM close_group.
Regards
Anji
‎2007 Oct 26 3:37 PM
Hi Anji,
Could u pls send me the recording, instead of the prog pls!!