APD - Query output on to a Flat file
All
We are on BI 7.0 with SP13 and NWS 12. I am trying to create a new APD with source as "Query" built on Info object and target as "Flat File". There is no requirement of transformation so I am trying to map directly from Source to Target with a direct link with out using any transformations in between,
I could check and found no errors in APD definition and when I run APD, the file is getting created both on application server and local workstation but with 0 records.
The volume of records are expected to be around 4 millions on this query and am just wondering why APD is not writing any data on CSV file.
Pls let me know the following;
- What is wrong in the above process and why it is not writing data on to flat file
- Can APD handle volume of 4 million rows even though job runs in the background?
Your inputs in this are highly helpful and thanks for your time to provide solution.
Thanks - Sriram
Hi
Thanks for your reply and I could solve this issue and found the root cause.
The very purpose of this APD is to provide a list of business partners to an upstream systerm with few attributes and in this process one of my consultant has deactivated the key figure in the query which is an input for APD process.
When the key figure is inactivated ( this is the only key figure in the query ), APD does not recognize query as a valid one and sends out an error message.
When we re activate the key figure ( I have hidden this later using APD transformations to hide the column and send output to a flat file on to unix server ) in the query, the APD runs fine and could deliver the output in flat file.
Thanks
Similar Messages
-
Query Output to download in flat file through APD or other means?
Hello Experts,
I am currently on BW3.5 system and have requirement to load query output in flat file in .csv format. I checked the option of APD but looks like we cant directly load the query output in flat file like in APD (BW 3.5 system) .
One way i can think of it...load the query output in transactional ODS and built an infospoke on it to write into flat file.
Please advice if there are any better methods to store the query output in flat files.
Thanks!Hi,
Use RSCRM_BAPI.
See
Re: RSCRM_Bapi
See the help on RSCRM_BAPI
Re: Running Quaries automatically and saving them in as a Excel file in Server
Re: Data transfer to external systems
Re: Loading from a Custom R/3 Table
Re: How can I schedule my Bex report to execute in background
Re: How can I insert the RSCRM_BAPI into Process chain?
Thanks
Reddy -
Outputting data to a flat file
Hi. Sorry if this is really a simple question, but I am new to PL/SQL and SQL.
I need to select all the fields from a table and output it to a flat file. Can you tell me how to do this, ie give me a sample code.
Thanks.Hey CD,
Theres Nothing more simple than outputting values in to a flat file from PL/SQL.
1-Open a cursor containing your field values.
2- Use the UTL_FILE package from Oracle to output the results....
Like so:
PROCEDURE PROC_PROCEDURE()
IS
-- declare variables!
var_FileHandle UTL_FILE.FILE_TYPE; -- file handle
var_Values VARCHAR2(4000); -- record layout
-- declare cursors
CURSOR cur_cursor IS
SELECT *
FROM table
WHERE {conditions}
-- declare cursor variables
varcur_cursor cur_cursor%ROWTYPE;
BEGIN
-- Open File to write...
var_FileHandle := UTL_FILE.FOPEN(ExportFilePath, FileName, 'w', 8191);
-- Select records...
FOR varcur_cursor IN cur_cursor LOOP
-- Build INSERT statements...
var_Values := varcur_cursor.FIELDNAME1
| |varcur_cursor.FIELDNAME2
| | ...more fields....
-- Insert Values into flat file...
UTL_FILE.PUT_LINE(var_FileHandle, var_Values);
END LOOP;
-- Close text file...
UTL_FILE.FCLOSE(var_FileHandle);
END PROC_PROCEDURE;
Hope this helps!
Mg. -
How to create sqlplus output spool to a flat file with a header record
Hi all,
I've requirement to spool data from a table to a flat file along with column headings in the first row.I'm getting data but I need header record in the first row also?
Thanks,
Mahender.Hi, Mahender,
If you give this SQL*Plus command before you start SPOOLing
SET PAGESIZE 50000then you can get the usual SQL*Plus column headings, and they won't repeat unless you have more than 50,000 rows of output.
When I can't do that, I use PROMPT
{spool}
SPOOL foo.txt
PROMPT empno ename job mgr ...
SELECT empno, ename, job, mgr ...
PROMPT will trim leading whitespace (unless you enclose it in quotes), but it will leave spacing between the columns alone.
You could also do a separate query, where you select some literals from dual:SPOOL foo.txt
SELECT ' empno ename job mgr ...'
FROM dual;
SELECT empno, ename, job, mgr ... -
Automation of Query generation and Conversion to Flat File CSV
I have a requirement for Generating / Executing the refresh for the existing Query IN BEX automatically on 3 rd Business day of Every Quarter in BEX Analyzer AND also to convert it to flat file after generation. Please give me some documents or exact steps on how to go about this
automation. Please reply me in detail and soon
Thanks
SoniyaHi Sir, I will be very grateful if u can clarify
1. User want the flat file on the Company Server, which means there are folder on my company BMW server , and he wants to see the flat file there so that he can review it
2. I saw some AL11 and directories how can I create my directory or Create the file in DIR_HOME and see the file in flat file format it shows like a screen which my user do not want, he just want a flat file.
3.Please suggest me if this method rscrm_bapi will work or should u suggest download scheduler or report agent and how.
4. Sorry for the question but my problem and requirement of user is not solved
please reply soon
thanks
soniya -
Query regarding Import Dimensions using Flat File in EPMA
Hi All,
I am trying to import dimensions and Dimension properties using a flat text file to the master dimension library. If I try to include any properties (HFM) in the !Members Section, I am getting an error "Input Line ... does not have the expected format of 1 columns". But if I remove the properties and just build the members and hierarchies without any properties definition, I am able to succeed. Can someone guide me on what I might be missing with regards to member properties? Below is the format of the input text file.
!Section=Dimensions
'Name,DimensionClass,DimensionAlias,CustomDimensionID
HFM_Entity,Entity,HFM_Entity,
!MEMBERS=HFM_Entity
'Name,Allow Adjustments
10001000,Y
10001100,Y
!HIERARCHIES=HFM_Entity
'Parent,Child
Please let me know if any other information is required.
Cheers,
HyperionUserHi,
Have a look in directory \Hyperion\products\Planning\bin\sampleapp
there is a sample ads file :- SampApp Source Flat File.ads
Cheers
John
http://john-goodwin.blogspot.com/ -
How to Add Header and Footer in Flat file
HI All,
I am using ODI 11g.
MY interface is populating data from joining to 2 tables through sql query and Loads in to Flat file.
But i need to add Header and Footer in the Flat file.
In the below 3 lines
The 1st line is header ....2nd line is Data ....3rd line is Footer.
Any ideas how to work on this.
HSB9KT.KTPRTO.EBSDATA.D0000000 20120626020636
CFFE00263 SOLGSR014991340000527894536058173880207SOLNE06242012072420120000009048382650000247MRS
T00000000000000000000
Thanks,
LonyHi Drieux,
i am able to add Header and Footer in this.
But i want the header like Its like HSB9KT.KTPRTO.EBSDATA.D0000000 || SYSDATE (YYYYMMDDHHMMSS)
In my Out put i only see header as HSB9KT.KTPRTO.EBSDATA.D0000000 .
I have added a Variable where i am using SELECT to_char(sysdate,'YYYYMMDDHHMMSS') FROM DUAL query.
create header (HSB9KT.KTPRTO.EBSDATA.D0000000 #v_DATE)
/*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=FFT_SOLSNP$CRLOAD_FILE=/home/tarak/FFT_SOL.datSNP$CRFILE_FORMAT=FSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000ASNP$CRFILE_FIRST_ROW=0SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=descrSNP$CRTYPE_NAME=STRINGSNP$CRLINE_OFFSET=1SNP$CRLENGTH=994SNP$CRPRECISION=994SNP$CR$$SNPS_END_KEY*/
Any idea why this sysdate part is not showing in Header. -
Ssis issue - load recent added 5 flat files
HI
i have one query like i have 5 flat files in one folder today i loaded into sql server table,tomorrow again added 5 flat files in same folder.i want to load recent added 5 flat files,
can any one give me answer?You need to have a loop and inside it have a step to check for file modified date for getting the recent files. Much better is if filename has timestamp part use that to determine the latest files
see example here
http://visakhm.blogspot.in/2012/05/package-to-implement-daily-processing.html
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
SSIS Compare 2 flat files and create a third flat file
Hey all,
I have two flat files structured as:
Flat File A:
3213,214,14,21421,354,325
Flat File B:
3213,214,14, 55,89, 21421,354,325
I am trying to create an ETL Package that compares Flat File A, to Flat File B, finds an anomaly, in this case
55,89, then outputs the anomalies to Flat File C, separated by commas.
How would I go about doing this? Everything I have looked at shows comparisons between SQL DB's.
Any suggestions?
Thank youHi, I'm looking for a no code solution for my clients. They're happy with drag and drop, but would prefer a no-code solution. Is this possible?
sorry what do you mean by drag and drop? what will client drag and drop? From what interface?
If you can give bigger picture then it would help
In SSIS you've to implement using SSIS tasks only
And in the above case you need to write code in any case be it script task which is in C#,VB .NET or be it execute sql task which is sql.
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Open Hub Destination with Flat File - Structure file is not correct
Using the new concept for Open Hub destination (NOT an InfoSpoke).
Output is to a Flat File. Remember that when output is to a flat file 2 files are generated: the output file and a structure file (S_<name of output file>.CSV)
The Output file structure corresponds to the structure defined in the Open Hub destination.
However, the S_ (structure) file does not reflect the proper structure. The S_ file lists all fields sorted in alphabetical order based on the field name, instead of listing all fields in the correct order that they appear in the output file.
I have not found any settings that I can modify for the S_ file. When using InfoSpokes the S_ file is correct and I do not have to do anything.
The issue is that the S_ file cannot be used to describe the output file. This is a problem.
Anyone knows a solution to this issue? The goal is to get the S_ file to reflect the proper structure.
I could not find any Notes on this. Please do not send general help links, this is a specific question.
Thank you all for your support.Hi,
However, the S_ (structure) file does not reflect the proper structure. The S_ file lists all fields sorted in alphabetical order based on the field name, instead of listing all fields in the correct order that they appear in the output file.
As I know and checked this is not the case. The S_ file has the fields in the order of infospoke object sequence ( and in transformation tab, source structure).
I would suggest you to control it again.
Derya -
Procedure to save the output of a query into excel file or flat file
Procedure to save the output of a query into excel file or flat file
I want to store the output of my query into a file and then export it from sql server management studio to a desired location using stored procedure.
I have run the query --
DECLARE @cmd VARCHAR(255)
SET @cmd = 'bcp "select * from dbo.test1" queryout "D:\testing2.xlsx;" -U "user-PC\user" -P "" -c '
Exec xp_cmdshell @cmd
error message--
SQLState = 28000, NativeError = 18456
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'user-PC\user'.
NULL
Goel.AmanHello,
-T:
Specifies that the bcp utility connects to SQL Server with a trusted connection using integrated security. The security credentials of the network user,
login_id, and password are not required. If
–T is not specified, you need to specify
–U and –P to successfully log in.
-U:
Specifies the login ID used to connect to SQL Server.
Note: When the bcp utility is connecting to SQL Server with a trusted connection using integrated security, use the
-T option (trusted connection) instead of the
user name and password combination
I would suggest you take a look at the following article:
bcp Utility: http://technet.microsoft.com/en-us/library/ms162802.aspx
A similar thread regarding this issue:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/b450937f-0ef5-427a-ae3b-115335c0d83c/bcp-connection-error-sqlstate-28000-nativeerror-18456?forum=sqldataaccess
Regards,
Elvis Long
TechNet Community Support -
APD from query to flat file - Results not correct
Hi All,
Need your help to resolve the issue.
I am using APD with query as source and target as file download.
For small sets of data the reults are dowloaded correct, howver if there is a large set more than 30K records the results dowloaded are incorrect.
BEX results are fine, the issue is only with APD dowload.
Appreciate all your responses at the earliest.i
Thanks
HariHi Hari,
By using the tcode RSCRM_BAPI you can Extract the date into Table or CSV file or save the file to the Application server .
please check the below link:
https://websmp103.sap-ag.de/~sapdownload/011000358700004400232004E/HowToRSCRM_BAPI.pdf
Thanks and Regards
Sekhar -
Saving query results to a flat file
Hello Experts!
We have a very specific issue on our current project and I would like to know if any of you have ever done something similar. We are taking query results from BW (after complex calculations, some based on SY-DATE) and saving them to flat files to transfer to a SQL database structure on the Enterprise Portal. From here, the portal team renders the information into more "static" dashboards that include mouse over features and even limited drilldown (i.e. no matter where a user clicks the report always drills down on profit center)
There are many reasons why the model is set up as such (mostly training of executive level end users), and even though it doesn't mesh with the idea that BW could do this work on its own, we have to work with what we have.
We have come up with 3 possible ways to save this data to flat files and hopefully someone can tell us which might be the most effective.
1.) Information Broadcasting. If we broadcast XML files to the portal, will the portals team be able to read that data into a SQL database? Is there another way to use broadcasting to create and send a flat file to specific location?
2.) RSCRM_BAPI. This transaction seems to not support texts.
3.) Open Hub. In order to get the open hub to work, we first have to save all of our query results to direct write data store objects using APD. (calculations based on current date, for example, would require daily full loads to the underlying data providers otherwise.)
What is the best way to accomplish this? Is information broadcasting capable of doing this?
Thanks!Hi Adam,
Do you have to use flat files to load the information to a SQL database? (if so maybe someone else has a suggestion on which way would be the best).
I try to stay away from flat file uploads as there is a lot of manual work involved. May I suggest setting up a connection to your SQL table in the DBCON table and then writing a small abap program to push data into the SQL database (which you can automate).
1) Use APD to push data into a table within BW.
2) Go to transaction SM30 > table DBCON and setup a new entry specifying the conncection parameters to your SQL database.
3) In SE38 Write an ABAP program along the folloing lines (assuming the connection you set in DBCON is named conn1:
data: con_name like dbcon-con_name
con_name = 'conn1'.
exec sql.
set connection :con_name
endexec.
****have a select statement which reads data from your table which the data is saved from the APD into an internal table**********
****loop on the internal table and have a SQL insert statement to insert the records into the SQL table as below******
exec sql.
insert into <SQL TABLE> (column names seperated by ,)
values (column names of the internal table seperated by ,) if the internal table is named itab the columns have to be specified as :itab-column1
If you decide to take this approach you may find more info on DBCON and the process in sdn. Good Luck!
endexec. -
Re-arrange the flat file out put in APD
Hi Guys,
I am loading data in APD,soruce is Query and target is Flat file.i want to re-arrange the out put file.
Let me know what are the possible ways to re-arrange the columns in the out put flat file.
Regards,
JayapalThere are three ways to do this:
1. Use Hide or Rename Columns (Projections) under Transformations in between the query and the flat file (recommended method)
Under the field selection tab..transfer the fields to the right pane in the order you wish to view thwm in.
2.Drag and drop a routine
Go to source fields tab
Move the entries in the right to the bottom left 'Source Fields' pane.
Then go to the Target field tab.
Right Click on the row and click unfreeze columns
Now you can drag & Drap and re-arrange the fields.
Insert the routine in between query and Flat file
3. Change the order of the fields in the Query Definition( Not Recommended)
Cheers! -
Not able to display flat file's error line in output
The below Source Code is BDC for XD01 (update Customer Master Record) in CALL TRANSACTION method. This program is written in call transaction method cause as per users requirement, user wants error log to be printed as soon as the BDC process finished in the background mode.
When you execute this below program it will show a selection screen from where you can select your flat file from system.
After executing this code show output like below as soon as it finished processing the FLAT file.
1. Customer Update Summary
2. Successful record with customer number and name.
3. Error Records with 'record number' and 'reason for error'
(For testing you just have to copy-paste-save-active the source code)
And I have encountered an issue over here in 3rd section-Record Number of Error Records.
The Record Number is for display the line number of that flat file line which in which error has occurred.
The Record Number Entries showing only 0 instead of showing line number of error entry .
I have used Function Module FORMAT_MESSAGE to capture the errors. But not able to display line number of that flat file which is containing error.
So please suggest me what changes I should make in below source code to get proper output.
Flat file for your R&D
1000 1000 10 10 0001 Company Chobey & Group1N Choubey Amit Choubey New Alipore Road Habijabi Apartment Rastar Dhra 777777 kolkata 777777 kolikata howrah 777777 IN WB 1111111111 2222222222 3333333333 4444444444 5555555555 6666666666 0700 EAST 02 01 1060003 A1 Z1 ZZ13 CALS 1 A 10 1
1000 1000 10 10 0001 Company Chobey & Group2N Choubey Amit Choubey New Alipore Road Habijabi Apartment Rastar Dhra 777777 kolkata 777777 kolikata howrah 777777 IN WB 1111111111 2222222222 3333333333 4444444444 5555555555 6666666666 0700 EAST 02 01 1060003 A1 Z1 ZZ13 CALS 1 A 10 1
1000 1000 10 10 0001 Company Chobey & Group3N Choubey Amit Choubey New Alipore Road Habijabi Apartment Rastar Dhra 777777 kolkata 777777 kolikata howrah 777777 IN WB 1111111111 2222222222 3333333333 4444444444 5555555555 6666666666 0700 EAST 02 01 1060003 A1 Z1 ZZ13 CALS . A 10 1
1000 1000 10 10 0001 Company Chobey & Group4N Choubey Amit Choubey New Alipore Road Habijabi Apartment Rastar Dhra 777777 kolkata 777777 kolikata howrah 777777 IN WB 1111111111 2222222222 3333333333 4444444444 5555555555 6666666666 0700 EAST 02 01 1060003 A1 Z1 ZZ13 CALS 1 A .. 1
1000 1000 10 10 0001 Company Chobey & Group5N Choubey Amit Choubey New Alipore Road Habijabi Apartment Rastar Dhra 777777 kolkata 777777 kolikata howrah 777777 IN WB 1111111111 2222222222 3333333333 4444444444 5555555555 6666666666 0700 EAST 02 01 1060003 A1 Z1 ZZ13 CALS 1 A 10 1
And Source Code
*& Report Z_TEST_SAI *
REPORT Z_TEST_SAI no standard page heading line-size 255.
TYPES: BEGIN OF t_cust,
bukrs like rf02d-bukrs,
vkorg like rf02d-vkorg,
vtweg like rf02d-vtweg,
spart like rf02d-spart,
ktokd like rf02d-ktokd,
anred like kna1-anred,
name1 like kna1-name1,
sortl like kna1-sortl,
name2 like kna1-name2,
name3 like kna1-name3,
name4 like kna1-name4,
stras like kna1-stras,
pfach like kna1-pfach,
ort01 like kna1-ort01,
pstlz like kna1-pstlz,
ort02 like kna1-ort02,
pfort like kna1-pfort,
pstl2 like kna1-pstl2,
land1 like kna1-land1,
regio like kna1-regio,
telx1 like kna1-telx1,
telf1 like kna1-telf1,
telfx like kna1-telfx,
telf2 like kna1-telf2,
teltx like kna1-teltx,
stceg like kna1-stceg,
cityc like kna1-cityc,
lzone like kna1-lzone,
niels like kna1-niels,
kukla like kna1-kukla,
akont like knb1-akont,
fdgrv like knb1-fdgrv,
vzskz like knb1-vzskz,
zterm like knb1-zterm,
vkbur like knvv-vkbur,
versg like knvv-versg,
vsbed like knvv-vsbed,
ktgrd like knvv-ktgrd,
taxkd like knvi-taxkd,
END OF t_cust.
TYPES: BEGIN OF t_sucrec,
cnum TYPE kna1-kunnr, "Customer Number
cnam TYPE kna1-name1, "Customer Name
END OF t_sucrec.
TYPES: BEGIN OF t_errrec,
* lineno TYPE i, "Line Number
lineno TYPE string,
message TYPE string, "Error Message
END OF t_errrec.
DATA: v_file TYPE string, "Variable for storing flat file
it_cust TYPE STANDARD TABLE OF t_cust, "Internal table of Customer
wa_cust LIKE LINE OF it_cust, "Workarea of Internal table it_cust
it_sucrec TYPE STANDARD TABLE OF t_sucrec, "Internal table of Success records
wa_sucrec LIKE LINE OF it_sucrec, "Workarea of Internal table it_sucrec
it_errrec TYPE STANDARD TABLE OF t_errrec,
wa_errrec LIKE LINE OF it_errrec,
it_bdctab LIKE bdcdata OCCURS 0 WITH HEADER LINE, "Internal table structure of BDCDATA
it_messagetab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE, "Tracing Error Messages
v_date LIKE sy-datum, "Controlling of session date
v_index LIKE sy-index, "Index Number
v_totrec TYPE i, "Total Records
v_errrec TYPE i, "Error Records
v_sucrec TYPE i, "Success Records
v_sesschk TYPE c. "Session maintenance
*& SELECTION-SCREEN
SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001 NO INTERVALS.
PARAMETERS: p_file TYPE rlgrap-filename. "rlgrap-filename is a predefined structure
SELECTION-SCREEN: END OF BLOCK blk1.
SELECTION-SCREEN: BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002 NO INTERVALS.
PARAMETERS: p_mode LIKE ctu_params-dismode DEFAULT 'N',
p_update LIKE ctu_params-updmode DEFAULT 'A'.
SELECTION-SCREEN END OF BLOCK blk2.
*& INITIALIZATION
INITIALIZATION.
v_date = sy-datum - 1.
*& AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_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.
*& START-OF-SELECTION
START-OF-SELECTION.
v_file = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_file
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = it_cust
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.
*& END-OF-SELECTION
END-OF-SELECTION.
v_index = sy-index.
LOOP AT it_cust INTO wa_cust.
perform bdc_dynpro using 'SAPMF02D' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KTOKD'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02D-BUKRS'
wa_cust-bukrs.
perform bdc_field using 'RF02D-VKORG'
wa_cust-vkorg.
perform bdc_field using 'RF02D-VTWEG'
wa_cust-vtweg.
perform bdc_field using 'RF02D-SPART'
wa_cust-spart.
perform bdc_field using 'RF02D-KTOKD'
wa_cust-ktokd.
perform bdc_dynpro using 'SAPMF02D' '0110'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-TELTX'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNA1-ANRED'
wa_cust-anred.
perform bdc_field using 'KNA1-NAME1'
wa_cust-name1.
perform bdc_field using 'KNA1-SORTL'
wa_cust-sortl.
perform bdc_field using 'KNA1-NAME2'
wa_cust-name2.
perform bdc_field using 'KNA1-NAME3'
wa_cust-name3.
perform bdc_field using 'KNA1-NAME4'
wa_cust-name4.
perform bdc_field using 'KNA1-STRAS'
wa_cust-stras.
perform bdc_field using 'KNA1-PFACH'
wa_cust-pfach.
perform bdc_field using 'KNA1-ORT01'
wa_cust-ort01.
perform bdc_field using 'KNA1-PSTLZ'
wa_cust-pstlz.
perform bdc_field using 'KNA1-ORT02'
wa_cust-ort02.
perform bdc_field using 'KNA1-PFORT'
wa_cust-pfort.
perform bdc_field using 'KNA1-PSTL2'
wa_cust-pstl2.
perform bdc_field using 'KNA1-LAND1'
wa_cust-land1.
perform bdc_field using 'KNA1-REGIO'
wa_cust-regio.
perform bdc_field using 'KNA1-SPRAS'
'EN'.
perform bdc_field using 'KNA1-TELX1'
wa_cust-telx1.
perform bdc_field using 'KNA1-TELF1'
wa_cust-telf1.
perform bdc_field using 'KNA1-TELFX'
wa_cust-telfx.
perform bdc_field using 'KNA1-TELF2'
wa_cust-telf2.
perform bdc_field using 'KNA1-TELTX'
wa_cust-teltx.
perform bdc_dynpro using 'SAPMF02D' '0120'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-CITYC'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNA1-STCEG'
wa_cust-stceg.
perform bdc_field using 'KNA1-CITYC'
wa_cust-cityc.
perform bdc_field using 'KNA1-LZONE'
wa_cust-lzone.
perform bdc_dynpro using 'SAPMF02D' '0125'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-KUKLA'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNA1-NIELS'
wa_cust-niels.
perform bdc_field using 'KNA1-KUKLA'
wa_cust-kukla.
perform bdc_dynpro using 'SAPMF02D' '0130'.
perform bdc_field using 'BDC_CURSOR'
'KNBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0340'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0360'.
perform bdc_field using 'BDC_CURSOR'
'KNVK-NAMEV(01)'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0210'.
perform bdc_field using 'BDC_CURSOR'
'KNB1-VZSKZ'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNB1-AKONT'
wa_cust-akont.
perform bdc_field using 'KNB1-FDGRV'
wa_cust-fdgrv.
perform bdc_field using 'KNB1-VZSKZ'
wa_cust-vzskz.
perform bdc_dynpro using 'SAPMF02D' '0215'.
perform bdc_field using 'BDC_CURSOR'
'KNB1-ZTERM'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNB1-ZTERM'
wa_cust-zterm.
perform bdc_dynpro using 'SAPMF02D' '0220'.
perform bdc_field using 'BDC_CURSOR'
'KNB5-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0230'.
perform bdc_field using 'BDC_CURSOR'
'KNB1-VRSNR'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0610'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KUNNR'.
perform bdc_dynpro using 'SAPMF02D' '0310'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-VERSG'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVV-AWAHR'
'100'.
perform bdc_field using 'KNVV-VKBUR'
wa_cust-vkbur.
perform bdc_field using 'KNVV-WAERS'
'INR'.
perform bdc_field using 'KNVV-KALKS'
'1'.
perform bdc_field using 'KNVV-VERSG'
wa_cust-versg.
perform bdc_dynpro using 'SAPMF02D' '0315'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-VSBED'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVV-LPRIO'
perform bdc_field using 'KNVV-KZAZU'
'X'.
perform bdc_field using 'KNVV-VSBED'
wa_cust-vsbed.
perform bdc_field using 'KNVV-ANTLF'
'9'.
perform bdc_dynpro using 'SAPMF02D' '0320'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-KTGRD'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVV-BOKRE'
'X'.
perform bdc_field using 'KNVV-KTGRD'
wa_cust-ktgrd.
perform bdc_dynpro using 'SAPMF02D' '1350'.
perform bdc_field using 'BDC_CURSOR'
'KNVI-TAXKD(01)'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVI-TAXKD(01)'
wa_cust-taxkd.
perform bdc_dynpro using 'SAPMF02D' '0324'.
perform bdc_field using 'BDC_CURSOR'
'KNVP-PARVW(01)'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
CALL TRANSACTION 'XD01' USING it_bdctab
MODE p_mode
UPDATE p_update
MESSAGES INTO it_messagetab.
IF sy-subrc = 0.
*& reading success records to corresponding internal table
READ TABLE it_messagetab WITH KEY msgtyp = 'S'.
IF sy-subrc = 0.
wa_sucrec-cnum = it_messagetab-msgv1.
wa_sucrec-cnam = wa_cust-name1.
APPEND wa_sucrec TO it_sucrec.
CLEAR wa_sucrec.
ENDIF.
ELSE.
*& reading error records to corresponding internal table
READ TABLE it_messagetab WITH KEY msgtyp = 'E'.
IF sy-subrc = 0.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = sy-msgid
no = it_messagetab-msgnr
v1 = it_messagetab-msgv1
v2 = it_messagetab-msgv2
v3 = it_messagetab-msgv3
v4 = it_messagetab-msgv4
IMPORTING
msg = wa_errrec-message.
wa_errrec-lineno = v_index.
*******wa_errrec-lineno = v_index.
*******wa_errrec-message = it_messagetab-msgv1.
APPEND wa_errrec TO it_errrec.
CLEAR wa_errrec.
ENDIF.
ENDIF.
CLEAR : it_bdctab, it_messagetab.
REFRESH: it_bdctab, it_messagetab.
ENDLOOP.
DESCRIBE TABLE it_cust LINES v_totrec.
DESCRIBE TABLE it_errrec LINES v_errrec.
DESCRIBE TABLE it_sucrec LINES v_sucrec.
PERFORM disp_data.
SKIP 2.
IF v_sucrec > 0.
PERFORM disp_success_data.
ENDIF.
SKIP 2.
IF v_errrec > 0.
PERFORM disp_error_data.
ENDIF.
*& Form bdc_dynpro
*# text
*# -->P_0104 text
*# -->P_0105 text
FORM bdc_dynpro USING program
dynpro.
CLEAR it_bdctab.
it_bdctab-program = program.
it_bdctab-dynpro = dynpro.
it_bdctab-dynbegin = 'X'.
APPEND it_bdctab.
ENDFORM. " bdc_dynpro
*& Form bdc_field
*# text
*# -->P_0109 text
*# -->P_IT_cust_LIFNR text
FORM bdc_field USING fnam
fval.
CLEAR it_bdctab.
it_bdctab-fnam = fnam.
it_bdctab-fval = fval.
APPEND it_bdctab.
ENDFORM. " bdc_field
*& Form disp_data
*# text
*# --> p1 text
*# <-- p2 text
FORM disp_data .
ULINE (45).
WRITE : / sy-vline,
12 'FAMD CUSTOMER UPDATE SUMMARY'(004) COLOR 1,
45 sy-vline.
ULINE /(45).
WRITE : / sy-vline,
'Total Records Processed'(007),
28 '=',
30 v_totrec,
45 sy-vline,
/ sy-vline,
'Error Records'(005),
28 '=',
30 v_errrec,
45 sy-vline,
/ sy-vline,
'Successful Records'(006),
28 '=',
30 v_sucrec,
45 sy-vline.
ULINE /(45).
ENDFORM. " disp_data
*& Form disp_success_data
*# text
*# --> p1 text
*# <-- p2 text
FORM disp_success_data .
ULINE (45).
WRITE : / sy-vline,
14 'Successful Records'(012) COLOR 1,
45 sy-vline.
ULINE /(45).
WRITE : / sy-vline ,
'Customer Number'(010) COLOR 2,
17 sy-vline,
25 'Customer Name'(011) COLOR 2,
45 sy-vline.
ULINE /(45).
LOOP AT it_sucrec INTO wa_sucrec.
WRITE: / sy-vline ,
wa_sucrec-cnum,
17 sy-vline,
19 wa_sucrec-cnam,
45 sy-vline.
ENDLOOP.
ULINE /(45).
ENDFORM. " disp_success_data
*& Form disp_error_data
*# text
*# --> p1 text
*# <-- p2 text
FORM disp_error_data .
ULINE (85).
WRITE : / sy-vline,
35 'Error Records'(013) COLOR 1,
85 sy-vline.
ULINE /(85).
WRITE : / sy-vline,
'Record Number'(008) COLOR 2,
sy-vline,
37 'Reason for error'(009) COLOR 2,
85 sy-vline.
ULINE /(85).
LOOP AT it_errrec INTO wa_errrec.
WRITE : / sy-vline,
wa_errrec-lineno,
17 sy-vline,
wa_errrec-message,
85 sy-vline.
ENDLOOP.
ULINE /(85).
ENDFORM. " disp_error_dataWorked out n found the solution
Maybe you are looking for
-
Can't transfer songs in manual mode
All the instructions say that in manual mode songs can be dragged from the music library and dropped into the iPOD but it won't work. The only way we can transfer is to set the preferences to automatic. Does anyone know how to transfer in manual mode
-
I can't find clicker games for my ipod nano (4th gen)
I have an ipod nano 4th generation and i can't find clicker wheel games for it in the itunes store. I am currently using Itunes 10.
-
Having multiple issues with my MacBook Pro
I have a MacBook Pro that I purchases new January 2013. I upgraded from Mountain to Maverick about 2 months ago, with no problems. About 3 days ago it started acting up. It started with my not being able to open Safari, although a few hours later I c
-
Hi, In Oracle 10g , maybe in older version too, there is the capability to create an error log table using the dbms_errlog package and create_error_log procedure... For exaample: exec dbms_errlog.create_error_log('EMP','EMP_ERROR') How to find afterw
-
Exchange server 2013 error called "403 Sorry! Access denied :"
I installed a domain and an exchange server on separate computers. After installed Exchange server 2013, tried to open "Exchange Administrative Center" there is an error message that is attached with this post and cannot go to the admin panel. so tr