Extract records to Desktop in flat file
How to Extract records to Desktop in flat file.
I am not able to do it from Syndicator,i tried many options.Some one can help.
I want to extract the records from MDM to Desktop in Excel/Flat file format,whether it is from Data Manage or Syndicator.
Immediate req.
Hi Shifali,
I want to extract the records from MDM to Desktop in Excel/Flat file format,whether it is from Data Manage or Syndicator
- MDM syndicator is the tool to export data in MDM .
- Data in MDM repository can be viewed and managed in MDM Data manager.
- What ever data is present in data manager will be exported outside using MDM syndicator.using your search criteria.
How to Extract records to Desktop in flat file.
I am not able to do it from Syndicator,i tried many options.Some one can help.
- Master data in MDM rep can be syndicated using MDM syndicator using 2 main formats Flat and XML.
- For local syndication to your desktop in flat format you need to follow the bewlo steps:
1) Create destination items manually in Syndicator under destination item tab.
2) Map this destination item to the source fields whcih are your mdm rep fields.
3) Use a serach critera if you wnat to filter records.
4) Click the export button in the syndicator
5) It will ask for the output file name and format
6) Give a name and select teh format form dropdown in the window (it can be text,excel.access any thing)
7) You output file is syndiacted to your local desktop.
Follow the below link for Flat syndication:
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60ebecdf-4ebe-2a10-cf9f-830906c73866 (Flat Syndication)
Follow the below link for XML syndication:
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e04fbbb3-6fad-2a10-3699-fbb40e51ad79 (XML Syndication)
This will give you the clear distinction between the two.
Hope It Helped
Thanks & Regards
Simona Pinto
Similar Messages
-
How to extract data from Essbase to Flat File using ODI
Hi,
Anyone know how to extract data from Essbase to Flat File using ODI?
Thanks in advance.
Regards,
SumardiHi,
Have you read through :-
Oracle Data Integrator Adapter for Hyperion Essbase Getting Started - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_getting_started.pdf
Oracle Data Integrator Adapter for Hyperion Essbase User's Guide - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_users.pdf
If you have read them and are still have a problem at what stage are you having the issues?
Cheers
John
http://john-goodwin.blogspot.com/ -
HI FRIENDS, significance of record set name in flat file process
1)significance of record set name in flat file process
hi ganga,
recordset specifies the logical structures in a flat file. A recordset can contain multiple types of substructures identified by logical names.
We can use the recordset in Node functions
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
regards,
nikhil bos -
Extracting XML Data to a flat file
I have an application which is puting an XML string into a field in the database... now my problem is that I have to extract that information and put it in either 1. a flat file, or 2. a seperate table containing a column for each XML attribute... Does anyone know of the best way to approach either solution?
cheers.And your Oracle version is?
There are many different ways to put something into a file. How about UTL_FILE?http://www.psoug.org/reference/utl_file.html
How to get it out of the table in the first place?
I usually try a SELECT statement. They seem to work.
PS: Databases don't have fields ... table's don't either. Check your verbiage.
Try looking of the word "FIELD" in the Oracle docs. Then try "COLUMN." -
How to find out duplicate record contained in a flat file
Hi Experts,
For my project I have written a program for flat file upload.
Requirement 1
In the flat file there may be some duplicate record like:
Field1 Field2
11 test1
11 test2
12 test3
13 test4
Field1 is primary key.
Can you please let me know how I can find out the duplicate record.
Requirement 2
The flat file contains the header row as shown above
Field1 Field2
How our program can skip this record and start reading / inserting records from row no 2 ie
11 test1
onwards.
Thanks
S
FORM upload1.
DATA : wf_title TYPE string,
lt_filetab TYPE filetable,
l_separator TYPE char01,
l_action TYPE i,
l_count TYPE i,
ls_filetab TYPE file_table,
wf_delemt TYPE rollname,
wa_fieldcat TYPE lvc_s_fcat,
tb_fieldcat TYPE lvc_t_fcat,
rows_read TYPE i,
p_error TYPE char01,
l_file TYPE string.
DATA: wf_object(30) TYPE c,
wf_tablnm TYPE rsdchkview.
wf_object = 'myprogram'.
DATA i TYPE i.
DATA:
lr_mdmt TYPE REF TO cl_rsdmd_mdmt,
lr_mdmtr TYPE REF TO cl_rsdmd_mdmtr,
lt_idocstate TYPE rsarr_t_idocstate,
lv_subrc TYPE sysubrc.
TYPES : BEGIN OF test_struc,
/bic/myprogram TYPE /bic/oimyprogram,
txtmd TYPE rstxtmd,
END OF test_struc.
DATA : tb_assum TYPE TABLE OF /bic/pmyprogram.
DATA: wa_ztext TYPE /bic/tmyprogram,
myprogram_temp TYPE ziott_assum,
wa_myprogram TYPE /bic/pmyprogram.
DATA : test_upload TYPE STANDARD TABLE OF test_struc,
wa2 TYPE test_struc.
DATA : wa_test_upload TYPE test_struc,
ztable_data TYPE TABLE OF /bic/pmyprogram,
ztable_text TYPE TABLE OF /bic/tmyprogram,
wa_upld_text TYPE /bic/tmyprogram,
wa_upld_data TYPE /bic/pmyprogram,
t_assum TYPE ziott_assum.
DATA : wa1 LIKE test_upload.
wf_title = text-026.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = wf_title
default_extension = 'txt'
file_filter = 'Tab delimited Text Files (*.txt)'
CHANGING
file_table = lt_filetab
rc = l_count
user_action = l_action
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
OTHERS = 3. "#EC NOTEXT
IF sy-subrc 0.
EXIT.
ENDIF.
LOOP AT lt_filetab INTO ls_filetab.
l_file = ls_filetab.
ENDLOOP.
CHECK l_action = 0.
IF l_file IS INITIAL.
EXIT.
ENDIF.
l_separator = 'X'.
wa_fieldcat-fieldname = 'test'.
wa_fieldcat-dd_roll = wf_delemt.
APPEND wa_fieldcat TO tb_fieldcat.
CALL FUNCTION 'MESSAGES_INITIALIZE'.
CLEAR wa_test_upload.
Upload file from front-end (PC)
File format is tab-delimited ASCII
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_file
has_field_separator = l_separator
TABLES
data_tab = i_mara
data_tab = test_upload
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.
EXIT.
ELSE.
CALL FUNCTION 'MESSAGES_INITIALIZE'.
IF test_upload IS NOT INITIAL.
DESCRIBE TABLE test_upload LINES rows_read.
CLEAR : wa_test_upload,wa_upld_data.
LOOP AT test_upload INTO wa_test_upload.
CLEAR : p_error.
rows_read = sy-tabix.
IF wa_test_upload-/bic/myprogram IS INITIAL.
p_error = 'X'.
MESSAGE s153 WITH wa_test_upload-/bic/myprogram sy-tabix.
CONTINUE.
ELSE.
TRANSLATE wa_test_upload-/bic/myprogram TO UPPER CASE.
wa_upld_text-txtmd = wa_test_upload-txtmd.
wa_upld_text-txtsh = wa_test_upload-txtmd.
wa_upld_text-langu = sy-langu.
wa_upld_data-chrt_accts = 'xyz1'.
wa_upld_data-co_area = '12'.
wa_upld_data-/bic/zxyzbcsg = 'Iy'.
wa_upld_data-objvers = 'A'.
wa_upld_data-changed = 'I'.
wa_upld_data-/bic/zass_mdl = 'rrr'.
wa_upld_data-/bic/zass_typ = 'I'.
wa_upld_data-/bic/zdriver = 'yyy'.
wa_upld_text-langu = sy-langu.
MOVE-CORRESPONDING wa_test_upload TO wa_upld_data.
MOVE-CORRESPONDING wa_test_upload TO wa_upld_text.
APPEND wa_upld_data TO ztable_data.
APPEND wa_upld_text TO ztable_text.
ENDIF.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM ztable_data.
DELETE ADJACENT DUPLICATES FROM ztable_text.
IF ztable_data IS NOT INITIAL.
CALL METHOD cl_rsdmd_mdmt=>factory
EXPORTING
i_chabasnm = 'myprogram'
IMPORTING
e_r_mdmt = lr_mdmt
EXCEPTIONS
invalid_iobjnm = 1
OTHERS = 2.
CALL FUNCTION 'MESSAGES_INITIALIZE'.
**Lock the Infoobject to update
CALL FUNCTION 'RSDG_IOBJ_ENQUEUE'
EXPORTING
i_objnm = wf_object
i_scope = '1'
i_msgty = rs_c_error
EXCEPTIONS
foreign_lock = 1
sys_failure = 2.
IF sy-subrc = 1.
MESSAGE i107(zddd_rr) WITH wf_object sy-msgv2.
EXIT.
ELSEIF sy-subrc = 2.
MESSAGE i108(zddd_rr) WITH wf_object.
EXIT.
ENDIF.
*****Update Master Table
IF ztable_data IS NOT INITIAL.
CALL FUNCTION 'RSDMD_WRITE_ATTRIBUTES_TEXTS'
EXPORTING
i_iobjnm = 'myprogram'
i_tabclass = 'M'
I_T_ATTR = lt_attr
TABLES
i_t_table = ztable_data
EXCEPTIONS
attribute_name_error = 1
iobj_not_found = 2
generate_program_error = 3
OTHERS = 4.
IF sy-subrc 0.
CALL FUNCTION 'MESSAGE_STORE'
EXPORTING
arbgb = 'zddd_rr'
msgty = 'E'
txtnr = '054'
msgv1 = text-033
EXCEPTIONS
OTHERS = 3.
MESSAGE e054(zddd_rr) WITH 'myprogram'.
ELSE.
CALL FUNCTION 'MESSAGE_STORE'
EXPORTING
arbgb = 'zddd_rr'
msgty = 'S'
txtnr = '053'
msgv1 = text-033
EXCEPTIONS
OTHERS = 3.
ENDIF.
*endif.
*****update Text Table
IF ztable_text IS NOT INITIAL.
CALL FUNCTION 'RSDMD_WRITE_ATTRIBUTES_TEXTS'
EXPORTING
i_iobjnm = 'myprogram'
i_tabclass = 'T'
TABLES
i_t_table = ztable_text
EXCEPTIONS
attribute_name_error = 1
iobj_not_found = 2
generate_program_error = 3
OTHERS = 4.
IF sy-subrc 0.
CALL FUNCTION 'MESSAGE_STORE'
EXPORTING
arbgb = 'zddd_rr'
msgty = 'E'
txtnr = '055'
msgv1 = text-033
EXCEPTIONS
OTHERS = 3.
ENDIF.
ENDIF.
ELSE.
MESSAGE s178(zddd_rr).
ENDIF.
ENDIF.
COMMIT WORK.
CALL FUNCTION 'RSD_CHKTAB_GET_FOR_CHA_BAS'
EXPORTING
i_chabasnm = 'myprogram'
IMPORTING
e_chktab = wf_tablnm
EXCEPTIONS
name_error = 1.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
****Release locks on Infoobject
CALL FUNCTION 'RSDG_IOBJ_DEQUEUE'
EXPORTING
i_objnm = 'myprogram'
i_scope = '1'.
ENDIF.
ENDIF.
PERFORM data_selection .
PERFORM update_alv_grid_display.
CALL FUNCTION 'MESSAGES_SHOW'.
ENDFORM.Can you please let me know how I can find out the duplicate record.
you need to split the records from flat file structure into your internal table ans use a delete ADJACENT duplicates comparing fields
split flat_str into wa_f1 wa_f2 wa_f2 at tab_space. -
Extracting the date from a flat file name in OWB
Hi,
I have a particular scenario, where I need to retrieve the date value from the name of the flat file and load it into a table, as a field in the target table. Is it possible to do this directly in owb. Your help would be appreciated.
regards,
varsha-- Product : Oracle Warehouse Builder
-- Generator Version : 10.1.2.3.63
-- Created Date : Mon May 15 20:07:54 IST 2006
-- Modified Date : Mon May 15 20:07:54 IST 2006
-- Created By : owbbeta4
-- Modified By : owbbeta4
-- Generated Object Type : EXTERNAL TABLE
-- Generated Object Name : CUSTEXTERNALTABLE
-- Comments :
-- Copyright © 2000, 2006, Oracle. All rights reserved.
WHENEVER SQLERROR EXIT FAILURE;
CREATE TABLE "CUSTEXTERNALTABLE"
"C1" VARCHAR2(255),
"C2" VARCHAR2(255),
"C3" DATE,
"C4" VARCHAR2(255),
"C5" VARCHAR2(255),
"C6" INTEGER
ORGANIZATION EXTERNAL (
TYPE ORACLE_LOADER
DEFAULT DIRECTORY NCDEX_STG_LOCATION_TO_HOURLY
ACCESS PARAMETERS (
RECORDS DELIMITED BY NEWLINE
CHARACTERSET WE8MSWIN1252
STRING SIZES ARE IN BYTES
NOBADFILE
NODISCARDFILE
NOLOGFILE
FIELDS
TERMINATED BY ','
NOTRIM
"C1" ,
"C2" ,
"C3" CHAR DATE_FORMAT DATE MASK "DD/MM/YYYY",
"C4" ,
"C5" ,
"C6"
LOCATION (
'bp20042005.csv'
REJECT LIMIT UNLIMITED
NOPARALLEL
; -
Extract PSA Data to a Flat File
Hello,
I would like to download PSA data into a flat file, so I can load it into SQL Server and run SQL statements on it for analysis purposes. I have tried creating a PSA export datasource; however, I can find way to cleanly get the data into a flat structure for analysis and/or download.
Can anyone suggest options for doing this?
Thanks in advance for your help.
Sincerely,
SonyaHi Sonya,
In teh PSA screen try pressing Shift and F8. If this does not bring up the file types then you can try the following: Settings > Chnage Display Variants > View tab > Microsoft Excel > Click SAP_OM.xls and then the green check amrk. The data will be displayed in excel format which you can save to your PC.
Hope this helps... -
CR & LF characters at the end of records when using delimited flat file (CR is missing)
Hi All,
I have a requirement where data of SQL query needs to be loaded to a CSV file.
The row delimiter of the CSV file has to be CR-LF.
In the flat file connection manager, I have mentioned Header Row delimiter as "{CR}{LF}" and under columns section, row delimiter is specified as "{CR}{LF}".
But when I open the detsnation CSV file using notepad++, I see only "LF" at the end of all rows.
Can you please let me know how can I get both CR & LF at the end of each row
Below is the screen shot of the flat file connection manager which I have used for CSV destination file:
RakshaHi Raksha,
Just as Vaibhav said, I’m curious why you need use “CR & LF” as row delimiter in Flat File Connection Manage. Since you can use "CR" as row delimiter in Flat File Connection Manager and it worked fine, you can directly specify "CR"
as row delimiter in Flat File Connection Manage.
Besides, if you still want to replace “LF” with “CR & LF” in the text file, we can use Notepad++’s Find/Replace feature or Edit -> EOL Conversion to achieve the goal. Then we can specify "CR & LF" as row delimiter in Flat File
Connection Manage.
The following blog about conversion between “LF” and “CR & LF” row delimiter in Notepad++ is for your reference:
http://sqlblog.com/blogs/jamie_thomson/archive/2012/08/07/replacing-crlf-with-lf-using-notepad.aspx
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
File record number in a Flat file
Hi Guys,
I am working on Idoc to file scenario and generating a file at the target.
at the file...for each line i have to add a line count.
i have 2 header and 5 detail records set..and details are repeating multiple times.
For Ex:
H1........001
H2....002
D1------003
D2----
004
D3----
005
D4-------006
D5----
007
Footer-----008
Could someone help me in resolving this issue?
Thanks
sahilHi Sahil,
You can write UDF as follow
AbstractTrace trace= (AbstractTrace)container.getTrace();
GlobalContainer globalContainer = container.getGlobalContainer();
String str = (String) globalContainer.getParameter ("COUNTER");
if(str!=null){
int tempRowCounter =(new Integer (str)).intValue();
globalContainer.setParameter("COUNTER",tempRowCounter++);
return tempRowCounter+"";
}else{
globalContainer.setParameter("COUNTER", "1");
return "1";
Regards
Ritu -
Hi,
I am trying to extract data from multiple CSV files to SQL into a single table. The data type of all the columns in SQL table is nvarchar(MAX). I am able to extract the data from the flat files but some of the data(on extraction) is
corrupt including question marks(?) and other invalid special characters. Also I tried selecting the UTF-8, 65001(Unicode) format but the problem still persists. Also I tried using data converter but no use.
I checked with the data in the flat file but there is no data with question mark(?) or any other special characters.
The separator in the flat file is Comma(,)
Please help.
Thanks in advace.The source system and application determines the code page and encoding. Is it Windows, Unix, Mainframe or some other type?
Unicode files sometimes begin with a byte order mark (2 bytes) to indicate little or big endian. If you open the file in notepad and then select save as, the encoding in the dialog will show the encoding notepad detected based on the BOM. If
that is ANSI instead of Unicode or UTF-8, you will need to know the code page the source system used when the file was created.
Dan Guzman, SQL Server MVP, http://www.dbdelta.com -
Extract data from Flat File in a remote machine
Hi All,
Can we extract the data from a flat file present in the Linux server ( same server having ODI installed ) and load it into the database. In most of the forms in the internet shows that the file is to be placed in the local client ( Eg:- C:/Flat_files/ ) .
Any thoughts on this is possible. Please provide me some information on the same.
Thanks and Regards,
Krishna PrasadMany ways to do this. For example you could use sqlloader or a simple File to SQL and load from an agent used on the same machine of your file.
If your agent is not on the same box as the flat file, you will need a shared drive. Or you can first move the file using FTP or something like that.
Shared drive is quite easy but they are the evil. You'll need an everyone-read permission.
Let us know -
Extract Master Data to Flat File
Hello
Do you know a easy way to extract master data into a flat file? I've tried using maintain master data but my master table is too large to display this way.Dear Satya,
1) You can simply write an ABAP to access the P table ( /BIC/PInfobobject )
2) Using infospokes
rsbo->ZDOWNLOAD->Create->Choose Data Source as Infopbject with attributes..
and select your fields and selections and specify the flat file destination and thatsts it..
regards,
Hari
Message was edited by: Hari Kiran Y -
Errors in flat file records? how can i handle them?
Hi All,
I am new for BDC. I am uploading customer(XD01) records using BDC caltransaction method.my problem is when i am running the program, some times my program is not updating the records because of my flat file errors. after i correcting the error records and if i run the same program already updated records not processing. my program not running. what i need to do? how can i handle the flat file for reprocessing the error records?
i have around 50,000 records in my flat file.your program accepts a flat file say the structure of it is structure_load and you create another structure similar to structure_load and name it structure_error.
loop at itab_load.
call transactions...
if success..
commit work and wait X sec.
else.
move-corresponding field to structure_error
append structure_error.
endif.
endloop.
write the file stru_error to PC or app server and make the changes to the data and use the str_error as input to your code again.. -
STEPS REQUIRED TO EXTRACT DATA FROM FLAT FILE TO BI 7.0
HI ALL,
I NEED THE STEPS TO EXTRACTED THE DATA FROM A FLAT FILE TO BI 7.0
PLEASE PROVIDE ME THE STEPS RATHER THAN PROVIDEING ME THE COMPLETE LINK OF SAP HELP.
I NEED THE STEPS ONLY.
THANKS,
GAUTAMBW 7.0
Uploading of master data
Log on to your SAP
Transaction code RSA1LEAD YOU TO MODELLING
1. Creation of Info Objects
In left panel select info object
Create info area
Create info object catalog ( characteristics & Key figures ) by right clicking the created info area
Create new characteristics and key figures under respective catalogs according to the project requirement
Create required info objects and Activate.
2. Creation of Data Source
In the left panel select data sources
Create application component(AC)
Right click AC and create datasource
Specify data source name, source system, and data type ( master data attributes, text, hierarchies)
In general tab give short, medium, and long description.
In extraction tab specify file path, header rows to be ignored, data format(csv) and data separator( , )
In proposal tab load example data and verify it.
In field tab you can you can give the technical name of info objects in the template and you not have to map during the transformation the server will automatically map accordingly. If you are not mapping in this field tab you have to manually map during the transformation in Info providers.
Activate data source and read preview data under preview tab.
Create info package by right clicking data source and in schedule tab click star to load data to PSA.( make sure to close the flat file during loading )
3. Creation of data targets
In left panel select info provider
Select created info area and right click to select Insert Characteristics as info provider
Select required info object ( Ex : Employee ID)
Under that info object select attributes
Right click on attributes and select create transformation.
In source of transformation , select object type( data source) and specify its name and source system Note: Source system will be a temporary folder or package into which data is getting stored
Activate created transformation
Create Data transfer process (DTP) by right clicking the master data attributes
In extraction tab specify extraction mode ( full)
In update tab specify error handling ( request green)
Activate DTP and in execute tab click execute button to load data in data targets.
4. Monitor
Right Click data targets and select manage and in contents tab select contents to view the loaded data. Alternatively monitor icon can be used.
BW 7.0
Uploading of Transaction data
Log on to your SAP
Transaction code RSA1LEAD YOU TO MODELLING
5. Creation of Info Objects
In left panel select info object
Create info area
Create info object catalog ( characteristics & Key figures ) by right clicking the created info area
Create new characteristics and key figures under respective catalogs according to the project requirement
Create required info objects and Activate.
6. Creation of Data Source
In the left panel select data sources
Create application component(AC)
Right click AC and create datasource
Specify data source name, source system, and data type ( Transaction data )
In general tab give short, medium, and long description.
In extraction tab specify file path, header rows to be ignored, data format(csv) and data separator( , )
In proposal tab load example data and verify it.
In field tab you can you can give the technical name of info objects in the template and you not have to map during the transformation the server will automatically map accordingly. If you are not mapping in this field tab you have to manually map during the transformation in Info providers.
Activate data source and read preview data under preview tab.
Create info package by right clicking data source and in schedule tab click star to load data to PSA.( make sure to close the flat file during loading )
7. Creation of data targets
In left panel select info provider
Select created info area and right click to create ODS( Data store object ) or Cube.
Specify name fro the ODS or cube and click create
From the template window select the required characteristics and key figures and drag and drop it into the DATA FIELD and KEY FIELDS
Click Activate.
Right click on ODS or Cube and select create transformation.
In source of transformation , select object type( data source) and specify its name and source system Note: Source system will be a temporary folder or package into which data is getting stored
Activate created transformation
Create Data transfer process (DTP) by right clicking the master data attributes
In extraction tab specify extraction mode ( full)
In update tab specify error handling ( request green)
Activate DTP and in execute tab click execute button to load data in data targets.
8. Monitor
Right Click data targets and select manage and in contents tab select contents to view the loaded data. There are two tables in ODS new table and active table to load data from new table to active table you have to activate after selecting the loaded data . Alternatively monitor icon can be used
cheers
sunil -
How to capture errors records in flat file in BDC
hi ,
i would like to know how to capture error records while uploading a flat file to screen through BDC .
appreciatable solutions are rewarded.
thanks,
shanHi shan,
write this code, it will solve your problem.
DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
DATA : I_MSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF I_ERR OCCURS 0,
MATNR(18),
FLAG(1),
MSG(100),
END OF I_ERR.
DATA :V_LINES TYPE I.
LOOP AT ITAB.
REFRESH BDCTAB.
PERFORM SCREEN USING: 'SAPLMGMM' '0060'.
PERFORM FIELD USING: 'RMMG1-MATNR' ITAB-MATNR,
'RMMG1-MBRSH' ITAB-MBRSH ,
'RMMG1-MTART' ITAB-MTART,
'BDC_OKCODE' '/00'.
PERFORM SCREEN USING: 'SAPLMGMM' '0070'.
PERFORM FIELD USING: 'MSICHTAUSW-KZSEL(01)' 'X' ,
'MSICHTAUSW-KZSEL(02)' 'X' ,
'MSICHTAUSW-KZSEL(09)' 'X' ,
'BDC_OKCODE' '=ENTR'.
PERFORM SCREEN USING: 'SAPLMGMM' '0080'.
PERFORM FIELD USING: 'RMMG1-WERKS' ITAB-WERKS,
'BDC_OKCODE' '=ENTR'.
PERFORM SCREEN USING: 'SAPLMGMM' '4004'.
PERFORM FIELD USING: 'MAKT-MAKTX' ITAB-MAKTX,
'MARA-MEINS' 'EA' ,
'MARA-MATKL' '001',
'BDC_OKCODE' '/00'.
PERFORM SCREEN USING: 'SAPLMGMM' '4004'.
PERFORM FIELD USING: 'BDC_OKCODE' '/00'.
PERFORM SCREEN USING: 'SAPLMGMM' '4000'.
PERFORM FIELD USING: 'MAKT-MAKTX' ITAB-MAKTX,
'MARA-MEINS' 'EA',
'MARC-EKGRP' '001',
'MARA-MATKL' '001',
'BDC_OKCODE' '=BU'.
CALL TRANSACTION 'MM01' USING BDCTAB
MODE 'A'
MESSAGES INTO I_MSG.
FINDING LAST MESSAGE IN THE I_MSG TABLE*****
DESCRIBE TABLE I_MSG LINES V_LINES.
ACCORDING TO THE V_LINES NUMBER TABLE WILL BE READ****
READ TABLE I_MSG INDEX V_LINES.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = I_MSG-MSGID
LANG = '-D'
NO = I_MSG-MSGNR
V1 = I_MSG-MSGV1
V2 = I_MSG-MSGV2
V3 = I_MSG-MSGV3
V4 = I_MSG-MSGV4
IMPORTING
MSG = I_ERR-MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF I_MSG-MSGID EQ 'M3' AND I_MSG-MSGNR EQ '800'.
I_ERR-FLAG = 'S'.
ELSE.
I_ERR-FLAG = 'E'.
ENDIF.
I_ERR-MATNR = ITAB-MATNR.
APPEND I_ERR.
CLEAR I_ERR.
ENDLOOP.
WRITE:/ 'SUCCESS RECORDS' COLOR COL_POSITIVE.
SKIP.
WRITE:/ 'MATERIAL' COLOR COL_HEADING, 20 'MESSAGE' COLOR COL_HEADING.
LOOP AT I_ERR WHERE FLAG EQ 'S'.
WRITE:/ I_ERR-MATNR, 20 I_ERR-MSG.
ENDLOOP.
SKIP 2.
WRITE:/ 'ERROR RECORDS' COLOR COL_NEGATIVE.
SKIP.
WRITE:/ 'MATERIAL' COLOR COL_HEADING, 20 'MESSAGE' COLOR COL_HEADING.
LOOP AT I_ERR WHERE FLAG EQ 'E'.
WRITE:/ I_ERR-MATNR, 20 I_ERR-MSG.
ENDLOOP.
*& Form SCREEN
SCREEN
form SCREEN using P_PROG P_SCREEN.
BDCTAB-PROGRAM = P_PROG.
BDCTAB-DYNPRO = P_SCREEN.
BDCTAB-DYNBEGIN = 'X'.
APPEND BDCTAB.
CLEAR BDCTAB.
endform. " SCREEN
*& Form FIELD
FIELD
form FIELD using FNAME FVAL .
BDCTAB-FNAM = FNAME.
BDCTAB-FVAL = FVAL.
APPEND BDCTAB.
CLEAR BDCTAB.
endform. " FIELD
Thanks,
Murali
Maybe you are looking for
-
Why can't I print a PDF as a PDF?
Hi, I'm trying to use some features in the print dialogue of Acrobat Pro 9 (split the document onto multiple pages). The problem is that I have to save it as a PDF. But if I want to call the action "Save as Adobe PDF" in the print dialogue I get the
-
32 bit vs. 64bit download link question
My daughter just bought a prepaid CC student and teacher license for her studies. She bought it thru thinkedu.com and it is the $199.00/12 month subscription. Her computer runs windows 8 pro 64 bit OS. The download link says 32 bit. I want to hel
-
Hi All, I'm new in EP. I would like to create simple Document Management System. It will provide a repository for storing shared documents for authenticated users or group of users, creating files & folders depend of polices, allows administrators
-
Hi there, all you Apple Mail experts! I hope you can help :-) When I write an email and type 'me' in the To: box, I see a list of the email addresses that I use - this is very helpful most of the time, but the email address that pops up at the top o
-
Can I install my Photoshop 10 on 2 computers
I used to have Elements 10 on my laptop and it crashed. I installed it on my new desktop. Now I want to install it on a second desktop which I frequently use at another location. Is this legal? Thanks Cindy Thomas [email removed] I forgot to menti