PURCHASE ORDER UPLOAD THRU BDC
HOW MANY FLAT FILES 'LL U UPLOAD FOR PURCHASE ORDER IN BDC ND BAPI. i.e., WILL U GIVE SEPERATE FILE FOR HEADER DATA AND ITEM DATA OR A SINGLE FILE FOR BOTH. GIVE ME SOME SAMPLE CODES.
Refer the sample program in BDC:
*& Report ZTRAINEE15_BDC *
REPORT ztrainee15_bdc
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA : BEGIN OF itab OCCURS 10,
orderno LIKE vbak-vbeln,
itemno LIKE vbap-posnr,
reason LIKE vbap-abgru,
END OF itab.
DATA : BEGIN OF it_bdc OCCURS 10.
INCLUDE STRUCTURE bdcdata.
DATA : END OF it_bdc.
DATA : filename TYPE string.
DATA: it_bdcmsgcall type standard table of BDCMSGCOLL WITH HEADER LINE.
*DATA: it_bdcdata type standard table of BDCDATA WITH HEADER LINE.
SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETER: p_file TYPE rlgrap-filename,
rjct_itm RADIOBUTTON GROUP g1,
add_item RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b1.
GUI FOR PATH FILE
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = ' '
IMPORTING
file_name = p_file.
UPLOADING FILE
START-OF-SELECTION.
filename = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = filename
filetype = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*AT SELECTION-SCREEN ON RADIOBUTTON GROUP g1.
CASE 'rjct_itm'.
WHEN 'X'.
PASSING DATA
program name, screen no.
LOOP AT itab.
clear: it_bdc, it_bdc[].
PERFORM bdc_dynpro USING 'SAPMV45A' '102' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'VBAK-VBELN'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SUCH'.
PERFORM bdc_field USING 'VBAK-VBELN' itab-orderno.
PERFORM bdc_dynpro USING 'SAPMV45A' '4001' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'VBAP-POSNR'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ITEM'.
PERFORM bdc_field USING 'VBAP-POSNR' itab-itemno.
PERFORM bdc_dynpro USING 'SAPMV45A' '4003' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'VBAP-ABGRU'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SICH'.
PERFORM bdc_field USING 'VBAP-ABGRU' itab-reason.
CALLING TRANSACTION
CALL TRANSACTION 'VA02' USING it_bdc MODE 'A' MESSAGES INTO
it_bdcmsgcall.
ENDLOOP.
LOOP AT it_bdc.
WRITE: / it_bdc-program,
it_bdc-dynpro,
it_bdc-dynbegin,
it_bdc-fnam,
it_bdc-fval.
ENDLOOP.
*ENDCASE.
*& Form bdc_dynpro
text
-->P_0198 text
-->P_0199 text
-->P_0200 text
FORM bdc_dynpro USING p_program
p_dynpro
p_flag.
it_bdc-program = p_program.
it_bdc-dynpro = p_dynpro.
it_bdc-dynbegin = p_flag.
APPEND it_bdc.
CLEAR it_bdc.
ENDFORM. " bdc_dynpro
*& Form bdc_field
text
-->P_0230 text
-->P_0231 text
FORM bdc_field USING p_fnam
p_fval.
it_bdc-fnam = p_fnam.
it_bdc-fval = p_fval.
APPEND it_bdc.
CLEAR it_bdc.
ENDFORM. " bdc_field
Similar Messages
-
How to upload Purchase Order Data thru LSMW
Hi All,
I need to upload Purchase order data thru LSMW. LSMW Provides standard object method which does not suit for split valuation. But in the client place split valuation is maintained. Is there any other of option of uploading the data.
Regards,
SrivatsanDear Srivatsan
For Upload Purchase order Data through LSMW
Business object BUS2012 - Purchase Order
Basic type PORDCR04
Message type PORDCR
Method CREATEFROMDATA
With regards
B.Ravindranath -
Doubt in uploading purchase order data using BDC
Hi friends,
how to upload purchase order data.
1) In both BDC and BAPI which one is preferable?
2) for suppose if it is through BDC, how to use? what are the transactions that we can use(SHDB, ME21N,ME21)?
3) To execute the job in background, is it possible for both call transaction and session method.
Thanks in advance
Sreenivas kIt really depends on the number of records you have. Still for a set of 5,000 records my answer to your questions will be:
1) In both BDC and BAPI which one is preferable? - <b>Go with BDC</b>
2) for suppose if it is through BDC, how to use? what are the transactions that we can use(SHDB, ME21N,ME21)? - <b>Yes, its SHDB for recording, SE38 for abap program and ME21 for PO. Avoid SAP Enjoy transactions for recording as you may end up having problems wiht it.</b>
3) To execute the job in background, is it possible for both call transaction and session method. - <b>If you use call transaction method then you have to schedule the job to run in background or simply run it through F9 instead of F8. In case of session method you can chose to process the session in background. However I would suggest you go with BDC Session method for this.</b>
- Guru
Reward points for helpful answers -
Open Purchase Order UPload Using the BAPI 's
i need to upload the open Purchase Order using the BAPI function BAPI_PO_CREATE1., below is the given fileds blod are for Header, header will Repeat for the line items,can any one help me out using the BAIP's for upload the PO, i need sample code for this ........
Thanks & Regards
Raghu
<u>Field Name Field Description Type Length</u>
<b>EBELN Purchasing Document Number CHAR 010 X
BUKRS Company Code CHAR 004 MN10 C
EKORG Purchasing Organization CHAR 004 MN00 C
EKGRP Purchasing group CHAR 003 X
BSART Order type (Purchasing) CHAR 004 X
LIFNR Account Number of Vendor or Creditor CHAR 010 X
BEDAT Purchase Order Date DATS 010 X
ZTERM Terms of payment key CHAR 004 X
WAERS Currency Key CUKY 005 X
INCO1 Incoterms (part 1) CHAR 003 X
INCO2 Incoterms (part 2) CHAR 028 X</b>
EBELP Item Number of Purchasing Document NUMC 005 X
EMATN Material number CHAR 018 X
WERKS Plant CHAR 004 X
LGORT Storage location CHAR 004 X
EPSTP Item category in purchasing document CHAR 001 X
KNTTP Account assignment category CHAR 001 X
EINDT Item delivery date DATS 010 X
MENGE "Purchase order quantity (direct input, transfer of POs)" CHAR 013 X
MEINS Order unit UNIT 003 X
NETPR "Net price: Document currency (direct input, transfer of" CHAR 011 X
PEINH "Price unit (direct input, transfer of POs)" CHAR 005 X
BPRME Order Price Unit (Purchasing) UNIT 003 X
BPUMZ Numerator: Conversion OPUn into OUn (direct input of POs CHAR 005 X
BPUMN Denominator: Conversion OPUn into OUn (direct input of P CHAR 005 X
SAKTO Cost element CHAR 010 X
KOSTL Cost Center CHAR 010 X
VBELN Sales and Distribution Document Number CHAR 010 X
VBELP Sales document item NUMC 006 X
WEMPF Goods recipient CHAR 012 X
WEBTH "Amount in local currency (direct input, transfer of POs)" CHAR 013 X
WEBTF "Amount in document currency (direct input, transfer of P" CHAR 013 X
WEREF Flag for treatment of GR/IR (direct input of POs) CHAR 001 X
SPINF Indicator: Update info record CHAR 001 X
WEPOS Goods Receipt Indicator CHAR 001 X
REPOS Invoice receipt indicator CHAR 001 Xi need to upload the open Purchase Order using the BAPI function BAPI_PO_CREATE1., below is the given fileds blod are for Header, header will Repeat for the line items,can any one help me out using the BAIP's for upload the PO, i need sample code for this ........
Thanks & Regards
Raghu
<u>Field Name Field Description Type Length</u>
<b>EBELN Purchasing Document Number CHAR 010 X
BUKRS Company Code CHAR 004 MN10 C
EKORG Purchasing Organization CHAR 004 MN00 C
EKGRP Purchasing group CHAR 003 X
BSART Order type (Purchasing) CHAR 004 X
LIFNR Account Number of Vendor or Creditor CHAR 010 X
BEDAT Purchase Order Date DATS 010 X
ZTERM Terms of payment key CHAR 004 X
WAERS Currency Key CUKY 005 X
INCO1 Incoterms (part 1) CHAR 003 X
INCO2 Incoterms (part 2) CHAR 028 X</b>
EBELP Item Number of Purchasing Document NUMC 005 X
EMATN Material number CHAR 018 X
WERKS Plant CHAR 004 X
LGORT Storage location CHAR 004 X
EPSTP Item category in purchasing document CHAR 001 X
KNTTP Account assignment category CHAR 001 X
EINDT Item delivery date DATS 010 X
MENGE "Purchase order quantity (direct input, transfer of POs)" CHAR 013 X
MEINS Order unit UNIT 003 X
NETPR "Net price: Document currency (direct input, transfer of" CHAR 011 X
PEINH "Price unit (direct input, transfer of POs)" CHAR 005 X
BPRME Order Price Unit (Purchasing) UNIT 003 X
BPUMZ Numerator: Conversion OPUn into OUn (direct input of POs CHAR 005 X
BPUMN Denominator: Conversion OPUn into OUn (direct input of P CHAR 005 X
SAKTO Cost element CHAR 010 X
KOSTL Cost Center CHAR 010 X
VBELN Sales and Distribution Document Number CHAR 010 X
VBELP Sales document item NUMC 006 X
WEMPF Goods recipient CHAR 012 X
WEBTH "Amount in local currency (direct input, transfer of POs)" CHAR 013 X
WEBTF "Amount in document currency (direct input, transfer of P" CHAR 013 X
WEREF Flag for treatment of GR/IR (direct input of POs) CHAR 001 X
SPINF Indicator: Update info record CHAR 001 X
WEPOS Goods Receipt Indicator CHAR 001 X
REPOS Invoice receipt indicator CHAR 001 X -
Regarding Purchase order upload
Dear All,
I have to upload the Purchase orders in to the SAP using DTW.i have fillled the follwing fields in to the opor and POR1 template but it is showing application error.
OPOR
Record Key
Docentry
address
cardcode
docduedate
docdate
doctotal
POr1
Recordkey
linenum
accountcode
itemcode
price
quantity..........
I think am missing a manadatory field.......Pls give me a solution to this...............Also tell me what are the mandatory fields that has to be filled for uploading.Actually the datas are large so i cannot ask the client to type all of them......Uploading is the only way..........So pls help me out.
Regards,
ShyamHello ,
You dont need to fill thise field in OPOR
Record Key
address
doctotal
because these all field all system generated
Then try again upload it.
Thanks
Manvendra Singh Niranjan -
Purchase order upload using LSMW
Hi
Can we use Basic type ORDERS05 in the IDOC method to upload purchase order using LSMW.
This also can achieved using business object BUS2012 and basic type PORDCR05.
Just wanted to what would be the difference between these two methods and possibliity of PO using basic type ORDERS05 using Idoc method.
Regards
Raj
Edited by: Rajitha1234 on Jan 28, 2011 6:55 AM
Edited by: Rajitha1234 on Jan 28, 2011 6:56 AMHai
Check with the following
Select fifth Radio button then follow the bellow step
<b>5) select radio-Button 5 and execute
Maintain Field Mapping and Conversion Rules
Select the Tcode and click on Rule button there you will select constant
and press continue button
give Transaction Code : ME21 and press Enter</b>
Thanks & regards
Sreenivasulu P -
Hi,
My query:
How to upload Purchase order data from legacy to SAP.
Bye...Hi
check this example(explained step by step)
Using Tcode MM01 -- Maintain the source fields are
1) mara-amtnr char(18)
2) mara-mbrsh char(1)
3) mara-mtart char(4)
4) makt-maktx char(40)
5) mara-meins char(3)
the flate file format is like this as follows
MAT991,C,COUP,Srinivas material01,Kg
MAT992,C,COUP,Srinivas material02,Kg
AMT993,C,COUP,Srinivas material03,Kg
MAT994,C,COUP,Srinivas material04,Kg
MAT995,C,COUP,Srinivas material05,Kg
goto Tcode LSMW
give Project Name
Subproject Name
object Name
Press Enter -
Press Execute Button
It gives 13 radio-Button Options
do the following 13 steps as follows
1) select radio-Button 1 and execute
Maintain Object Attributes
select Standard Batch/Direct Input
give Object -- 0020
Method -- 0000
save & Come Back
2) select radio-Button 2 and execute
Maintain Source Structures
select the source structure and got to click on create button
give source structure name & Description
save & Come Back
3) select radio-Button 3 and execute
Maintain Source Fields
select the source structure and click on create button
give
first field
field name matnr
Field Label material Number
Field Length 18
Field Type C
Second field
field name mbrsh
Field Label Industrial Sector
Field Length 1
Field Type C
Third field
field name mtart
Field Label material type
Field Length 4
Field Type C
fourth field
field name maktx
Field Label material description
Field Length 40
Field Type C
fifth field
field name meins
Field Label base unit of measurement
Field Length 3
Field Type C
save & come back
4) select radio-Button 4 and execute
Maintain Structure Relations
go to blue lines
select first blue line and click on create relationship button
select Second blue line and click on create relationship button
select Third blue line and click on create relationship button
save & come back
5) select radio-Button 5 and execute
Maintain Field Mapping and Conversion Rules
Select the Tcode and click on Rule button there you will select constant
and press continue button
give Transaction Code : MM01 and press Enter
after that
1) select MATNR field click on Source filed(this is the field mapping) select MATNR and press Enter
2) select MBRSH field click on Source filed(this is the field mapping) select MBRSH and press Enter
3) select MTART field click on Source filed(this is the field mapping) select MTART and press Enter
4) select MAKTX field click on Source filed(this is the field mapping) select MAKTX and press Enter
5) select MEINS field click on Source filed(this is the field mapping) select MEINS and press Enter
finally
save & come back
6) select radio-Button 6 and execute
Maintain Fixed Values, Translations, User-Defined Routines
Create FIXED VALUE Name & Description as MM01
Create Translations Name & Description as MM01
Create User-Defined Routines Name & Description as MM01
after that delete all the above three just created in the 6th step
FIXED VALUE --MM01
Translations --MM01
User-Defined Routines --MM01
come back
7) select radio-Button 7 and execute
Specify Files
select On the PC (Frontend) -- and click on Create button(f5)
give the path of the file like "c:\material_data.txt"
description : -
separators as select comma radiao- button
and press enter save & come back
8) select radio-Button 8 and execute
Assign Files
Save & come back
9) select radio-Button 9 and execute
Read Files
Execute
come back
come back
10) select radio-Button 10 and execute
Display Imported Data
Execute and press enter
come back
Come back
11) select radio-Button 11 and execute
Convert Data
Execute
come back
Come back
12) select radio-Button 12 and execute
Display Converted Data
Execute & come back
13) select radio-Button 13 and execute
Start Direct Input Program
select the Program
select continue button
go with via physical file
give the lock mode as 'E'
and execute
Also chk this:
http://www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc
http://www.mydatabus.com/visitor.php?pt=downloadFile&tc=6289701541332&cl=53&cn=000003&uid=6659
I recommend visiting http://www.**************** for this. For more details, click on http://www.****************/Tutorials/LSMW/LSMWMainPage.htm
http://www.erpgenie.com/sap/saptech/lsmw.htm
The steps are:
Maintain Object Attributes
Maintain Source Structures
Maintain Source Fields
Maintain Structure Relations
Maintain Field Mapping and Conversion Rules
Maintain Fixed Values, Translations, User-Defined Routines
Specify Files
Assign Files
Read Data
Display Read Data
Convert Data
Display Converted Data
Create Batch Input Session
Run Batch Input Session
also go through the links:
http://www.sapbrain.com/TOOLS/LSMW/SAP_LSMW_steps_introduction.html
http://esnips.com/doc/8e732760-5548-44cc-a0bb-5982c9424f17/lsmw_sp.ppt
http://esnips.com/doc/f55fef40-fb82-4e89-9000-88316699c323/Data-Transfer-Using-LSMW.zip
http://esnips.com/doc/1cd73c19-4263-42a4-9d6f-ac5487b0ebcb/LSMW-with-Idocs.ppt
http://esnips.com/doc/ef04c89f-f3a2-473c-beee-6db5bb3dbb0e/LSMW-with-BAPI.ppt
http://esnips.com/doc/7582d072-6663-4388-803b-4b2b94d7f85e/LSMW.pdf
REFER.
Re: ALE
check the following it contains step by step procedure,
https://help.sap.com/saphelp_nw04s/helpdata/en/87/f3ae74e68111d1b3ff006094b944c8/content.htm
Check this how to create LSMW
http://www.sapbrainsonline.com/TOOLS/LSMW/SAP_LSMW_steps_introduction.html
http://www.sapbrain.com/TOOLS/LSMW/SAP_LSMW_steps_introduction.html
http://esnips.com/doc/8e732760-5548-44cc-a0bb-5982c9424f17/lsmw_sp.ppt
http://esnips.com/doc/f55fef40-fb82-4e89-9000-88316699c323/Data-Transfer-Using-LSMW.zip
http://esnips.com/doc/1cd73c19-4263-42a4-9d6f-ac5487b0ebcb/LSMW-with-Idocs.ppt
http://esnips.com/doc/ef04c89f-f3a2-473c-beee-6db5bb3dbb0e/LSMW-with-BAPI.ppt
http://esnips.com/doc/7582d072-6663-4388-803b-4b2b94d7f85e/LSMW.pdf
For more documents regarding creation of lsmw give me your mail id i'll send some documents
Reward all helpfull answers
Regards
Pavan
Message was edited by:
Pavan praveen -
How we know the Purchase Orders List thru MRP or Manual
Hello Experts,
We have started making purchase orders thru purchase requistions which are generated thru MRP/APO. But at the same time some purchase orders are being made manually. Now we want to make list of those which are created thru PR and those which are made manually.
Kindly advise.
Rajeev GuptaDear Rajeev
What I am guessing is that through MRP you must be generating schedule lines as a automatic procurement & another part is manual PO which is not covered through MRP.Both these will have a different number range of document when it is saved or created .From document no. you can identify .
Please check this hint & come back .If useful reward points,
Vivek Maitra -
Standard purchase order upload to oracle
hi,
we are on oracle apps 11i, database 9i.
I have a custom requirement that requires importing purchase orders to Oracle Apps through database. I was advised to use the following interface tables:
PO_HEADERS_INTERFACE
PO_LINES_INTERFACE
PO_LINE_LOCATIONS_INTERFACE
PO_DISTRIBUTIONS_INTERFACE
insert the data to these tables using a PLSQL procedure and then running the program IMPORT STANDARD PURCHASE ORDERS from front end.
If someone confirms the above is the right method, it would be appreciated.
thanks & regardsLooks correct. Refer to the below links.
http://docs.oracle.com/cd/E19509-01/820-4390/ggtjd/index.html
http://api-wizard.blogspot.com/2012/10/purchase-order-import.html
http://raghuoaf.blogspot.com/2012/03/po-creation-and-import-po.html
Thanks
Shree -
Hello Experts,
We have a requirement of sending SMS alert to the Vendor (Multiple Numbers) once the Purchase Order is created and released against that vendor.
We have SAP ECC 6.0 , please let me know whether it is possible if yes what settings we need to make in Functional Areas, Basis Area and ABAP Development .
Is there any configuration required .
Best regards,
SAP MMNot aNSWERED.
-
Upload Purchase order text using BDC while updating Material Master MM02
Hi All,
Please help me out with sample code upload PO Txt ( long text...which is more than 72 chars)using MM02. Its very urgent
I am not able to pass data into following fields seen in recording,
RSTXT-TXLINE(02),
RSTXT-TXLINE(03),
RSTXT-TXLINE(04),
RSTXT-TXLINE(05), as we can see only RSTXT-TXLINE field in the RSTXT structure......
how to split the long text into 72 chrs each and pass into data into the RSTXT-TXLINE(02), RSTXT-TXLINE(03), RSTXT-TXLINE(04)....correspondingly........
Thanks in advance.....
Reagards,
Prasad KR.Hi
see the sample program
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
text2 LIKE tline-tdline, " Long Text
text3 LIKE tline-tdline, " Long Text
text4 LIKE tline-tdline, " Long Text
text5 LIKE tline-tdline, " Long Text
text6 LIKE tline-tdline, " Long Text
text7 LIKE tline-tdline, " Long Text
text8 LIKE tline-tdline, " Long Text
text9 LIKE tline-tdline, " Long Text
text10 LIKE tline-tdline, " Long Text
text11 LIKE tline-tdline, " Long Text
text12 LIKE tline-tdline, " Long Text
text13 LIKE tline-tdline, " Long Text
text14 LIKE tline-tdline, " Long Text
text15 LIKE tline-tdline, " Long Text
text16 LIKE tline-tdline, " Long Text
text17 LIKE tline-tdline, " Long Text
text18 LIKE tline-tdline, " Long Text
text19 LIKE tline-tdline, " Long Text
text20 LIKE tline-tdline, " Long Text
text21 LIKE tline-tdline, " Long Text
text22 LIKE tline-tdline, " Long Text
text23 LIKE tline-tdline, " Long Text
text24 LIKE tline-tdline, " Long Text
text25 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-text25 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text25.
APPEND itab.
ENDIF.
IF itab1-text24 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text24.
APPEND itab.
ENDIF.
IF itab1-text23 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text23.
APPEND itab.
ENDIF.
IF itab1-text22 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text22.
APPEND itab.
ENDIF.
IF itab1-text21 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text21.
APPEND itab.
ENDIF.
IF itab1-text20 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text20.
APPEND itab.
ENDIF.
IF itab1-text19 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text19.
APPEND itab.
ENDIF.
IF itab1-text18 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text18.
APPEND itab.
ENDIF.
IF itab1-text17 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text17.
APPEND itab.
ENDIF.
IF itab1-text16 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text16.
APPEND itab.
ENDIF.
IF itab1-text15 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text15.
APPEND itab.
ENDIF.
IF itab1-text14 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text14.
APPEND itab.
ENDIF.
IF itab1-text13 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text13.
APPEND itab.
ENDIF.
IF itab1-text12 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text12.
APPEND itab.
ENDIF.
IF itab1-text11 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text11.
APPEND itab.
ENDIF.
IF itab1-text10 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text10.
APPEND itab.
ENDIF.
IF itab1-text9 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text9.
APPEND itab.
ENDIF.
IF itab1-text8 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text8.
APPEND itab.
ENDIF.
IF itab1-text7 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text7.
APPEND itab.
ENDIF.
IF itab1-text6 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text6.
APPEND itab.
ENDIF.
IF itab1-text5 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text5.
APPEND itab.
ENDIF.
IF itab1-text4 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text4.
APPEND itab.
ENDIF.
IF itab1-text3 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text3.
APPEND itab.
ENDIF.
IF itab1-text2 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text2.
APPEND itab.
ENDIF.
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.
Reward points for useful Answers
Regards
Anji -
Dear All,
I have to upload the vendor master using the standard BDC RFBIKR00. Please tell shall I use the MS Excel for the legacy data and the format of the same.
Thanx in advance,
Alok.Hi
You should decide the format in according to the data you need to transfer to the batch.
All data of every vendorw should be place in only one row of the file and in the step of mapping you have to indicate the link beetween the fields of your file and the fields of the structure of RFBIKR00.
It would be better to save the excel file in CSV format.
Max -
Upload thru bdc (PA61)?
hi everybody,
i have developed a program to upload time events thru transaction PA61.
and when i m running the program, i m able to load only the first three records.
could anyone suggest me where might i have gone wrong.
early reply would be appreciated.
thanks in advance,
mitra.Hi santhosh,
leme explain u in a more clearly.
i have written the code and when i execute the program for a specific personnel no (say 11)
which has some 10 time events (that are to be entered in the list events).
for eg the below is the data to be uploaded.
personnel no date time
00000011 01.03.2007 08:24:00 I 0004
00000011 01.03.2007 12:30:00 O 0004
00000011 02.03.2007 08:22:20 I 0004
00000011 02.03.2007 12:13:00 O 0004
then while execution i get only the first three time events for the personnel number.
i m getting the data uploaded correct in the internal table.
but its not getting into the transaction.
can anybody suggest me where am i goin wrong?????
OR CAN ANYBODY SEND ME THE CODE FOR THE SAME????
early response would be appreciated.
thanks,
mitra. -
Fail safe logic needed for purchase order upload program
Hello all,
i am working on creating PO's by reading data from a text file. I need to implement fail safe logic in it, which is to make sure this program uploads all the records in the text file successfully. For example, i have 1000 records in my text file and while running the upload program if the program times out while creating the 500th PO or if SAP is down at that time, then we have 499 PO's created and 501 yet to be created. But if we run the same program again, we will generate duplicate PO's for 499 again. I want to avoid this kind of problem.
How do i implement this idea?
Kindly guide me on this.
Thanks.Ok ..
Then I would suggest you use Application Log to keep the success and error messages of PO processing.
You can check trsnaction SLG0 and create your own application log object.
Then you need to use FMs BAL_LOG_* to crate and add messages to it.
This way you will have a facility to check as which of your records are converted to PO for a run.
In case SAP gets down in between , still you can find the details using Xn SLG1 and then accordingly remove the records from your file which are already converted to PO.
Thanks,
Ram -
Regarding bdc upload for purchase order
hi friends,
here i got a problem in purchase order upload.the format in excel sheet data is in this format mentioned bellow
lifnr ekorg ekgrp werks lgort ematn menge netpr
142 1000 1000 1000 1000 <b>100-100 10 150
100-100 15 100
100-100 10 140
100-100 12 56
100-100 8 40</b>
here to identify items which r in bold and to write code for this is my problem. if the iteams r separated with ' , ' i can use split at , and between loop and end loop i executed the code earlier. but now my flat file containing 1000+ records and to convert that in my mode of program is a problem. so can any one suggest me how to proceed and code the above mentioned flat file structure to be uploaded in one record.
<b>this program is very urgent.............so take it as a request and help me in futher proceddings.......</b>
thaning you all........
i wait for replay...............Hi,
I hope earlier you are comma seperated file, and you are easily spliting the values using SPLIT command.
Now you are using flat file (fixed length) Using offset values you need map the fields manually in loop ... endloop control statement. (takes long time to find total lengh of record although you have to).
If you using TABDELIMITED, use the same SPLIT command , instead of 'comma' use 'CL_ABAP_CHAR_UTILITIES=>TAB_DELIMITED' attribute.
If you can maintain hierarchy. I hope it will be easy.
see below structure if want to do in hierarchy mode. Write logic determine the detail record and map it. It is easy rather than direct offset mapping.
<b>indicator ifnr ekorg ekgrp werks lgort
indicator ematn menge netpr
1 142 1000 1000 1000 1000
<i>2 100-100 10 150
2 100-100 15 100
2 100-100 10 140
2 100-100 12 56
2 100-100 8 40</i></b>
Please let me know what type of file i.e. reason i have given all three types.
If it helps.Plz reward points.
Regards
Bhupal Reddy.
Maybe you are looking for
-
Planning problems with russian language during refresh application
Hello all )) I have problems with Planning during refresh my Application with Essbase. I intsalled Essbase on RHEL4 and set ESSLANG=Russian_Russia.ISO-8859-5@Default also I set locale on ru_RU.iso88595 Ater that I installed Planning on Solaris 9 whic
-
In need of serious aid.
Hello all. I appreciate any advise as I am in a true bind and need assistance desperately. I recently changed my Yahoo email password on a computer, (as you cannot change your password on the Ipad from my understanding). After changing the password s
-
New versions of ACS and ADE in the short term ??
Hello everyone, My company has several clients (publishers and libraries) that use the Adobe Content Server and Adobe Digital Editions. I would like to Know if Adobe will release new versions of these products in the short term. Our customers are ask
-
Fundamentals: Custom Nodes vs Methods and Controller in MVC
I have a couple quick questions that I'd consider somewhat fundamental that I should have a better grasp this far along in development... - First of all, what do you guys/gals consider the best way to structure your JavaFX classes. I almost always cr
-
Hi Everyone, I've been shooting for quite some time and using Lightroom since the very first release. I've also begun using Photoshop for some work, but I'm still quite new to Photoshop. I just finished a year in India and Nepal where I grew consid