Simples for IDOC - Flat files (Formated) process
Hi all,
I m looking for same exemple showing how to create formated flat files from a standard IDOC.
Thanks in advance,
Fouad,
hi,
have a look at this :
https://websmp102.sap-ag.de/~sapdownload/011000358700001795162005E/HowToIDocXMLToFlat.pdf
abap mapping from IDOC to flat file
all the code is inside the pdf
or you can generate a file from R3 directly
/people/stefan.grube/blog/2006/09/18/collecting-idocs-without-using-bpm
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
Similar Messages
-
BDC for ME21N (Flat file format)
Hello,
I have to write a BDC for ME21N(stock transfer).... Someone pls give me the format of flat file... we need separate files for header and items or only one file is enough??? pls someone send me the format and code......
my email id is [email protected]
Thanks in advance...
Regards,
Maya.Hi
see this and do accordingly
REPORT zmm_bdcp_purchaseorderkb02
NO STANDARD PAGE HEADING LINE-SIZE 255.
Declaring internal tables *
*-----Declaring line structure
DATA : BEGIN OF it_dummy OCCURS 0,
dummy(255) TYPE c,
END OF it_dummy.
*-----Internal table for line items
DATA : BEGIN OF it_idata OCCURS 0,
ematn(18), "Material Number.
menge(13), "Qyantity.
netpr(11), "Net Price.
werks(4), "Plant.
ebelp(5), "Item Number.
END OF it_idata.
*-----Deep structure for header data and line items
DATA : BEGIN OF it_me21 OCCURS 0,
lifnr(10), "Vendor A/c No.
bsart(4), "A/c Type.
bedat(8), "Date of creation of PO.
ekorg(4), "Purchasing Organisation.
ekgrp(3), "Purchasing Group.
x_data LIKE TABLE OF it_idata,
END OF it_me21.
DATA : x_idata LIKE LINE OF it_idata.
DATA : v_delimit VALUE ','.
DATA : v_indx(3) TYPE n.
DATA : v_fnam(30) TYPE c.
DATA : v_count TYPE n.
DATA : v_ne TYPE i.
DATA : v_ns TYPE i.
*include bdcrecx1.
INCLUDE zmm_incl_purchaseorderkb01.
Search help for file *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
START-OF-SELECTION.
To upload the data into line structure *
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = it_dummy.
Processing the data from line structure to internal tables *
REFRESH:it_me21.
CLEAR :it_me21.
LOOP AT it_dummy.
IF it_dummy-dummy+0(01) = 'H'.
v_indx = v_indx + 1.
CLEAR it_idata.
REFRESH it_idata.
CLEAR it_me21-x_data.
REFRESH it_me21-x_data.
SHIFT it_dummy.
SPLIT it_dummy AT v_delimit INTO it_me21-lifnr
it_me21-bsart
it_me21-bedat
it_me21-ekorg
it_me21-ekgrp.
APPEND it_me21.
ELSEIF it_dummy-dummy+0(01) = 'L'.
SHIFT it_dummy.
SPLIT it_dummy AT v_delimit INTO it_idata-ematn
it_idata-menge
it_idata-netpr
it_idata-werks
it_idata-ebelp.
APPEND it_idata TO it_me21-x_data.
MODIFY it_me21 INDEX v_indx.
ENDIF.
ENDLOOP.
To open the group *
PERFORM open_group.
To populate the bdcdata table for header data *
LOOP AT it_me21.
v_count = v_count + 1.
REFRESH it_bdcdata.
PERFORM subr_bdc_table USING: 'X' 'SAPMM06E' '0100',
' ' 'BDC_CURSOR' 'EKKO-LIFNR',
' ' 'BDC_OKCODE' '/00',
' ' 'EKKO-LIFNR' it_me21-lifnr,
' ' 'RM06E-BSART' it_me21-bsart,
' ' 'RM06E-BEDAT' it_me21-bedat,
' ' 'EKKO-EKORG' it_me21-ekorg,
' ' 'EKKO-EKGRP' it_me21-ekgrp,
' ' 'RM06E-LPEIN' 'T'.
PERFORM subr_bdc_table USING: 'X' 'SAPMM06E' '0120',
' ' 'BDC_CURSOR' 'RM06E-EBELP',
' ' 'BDC_OKCODE' '/00'.
MOVE 1 TO v_indx.
*-----To populate the bdcdata table for line item data
LOOP AT it_me21-x_data INTO x_idata.
CONCATENATE 'EKPO-EMATN(' v_indx ')' INTO v_fnam.
PERFORM subr_bdc_table USING ' ' v_fnam x_idata-ematn.
CONCATENATE 'EKPO-MENGE(' v_indx ')' INTO v_fnam.
PERFORM subr_bdc_table USING ' ' v_fnam x_idata-menge.
CONCATENATE 'EKPO-NETPR(' v_indx ')' INTO v_fnam.
PERFORM subr_bdc_table USING ' ' v_fnam x_idata-netpr.
CONCATENATE 'EKPO-WERKS(' v_indx ')' INTO v_fnam.
PERFORM subr_bdc_table USING ' ' v_fnam x_idata-werks.
v_indx = v_indx + 1.
PERFORM subr_bdc_table USING: 'X' 'SAPMM06E' '0120',
' ' 'BDC_CURSOR' 'RM06E-EBELP',
' ' 'BDC_OKCODE' '/00'.
ENDLOOP.
PERFORM subr_bdc_table USING: 'X' 'SAPMM06E' '0120',
' ' 'BDC_CURSOR' 'RM06E-EBELP',
' ' 'BDC_OKCODE' '=BU'.
PERFORM bdc_transaction USING 'ME21'.
ENDLOOP.
PERFORM close_group.
End of selection event *
END-OF-SELECTION.
IF session NE 'X'.
*-----To display the successful records
WRITE :/10 text-001. "Sucess records
WRITE :/10 SY-ULINE(20).
SKIP.
IF it_sucess IS INITIAL.
WRITE :/ text-002.
ELSE.
WRITE :/ text-008, "Total number of Succesful records
35 v_ns.
SKIP.
WRITE:/ text-003, "Vendor Number
17 text-004, "Record number
30 text-005. "Message
ENDIF.
LOOP AT it_sucess.
WRITE:/4 it_sucess-lifnr,
17 it_sucess-tabix CENTERED,
30 it_sucess-sucess_rec.
ENDLOOP.
SKIP.
*-----To display the erroneous records
WRITE:/10 text-006. "Error Records
WRITE:/10 SY-ULINE(17).
SKIP.
IF it_error IS INITIAL.
WRITE:/ text-007. "No error records
ELSE.
WRITE:/ text-009, "Total number of erroneous records
35 v_ne.
SKIP.
WRITE:/ text-003, "Vendor Number
17 text-004, "Record number
30 text-005. "Message
ENDIF.
LOOP AT it_error.
WRITE:/4 it_error-lifnr,
17 it_error-tabix CENTERED,
30 it_error-error_rec.
ENDLOOP.
REFRESH it_sucess.
REFRESH it_error.
ENDIF.
CODE IN INCLUDE.
Include ZMM_INCL_PURCHASEORDERKB01
DATA: it_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
DATA: it_MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA: E_GROUP_OPENED.
*-----Internal table to store sucess records
DATA:BEGIN OF it_sucess OCCURS 0,
msgtyp(1) TYPE c,
lifnr LIKE ekko-lifnr,
tabix LIKE sy-tabix,
sucess_rec(125),
END OF it_sucess.
DATA: g_mess(125) type c.
*-----Internal table to store error records
DATA:BEGIN OF it_error OCCURS 0,
msgtyp(1) TYPE c,
lifnr LIKE ekko-lifnr,
tabix LIKE sy-tabix,
error_rec(125),
END OF it_error.
Selection screen
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS session RADIOBUTTON GROUP ctu. "create session
SELECTION-SCREEN COMMENT 3(20) text-s07 FOR FIELD session.
SELECTION-SCREEN POSITION 45.
PARAMETERS ctu RADIOBUTTON GROUP ctu. "call transaction
SELECTION-SCREEN COMMENT 48(20) text-s08 FOR FIELD ctu.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(20) text-s01 FOR FIELD group.
SELECTION-SCREEN POSITION 25.
PARAMETERS group(12). "group name of session
SELECTION-SCREEN COMMENT 48(20) text-s05 FOR FIELD ctumode.
SELECTION-SCREEN POSITION 70.
PARAMETERS ctumode LIKE ctu_params-dismode DEFAULT 'N'.
"A: show all dynpros
"E: show dynpro on error only
"N: do not display dynpro
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 48(20) text-s06 FOR FIELD cupdate.
SELECTION-SCREEN POSITION 70.
PARAMETERS cupdate LIKE ctu_params-updmode DEFAULT 'L'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(20) text-s03 FOR FIELD keep.
SELECTION-SCREEN POSITION 25.
PARAMETERS: keep AS CHECKBOX. "' ' = delete session if finished
"'X' = keep session if finished
SELECTION-SCREEN COMMENT 48(20) text-s09 FOR FIELD e_group.
SELECTION-SCREEN POSITION 70.
PARAMETERS e_group(12). "group name of error-session
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 51(17) text-s03 FOR FIELD e_keep.
SELECTION-SCREEN POSITION 70.
PARAMETERS: e_keep AS CHECKBOX. "' ' = delete session if finished
"'X' = keep session if finished
SELECTION-SCREEN END OF LINE.
PARAMETERS:p_file LIKE rlgrap-filename.
at selection screen *
AT SELECTION-SCREEN.
group and user must be filled for create session
IF SESSION = 'X' AND
GROUP = SPACE. "OR USER = SPACE.
MESSAGE E613(MS).
ENDIF.
create batchinput session *
FORM OPEN_GROUP.
IF SESSION = 'X'.
SKIP.
WRITE: /(20) 'Create group'(I01), GROUP.
SKIP.
*----open batchinput group
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = GROUP
USER = sy-uname.
WRITE:/(30) 'BDC_OPEN_GROUP'(I02),
(12) 'returncode:'(I05),
SY-SUBRC.
ENDIF.
ENDFORM. "OPEN_GROUP
end batchinput session *
FORM CLOSE_GROUP.
IF SESSION = 'X'.
*------close batchinput group
CALL FUNCTION 'BDC_CLOSE_GROUP'.
WRITE: /(30) 'BDC_CLOSE_GROUP'(I04),
(12) 'returncode:'(I05),
SY-SUBRC.
ELSE.
IF E_GROUP_OPENED = 'X'.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
WRITE: /.
WRITE: /(30) 'Fehlermappe wurde erzeugt'(I06).
ENDIF.
ENDIF.
ENDFORM. "CLOSE_GROUP
Start new transaction according to parameters *
FORM BDC_TRANSACTION USING TCODE TYPE ANY.
DATA: L_SUBRC LIKE SY-SUBRC.
*------batch input session
IF SESSION = 'X'.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = TCODE
TABLES
DYNPROTAB = it_BDCDATA.
WRITE: / 'BDC_INSERT'(I03),
TCODE,
'returncode:'(I05),
SY-SUBRC,
'RECORD:',
SY-INDEX.
ELSE.
REFRESH it_MESSTAB.
CALL TRANSACTION TCODE USING it_BDCDATA
MODE CTUMODE
UPDATE CUPDATE
MESSAGES INTO it_MESSTAB.
L_SUBRC = SY-SUBRC.
WRITE: / 'CALL_TRANSACTION',
TCODE,
'returncode:'(I05),
L_SUBRC,
'RECORD:',
SY-INDEX.
ENDIF.
Message handling for Call Transaction *
perform subr_mess_hand using g_mess.
*-----Erzeugen fehlermappe
IF L_SUBRC <> 0 AND E_GROUP <> SPACE.
IF E_GROUP_OPENED = ' '.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = E_GROUP
USER = sy-uname
KEEP = E_KEEP.
E_GROUP_OPENED = 'X'.
ENDIF.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = TCODE
TABLES
DYNPROTAB = it_BDCDATA.
ENDIF.
REFRESH it_BDCDATA.
ENDFORM. "BDC_TRANSACTION
Form subr_bdc_table *
text
-->P_0220 text *
-->P_0221 text *
-->P_0222 text *
FORM subr_bdc_table USING VALUE(P_0220) TYPE ANY
VALUE(P_0221) TYPE ANY
VALUE(P_0222) TYPE ANY.
CLEAR it_bdcdata.
IF P_0220 = ' '.
CLEAR it_bdcdata.
it_bdcdata-fnam = P_0221.
it_bdcdata-fval = P_0222.
APPEND it_bdcdata.
ELSE.
it_bdcdata-dynbegin = P_0220.
it_bdcdata-program = P_0221.
it_bdcdata-dynpro = P_0222.
APPEND it_bdcdata.
ENDIF.
ENDFORM. " subr_bdc_table
Form subr_mess_hand *
text *
-->P_G_MESS text *
FORM subr_mess_hand USING P_G_MESS TYPE ANY.
LOOP AT IT_MESSTAB.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = it_messtab-msgid
LANG = it_messtab-msgspra
NO = it_messtab-msgnr
v1 = it_messtab-msgv1
v2 = it_messtab-msgv2
IMPORTING
MSG = P_G_MESS
EXCEPTIONS
OTHERS = 0.
CASE it_messtab-msgtyp.
when 'E'.
it_error-error_rec = P_G_MESS.
it_error-lifnr = it_me21-lifnr.
it_error-tabix = v_count.
APPEND IT_ERROR.
when 'S'.
it_sucess-sucess_rec = P_G_MESS.
it_sucess-lifnr = it_me21-lifnr.
it_sucess-tabix = v_count.
APPEND IT_SUCESS.
endcase.
ENDLOOP.
Describe table it_sucess lines v_ns.
Describe table it_error lines v_ne.
ENDFORM. " subr_mess_hand
Regards
Anji -
Sender Idoc_AAE Adapter for flat file format
I have been given to develop a Scenario where in an Idoc in a flat file (.txt) format needs to be sent from ECC system to a Bank SFTP server . NO ESR objects are involved ,just pick and place .Kindly Explain the configuration on the Sender Idoc_AAE Adapter .
Hi Srinath,
Please refer the below blogs for IDOC_AAE configuration
How to create and configure Sender Idoc AAE Scenario - PI 7.3
refer the below blog for IDOC to file scenario (with IDOC_AAE)
IDOC_AAE To File with all Configurations
to convert IDOC XML to IDOC flat you need to create JCA in NWA. Please refer the below blog
Converting IDoc XML to Flat File and Vice-Versa
regards,
Harish -
Hi all,
I am able to generate the PO Idoc in Flat file format using standrad FM IDOC_OUTPUT_ORDERS. but the Flat file appearing is not in a appropriate format.
I'm looking to generate the Flat file in such a way that there will be only one line for each Idoc Segment.( with Line termination).
How to Achieve this.
Regards,
S AnandResolved.
we can use CG3Y transaction.
Regards,
S Anand -
New EDI Implementation - Flat File format for SPSI in eCommerce Gateway
Hi,
we are trying to setup EDI with a business partner, goal is to import a DELFOR message into Oracle Order Management. Plans are: translate the inbound message into the SPSI flat file format, load it through eCommerce Gateway / Release Management into Order Management.
For this purpose I'd like to test to the import of a SPSI flat file into eCommerce Gateway / Release Management, however I have difficulties to get a proper flat file. Is there a way to generate example flat files somehow? I tried to generate my own flat file, based on the Oracle manuals, but how can I be sure that the format is correct (besides of running the import program)? Any advice on this?
Or is there a better way, e.g. through XML files?
Thanks in advance,
David.Hi, thanks for the response.
Yes I use that report already to get the details of the flat file. But what I am missing is for example which records are repeated, e.g. for every 4000 record, do I need one 0010 record, or can I put multiple 4000 records within one 0010 record?
regards,
David. -
Standardize a flat file format w.r.t OWB
Hi Pat,
or anyone,
Can u help me to standardize a flat file format with respect to OWB?
I have 15 financial source systems. The client agreed in giving the data in csv format. Now I need to standardize the feed file so that it would be easy for me handle it in OWB. Please note depending on my standardization the client would give me the data and in turn it would be easy for me to handle it OWB External Tables. The records size for a single feed file is 1 million. So my questions are
1.How should I standardize a date field in flat file?. Please note target date field is default date in Oracle.
2.How should I standardize an address field? I.e. normally here I have 3 address fields. But I want the output in 1 field. What is the best possible methodology to do this? Or can I handle this issue in OWB front.
3.How should I standardize a feed file name (generic)?
4.How should I standardize a feed file folder (generic)? Please note the folder will reside in UNIX environment. The concept is, there would be respective folders in UNIX and the feed files would automatically fall into these respective folders in a fortnight basis. So what should I do to achieve this? I know I have to write a shell script for the automatic process. If so how will I do this and schedule it.
5.And w.r.t above question, how will I tell OWB to go and fetch the files in those folders. I know it is done while mapping. But my question is Is that the only best way I can achieve it?
6.If I left anything related to feed file, please tell me?
Please note that based on my standardization, the client would extract the data and give it to me. So if I standardize the feed file which would be easy for me to handle it in OWB, then that would be a great success. And also note this is for a long run. Minimum 10 years.
Regards,
rem.Good afternoon Rem,
It's all very theoretical indeed, talking about standards and all. I'll try to answer some of your questions according to my experiences.
@1, Usually we load flat files into external tables using varchar2-fields only, occasionally number fields; dates however are always loaded into varchar2's and then when reading the external table into the staging area they are converted to Oracle dates using a simple TO_DATE transformation.
@2, I don't think there's a real standard for that, it should simply meet YOUR needs, so when loading EXT into STG simply perform a transformation concatenating those 3 fields to form one.
@5, you have to register the location where you have defined your flat files, this should be some Unix location; after that the connector between EXT and STG will know what to do when running the mappings from EXT to STG (thus: no other action is needed to 'tell OWB' where to fetch data from flat files).
As far as I know there a no standards in naming conventions for files and folders, just go with what seems logical/practical in your situation.
Regards, Patrick -
Picking a IDOC Flat File stored in SAP R/3 Application Server by SAP PI
Hi,
Can SAP PI pickup a IDOC Flat File stored in SAP R/3 Application Server Directory and send it back as an Inbound IDOC.
Scenario:
We have a data in the EXCEL Sheet, which will be used to a fill an IDOC and the IDOC will be just save in the SAP R/3 Application Server Directory, but can not be triggered due to its peculiar behavior. Afterwards, SAP PI should pole the SAP R/3 and pick up that IDOC Flat File from the R/3 Application Server and send it back to the SAP R/3 as an Inbound IDOC.
For Ref: IDOC does not have a Outbound Process Code, thus can not be triggered and send to SAP PI. It is always used as a Inbound IDOC in SAP R/3 system.
Regards,
SaurabhSAP PI should pole the SAP R/3 and pick up that IDOC Flat File from the R/3 Application Server
If SAP PI = 7.11 --> /people/william.li/blog/2009/04/01/how-to-use-user-module-for-conversion-of-idoc-messages-between-flat-and-xml-formats
send it back to the SAP R/3 as an Inbound IDOC
why to send some information again into R3 which it already has? cant some internal code in R3 read the info from excel and then update the IDOC directly? -
Hi Experts.
I need the Idoc flat file for Delfor01(delivery schedule).
Advance Thanks.Hi Bala,
Follow the procedure
IDOC to XML Convertion using ALE Interface
1) Send an outbound IDOC data(MATMAS) to a flat file(XML) on client1(SENDER).
- Create File Port (WE21) of XML Type for outbound file.
- Specify the Physical directory and file under the Outbound File tab
- Maintain Distribution Model (BD64) for sender ->receiver system.
- Create Partner Profile (WE20) for logical system.
- You can use this program RBDSEMAT (t/code BD10) to generate IDoc MATMAS file(s).
_ Then you can FTP the file(s) to receiver system.
2) Upload the flat file as an IDOC on the inbound sytem
which is Client2(RECIEVER).
- Create File Port (WE21) for inbound file.
- Maintain Distribution Model (BD64) for receiver -> sender system.
- Create Partner Profile (WE20) for logical system.
- You can use this program RSEINB00 to upload IDoc MATMAS file(s).
A sample scenario for idoc generation
Sending System(Outbound ALE Process)
Tcode SALE ? for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 ? Create Model View
Tcode BD82 ? Generate partner Profiles & Create Ports
Tcode BD64 ? Distribute the Model view
Message Type MATMAS
Tcode BD10 ? Send Material Data
Tcode WE05 ? Idoc List for watching any Errors
Receiving System(Inbound ALE )
Tcode SALE ? for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 ? Check for Model view whether it has distributed or not
Tcode BD82 -- Generate partner Profiles & Create Ports
Tcode BD11 Getting Material Data
Tcode WE05 ? Idoc List for inbound status codes
ALE IDOC Steps
Sending System(Outbound ALE Process)
Tcode SALE ?3 for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 !V Create Model View
Tcode BD82 !V Generate partner Profiles & Create Ports
Tcode BD64 !V Distribute the Model view
This is Receiving system Settings
Receiving System(Inbound ALE )
Tcode SALE ?3 for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 !V Check for Model view whether it has distributed or not
Tcode BD82 -- Generate partner Profiles & Create Ports
Tcode BD11 Getting Material Data
Tcode WE05 !V Idoc List for inbound status codes
Message Type MATMAS
Tcode BD10 !V Send Material Data
Tcode WE05 !V Idoc List for watching any Errors
STEP 1)a Goto Tcode SALE
Click on Sending & Receiving Systems-->Select Logical Systems
Here Define Logical Systems---> Click on Execute Button
go for new entries
-System Name : ERP000
-Description : Sending System
-System Name : ERP800
-Description : Receiving System
press Enter & Save
it will ask Request
if you want new request create new Request orpress continue for transfering the objects
B) goto Tcode SALE
Select Assign Client to Logical Systems-->Execute
000--> Double click on this
Give the following Information
-Client : ERP 000
-City :
-Logical System
-Currency
-Client role
Save this Data
Step 2) For RFC Creation
Goto Tcode SM59-->Select R/3 Connects
Click on Create Button
RFC Destination Name should be same as partner's logical system name and case sensitive
to create the ports automatically while generating the partner profiles
give the information for required fields
RFC Destination : ERP800
Connection type: 3
Description
Target Host : ERP000
System No:000
lan : EN
Client : 800
User : Login User Name
Password:
save this & Test it & RemortLogin
STEP 3) Goto Tcode BD64 -- click on Change mode button
click on create moduleview
short text : xxxxxxxxxxxxxx
Technical Neme : MODEL_ALV
save this & Press ok
select your just created modelview Name :'MODEL_ALV'.
goto add message type
Model Name : MODEL_ALV
sender : ERP000
Receiver : ERP800
Message type :MATMAS
save & Press Enter
STEP 4) Goto Tcode BD82
Give Model View : MODEL_ALV
Partner system : ERP800
execute this by press F8 Button
it will gives you sending system port No :A000000015(Like)
STEP 5) Goto Tcode BD64
select the modelview
goto >edit>modelview-->distribute
press ok & Press enter
STEP 6) goto Tcode : BD10 for Material sending
Material : mat_001
Message Type : MATMAS
Logical System : ERP800
and Execute
STEP 7)goto Tcode : BD11 for Material Receiving
Material : 100-300
Message Type : MATMAS
and Execute --> 1 request idoc created for message type Matmas
press enter
Here Master Idoc set for Messge type MATMAS-->press Enter
1 Communication Idoc generated for Message Type
Now go to the physical directory and check your idoc converted as an XML File.
Note enter required message type
OR try this
Just pass the IDoc Document no in the FM - IDOC_XML_TRANSFORM.
IDOCS_OUTPUT_IN_XML_FORMAT
IDX_IDOC_TO_XML
it will transform the IDoc in XML format
Regards,
Sridhar -
Flat File automation process - limitations
Hello Everyone,
I would really appreciate any insight on the process improvement suggestions.
Background:
Currently we have around 12 territories providing a new flat file with new data on a daily basis depending on the business activity. Which would also mean that, on a given day if there is no activity would mean no flat file provided to BI for loading process.
The flat files provided need to be loaded into the BI system (PSA - DSO - InfoCube).
The flat file loading process has been automated for the daily file by implementing the logical file name for each territory.
1. The process variant in the process chain is to ensure if the flat file is available on the App server (Custom ABAP program).
2. 12 InfoPackages have been created to pick the data from the flat file on the app server and load the data over into the PSA.
3. All the InfoPackages merge into an "AND" event in the process chain before the DTP load into the DSO kicks off.
4. DSO Activation
5. Recon between the flat file and the DSO to ensure all the data from flat file has been loaded into the DSO.
6. DTP loads into the InfoCube.
7. Recon between the InfoCube and the DSO itself.
8. Moving the flat file from one folder into another.
All the above processes are automatically performed without any issues if the flat file is available on the server.
Problem / Issue:
As one of the major limitations of the above design is the flat file for sure needs to be made available on the app server in order for the whole data flow in the process chain to continue without any breakpoints.
Current workaround / process improvement in place:
Based on the above limitation and upon further research, I was able to apply the OSS Note to give us the option of maintaining multiple DTPs for the same data target with different filter values.
So, even if have individual data stream for each territory with a different DTP the issue still remains where the process variant (ABAP program to check if file exists) or the InfoPackage load if the ABAP program is removed will fail.
Which means due to the above fact, the support team is alerted about the process chain failure.
Question / Suggestions required:
The main questions or any suggestions would be welcome, if one of you can let us know an approach where the flat file check program doesn't have to give a hard failure in the process chain for the rest of the process chain to continue with the loading process. (As in order for the rest of the process chain to continue the only options we have are Error, Success, Always).
I have also looked into the Decision process variant available in the process chain, but based on the options available within I cannot utilize it for the loading process.
Error can be caused by generating an error message in the ABAP program which in turn is causing the issue of alert being sent over even if the rest of the process chain finishes.
Success would mean the flat file needs to be available. Always cannot be used in this case as it will cause a failure at the InfoPackage level.
If the InfoPackage load can be avoided without a hard error to be generated, the process chain does not have to remain in the failed state which in turn will not trigger any alert to the support team.
Please do let me know if you need more details about the above process improvement question.
Thanks
Dharma.The main issue with this as you mentioned is that the file has to be available for sure.
We had a similar issue - we had a very critical data load that had to happen everyday , failure of the file getting loaded would mean that the reports for the day would be delayed.
We were running on UNIX and we implemented a simple UNIX command that would not complete till the file was available in the app server.
Something like
while ( the file does not exist )
delay of 15 seconds
you will come out of the while only after the while completes which means that the file becomes available.
You can write a similar ABAp program to check file availability if required and put it into your program.
we also had a failover process where we created a zero byte file with the same name if the file did not come beyond a certain number of tries and the PSA would load zero records and the data load will continue.
Edited by: Arun Varadarajan on Jan 26, 2009 10:18 AM -
Hi all
What is mean by ASCI format for the flat file
any eg to show?
Name | Age | Hobby | Contact
john;23;soccer;123456
do u mean by ASCI format above?gary,
American Standard Code for Information Interchange (ASCII), generally pronounced ask-ee , is a character encoding based on the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that work with text. Most modern character encodings which support many more characters have a historical basis in ASCII.
Work on ASCII began in 1960. The first edition of the standard was published in 1963,[1] a major revision in 1967, and the most recent update in 1986. It currently defines codes for 128 characters: 33 are non-printing, mostly obsolete control characters that affect how text is processed, and 95 are printable characters.
Regards,
Karthik -
Hi,
I have a requirement wherein we have to read the IDOC flat file and post it as IDOC to SAP using XI. I understand we have to use the Flat File Sender adapter and the IDOC Receiver Adapter. On the Sender Side we have to define the Content Conversion to convert the IDOC Flat File to IDOC XML. Writing File Content Conversion for the IDOC Flat File would be very tedious because of the number of fields and fixed structure of the flat file.
I have don through the following guide Section 3.2 where it talks abt converting IDOC to IDOC XML using reportRSEINB00.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how%20to%20convert%20between%20idoc%20and%20xml%20in%20xi%203.0.pdf
I am not clear how to invoke this report in the Flat File Sender adapter. Also is there any other approach.
Thanks
Rajeev GuptaHi Rajeev
You have a flatfile at the sender side so you dnt have any feasiable option to do other than FCC....FCC is not a tediuos one...if you can provide the strucutrre we will help you out...
Check out you have a fixedlength file or piple separated one....
In the functional design how many fields re present and buil the DT,MT MI accoprdingly.....
you have to just use some conecnt conversion parameters that's it...
item.fieldSeparator
item.endSeparator
item.fieldNames
here item is your recordset name
let us know your strucutre
regards
Nisar -
Flat file format - importing vs typing it out
Hi. I've heard there is a way to import the format (rather that typing it out in connection mgr) of a fixed width flat file. What r the general steps or where is there a set of instructions online? I generally have a txt doc with column
names (lots of them) , widths etc that I would use for import and could easily transfer them to a spreadsheet if necessary. So far the word import is bringing up a lot of unwanted subject matter in my web searches. I am spending a lot
of time typing out flat file formats in conn mgrs and am thinking it may be worth a look at ssis's ability to "import" a format. We generally land our data in "untyped" staging tables 1st so ssis could assume everything is string.
I dont really want to read my records as one long string and parse them later.thx. I suppose I can write and share with the community some general t-sql that generates the following but would like to know a couple of things.
First, is any old guid ok in each of the places where a guid is indicated? I would generate a new one for each guid.
Second, what is the locale id?
Of course i would only paste the results in a pkg (dtsx file) that doesnt reference the cols (beyond the connection stuff) yet.
What gotchtyas am I looking at if i try this with the intention of pasting the generated code over the top of what ssis already generated (inside the dtsx file) in a one column connector created the usual way?
<DTS:ConnectionManagers>
<DTS:ConnectionManager
DTS:refId="Package.ConnectionManagers[Flat File Connection Manager]"
DTS:CreationName="FLATFILE"
DTS:Description="ZZZZZZ"
DTS:DTSID="{some guid}"
DTS:ObjectName="Flat File Connection Manager">
<DTS:PropertyExpression
DTS:Name="ConnectionString">@[User::fileName]</DTS:PropertyExpression>
<DTS:ObjectData>
<DTS:ConnectionManager
DTS:Format="FixedWidth"
DTS:LocaleID="1033"
DTS:HeaderRowDelimiter="_x000D__x000A_"
DTS:RowDelimiter=""
DTS:TextQualifier="_x003C_none_x003E_"
DTS:CodePage="1252"
DTS:ConnectionString="c:...">
<DTS:FlatFileColumns>
<DTS:FlatFileColumn
DTS:ColumnDelimiter=""
DTS:ColumnWidth="2"
DTS:MaximumWidth="2"
DTS:DataType="129"
DTS:ObjectName="XXXXX"
DTS:DTSID="{some other guid}"
DTS:CreationName="" />
<DTS:FlatFileColumn
DTS:ColumnDelimiter=""
DTS:ColumnWidth="2"
DTS:MaximumWidth="2"
DTS:DataType="129"
DTS:ObjectName="YYYYYY"
DTS:DTSID="{some other guid}"
DTS:CreationName="" /> -
IDoc flat file over AS2 adapter to IDoc adapter
Hi,
The scenario is IDoc flat file(.txt) over AS2 adapter to IDoc adapter. Could anyone help on how to convert the IDoc flat file to xml in AS2 adapter to execute the mapping further? we are using PI 7.0.
Thanks in advance!
-zameerHi,
Since you are on Pi 7.0, you would not be able to use the modules for this in PI 7.1.
You would need to refer this document for converting from Idoc flat to XML
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a?quicklink=index&overridelayout=true
In your sender AS2 adapter, you can pass the file as is to an abap mapping which will do the conversion to Idoc xml. the output of the abap mapping goes to your message mapping then for conversion.
Another option would be to use a custom adapter module in the sender AS2 adapter to call the Aabap mapping to do the conversion into Idoc xml.
The custom adapter module would do a JCO/RFC call which will do the conversion before passing the data back to the adpter module.
Regards -
I am receiving flat file in SFTP Server which need to be posted into SAP (No mapping involved)
What will be the best approach ?
1. I tried using IDOCFlatToXmlConvertor (The limitation in the format of source file. The parent and child node relationship should be explicitly mentioned in IDoc flat file which legacy system is not able to do) - Any workarounds ?
2. I moved the Idoc flat file into SAP application server. Now need to schedule job using program RSEINB00
3. File Content Conversion
Any other better solution ? Appreciate your help.
Thanks and regards,
Jose AugastineFor converting Idoc Flat file to idoc xml, ABAP mapping is one of the feasible option.
-
Connection to be done for IDOC to File
Hi All,
I am doing IDOC to file ,i need to know what all connection need to be done (ALE) connection , please help me
Thanking you
SridharHi,
For IDoc to File sceanrio first you have to do ALE settings on R# and XI system.
Steps for ALE settings:-
Steps for XI
Step 1)
Goto SM59.
Create new RFC destination of type 3(Abap connection).
Give a suitable name and description.
Give the Ip address of the R3 system.
Give the system number.
Give the gateway host name and gateway service (3300 + system number).
Go to the logon security tab.
Give the lang, client, username and password.
Test connection and remote logon.
Step 2)
Goto IDX1.
Create a new port.
Give the port name.
Give the client number for the R3 system.
Select the created Rfc Destination.
Step 3)
Goto IDX2
Create a new Meta data.
Give the Idoc type.
Select the created port.
Steps for R3.
Step 1)
Goto SM59.
Create new RFC destination of type 3(Abap connection).
Give a suitable name and description.
Give the Ip address of the XI system.
Give the system number.
Give the gateway host name and gateway service (3300 + system number).
Go to the logon security tab.
Give the lang, client, username and password.
Test connection and remote logon.
Step 2)
Goto WE21.
Create a port under transactional RFC.(R3->XI)
Designate the RFC destination created in prev step.
Step 3)
Goto SALE.
Basic settings->Logical Systems->Define logical system.
Create two logical systems(one for XI and the other for R3)
Basic settings->Logical Systems->Assign logical system.
Assign the R3 logical system to respective client.
Step 4)
Goto WE20.
Partner type LS.
Create two partner profile(one for XI the other for R3).
Give the outbound or inbound message type based on the direction.
Step 5)
Goto WE19
Give the basic type and execute.
fill in the required fields.
Goto IDOC->edit control records.
Give the following values.(Receiver port,partner no.,part type and sender Partner no. and type)
Click outbound processing.
Step 6)
Go to SM58
if there are any messages then there is some error in execution.
Goto WE02.
Check the status of the IDOC.
Goto WE47.
TO decode the status code.
Step 7)
Not mandatory.
Goto BD64.
Click on Create model view.
Add message type.
Affter ALE setting you have to do development in IR and ID as per standard XI procedure.
Regards,
Sami.
Maybe you are looking for
-
Read this link before this question. http://discussions.apple.com/thread.jspa?threadID=1584036&tstart=0 In the link above, I explained a problem with expose, which in turn caused a problem with my iPod. "Another time, dragging an mp3 to my iPod. The
-
How do I see the Kernel patch level in Java ONLY instance?
Could someone please tell me How do I see the Kernel patch level in a Java ONLY instance? In Abap, it is simple! In Java I see in the System Info: Kernel Version: 7.00 PatchLevel 108458.44 BUT that doesn't correspond to the real patch level which I
-
Balance sheet revaluation - ABAW
Hi, I have to configure balance sheet revaluation but I have not done it before. I made some custom, and I run ABAW. This transaction does not generate any FI documents. Should I do something more? Do you have any experiences with Balance sheet reval
-
BP opening balance modification
Hi All, All the vendor opening balances which were taken as +ve, needs to be taken as -ve and vice versa...What will be the best possible option for the same? Regards, Rupa
-
CVP - SIP Server Groups and Redundant SIP Proxy (CUPS)
I am migrating from a CVP 7 + UCCE 7.5 solution which uses srv.xml files on the CVP servers to implement redundancy from CVP to the SIP Proxies (which are CUPS based). In the new CVP 8.5 + UCCE 8.5 solution, I am trying to set up equivalent redundanc