All IDoc data records are exchanged in a fixed format, regardless of the segment type. The
segment’s true structure is stored in R/3’s repository as a DDic structure of the same name.
The segment info tells the IDoc processor how the current segment data is structured
and should be interpreted. The information, which is usually the only interest, is the
name of the segment EDID4-SEGNAM.
The segment name corresponds to a data dictionary structure with the same name,
which has been created automatically when defining the IDoc segment definition
with transaction WE31 .
For most applications, the remaining information in the segment info can be ignored
as being redundant. Some older, non-SAP-compliant partners may require it. E.g.
the IDoc segment info will also store the unique segment number for systems, which
require numeric segment identification.
To have the segment made up for processing in an ABAP, it is usually wise to move
the segment data into a structure, which matches the segment definition.
For a segment of type e1maram the following coding is commonly used:
TABLES: e1maram.
. . .
MOVE edidd-sdata TO e1maram.
Then you can access the fields of the IDoc segment EDIDD-SDATA as fields of the
structure e1maram .
WRITE: e1maram-matnr.
The following coding sample, shows how you may read a MATMAS IDoc and
extract the data for the MARA and MARC segments to some internal variables and
tables.
DATA: xmara LIKE e1maram.
DATA: tmarc AS STANDARD TABLE OF e1marcm
WITH HEADER LINE.
LOOP AT edidd.
CASE edidd-segnam.
WHEN 'E1MARAM'.
MOVE edidd-sdata TO xmara.
WHEN 'E1MARCM'.
MOVE edidd-sdata TO tmarc.
APPEND tmarc.
ENDCASE.
ENDLOOP.
now do something with xmara and tmarc.
ABAP/4,ABAP report,Interactive Report Example,ALV grid Example,ALV list,IDOC,User Exit,RFC,Smartform,sapscript,ABAP Performance,Remote Function Module( RFC ),Function Module,ABAP Sample Code,ABAP tools,ALV report Generator,ABAP Interview Questions,BDC,BAPI,ALE,BADI,EDI,InternalTable,Data Structure,LSMW,Domain,DataElement,Basis and Administration,ABAP HR development,ABAPDebugger,BW,Exception Handling,Download FI, CO, MM, PP, SD, PM, PS, QM, SM, HR, BW, APO,ABAP Tutorial
Monday, April 21, 2008
Subscribe to:
Post Comments (Atom)
Sample ABAP Code
- Sample ABAP Program to Upload table using new function GUI_UPLOAD
- Sample ABAP Program for Submitting report with selection table
- Sample ABAP Program for Sending SAP Mail
- Sample ABAP Program for Search Layout sets for given String
- Sample ABAP Program for Sapscript PerForm Module
- Sample ABAP Program for Create IDOC
- Sample ABAP Program for Output file to application server then send mail with Download details
- Sample ABAP Program for Module Pool Skeleton
- Sample ABAP Program for Module Pool containing screen loop processing
- Sample ABAP Program for MB1B Call Transaction
- Sample ABAP Program of Function Module to Convert Work Center into Personnel Number
- Sample ABAP Program of FTP Function Module
- Sample ABAP Program to EXPORT LIST TO MEMORY
- Sample ABAP Program to Execute Unix command from within SAP
- Sample ABAP Program to Get Output in EXCEL
- Sample ABAP Program to Implement EDI
- Sample Program to dynamically change upload/download program for any Table
- Sample ABAP Program to download table using new function GUI_DOWNLOAD
- Sample ABAP Program to Download file to Presentation Server
- Sample ABAP Program to display pop message to avoid abort
- Sample ABAP Program of ALV Grid
- Sample ABAP Program of Dialogue Module Pool
- Sample ABAP Program to DIALOGUE FLOW LOGIC
- Sample ABAP Program to Delete a file from the application server
- Sample ABAP Program to Compare to Unix or PC files and print differences
- Sample ABAP Program to Colour cells in ALV
- Sample ABAP Program to Calculate difference between date/times in hours
- Sample ABAP Program of BW User Exit
- Sample ABAP Program of ALV Grid control using OO methods
- Browse a file on the application server
No comments:
Post a Comment