Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Process and reprocess

Former Member
0 Likes
978

Hi experts I have One doubt in ALEIdoc

If any One ask me in interview ,

How do u process Idoc in inbound side what I have to tell

and If they ask me how do u reprocess idoc at inbound side what I have to tell please guide me

Points will be rewarded

Thanks,

Durga .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
874

Hi,

The process code assigned in the partner profile is pointing to a function module which is a processing routine for the incoming idoc.

Proper partner profile will be found out by using the sender logical system name and the interface is found out by using the message type and idoc type.

Use report RBDAGAI2 to reprocess the inbound idocs.

Reward points if you find it helpful

Thanks,

Prasanna

5 REPLIES 5
Read only

Former Member
0 Likes
874

Hi,

searchsap.techtarget.com/tip/0,289483,sid21_gci1268508,00.html - 68k - Cached - Similar pages

Sample Processing Routines

Last edited:

Creating and processing IDocs are a widely mechanical task, as it is true for all interface programming. We will show a short example that packs SAP R/3 SapScript standard text elements into IDocs and stores them back to texts in a second routine. The text elements can be edited with SO10.

Outbound function IDoc outbound functions are function modules with a standard interface which will read data from an application database and convert the data into IDoc format.

The interface parameters need to be compatible with a well defined standard, because the function module will be called from within another program.

Inbound function IDoc inbound functions are function modules with a standard interface, which will interpret the received IDoc data and prepare for processing by an application.

The received IDoc data is processed record by record and interpreted according the segment information provided with each record. The prepared data can then be processed by an application, a function module or a self-written program.

The example programs in the following chapters will show you how texts from the text pool can be converted into an IDoc and processed by an inbound routine to be stored into another system. The following will give you the basics to understand the example.

Text from READ_TEXT SAP R/3 allows the creation of text elements, e.g. with transaction SO10. Each standard text elements has a header record which is stored in table STXH. The text lines itself are stored in a special cluster table. To retrieve the text from the cluster, you will use the standard function module function READ_TEXT . We will read such a text and pack it into an IDoc. That is what the following simple function module does.

If there is no convenient routine to process data, the easiest way to hand over the data to an apllication is to record a transaction with transaction SHDB and create a simple processing function module from that recording.

Sample Inbound Routines

Last edited:

Inbound processing is widely the reverse process of an outbound.. The received IDoc has to be unpacked, interpreted and transferred to an application for further processing.

Inbound processing function module Below is the example of an inbound function module. This module expects an IDoc with rows of plain text and will save this text under a given name to SAP's text database. The procedure will extract the text name and the text line from the IDoc and hand over the text data to the function module READ_TEXT which will store the text in the text pool.

FUNCTION

*"----

-


""Lokale Schnittstelle:

*" IMPORTING

*" VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD

*" VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC

*" EXPORTING

*" VALUE(WORKFLOW_RESULT) LIKE BDWFAP_PAR-RESULT

*" VALUE(APPLICATION_VARIABLE) LIKE BDWFAP_PAR-APPL_VAR

*" VALUE(IN_UPDATE_TASK) LIKE BDWFAP_PAR-UPDATETASK

*" VALUE(CALL_TRANSACTION_DONE) LIKE BDWFAP_PAR-CALLTRANS

*" TABLES

*" IDOC_CONTRL STRUCTURE EDIDC

*" IDOC_DATA STRUCTURE EDIDD

*" IDOC_STATUS STRUCTURE BDIDOCSTAT

*" RETURN_VARIABLES STRUCTURE BDWFRETVAR

*" SERIALIZATION_INFO STRUCTURE BDI_SER

*"----

-


DATA: XTHEAD LIKE THEAD .

DATA: TLINES LIKE TLINE OCCURS 0 WITH HEADER LINE.

CLEAR XTHEAD.

REFRESH TLINES.

  • *** --- Unpacking the IDoc --- ***

LOOP AT IDOC_DATA.

CASE IDOC_DATA-SEGNAM.

WHEN 'YAXX_THEAD'.

MOVE IDOC_DATA-SDATA TO XTHEAD.

WHEN 'YAXX_TLINE'.

MOVE IDOC_DATA-SDATA TO TLINES.

ENDCASE.

ENDLOOP.

  • *** --- Calling the application to process the received data --- ***

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

HEADER = XTHEAD

SAVEMODE_DIRECT = 'X'

TABLES

LINES = TLINES.

ADD SY-SUBRC TO OK.

  • füllen IDOC_Status

  • fill IDOC_Status

IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.

IDOC_STATUS-MSGV1 = IDOC_CONTRL-IDOCTP.

IDOC_STATUS-MSGV2 = XTHEAD.

IDOC_STATUS-MSGID = '38'.

IDOC_STATUS-MSGNO = '000'.

IF OK NE 0.

IDOC_STATUS-STATUS = '51'.

IDOC_STATUS-MSGTY = 'E'.

ELSE.

IDOC_STATUS-STATUS = '53'.

IDOC_STATUS-MSGTY = 'S'.

CALL_TRANSACTION_DONE = 'X'.

ENDIF.

APPEND IDOC_STATUS.

ENDFUNCTION.

Unpacking the IDoc data The received IDoc data is processed record by record and unpacking is a simple discrimination by case according the segment name provided with each record..

  • *** --- Unpacking the IDoc --- ***

LOOP AT IDOC_DATA.bb

CASE IDOC_DATA-SEGNAM.

WHEN 'YAXX_THEAD'.

PERFORM UNPACK_IDOC TABLES IDOC_DATA USING XTHEAD.

WHEN 'YAXX_TLINE'.

PERFORM UNPACK_TAB TABLES IDOC_DATA TLINES.

ENDCASE.

ENDLOOP.

Application processing When the IDoc is unpacked it needs to be passed to the application. In our case this will be a simple call to a standard function which is going to store the data to the text database.

  • *** --- Calling the application to process the received data --- ***

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

HEADER = XTHEAD

SAVEMODE_DIRECT = 'X'

TABLES

LINES = TLINES.

Writing a status log Finally the processing routine needs to pass a status record to the IDoc processor. This status indicates successful or unsuccessful processing and will be added as a log entry to the table EDIDS.

  • fill IDOC_Status

IF OK NE 0.

IDOC_STATUS-STATUS = '51'.

...

ELSE.

IDOC_STATUS-STATUS = '53'.

...

ENDIF.

APPEND IDOC_STATUS.

The status value '51' indicates a general error during application processing and the status '53' indicates everything is OK. There are numerous other status values, with distinct meanings, but '51' and '53' are the most common ones.

http://idocs.de/www3/cookbooks/id

verify if it helps

Thanks & regards,

sravani yendru

Read only

Former Member
0 Likes
875

Hi,

The process code assigned in the partner profile is pointing to a function module which is a processing routine for the incoming idoc.

Proper partner profile will be found out by using the sender logical system name and the interface is found out by using the message type and idoc type.

Use report RBDAGAI2 to reprocess the inbound idocs.

Reward points if you find it helpful

Thanks,

Prasanna

Read only

Former Member
0 Likes
874

Hi Durga Prasad,

1.How do u process Idoc in inbound side .

If any Error Occurs in inbound . goto WE19 and give the Error Idoc number and go for process .and select "Innbound fonction module u will get one popup ,provide ur corresponding fiunctin module . select ok

now the duplicate Idoc will be created in the above case .

2. If they ask me how do u reprocess idoc at inbound side .

Goto bd87 Provide ur Idoc number selct process, select ur node again go for Process , Error Idoc will be reprocessed .

No duplicate Idoc will be created

Please let me know if u have any query.

Rgds

Sree M

Read only

0 Likes
874

Hi Sree How are you,

as u said i tried with bd87 after entering idoc number Gone with process,

after that selected node , after that gone with process In Application tool bar

One Error is coming there

  • The operation cannot be carried out with this node type *

what is this one plz explain , I think we can find in the selection screen if I enter outbound idoc Number we can find corresponding Inbound Idoc number ,

How we can do this plz explain this one also

If possible 100 Points will be rewarded to u from my side

Thanks

Durga Prasad.

Read only

Former Member
0 Likes
874

Hi,

Process Code turn drives which Function Module to use,which in turn will determine the content of the message.

Process Codes are used to identify the function module or API (Application Programming Interface) to be invoked for subsequent processing (Outbound or Inbound) of the business application.

Outbound process code - Outbound process code under Message Control, generated the IDoc in the IDoc Interface. The process code determines the relevant function module. (TCode – WE41)

Inbound process Code - names the function module or workflow which reads the IDoc data and transfers the data to the application document. (TCode – WE42)

Outbound process codes are stored in table TEDE1, while inbound process codes are stored in TEDE2.

with regards,

sowjanyagosala