2006 Nov 10 4:42 PM
I need to know what IDOCs are, what they do and to implement or use them?
i also need to know about ALV anf if there are any tutorials they will be very helpful
Thank you
2006 Nov 10 4:55 PM
Hi
IDoc is SAP's version of EDI.(Electronic Data Interchange)
EDI is just an electronic file transfer across Internet.
[url=http://www.webopedia.com/TERM/E/EDI.html]
regarding ALV there is abundant documentation in help.sap.com.
2006 Nov 10 5:03 PM
<b>IDoc (Intermediate Document)</b>
IDoc is standard data structure for EDI between application programs written for the popular SAP business system or between an SAP application and an external program. Docs serve as the vehicle for the data transfer in SAPs ALE system.
IDocs are used for Asynchronous transactions.
IDoc contains 3 segments
<b>IDoc Generation</b>
<b>
Sending System:</b>
Create a segment -- WE31
Create an IDoc Type -- WE30
Create a Logical Msg Type WE81
Assign IDoc & Msg Types --WE82
Create Outbound IDoc program- SE38
Receiving System
Create an Inbound FM -- SE37
Assign FM-IDoc-Msg Type -- WE57
Assign Charac of Inbound FM--BD51
Create an Inbound Process Code --WE42
Configure the ALE settings
<b>IDoc Events occurring during its generation</b>
A unique IDoc number is allocated
One control record is attached
Data segments translate into data records
Status records are attached
Syntax rules are checked
<b>Standard IDocs
</b>
Description Msg Type IDoc Type
Vendor CREMAS CREMAS02
Customer DEBMAS DEBMAS03
Material Master MATMAS MATMAS03
Document DOCMAS DOCMAS04
Orders ORDERS ORDERS04
Invoice INVOIC INVOIC02
GL Account GLMAST GLMAST01
PA-Object Type HRMD-A HRMD-A03
User Master Record USERCLONE USERCLONE01
<b>
IDocs </b>
Used only for create purposes only.
Whole data is wrapped
Target system need not be online
No additional programming is required
Receipt / Sending on the target system may not be immediate
The sending system has no way to know the status of IDocs
Its harder to create a customized IDoc
Process is more secured
<b>ALV Reports</b>
The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).
All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.
<b>Simple report:</b>
Reuse_alv_list_display
Reuse_alv_fieldcatalog_merge
Reuse_alv_events_get
Reuse_alv_commentary_write
Reuse_alv_grid_display
<b>Hierarchical Sequential Report:</b>
Reuse_alv_hierseq_list_display
<b>Block Report:</b>
Reuse_alv_block_list_init
Reuse_alv_block_list_append
Reuse_alv_block_hs_list_append
Reuse_alv_block_list_display
<b>Example program:</b>
REPORT Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB .
tables:
marav. "Table MARA and table MAKT
Data:
begin of imat occurs 100,
matnr like marav-matnr, "Material number
maktx like marav-maktx, "Material short text
matkl like marav-matkl, "Material group
ntgew like marav-ntgew, "Net weight, numeric field
gewei like marav-gewei, "weight unit (just to be complete)
end of imat.
data i_repid like sy-repid.
data i_lines like sy-tabix.
TYPE-POOLS: SLIS.
data int_fcat type SLIS_T_FIELDCAT_ALV.
select-options:
s_matnr for marav-matnr matchcode object MAT1.
start-of-selection.
read data into table imat
select * from marav
into corresponding fields of table imat
where
matnr in s_matnr.
Check if material was found
clear i_lines.
describe table imat lines i_lines.
if i_lines lt 1.
write: / 'No materials found.'.
exit.
endif.
end-of-selection.
i_repid = sy-repid.
Create Fieldcatalogue from internal table
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = i_repid
I_INTERNAL_TABNAME = 'IMAT' "caps!
I_INCLNAME = i_repid
CHANGING
CT_FIELDCAT = int_fcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
write: / 'Returncode', sy-subrc, 'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.
ENDIF.
Call for ALV list display
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB'
I_CALLBACK_PROGRAM = i_repid
IT_FIELDCAT = int_fcat
I_SAVE = 'A'
TABLES
T_OUTTAB = imat
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
write: / 'Returncode', sy-subrc, 'from FUNCTION REUSE_ALV_LIST_DISPLAY'.
ENDIF.
Award points if helpful.
Thanks
Aneesh