Query upload from a file
Hi !
I have my query details stored in a txt file . I want to create a new query and upload this text file data into that new query so that all the query is copied on . Could anyone please let me know how do i upload a query with the text?
Thanks
Actually there is an existing query/infoset in DEV which has been downloaded intoma text file.
I would like to create a new query in SBX by copying the same query in SBX. The query was in standard area so there is no transport in DEV for it . I went into SBX and created a new query with the same name as in DEV and clicked transport which took me to the SAP query transport tool screen for query and infosets.
Here I selcted the upload and and under transport section checked the radiobitton for querry and infoset and gave names for that and selcted the checkbox - overwritting allowed and executed , it asked for the file name and it slected the file , but it gives me the following message:
Uploading transport dataset
Import log: List of imported object
F No transport dataset read
How would I be able to copy the infoset and query from this file .?
Thanks
Similar Messages
-
Error in running Extract Definition Upload from Data File concurrent.
Hi all,
Am trying to upload the 834 Extract Layout from the data file by running the concurrent program, Extract Definition Upload from Data File.
After running this concurrent program am getting the Extract Layout definition with Record layout and Data elements within it.
But some record layouts has the changes at their repeating level in that.
Please suggest me how do i get the same repeating levels for the record layouts when i move the 834 benefit extract layout definition
from one instance to another instance.Hi,
We have exactly the same error in IBolt. This error happens sometime and we don't find the reason.
IBolt has been upgraded to Version 3.1 SP1 and a fix has been developed by the support. After installation, we've work hardly during 2 days for testing all the flows by the customer without having this error.
Ibolt works as a service and when this error occurs, the service stopped and must be restarted.
In our flows, we have put a delete of the observer.dll file just before the rest of the flow but it doesn't solve the problem.
Deleting the directory can be temporarly a solution but the error come back another day.
Each time the SBO client or DTW is started, the %temp%\SMS_OBJ_DLL directory is created...
When you just delete the observer.dll file and leave the rest of the directory like it is, the file is re-created when you start and log to SBO. I would say that this file is a copy of another file observer_800178.dll (800178 depending of the version of SBO yoi have). 800178 corresponds to SBO 2007 A PL 42.
Do you have more information since your post has been send ?
Thanks in advance for your help.
Best regards. -
Upload from flat file to table
Hi experts,
i need to upload the following file in a table with the columns names as field names in my database table
weekly_eft_repo 1.0 Page: 1
CDC:00304 / Sat Oct-31-2009 Weekly EFT Sweep for 25/10/09 - 31/10/09 Effective Date 03/11/09 Sat Oct-31-2009 22:06:14
*Bill to*
*Retailer Retailer Name Name on Bank Account Bank ABA Bank Acct On-line Amount Instant Amount Total Amount*
======== ============================== ============================== ========== ==================== =============== =============== ===============
0200101 Triolet Popular Store Triolet Popular Store 111111111 62030100130659 10,868.00 0.00 10,868.00
0200103 Le Cacharel Snack Le Cacharel Snack 111111111 62030100130813 9,728.00 0.00 9,728.00
0200104 Advanced Co-operative Self Ser Advanced Co-operative Self Ser 111111111 111111111 7,334.00 0.00 7,334.00
0200105 Chez Popo Supermarket Chez Popo Supermarket 111111111 61030100044898 30,932.00 0.00 30,932.00
0200106 Vana Supermarket Vana Supermarket 111111111 111111111 17,775.00 0.00 17,775.00
0200107 Mont Choisy Store Mont Choisy Store 111111111 62030100130804 8,840.00 0.00 8,840.00
0200108 Vijay Store Vijay Store 111111111 62030100131229 16,416.00 0.00 16,416.00
0200109 Neptune Confection Neptune Confection 111111111 62030100130931 11,077.00 0.00 11,077.00
0200110 Antoine Store Antoine Store 111111111 111111111 2,470.00 0.00 2,470.00Database table
TABLE weekly_eft_report_temp
Name Null? Type
BILL_TO_RETAILER NOT NULL VARCHAR2(15)
RETAILER_NAME VARCHAR2(100)
NAME_ON_BANK_ACCOUNT VARCHAR2(100)
BANK_ABA VARCHAR2(1)
BANK_ACCT VARCHAR2(1)
ON_LINE_AMOUNT NUMBER
INSTANT_AMOUNT NUMBER
TOTAL_AMOUNT NUMBER I am having lots of difficulty in doing so. Can anyone plz help me. ThanksHi Damorgan,
I am having a little problem with my external table though and dont seem to find the solution. can you help me on this one please.
For my external table
create table weekly_eft_temp
(line varchar2(4000))
ORGANIZATION EXTERNAL (
TYPE oracle_loader
DEFAULT DIRECTORY GTECHFILES
ACCESS PARAMETERS (
RECORDS DELIMITED BY NEWLINE
CHARACTERSET WE8MSWIN1252
BADFILE 'weekly_eft.bad'
DISCARDFILE 'weekly_eft.dis'
LOGFILE 'weekly_eft.log'
FIELDS TERMINATED BY X'0D' RTRIM
REJECT ROWS WITH ALL NULL FIELDS
line char(4000)
LOCATION ('weekly_eft_report_c00381.rep')
PARALLEL
REJECT LIMIT UNLIMITED ;There is no problem with this. My external table is populated ok.
My problem lies in my sql query. I am not able seperate my field so that they can be inserted into their appropriate fields in my table
INSERT INTO weekly_eft_report_temp
(Bill_to_Retailer ,
Retailer_Name ,
Name_on_Bank_Account ,
Bank_ABA ,
Bank_Acct ,
On_line_Amount ,
Instant_Amount ,
Total_Amount ,
CDC ,
SOURCE ,
INSERTED_DATE ,
UPLOADED
select
case when Bill_to_Retailer is null then lag(RETAILER_NO, decode(PRODUCT, ''Loto'', 1, ''Inst Tk'', 2 )) over (order by line_no) else null end as RETAILER_NO,
Bill_to_Retailer ,
Retailer_Name ,
Name_on_Bank_Account ,
Bank_ABA ,
Bank_Acct ,
On_line_Amount ,
Instant_Amount ,
Total_Amount ,
'00381' ,
'weekly_eft_report_c00381.rep' ,
sysdate ,
'N'
from (
select
Bill_to_Retailer ,
Retailer_Name ,
Name_on_Bank_Account ,
Bank_ABA ,
Bank_Acct ,
On_line_Amount ,
Instant_Amount ,
Total_Amount
from
( select
rownum as line_no,
regexp_substr(line, '[^ ]+', 1, 1) as Bill_to_Retailer ,
regexp_substr(line, '[^ ]+', 1, 2) as Retailer_Name ,
regexp_substr(line, '[^ ]+', 1, 3) as Name_on_Bank_Account ,
regexp_substr(line, '[^ ]+', 1, 4) as Bank_ABA ,
regexp_substr(line, '[^ ]+', 1, 5) as Bank_Acct ,
regexp_substr(line, '[^ ]+', 1, 6) as On_line_Amount ,
regexp_substr(line, '[^ ]+', 1, 7) as Instant_Amount ,
regexp_substr(line, '[^ ]+', 1, 8) as Total_Amount
from weekly_eft_temp )
-- where regexp_like(line, '^( +Bill to Retailer)')
The result of my query is as follows:
weekly_eft_repo 1.0 L o t t o t
CDC:00381 / Sat Jan-16-2010 Weekly EFT Sweep for
Bill to
Retailer Retailer Name Name on Bank Account Bank
======== ============================== ============================== ========== ==================== =============== =============== ===============
0200101 Triolet Popular Store Triolet Popular Store 111111111
0200103 Le Cacharel Snack Le Cacharel Snack 111111111
0200104 Advanced Co-operative Self Ser Advanced Co-operative Self
0200105 Chez Popo Supermarket Chez Popo Supermarket 111111111
0200106 Vana Supermarket Vana Supermarket 111111111 62030100133937 37,636.00
0200107 Mont Choisy Store Mont Choisy Store 111111111
0200108 Vijay Store Vijay Store 111111111 62030100131229 30,948.00
0200109 Neptune Confection Neptune Confection 111111111 62030100130931 23,769.00
0200110 Antoine Store Antoine Store 111111111 62030100134575 35,048.00
0200111 P.S.C Cold Storage P.S.C Cold Storage 111111111
0200113 Mini Prix Boutique Mini Prix Boutique 111111111
0200114 Hotel Cassim Hotel Cassim 111111111 62030100133914 171,802.00
0200116 Aman Snack Aman Snack 111111111 62030100129481 32,224.00
0200117 Best For Less Company Ltd Best For
0200118 Central Way Central Way 111111111 111111111 34,956.00
0200119 Amba Veerapen Amba Veerapen 111111111 62030100129436 35,817.00
0200121 Tang Way Tang Way 111111111 111111111 117,542.00
0200122 Football Pools Collector Football Pools Collector 111111111
0200123 Kim Lee Kim Lee 111111111 62030100129422 19,782.00
0200126 Chez Andrex Chez Andrex 111111111 11111111 141,732.00
0200127 Sungkoora Pools & Lottery Hous Sungkoora PoolsThe problem is that is that i want to take data only after the ====== and also it is seperating the names which is right. Can you please help me. Many thanks -
Va31 shedule line agreement data upload from flat file
Hi abapers
I have to upload some data (va31) from flat file to my database (shedule line agreement data) I am using user exit for it...Cant get which user exit will solve the purpose and where to check it from..I tried using SDTRM001 , meeta001 and and the va45A series but its not working. I used break point on these user exits but its not stoping at break point.
Can any one help me where to find which user exit will work in this case?
Thanks in Advance
AnnuHi Prash,
Check these posts:
Re: Increasing the length of Infoobject from 60 to 240 characters
Re: InfoObject > 60
Bye
Dinesh -
834 Benefit Extracts - Error in Extract Definition Upload from Data File
Hi all,
I try uploading the Extract Definition of 834 Benefit Extract definition data file to create 834 Benefit Extract File layout in the system.
But it has errors as mention below and no clue in it to get through with the uploading process .
am providing the error info which i got from the log file.
Upload from stage tables
Error loading seed data for EXT_WHERE_CLAUSE8: FILE_NAME = ALB_ANSI-834 Full Profile, RECORD_NAME = ALB SE - Transaction Set Trailer, DATA_ELEMT_NAME = ALB SE01_Total, PARENT_RECORD_NAME = ALB SE - Transaction Set Trailer, PARENT_ELEMENT_NAME = , DATA_ELMT_NAME = ALB SE01_Total, COND_DATA_ELMT_NAME = ALB SE01_REF, ORA-01403: no data found
Start of log messages from FND_FILE
WARNING : Element ALB INS04 Decode Value 14 not uploaded
WARNING : Element ALB INS04 Decode Value 03 not uploaded
WARNING : Element ALB INS04 Decode Value 01 not uploaded
WARNING : Element ALB INS04 Decode Value 07 not uploaded
WARNING : Element ALB INS04 Decode Value 04 not uploaded
WARNING : Element ALB INS08 Decode Value FT not uploaded
WARNING : Element ALB INS08 Decode Value TE not uploaded
WARNING : Element ALB INS08 Decode Value RT not uploaded
WARNING : Element ALB DMG05 Decode Value O not uploaded
WARNING : Element ALB DMG05 Decode Value J not uploaded
WARNING : Element ALB DMG05 Decode Value H not uploaded
WARNING : Element ALB DMG05 Decode Value I not uploaded
WARNING : Element ALB DMG05 Decode Value B not uploaded
WARNING : Element ALB DMG05 Decode Value A not uploaded
WARNING : Element ALB HD03 Decode Value PPO not uploaded
WARNING : Element ALB HD03 Decode Value PPO not uploaded
WARNING : Element ALB HD03 Decode Value PPO not uploaded
WARNING : Element ALB HD05 Decode Value SPO not uploaded
WARNING : Element ALB HD05 Decode Value ESP not uploaded
WARNING : Element ALB HD05 Decode Value EMP not uploaded
WARNING : Element ALB HD05 Decode Value E1D not uploaded
WARNING : Element ALB HD05 Decode Value FAM not uploaded
WARNING : Element ALB HD01_TERM Decode Value 024 not uploaded
WARNING : Element ALB HD01_TERM Decode Value 024 not uploaded
End of log messages from FND_FILE
thanks & regards,
V.Leelaprasath.Hi
Use the PERFORM OPEN_GROUP after the enddo.
open dataset v_data for input in text mode encoding default.
do.
read dataset v_data into < itab-fields>
if sy-subrc <> 0.
message e001(yarcjosh).
else.
Append itab.
clear itab.
endif.
enddo.
perform open_group.
loop at record.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
endloop.
Reward points if useful
Regards
Anji -
XML data upload from .xml file
Hi,
Can anyone let me know is ther any way how I can upload the data from .xml file into Oracle Table.
Note: I just want to upload the data from xml file; not entire .xml file.
I have data like as below in test.xml file and I want to upload the data only into TEST_EMP table:
<?xml version = '1.0'?>
<ROWSET>
<ROW num="1">
<TABLE_NAME>DEPT</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
<ROW num="2">
<TABLE_NAME>EMP</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
<ROW num="3">
<TABLE_NAME>BONUS</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
<ROW num="4">
<TABLE_NAME>SALGRADE</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
<ROW num="5">
<TABLE_NAME>BHAVESH_EMP</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
</ROWSET>
Any help would be highly appreciated!!
Thanks... BhaveshOne way is to use sql* loader...
http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb25loa.htm -
Error occurred in the data uploading from Flat File in BPC NW
Hi,
I am doing Migration project from BPC MS to NW.
In this i am loading data from flat file to BPC NW. One error occured in this process that is Record Duplication.
Total 17000 records in that 7000 recards rejected by the reason of duplication.
The Information about Package Log
/CPMB/MODIFY completed in 0 seconds
/CPMB/CONVERT completed in 2 seconds
/CPMB/LOAD completed in 7 seconds
/CPMB/CLEAR completed in 0 seconds
[Selection]
FILE= DATAMANAGER\DATAFILES\Aprilmayjun_2011_Budget_V1.CSV
TRANSFORMATION= DATAMANAGER\TRANSFORMATIONFILES\ZAPRMAYJUN_2011BUDGET.xls
CLEARDATA= No
RUNLOGIC= Yes
CHECKLCK= No
[Messages]
Task name CONVERT:
No 1 Round:
Record count: 17064
Accept count: 17064
Reject count: 0
Skip count: 0
Task name LOAD:
Reject count: 7230
Submit count: 9834
Application: CorpBudget Package status: WARNING
Could you help me in this at the earliest.
Thanks and Regards
KrishnaHi,
You cannot send the duplicated with the standard import package. You need to create or add a new package and link to /CPMB/APPEND process chain and do the import. This would consider the duplicate entries also. It looks like you need somehow load all the records including the duplicate ones.
So on excel go to Manage Data -> Maintain Data management -> organize package list and add a new package and link to the standard BPC process chain /CPMB/APPEND.
Thanks,
Sreeni -
How can I query data from XML file stored as a CLOB ?
Hi folks,
please see below sample of XML file, which is stored in "os_import_docs", column "document" as CLOB.
I would like to query this XML file using some SQL select.
How can I query data form below XML?
<?xml version="1.0" encoding="UTF-8"?>
<etd>
<header>
<AR>000000000</AR>
<AW>0</AW>
<CT>S</CT>
<CU>H</CU>
<CZ>SS48</CZ>
<BU>4</BU>
<CH>0032</CH>
<CK>2012-11-01</CK>
<CL>21:18</CL>
<CW>225</CW>
<CX>0</CX>
<CF>SS-CZL18</CF>
<DV>2</DV>
</header>
<account_group id="234">
<account id="234">
<invoice id="000742024">
<da>
<AR>000742024</AR>
<AW>0</AW>
<CT>D</CT>
<CU>A</CU>
<CH>0032</CH>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<AB>234</AB>
<AA>234</AA>
<BS>88754515</BS>
<AD>Mike Tyson</AD>
<AC>Mike Tyson</AC>
<AZ>CZ6521232465</AZ>
<AE/>
<CG>A</CG>
<AL>A</AL>
<BZ>.</BZ>
<AH>Some street</AH>
<AI/>
<AF>Some city</AF>
<AK>Kraj</AK>
<AG>CZ</AG>
<AJ>885 21</AJ>
<CR>21-11-2012</CR>
<AY>602718709</AY>
<AV>800184965</AV>
<AP/>
<AO/>
<AQ/>
<AN/>
</da>
<da>
<AR>000742024</AR>
<AW>0</AW>
<CT>D</CT>
<CU>A</CU>
<CH>0032</CH>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<AB>234</AB>
<AA>234</AA>
<BS>88754515</BS>
<AD>Mike Tyson</AD>
<AC>Mike Tyson</AC>
<AZ>CZ6521232465</AZ>
<AE/>
<CG>A</CG>
<AL>L</AL>
<BZ>Mike Tyson</BZ>
<AH>Some street</AH>
<AI/>
<AF>Some city</AF>
<AK>Kraj</AK>
<AG>CZ</AG>
<AJ>885 21</AJ>
<CR>21-11-2012</CR>
<AY/>
<AV>800184965</AV>
<AP/>
<AO/>
<AQ/>
<AN/>
</da>
<detaildc CH="0032" AB="234" BS="11888954" BB="32" BA="CZ" AT="" CI="7077329000002340342" AU="" DU="1Z48395" CB="CZK">
<dc>
<AW>0</AW>
<CT>D</CT>
<CU>C</CU>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<CV>8151</CV>
<BT>12111</BT>
<CJ>1</CJ>
<AM>0</AM>
<DR>PC</DR>
<DS/>
<DO>25-10-2012</DO>
<DQ>18:42</DQ>
<CE>1</CE>
<BH>8151</BH>
<CY>8151 SHELL MALKOVICE P</CY>
<DP>049336</DP>
<DT/>
<BQ/>
<BR>500000</BR>
<CN>30</CN>
<CM>030</CM>
<BO>160,00</BO>
<BF>38,900</BF>
<BC>6224,00</BC>
<BI>32,417</BI>
<CD>B</CD>
<BG>0,600</BG>
<BK>31,817</BK>
<BJ>0,000</BJ>
<DI>8</DI>
<BP>20,00%</BP>
<CC>CZK</CC>
<BM>5090,67</BM>
<BN>1018,13</BN>
<BL>6108,80</BL>
<BD>5090,67</BD>
<BE>1018,13</BE>
<DW>6108,80</DW>
<CO>Nafta</CO>
</dc>
</detaildc>
<dt>
<AR>000742024</AR>
<AW>0</AW>
<CT>D</CT>
<CU>T</CU>
<CH>0032</CH>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<AB>234</AB>
<AA>234</AA>
<BS>11888954</BS>
<BB/>
<BA>CZ</BA>
<DG>1</DG>
<CN>30</CN>
<CM>030</CM>
<DF>160,00</DF>
<DH>litr</DH>
<DJ>20,00%</DJ>
<DD>5090,67</DD>
<DE>1018,13</DE>
<DC>6108,80</DC>
<DB>CZK</DB>
<DA>P</DA>
<AX/>
<CQ/>
<CP/>
</dt>
<dt>
<AR>000742024</AR>
<AW>0</AW>
<CT>D</CT>
<CU>T</CU>
<CH>0032</CH>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<AB>234</AB>
<AA>234</AA>
<BS>11888954</BS>
<BB/>
<BA>CZ</BA>
<DG>2</DG>
<CN/>
<CM/>
<DF>160,00</DF>
<DH>litr</DH>
<DJ/>
<DD>5090,67</DD>
<DE>1018,13</DE>
<DC>6108,80</DC>
<DB>CZK</DB>
<DA/>
<AX/>
<CQ/>
<CP/>
</dt>
<dt>
<AR>000742024</AR>
<AW>0</AW>
<CT>D</CT>
<CU>T</CU>
<CH>0032</CH>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<AB>234</AB>
<AA>234</AA>
<BS>11888954</BS>
<BB/>
<BA>CZ</BA>
<DG>19</DG>
<CN/>
<CM/>
<DF/>
<DH/>
<DJ/>
<DD>5090,67</DD>
<DE>1018,13</DE>
<DC>6108,80</DC>
<DB>CZK</DB>
<DA/>
<AX/>
<CQ/>
<CP/>
</dt>
<dt>
<AR>000742024</AR>
<AW>0</AW>
<CT>D</CT>
<CU>T</CU>
<CH>0032</CH>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<AB>234</AB>
<AA>234</AA>
<BS>11888954</BS>
<BB/>
<BA>CZ</BA>
<DG>8</DG>
<CN/>
<CM/>
<DF/>
<DH/>
<DJ/>
<DD>5090,67</DD>
<DE>1018,13</DE>
<DC>6108,80</DC>
<DB>CZK</DB>
<DA/>
<AX/>
<CQ/>
<CP/>
</dt>
</invoice>
</account>
</account_group>
<footer>
<AR>999999999</AR>
<AW>0</AW>
<CT>S</CT>
<CU>T</CU>
<CZ>SS48</CZ>
<BU>4</BU>
<CH>0032</CH>
<CK>2012-11-01</CK>
<CL>23:04</CL>
<CW>225</CW>
<BX>1</BX>
<CS>7</CS>
<BW>0000000000000610880</BW>
</footer>
</etd>sample - not working:
select x.*
from os_import_docs d
,XMLTABLE('/etd/header'
PASSING httpuritype(d.document).getXML()
COLUMNS
response_status varchar2(50) PATH 'AR'
) x
where d.object_id = 2587058
and rownum = 1;
ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 6196, maximum: 4000)Many thanks,
TomasHello,
many thanks for the reply. Your examples are very usefull for me.
To answer your questions.
An XML structure:
/etd
/header - repeat in each row in output
/account_group/account
/invoice
/da - repeat for each details under "selected "invoice
/detaildc/dc - the lowest level
/detaildn/dn - the lowest level
/dt - repeat for each details under "selected "invoice
/footer - repeat in each row in outputI would like to to have a 1 row for each "record" in /detaildc section and include related nodes at higher levels.
Please see below XML file, which is simplified file of example in first post, but includes a complete xml structure which needs to be queried in db.
<?xml version="1.0" encoding="UTF-8"?>
<etd>
<header>
<AR>000000000</AR>
<CK>2012-10-31</CK>
<CF>SS-CZL19</CF>
</header>
<account_group id="234">
<account id="234">
<invoice id="EI08P4000">
<da>
<AR>EI08P4000</AR>
<AD>Mickey Mouse</AD>
</da>
<detaildc DU="1Z56655" CB="EUR">
<dc>
<DO>16-10-2012</DO>
<CY>ASFINAG POST_MAUT</CY>
<BM>1940,60</BM>
<CO>Dalnicni znamka</CO>
</dc>
</detaildc>
<detaildc DU="2Z55050" CB="EUR">
<dc>
<DO>17-10-2012</DO>
<CY>ASFINAG POST_MAUT</CY>
<BM>1328,10</BM>
<CO>Dalnicni znamka</CO>
</dc>
</detaildc>
<detaildc DU="2Z90001" CB="EUR">
<dc>
<DO>27-10-2012</DO>
<CY>ASFINAG POST_MAUT</CY>
<BM>185,10</BM>
<CO>Poplatek</CO>
</dc>
</detaildc>
<dt>
<AR>EI08P4000</AR>
<DG>8</DG>
</dt>
</invoice>
</account>
<account id="234">
<invoice id="EI13T7777">
<da>
<AR>EI13T7777</AR>
<AD>Mickey Mouse</AD>
</da>
<detaildc DU="1Z48302" CB="EUR">
<dc>
<DO>26-10-2012</DO>
<CY>SANEF 07706 A 07704</CY>
<BM>232,10</BM>
<CO>Dalnicni poplatek</CO>
</dc>
</detaildc>
<detaildc DU="1Z48302" CB="EUR">
<dc>
<DO>20-10-2012</DO>
<CY>TEST A 07704</CY>
<BM>30,10</BM>
<CO>Poplatek</CO>
</dc>
</detaildc>
<dt>
<AR>EI13T7777</AR>
<DG>8</DG>
</dt>
</invoice>
</account>
<account id="234">
<invoice id="EI327744">
<da>
<AR>EI327744</AR>
<AD>Mickey Mouse</AD>
</da>
<detaildn CI="707732 00000234" >
<dn>
<BY>30-10-2012</BY>
<BM>8,10</BM>
</dn>
</detaildn>
<detaildn CI="707732 00000234" >
<dn>
<BY>30-10-2012</BY>
<BM>399,50</BM>
</dn>
</detaildn>
<dt>
<AR>EI327744</AR>
</dt>
</invoice>
</account>
<account id="234">
<invoice id="EI349515">
<da>
<AR>EI349515</AR>
<AD>Mickey Mouse</AD>
</da>
<detaildc DU="1Z56514" CB="EUR">
<dc>
<DO>29-10-2012</DO>
<CY>ALLAMI AUTOPALYAKEZE</CY>
<BM>1240,60</BM>
<CO>Dalnicni znamka</CO>
</dc>
</detaildc>
<detaildc DU="1Z56515" CB="EUR">
<dc>
<DO>19-10-2012</DO>
<CY>ASFINAG POST_MAUT</CY>
<BM>7428,10</BM>
<CO>Dalnicni znamka</CO>
</dc>
</detaildc>
<detaildc DU="1Z56515" CB="EUR">
<dc>
<DO>12-10-2012</DO>
<CY>UK</CY>
<BM>954,10</BM>
<CO>Poplatek</CO>
</dc>
</detaildc>
<dt>
<AR>EI349515</AR>
<DG>8</DG>
</dt>
</invoice>
</account>
</account_group>
<footer>
<CZ>SS47</CZ>
<BU>4</BU>
<CH>0032</CH>
<CK>2012-10-31</CK>
<CL>01:25</CL>
</footer>
</etd>Expected output
AR CK CF AR4 AD DU CB DO CY BM CO AR5 DG CI BY BM6 CZ BU CH CK7 CL
0 41213 SS-CZL19 EI08P4000 Mickey Mouse 1Z56655 EUR 16-10-2012 ASFINAG POST_MAUT 1940,60 Dalnicni znamka EI08P4000 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI08P4000 Mickey Mouse 2Z55050 EUR 17-10-2012 ASFINAG POST_MAUT 1328,10 Dalnicni znamka EI08P4000 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI08P4000 Mickey Mouse 2Z90001 EUR 27-10-2012 ASFINAG POST_MAUT 185,10 Poplatek EI08P4000 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI13T7777 Mickey Mouse 1Z48302 EUR 26-10-2012 SANEF 07706 A 07704 232,10 Dalnicni poplatek EI13T7777 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI13T7777 Mickey Mouse 1Z48302 EUR 20-10-2012 TEST A 07704 30,10 Poplatek EI13T7777 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI327744 Mickey Mouse EI327744 707732 00000234 30-10-2012 8,10 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI327744 Mickey Mouse EI327744 707732 00000234 30-10-2012 399,50 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI349515 Mickey Mouse 1Z56514 EUR 29-10-2012 ALLAMI AUTOPALYAKEZE 1240,60 Dalnicni znamka EI349515 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI349515 Mickey Mouse 1Z56515 EUR 19-10-2012 ASFINAG POST_MAUT 7428,10 Dalnicni znamka EI349515 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI349515 Mickey Mouse 1Z56515 EUR 12-10-2012 UK 954,10 Poplatek EI349515 8 SS47 4 32 41213 01:25 -
Pls tell me how to upload from excel file to database.
hello,experts,
I want to upload data from excel local file to database table created by myself.when I use function
CALL FUNCTION 'GUI_DOWNLOAD'
the data in the internal table just become error code data that can not understand.
who can help me out?
thanks.Hi,
1st copy the values in XLS into internal table by using function Module:-
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = file_name<it is file path of u r XLS>
i_begin_col = 1
i_begin_row = 1
i_end_col = 250
i_end_row = 1
tables
intern = itab<this structure is same like u r database table>
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
if sy-subrc 0.
then modify or insert these values to database from internal table:-
modify <DB table> from itab accepting duplicate keys.
for file popup use :
at selection-scree on <screen field>.
call function 'F4_FILENAME'
exporting
program = sy-cprog
dynnr = sy-dynnr
importing
filename = zfilename.
here zfilename of type rlgrap-filename.
and pass this as path in ASLA_EXCEL_TO_INTERNAL_TABLE
Edited by: vijay Mekala on Dec 29, 2007 12:45 PM -
BDC Uploading from flat file to VA01.
i have a flat file, where i have to upload data into VA01, but it should suppose to multiple materials under same customer and it should not get saved until end user decide whether data is ok or not. my problem is, how to make multiple entries of diff materials in VA01 for single customer. Please give me any solution, and if possible provide me any examples. thank you.
Hi Kalyan,
Here is the sample code for you ....... but i tis better you use the BAPI
<b>BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2</b>
REPORT ZSD00001 MESSAGE-ID ZZ.
TABLES: VBAK, VBAP.
TABLES: ZSOM1, ZSOM2.
SELECTION-SCREEN: BEGIN OF BLOCK FORT WITH FRAME TITLE TEXT-002.
PARAMETERS: P_FILE RADIOBUTTON GROUP B2 DEFAULT 'X',
P_TABLE RADIOBUTTON GROUP B2,
P_REPORT RADIOBUTTON GROUP B2.
SELECTION-SCREEN SKIP 1.
PARAMETER: VIEW RADIOBUTTON GROUP VIEW,
ERRORS RADIOBUTTON GROUP VIEW,
NO_DIS RADIOBUTTON GROUP VIEW DEFAULT 'X'.
SELECTION-SCREEN: END OF BLOCK FORT.
SELECTION-SCREEN: BEGIN OF BLOCK FILE WITH FRAME TITLE TEXT-001.
PARAMETERS:
IDLEX RADIOBUTTON GROUP B1 DEFAULT 'X',
DBLEX RADIOBUTTON GROUP B1,
BDC_NAME(12) TYPE C DEFAULT 'idllapso',
IDLH(99) TYPE C DEFAULT
'/usr/sap/D01/DVEBMGS00/ISAP/interfaces/laptop/in/idlordht.txt',
IDLI(99) TYPE C DEFAULT
'/usr/sap/D01/DVEBMGS00/ISAP/interfaces/laptop/in/idlordit.txt',
ARC_FIL DEFAULT ' ' AS CHECKBOX.
SELECTION-SCREEN: END OF BLOCK FILE.
SELECTION-SCREEN: BEGIN OF BLOCK TAB WITH FRAME TITLE TEXT-003.
SELECT-OPTIONS: O_IHREZ FOR ZSOM1-IHREZ,
O_VBELN FOR ZSOM1-IHREZ,
O_MESS FOR ZSOM1-MESS DEFAULT 'W'.
SELECTION-SCREEN: END OF BLOCK TAB.
DATA:
* Data counters.
RECS_IN(4) TYPE N VALUE 0,
BDC_RECS_OUT(4) TYPE N VALUE 0,
BDC_RECS_ERR(4) TYPE N VALUE 0,
DATA_IN_RECS(4) TYPE N VALUE 0,
* Data constants
TRUE(1) TYPE C VALUE 'X',
FALSE(1) TYPE C VALUE ' ',
* Data variables
ABAPNAME LIKE SY-REPID,
ABAPTITLE LIKE SY-TITLE,
SAVE_UCOMM LIKE SY-UCOMM,
V_IHREZ LIKE VBAK-IHREZ.
* inbound header structure
DATA: BEGIN OF IDLORDH OCCURS 1000,
SO-NUMBER(5) TYPE N, "The order number given by the Vax - Alwa
ORDER-TYPE(1) TYPE N, "1 - Under-Bond Sale 3 - Duty-Paid Order
CUST-NO(7) TYPE N, "Id for customer
BRANCH-NO(4) TYPE N, "Id of customer's branch
PC-DATE-REQD(8) TYPE C, "Date that customer required the order
IDL-ORDER-NO(5) TYPE N, "Laptop's Order Number
SPEC-INS-1(40) TYPE C, "Text detailing special instruction for t
SPEC-INS-2(40) TYPE C, "Part 2 of above
PC-ORDER-DATE(8) TYPE C, "Date order was entered on the Laptop
ORDER-METHOD(1) TYPE N, "Always 5 for laptop
FOR-COLLECTION(1) TYPE C, "Y if customers is collecting order else
CASH-RECEIVED(9) TYPE N, "N/A
CASH-SHEET-NO(6) TYPE N, "N/A
CUST-ORDER-NO(14) TYPE C, "Customers Order Number - Optional
HOLD-FOR-PRICING(1) TYPE C, "Y if this order is held because no price
PC-PRICE-EFF-DATE(8) TYPE C, "Defaults to order date
NO-ITEMS(4) TYPE N, "Number of items for this order in detail
TOTAL-QTY-ORDERED(9) TYPE N, "Number of cases on this order
TOTAL-CE-ORDERED(9) TYPE N, "Number of case equivalents on this order
ORDER-STATUS(1) TYPE N, "Always 0 for new orders
SITE-PREFIX(1) TYPE C, "Plant from where the delivery will be ma
PC-USER-NO(3) TYPE N. "laptop user who crested order
DATA: END OF IDLORDH.
DATA: BEGIN OF IDLORDI OCCURS 1000,
SO-NUMBER(5) TYPE N, "The order number given by the Vax - Alway
ORDER-ENTRY-CODE(5) TYPE N, "Part Id
PC-DATE-REQD(8) TYPE C, "Date the customer required order.
QTY-TO-ORDER(4) TYPE N, "Number of units on the order.
PC-USER-NO(3) TYPE N, "Id of rep. Who created the order
IDL-ORDER-NO(5) TYPE N, "Laptop's Order Number
FREE-QTY-ORDERED(4) TYPE N, "Number of free units on the order.
PROMOTION-NO(4) TYPE N. "If Free units on the order, this is promo
DATA: END OF IDLORDI.
* Internal table to hold the mapped data.
DATA: BEGIN OF DATA_IN OCCURS 1000,
RTYPE(1) TYPE C,
* header
AUART LIKE VBAK-AUART, "order type
VKORG LIKE VBAK-VKORG, "sales org
VTWEG LIKE VBAK-VTWEG, "dist.channel
SPART LIKE VBAK-SPART, "division
KUNNR LIKE KUAGV-KUNNR, "customer num
* vkbur like vbak-vkbur, "sales off
* vkgrp like vbak-vkgrp, "sales grp
BSTNK LIKE VBAK-BSTNK, "po num
IHREZ LIKE VBAK-IHREZ, "po reference
BSTDK LIKE VBAK-BSTDK, "po date
KPRGBZ LIKE RV45A-KPRGBZ, "date type
* ketdat like rv45a-ketdat, "req delivery date
KETDAT(8) TYPE C , "req delivery date
PRSDT LIKE VBKD-PRSDT, "pricing date
LIFSK LIKE VBAK-LIFSK, "delivery block
INCO1 LIKE VBKD-INCO1, "inco terms
INCO2 LIKE VBKD-INCO2, "inco descript.
FAKSK LIKE VBAK-FAKSK, "biling block
KUNDE LIKE RV02P-KUNDE, "shipto
ltext1(256) type c, "Special text1
ltext2(256) type c, "Special text2
BSARK LIKE VBAK-BSARK, "ordering method
BNAME LIKE VBAK-BNAME, "orderer
WERKS LIKE VBAP-WERKS, "Site Prefix
* item
POSNR LIKE VBAP-POSNR, "item
MATNR LIKE VBAP-MATNR, "material
MENGE(15) TYPE C, "qty
FREE_MENGE(15) TYPE C, "Free qty ordered
PSTYV LIKE VBAP-PSTYV, "item category
ROUTE LIKE VBAP-ROUTE, "Collect or not
* vrkme(3) type c, "uom
* itext(40), "item txt
END OF DATA_IN.
DATA: BEGIN OF I_MATERIAL OCCURS 0,
MATNR LIKE MARA-MATNR,
ORDER LIKE IDLORDI-ORDER-ENTRY-CODE,
END OF I_MATERIAL.
DATA: BEGIN OF I_MAIL OCCURS 0.
INCLUDE STRUCTURE SOLI.
DATA: END OF I_MAIL.
* Internal table to contain BDC data.
DATA: BEGIN OF BDCDATA OCCURS 1000.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDCDATA.
DATA: BEGIN OF MESSTAB OCCURS 0.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF MESSTAB.
DATA: BEGIN OF I_OUTPUT OCCURS 1000.
INCLUDE STRUCTURE DATA_IN.
DATA: END OF I_OUTPUT.
DATA: OLD_RTYPE LIKE DATA_IN-RTYPE,
V_VBELN LIKE VBAK-VBELN,
V_ITEM_NO(2) TYPE N,
V_MAIL(1) TYPE C,
V_VIEW(1) TYPE C,
V_IDL-ORDER-NO LIKE IDLORDH-IDL-ORDER-NO,
V_PC-USER-NO LIKE IDLORDH-PC-USER-NO.
AT SELECTION-SCREEN.
* Check name of BDC session has been supplied.
IF BDC_NAME EQ SPACE.
SET CURSOR FIELD 'BDC_NAME'.
MESSAGE E002 WITH 'No batch-input session name supplied'.
ENDIF.
START-OF-SELECTION.
MOVE: SY-REPID TO ABAPNAME,
SY-TITLE TO ABAPTITLE.
IF VIEW = 'X'. V_VIEW = 'A'. ENDIF.
IF ERRORS = 'X'. V_VIEW = 'E'. ENDIF.
IF NO_DIS = 'X'. V_VIEW = 'N'. ENDIF.
IF P_FILE = 'X'.
* Read the input files.
PERFORM READ_FILES.
* Map the data.
PERFORM MAP_DATA.
* Create the BDC sessions.
PERFORM CREATE_BDC_SESSIONS.
MESSAGE I002 WITH 'Run the Report to check which orders have been
CREATED'.
ELSEIF P_TABLE = 'X'.
V_VIEW = 'A'.
* Load Data from table.
PERFORM F_TABLE_LOAD.
* Create the BDC sessions.
PERFORM CREATE_BDC_SESSIONS.
MESSAGE I002 WITH 'Run the Report to check which orders have been
CREATED'.
ELSEIF P_REPORT = 'X'.
*Submit report.
SUBMIT ZSDRLAPS AND RETURN
USING SELECTION-SETS OF PROGRAM 'ZSDILAPT'
WITH O_IHREZ IN O_IHREZ
WITH O_VBELN IN O_VBELN
WITH O_MESS IN O_MESS.
ENDIF.
* Archive the input file.
IF ARC_FIL NE SPACE.
PERFORM DEL_INP_FILE.
ENDIF.
IF V_MAIL = 1.
MOVE 'CTRL F6 to Execute the LAPTOP Error log Program' TO I_MAIL-LINE.
APPEND I_MAIL.
CLEAR I_MAIL.
CALL FUNCTION 'Z_SEND_MESSAGE'
EXPORTING
MAIL_TO = 'LAPTOPS'
MAIL_TITLE = 'LAPTOP SALES ORDERS'
ATTACH_TYPE = 'R'
NAME = 'ZSDRLAPS'
TABLES
CONTENTS = I_MAIL
EXCEPTIONS
PERS_NO_USERID = 1
OTHERS = 2.
ENDIF.
END-OF-SELECTION.
* FORM CREATE_BDC_SESSION *
* This form will create a BDC session. *
FORM CREATE_BDC_SESSIONS.
REFRESH BDCDATA.
CLEAR BDCDATA.
OLD_RTYPE = SPACE.
READ TABLE DATA_IN INDEX 1.
OLD_RTYPE = DATA_IN-RTYPE.
CLEAR DATA_IN.
LOOP AT DATA_IN.
IF OLD_RTYPE EQ '2' AND DATA_IN-RTYPE EQ '1'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/11'.
CALL TRANSACTION 'VA01' USING BDCDATA MODE V_VIEW UPDATE 'S'
MESSAGES INTO MESSTAB.
* if sy-subrc ne 0.
PERFORM F_MESSAGE_ANALYSIS.
* endif.
REFRESH BDCDATA.
ENDIF.
IF DATA_IN-RTYPE = 1.
PERFORM TRANS_VA01_HEADER.
ELSE.
PERFORM TRANS_VA01_ITEM.
ENDIF.
OLD_RTYPE = DATA_IN-RTYPE.
MOVE-CORRESPONDING DATA_IN TO I_OUTPUT.
APPEND I_OUTPUT.
CLEAR I_OUTPUT.
ENDLOOP.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/11'.
* Call transaction
CALL TRANSACTION 'VA01' USING BDCDATA MODE V_VIEW UPDATE 'S'
MESSAGES INTO MESSTAB.
* if sy-subrc ne 0.
PERFORM F_MESSAGE_ANALYSIS.
* endif.
REFRESH BDCDATA.
ENDFORM.
* FORM RANS_va01_header. *
* Set up BDCDATA table for transaction VA01. *
FORM TRANS_VA01_HEADER.
* Process program SAPMV45a screen 0101
* CREATE sales order Initial screen
PERFORM BDC_NEW_DYNPRO USING 'SAPMV45A' '0101'.
PERFORM BDC_FIELD USING 'VBAK-AUART' DATA_IN-AUART.
PERFORM BDC_FIELD USING 'VBAK-VKORG' DATA_IN-VKORG.
PERFORM BDC_FIELD USING 'VBAK-VTWEG' DATA_IN-VTWEG.
PERFORM BDC_FIELD USING 'VBAK-SPART' DATA_IN-SPART.
* perform bdc_field using 'VBAK-VKBUR' data_in-vkbur.
* perform bdc_field using 'VBAK-VKGRP' data_in-vkgrp.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/0'.
* Process program SAPMV45a screen 0402
PERFORM BDC_NEW_DYNPRO USING 'SAPMV45A' '0402'.
* Overview screen
PERFORM BDC_FIELD USING 'KUAGV-KUNNR' DATA_IN-KUNNR.
PERFORM BDC_FIELD USING 'VBAK-BSTNK' DATA_IN-BSTNK.
PERFORM BDC_FIELD USING 'VBAK-BSTDK' DATA_IN-BSTDK.
PERFORM BDC_FIELD USING 'RV45A-KPRGBZ' DATA_IN-KPRGBZ.
PERFORM BDC_FIELD USING 'RV45A-KETDAT' DATA_IN-KETDAT.
* perform bdc_field using 'VBKD-PRSDT' data_in-prsdt.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'KKAU'.
* Header Bus data
PERFORM BDC_NEW_DYNPRO USING 'SAPMV45A' '0300'.
PERFORM BDC_FIELD USING 'VBAK-LIFSK' DATA_IN-LIFSK.
PERFORM BDC_FIELD USING 'VBKD-INCO1' DATA_IN-INCO1.
PERFORM BDC_FIELD USING 'VBKD-INCO2' DATA_IN-INCO1.
PERFORM BDC_FIELD USING 'VBAK-FAKSK' DATA_IN-FAKSK.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'KPAR'.
* Partner
PERFORM BDC_NEW_DYNPRO USING 'SAPDV02P' '0624'.
PERFORM BDC_FIELD USING 'RV02P-KUNDE(4)' DATA_IN-KUNDE.
* text
IF DATA_IN-LTEXT1 NE SPACE.
PERFORM CREATE_TEXT.
ENDIF.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'KBES'.
* Purchase order data
PERFORM BDC_NEW_DYNPRO USING 'SAPMV45A' '0351'.
PERFORM BDC_FIELD USING 'VBAK-BSARK' DATA_IN-BSARK.
PERFORM BDC_FIELD USING 'VBAK-BNAME' DATA_IN-BNAME.
PERFORM BDC_FIELD USING 'VBAK-IHREZ' DATA_IN-IHREZ.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'UER1'.
ENDFORM.
* FORM TRANS_VA01_ITEM *
FORM TRANS_VA01_ITEM.
PERFORM BDC_NEW_DYNPRO USING 'SAPMV45A' '0402'.
IF OLD_RTYPE = '1'. "ie, this is the first item.
PERFORM BDC_FIELD USING 'VBAP-MATNR(001)' DATA_IN-MATNR.
PERFORM BDC_FIELD USING 'RV45A-KWMENG(001)' DATA_IN-MENGE.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/0'.
PERFORM BDC_NEW_DYNPRO USING 'SAPMV45A' '0402'.
PERFORM BDC_FIELD USING 'RV45A-VBAP_SELKZ(001)' 'X'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'PKAU'.
PERFORM TRANS_VA01_ITEM_DETAILS.
ELSE.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'POAN'. "create item
PERFORM BDC_NEW_DYNPRO USING 'SAPMV45A' '0402'.
PERFORM BDC_FIELD USING 'VBAP-MATNR(002)' DATA_IN-MATNR.
IF DATA_IN-MENGE = SPACE.
PERFORM BDC_FIELD USING 'RV45A-KWMENG(002)' DATA_IN-FREE_MENGE.
ELSE.
PERFORM BDC_FIELD USING 'RV45A-KWMENG(002)' DATA_IN-MENGE.
ENDIF.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/0'.
PERFORM BDC_NEW_DYNPRO USING 'SAPMV45A' '0402'.
PERFORM BDC_FIELD USING 'RV45A-VBAP_SELKZ(002)' 'X'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'PKAU'.
PERFORM TRANS_VA01_ITEM_DETAILS.
ENDIF.
ENDFORM.
*& Form TRANS_VA01_ITEM_DETAILS
* text
* --> p1 text
* <-- p2 text
FORM TRANS_VA01_ITEM_DETAILS.
*Business Data
PERFORM BDC_NEW_DYNPRO USING 'SAPMV45A' '0450'.
PERFORM BDC_FIELD USING 'VBAP-WERKS' DATA_IN-WERKS.
IF DATA_IN-MENGE = SPACE.
PERFORM BDC_FIELD USING 'VBAP-PSTYV' 'TANN'.
ENDIF.
* perform bdc_field using 'VBAP-PSTYV' 'TAN'.
* route mapping
IF DATA_IN-ROUTE = 'D'.
PERFORM BDC_FIELD USING 'VBAP-ROUTE' '000001'.
ELSE.
ENDIF.
PERFORM BDC_FIELD USING 'VBAP-FAKSK' DATA_IN-FAKSK.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'UER1'.
ENDFORM. " TRANS_VA01_ITEM_DETAILS
* FORM BDC_NEW_DYNPRO *
* Updates the BDCDATA table with the program and screen number *
* of the next screen. *
FORM BDC_NEW_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
* FORM BDC_FIELD *
* Updates the BDCDATA table with the field name and value of *
* the current screen. *
* --> FIELD - Field name *
* --> VALUE - Field value *
FORM BDC_FIELD USING FIELD VALUE.
IF VALUE NE SPACE.
CLEAR BDCDATA.
BDCDATA-FNAM = FIELD.
BDCDATA-FVAL = VALUE.
APPEND BDCDATA.
ENDIF.
ENDFORM.
*& Form READ_FILE
* text
* --> p1 text
* <-- p2 text
FORM READ_FILES.
* Read order headers
OPEN DATASET IDLH FOR INPUT IN TEXT MODE.
IF SY-SUBRC NE 0.
MESSAGE E002(ZZ) WITH 'Cannot find file in directory'.
ENDIF.
DO.
READ DATASET IDLH INTO IDLORDH.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
APPEND IDLORDH.
ENDDO.
CLOSE DATASET IDLH.
* Read order items
OPEN DATASET IDLI FOR INPUT IN TEXT MODE.
IF SY-SUBRC NE 0.
MESSAGE E002(ZZ) WITH 'Cannot find file in directory'.
ENDIF.
DO.
READ DATASET IDLI INTO IDLORDI.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
APPEND IDLORDI.
ENDDO.
CLOSE DATASET IDLI.
ENDFORM. " READ_FILE_INTO_CUST
*& Form DEL_INP_FILE
* text
* --> p1 text
* <-- p2 text
FORM DEL_INP_FILE.
DATA: PARAX(128).
DATA: PARAM(200).
DATA: CMDSTR(18),
CMD_RESULT LIKE BTCXPM OCCURS 10 WITH HEADER LINE,
LINES TYPE I.
DATA: PATH1(60) TYPE C.
DATA: PATH2(60) TYPE C.
DATA: NAME(20) TYPE C.
DATA: INTNAME(20) TYPE C VALUE 'LAPTOP',
V_FILENAME1(20) TYPE C VALUE 'ORDHT',
V_FILENAME2(20) TYPE C VALUE 'ORDIT'.
DATA: V_DATE LIKE SY-DATUM.
V_DATE = SY-DATUM+4(4).
CLEAR PARAX.
* build IN directory
PATH1 ='/'.
WRITE SY-SYSID TO PATH1+1(3). "D01 or T01 or P01 !
WRITE 'INT/' TO PATH1+4(4). "Interfaces
WRITE INTNAME TO PATH1+8(20).
CONDENSE PATH1 NO-GAPS.
WRITE '/IN' TO PATH1+30(5).
CONDENSE PATH1 NO-GAPS.
* build ARCH directory
PATH2 ='/'.
WRITE SY-SYSID TO PATH2+1(3). "D01 or T01 or P01 !
WRITE 'INT/' TO PATH2+4(4). "Interfaces
WRITE INTNAME TO PATH2+8(20).
CONDENSE PATH2 NO-GAPS.
WRITE '/ARCH' TO PATH2+30(5).
CONDENSE PATH2 NO-GAPS.
DO 2 TIMES.
CASE SY-INDEX.
WHEN 1.
IF IDLEX = 'X'.
CONCATENATE 'IDL' V_FILENAME1 INTO NAME.
ELSE.
CONCATENATE 'DB' V_FILENAME1 INTO NAME.
ENDIF.
* name = filename1.
WHEN 2.
IF IDLEX = 'X'.
CONCATENATE 'IDL' V_FILENAME2 INTO NAME.
ELSE.
CONCATENATE 'DB' V_FILENAME2 INTO NAME.
ENDIF.
* name = filename2.
ENDCASE.
CMDSTR = 'ZMOV'.
WRITE ' OBJ( TO PARAM.
WRITE PATH1 TO PARAM+7(50).
WRITE '/' TO PARAM+50(1).
CONDENSE PARAM NO-GAPS.
WRITE NAME TO PARAM+70(12).
CONDENSE PARAM NO-GAPS.
WRITE )@TOOBJ( TO PARAM+70(13).
CONDENSE PARAM NO-GAPS.
WRITE PATH2 TO PARAM+82(60).
CONDENSE PARAM NO-GAPS.
WRITE '/' TO PARAM+140(1).
CONDENSE PARAM NO-GAPS.
WRITE V_DATE TO PARAM+140(4).
CONDENSE PARAM NO-GAPS.
WRITE NAME TO PARAM+140(15).
CONDENSE PARAM NO-GAPS.
WRITE )' TO PARAM+142(5).
CONDENSE PARAM NO-GAPS.
REPLACE '@' WITH ' ' INTO PARAM.
* replace '@' with ' ' into param.
MOVE PARAM(127) TO PARAX(127).
CALL FUNCTION 'SXPG_CALL_SYSTEM'
EXPORTING
COMMANDNAME = CMDSTR
PARAMETERS = PARAX
TABLES
EXEC_PROTOCOL = CMD_RESULT
EXCEPTIONS
NO_PERMISSION = 1
COMMAND_NOT_FOUND = 2
OTHERS = 4.
IF SY-SUBRC <> 0. "extenal command not executed
MESSAGE I002 WITH 'error calling external command - call sys admin'.
ENDIF.
ENDDO.
ENDFORM. " DEL_INP_FILE
*& Form CREATE_TEXT
* text
* --> p1 text
* <-- p2 text
FORM CREATE_TEXT.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'KTEX'.
* Text overview
PERFORM BDC_NEW_DYNPRO USING 'SAPMV45A' '0150'.
PERFORM BDC_FIELD USING 'RTEXT-SELKZ(02)' 'X'.
PERFORM BDC_FIELD USING 'RTEXT-SPRAS(02)' 'E'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'TEDE'.
* Text editor
PERFORM BDC_NEW_DYNPRO USING 'SAPLSTXX' '1100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/06'.
PERFORM BDC_NEW_DYNPRO USING 'SAPLSTXX' '1100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'RSTXT-TXLINE(02)'.
PERFORM BDC_FIELD USING 'RSTXT-TXLINE(02)' DATA_IN-LTEXT2(70).
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/06'.
PERFORM BDC_NEW_DYNPRO USING 'SAPLSTXX' '1100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'RSTXT-TXLINE(02)'.
PERFORM BDC_FIELD USING 'RSTXT-TXLINE(02)' DATA_IN-LTEXT1(70).
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'RSTXT-TXLINE(04)'.
* perform bdc_field using 'BDC_OKCODE' '/06'.
* perform bdc_new_dynpro using 'SAPLSTXX' '1100'.
* PERFORM BDC_FIELD USING 'RSTXT-TXLINE(004)' DATA_IN-ltext+140(70).
* PERFORM BDC_FIELD USING 'BDC_OKCODE' '/06'.
* PERFORM BDC_NEW_DYNPRO USING 'SAPLSTXX' '1100'.
* PERFORM BDC_FIELD USING 'RSTXT-TXLINE(005)' DATA_IN-ltext+210(46).
* PERFORM BDC_FIELD USING 'BDC_OKCODE' '/06'.
PERFORM BDC_NEW_DYNPRO USING 'SAPLSTXX' '1100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'TXVB'.
PERFORM BDC_NEW_DYNPRO USING 'SAPLSTXX' '1100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'TXEX'.
PERFORM BDC_NEW_DYNPRO USING 'SAPMV45A' '0150'.
ENDFORM. " CREATE_TEXT
*& Form MAP_DATA
* text
* --> p1 text
* <-- p2 text
FORM MAP_DATA.
TABLES: KNB1, CABN, AUSP.
TABLES: ZPM1.
DATA: V_CUST_NO(11) TYPE C.
CLEAR IDLORDH.
CLEAR DATA_IN.
SELECT * FROM CABN
WHERE ATNAM = 'ORDER_ENTRY_CODE'.
EXIT.
ENDSELECT.
SELECT OBJEK ATWRT INTO (I_MATERIAL-MATNR, I_MATERIAL-ORDER)
FROM AUSP
WHERE ATINN = CABN-ATINN.
APPEND I_MATERIAL.
ENDSELECT.
LOOP AT IDLORDH.
MOVE '1' TO DATA_IN-RTYPE.
* Order type.
DATA_IN-AUART = 'ZOR'.
* Sales organisation
IF IDLEX EQ 'X'.
DATA_IN-VKORG = '1100'. "idl domestic.
ELSE.
DATA_IN-VKORG = '1350'. "dillion bass domestic.
ENDIF.
* Distribution Channel
DATA_IN-VTWEG = '10'.
* Division
DATA_IN-SPART = '10'.
* Customer Number
IF IDLORDH-CUST-NO(1) = SPACE.
CONCATENATE '0' IDLORDH-CUST-NO INTO V_CUST_NO.
CONDENSE V_CUST_NO NO-GAPS.
ELSE.
V_CUST_NO = IDLORDH-CUST-NO.
ENDIF.
DO 4 TIMES.
IF IDLORDH-BRANCH-NO CS SPACE.
REPLACE SPACE WITH '0' INTO IDLORDH-BRANCH-NO.
ENDIF.
ENDDO.
move idlordh-branch-no to v_cust_no+7(4).
select * from knb1 where eikto = v_cust_no.
EXIT.
ENDSELECT.
MOVE KNB1-KUNNR TO DATA_IN-KUNNR.
* Sales Office
*ata_in-vkbur.
* Sales Group
*ata_in-vkgrp
* PO number
DATA_IN-BSTNK = IDLORDH-CUST-ORDER-NO.
* PO ref number
IF IDLORDH-IDL-ORDER-NO(1) EQ SPACE.
MOVE IDLORDH-IDL-ORDER-NO TO V_IDL-ORDER-NO.
REPLACE SPACE WITH '0' INTO V_IDL-ORDER-NO.
ENDIF.
MOVE IDLORDH-PC-USER-NO TO V_PC-USER-NO.
DO 3 TIMES.
REPLACE SPACE WITH '0' INTO V_PC-USER-NO.
ENDDO.
CONCATENATE V_IDL-ORDER-NO '-' V_PC-USER-NO INTO V_IHREZ.
DATA_IN-IHREZ = V_IHREZ.
* PO Date
DATA_IN-BSTDK = IDLORDH-PC-ORDER-DATE.
DO 2 TIMES.
REPLACE '/' WITH '.' INTO IDLORDH-PC-ORDER-DATE.
ENDDO.
DATA_IN-BSTDK = IDLORDH-PC-ORDER-DATE.
* Date Type
*ata_in-kprgbz
* Required Delivery Date
DO 2 TIMES.
REPLACE '/' WITH '.' INTO IDLORDH-PC-DATE-REQD.
ENDDO.
DATA_IN-KETDAT = IDLORDH-PC-DATE-REQD.
*pricing date
*ata_in-prsdt
*delivery block
*ata_in-lifsk
*inco terms.
IF IDLORDH-FOR-COLLECTION = 'Y'.
DATA_IN-INCO1 = 'EXW'.
ELSE.
DATA_IN-INCO1 = 'CIF'.
ENDIF.
*inco description
*ata_in-inco2
*billing block
IF IDLORDH-HOLD-FOR-PRICING = 'Y'.
DATA_IN-FAKSK = '99'.
ENDIF.
*shipto
*ata_in-kunde
*special text
DATA_IN-LTEXT1 = IDLORDH-SPEC-INS-1.
DATA_IN-LTEXT2 = IDLORDH-SPEC-INS-2.
*ordering method
DATA_IN-BSARK = 'LAPT'.
*plant.
SELECT * FROM ZPM1
WHERE ZLPLANT = IDLORDH-SITE-PREFIX.
EXIT.
ENDSELECT.
DATA_IN-WERKS = ZPM1-ZWERKS.
*orderer
*data_in-bname
APPEND DATA_IN.
CLEAR DATA_IN.
LOOP AT IDLORDI WHERE IDL-ORDER-NO = IDLORDH-IDL-ORDER-NO AND
PC-USER-NO = IDLORDH-PC-USER-NO.
MOVE '2' TO DATA_IN-RTYPE.
*item
*material no.
READ TABLE I_MATERIAL WITH KEY ORDER = IDLORDI-ORDER-ENTRY-CODE.
DATA_IN-MATNR = I_MATERIAL-MATNR.
*Order quantity
DATA_IN-MENGE = IDLORDI-QTY-TO-ORDER.
DATA_IN-FREE_MENGE = IDLORDI-FREE-QTY-ORDERED.
*plant.
DATA_IN-WERKS = ZPM1-ZWERKS.
*ata_in-pstyv
* route
* vrkme
* itext
APPEND DATA_IN.
IF IDLORDI-FREE-QTY-ORDERED > 0.
CLEAR DATA_IN-MENGE.
APPEND DATA_IN.
ENDIF.
CLEAR DATA_IN.
ENDLOOP.
ENDLOOP.
ENDFORM. " MAP_DATA
*& Form F_MESSAGE_ANALYSIS
* <-- p2 text
FORM F_MESSAGE_ANALYSIS.
DATA: V_FIRST(1) TYPE C VALUE '1',
V_COUNT(2) TYPE N,
V_MESSAGE(1) TYPE C,
V_MESSLINES(2) TYPE N.
CLEAR: V_IHREZ, V_MESSLINES.
DESCRIBE TABLE MESSTAB LINES V_MESSLINES.
READ TABLE MESSTAB WITH KEY MSGTYP = 'S' MSGID = 'V1' MSGNR = '311'.
IF SY-SUBRC = 0.
IF V_MESSLINES = 1.
V_MESSAGE = 'S'.
ELSE.
V_MESSAGE = 'W'.
V_MAIL = 1.
ENDIF.
V_VBELN = MESSTAB-MSGV2(08).
ELSE.
V_MESSAGE = 'E'.
V_MAIL = 1.
ENDIF.
V_FIRST = 1.
LOOP AT I_OUTPUT.
IF V_FIRST = 1.
MOVE I_OUTPUT-IHREZ TO V_IHREZ.
CLEAR V_FIRST.
ENDIF.
ZSOM1-VBELN = V_VBELN.
ZSOM1-ITEM_NO = V_ITEM_NO.
ZSOM1-MESS = V_MESSAGE.
MOVE-CORRESPONDING I_OUTPUT TO ZSOM1.
ZSOM1-IHREZ = V_IHREZ.
MODIFY ZSOM1.
CLEAR ZSOM1.
V_ITEM_NO = V_ITEM_NO + 1.
ENDLOOP.
LOOP AT MESSTAB.
V_COUNT = V_COUNT + 1.
ZSOM2-MCOUNT = V_COUNT.
ZSOM2-IHREZ = V_IHREZ.
CASE MESSTAB-MSGTYP.
WHEN 'E'.
MOVE-CORRESPONDING MESSTAB TO ZSOM2.
WHEN 'A'.
MOVE-CORRESPONDING MESSTAB TO ZSOM2.
WHEN 'W'.
MOVE V_VBELN TO ZSOM2-VBELN.
MOVE-CORRESPONDING MESSTAB TO ZSOM2.
WHEN 'I'.
MOVE V_VBELN TO ZSOM2-VBELN.
MOVE-CORRESPONDING MESSTAB TO ZSOM2.
WHEN 'S'.
MOVE V_VBELN TO ZSOM2-VBELN.
MOVE-CORRESPONDING MESSTAB TO ZSOM2.
ENDCASE.
MODIFY ZSOM2.
CLEAR ZSOM2.
ENDLOOP.
REFRESH: MESSTAB, I_OUTPUT.
CLEAR: MESSTAB, I_OUTPUT.
CLEAR: V_FIRST, V_VBELN, V_IHREZ, V_ITEM_NO, V_COUNT, V_MESSAGE.
ENDFORM. " F_MESSAGE_ANALYSIS
*& Form F_TABLE_LOAD
FORM F_TABLE_LOAD.
SELECT * FROM ZSOM1
WHERE IHREZ IN O_IHREZ
AND MESS = 'E'.
IF NOT ZSOM1-VBELN IS INITIAL.
CHECK ZSOM1-VBELN IN O_VBELN.
ENDIF.
MOVE-CORRESPONDING ZSOM1 TO DATA_IN.
APPEND DATA_IN.
CLEAR DATA_IN.
ENDSELECT.
ENDFORM. " F_TABLE_LOAD -
Procurement Card data upload from flat file to database
Hi All,
I need to upload Procurement Card data from a flat file to the database in the table BBP_PCMAS.
I found a BAPI BAPI_PCARD_CREATEMULTIPLE which uploads the data perfectly, however the structure PCMASTER that it takes as input does not contain the field for Blocking reason PCBLOCK - Reason for blocking procurement card. I need to upload this file as well from the flat file.
Any suggestions?
ThanksHi,
You are correct the function module BAPI_PCARD_CREATEMULTIPLE does not contain the PCBLOCK field.
Alternatively what you can do is read the PC data after it is created and modify it with the PCBLOCK appropiately. The necessary function modules are given below.
BBP_PCMAS_READ_PCMAS - Read Data
BBP_PCMAS_MODIFY_PCMAS - Modify Data
Note: BBP_PCMAS_MODIFY_PCMAS is a Update Task FM. Hence it shoild be called as given below, ( refer form write_data of the FM BAPI_PCARD_CREATEMULTIPLE)
call function 'BBP_PCMAS_MODIFY_PCMAS' in update task
exporting
i_pcmas = i_pcmas
* I_PCMAS_OLD =
* I_DELETE =
tables
t_pcacc = i_pcacc
* T_PCACC_OLD =
exceptions
not_found = 1
others = 2.
Regards
Kathirvel -
UNICODE Problem when Download/Upload from ASC file.
Due to the Unicode system takes each Chinese character as a byte, the field(10) can take 10 Chinese Characters, not like before only 5 characters allowed.
The problem is when the data is downloaded to a txt file, the field ,length 10, contained Characters, is displayed 10 Chinese characters(that's 20 bytes in txt file). It causes the displayed field length are changed.
ex.
text = '12@@@@@00012345'.
text = text+0(12) --> display '12@@@@@' the output I actually want.
text = text+0(12) --> display '12@@@@@00012' Unicode makes this in txt file,
the Chinese characters cannot display properly, so just assume each '@' as a Chinese character.
How to make system take the Chinese characters as 2 bytes when download....or any other better idea for this?
anyone who can solve this, thanks in advance.Hi Prashant and Uwe,
Thanks for your help. I used 'GUI_UPLOAD', but it still doesn't work.
'Text1' still equal to '12@@@@@00012' , not '12@@@@@'
My test problem as below:
data: l_file type string.
text1(20) type c.
DATA: BEGIN OF T_FICH OCCURS 0,
LIGNE(5000),
END OF T_FICH.
l_file = P_SOURCE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = l_file
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
Read_By_Line = 'X'
CODEPAGE = '8400'
TABLES
DATA_TAB = T_FICH
EXCEPTIONS
OTHERS = 99.
LOOP AT T_FICH.
text1 = T_FICH-LIGNE+0(12).
ENDLOOP.
Could you give me some advise about this? -
Loading Hierarchy from flat file giving dump
Hi gurus,
i am trying to load data from flat file to hierarchy, when i am trying to schedule the infopackage its giving message PLEASE SELECT THE VALID INFOOBJECT and if i proceed even its giving a dump :-ASSIGN LENGTH 0.
i tired using i-doc method...then i am getting records in to BW in red and the same error
InfoObject INFOOBJECT is not available.
i followed the blog
/people/prakash.bagali/blog/2006/02/07/hierarchy-upload-from-flat-files
> points will be assigned for inputs.
Message was edited by:
ravi ahi guys,
my heirarchy is different from the one in the blog. should i mark all the infoobjects in all nodes as hierarchy relavant or only the bottom one? i also brought the 0hier_node from the business content. i dont know what other valid infoobject is missing ......plz help........
the following are more details about the dump
Program error: ASSIGN with length 0 in program "SAPLRRSV".
Error analysis
An ASSIGN statement in the program "SAPLRRSV" contained a field symbol with
length 0. This is not possible.
length 0.
This is not possible -
I have to load hierarchy from flat file
Hi Guys,
I build a balance sheet Report,which is showing the report based on financial statement item(0glaccext)hierarchy.
But previously client is maintaining some third party system,so client wants to load all the GL accounts in to BW.
When i load the GL accounts in to BW using flat file,in report it is not showing based on hierarchy for the flat file GL accounts.
So i need to load the hierarchy also for those GL accounts,how to load the GL accounts using flat file to maintain the hierarchy based on Assets,liabilities etc...Abdul,
You might want to take a look here:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0403a990-0201-0010-38b3-e1fc442848cb
or else see this weblog:
/people/prakash.bagali/blog/2006/02/07/hierarchy-upload-from-flat-files
assign points if useful
kalyan -
Uploading a text file from webi filter area as part of the query condition
Post Author: balasura
CA Forum: Publishing
Requirement : Uploading a text file from webi filter area as part of the query condition Hi, I am in a serious requirement which I am not sure available in BO XI. Can some one help me plz. I am using BO XI R2, webi I am generating a ad-hoc report, when I want to give a filter condition for a report, the condition should be uploaded from a .txt file. In the current scenario we have LOV, but LOV could hold only a small number of value, my requirement is just like a lov but the list of values will be available in a text file ( which could number to 2000 or 2500 rows). I would like to upload this 2500 values in the form of a flat text file to make a query and genrate report. Is it possible in BO XI? For Eg:- Select * from Shipment Where u201CShipment id = u2018SC4539u2019 or Shipment id = u2018SC4598u2019u201D The u201Cwhereu201D condition (filter) which has shipment id will be available in a text file and it needs to be loaded in the form of .txt file so that it will be part of the filter condition. Content of a .txt file could be this shipment.txt =============== SC4539 sc2034 SC2343 SC3892 . . . . etc upto 2500 shipment Ids I will be very glad if some could provide me a solution. Thanks in advance. - BalaHi Ron,
This User does not have the access to Tcode ST01.
The user executed Tcode SU53 immediately following the authorization failure to see the authorization objects. The 'Authorization obj' is blank and under the Description it has 'The last Authorization check was successful' with green tick mark.
Any further suggestions, PLEASE.
Thanks.
Maybe you are looking for
-
Itunes 9 on a NAS for Windows and Mac
I have read dozens of posts here but cannot find the answer so hoping to get this cleared up once and for all. I have a NeadyNAS NV+ where my "My Music" folder exists. The NAS has a Firefly iTunes server I have a Win7 desktop, Vista laptop and two Ma
-
Does anybody know how I can delete/disable the download button in a photo gallery. As a pro photographer I surelly don't want any download possiblity for the whole public. Many thanks in forward
-
How to Install PHP in PL/SQL??
Hello!! How to install php in pl/sql ??
-
Friends, I have configured mail transport for portal. In SMTP server name I have given its IP address. Is it right or i should give address like "smtp.xxx.xx". I am expecting some quick response. regards, M.Arunkumar.
-
every time i empty my trash in iphoto, it quits unexpectedly and wants me to send the into to apple. of which i do, but why, i empty the trash of photos and it quits and the photos remain in the trash what should i do