Application Development 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: 

idoc messages

Former Member
0 Kudos

Hi all,

In my project end users create document in front end application based on .net. I am posting the same data into sap using Idocs. my question is how I can pass Idocs messages i.e. document no , error message to back to user again .

How can I pass messages to users through mail i.e. sending idoc messages through mail?

Thanks,

Sridhar.

3 REPLIES 3

Former Member
0 Kudos

Hi Sridhar,

Well if you have the Idco no then its pretty simple.

Goto EDIDS table which stores status messages and fetch status from there.

There is a field STATYP which means ERROR or WARNING or SUCCCESS message.

Hope it'll help.

Cheers

Ankur

former_member188685
Active Contributor
0 Kudos

Hi,

after IDOC creation you can trigger workflow, using the workflow you can send the messages what ever it may be either success or error.

for getting messages you need to take help of edids table. select the records from edids for that IDoc, but you cannot see any message . for getting them you just see the below logic..

here i am looking for error, 51 status.

[code] CLEAR IT_MESG.REFRESH IT_MESG.

DATA: T100 TYPE T100,

BUFFER(273).

LOOP AT IT_EDIDS INTO X_EDIDS WHERE STATUS = C_51.

SELECT SINGLE * FROM T100 INTO T100

WHERE SPRSL = SY-LANGU

AND ARBGB = X_EDIDS-STAMID

AND MSGNR = X_EDIDS-STAMNO.

IF SY-SUBRC = 0.

BUFFER = T100-TEXT.

ELSE.

BUFFER = TEXT-M00.

ENDIF.

  • at first &1/&2/&3/&4 or. $1/$2/$3/$4 replace

IF T100-TEXT CA '$1'.

REPLACE '$1' WITH X_EDIDS-STAPA1 INTO BUFFER.

ENDIF.

IF T100-TEXT CA '$2'.

REPLACE '$2' WITH X_EDIDS-STAPA2 INTO BUFFER.

ENDIF.

IF T100-TEXT CA '$3'.

REPLACE '$3' WITH X_EDIDS-STAPA3 INTO BUFFER.

ENDIF.

IF T100-TEXT CA '$4'.

REPLACE '$4' WITH X_EDIDS-STAPA4 INTO BUFFER.

ENDIF.

IF T100-TEXT CA '&1'.

REPLACE '&1' WITH X_EDIDS-STAPA1 INTO BUFFER.

ENDIF.

IF T100-TEXT CA '&2'.

REPLACE '&2' WITH X_EDIDS-STAPA2 INTO BUFFER.

ENDIF.

IF T100-TEXT CA '&3'.

REPLACE '&3' WITH X_EDIDS-STAPA3 INTO BUFFER.

ENDIF.

IF T100-TEXT CA '&4'.

REPLACE '&4' WITH X_EDIDS-STAPA4 INTO BUFFER.

ENDIF.

IF T100-TEXT CA '$'.

REPLACE '$' WITH X_EDIDS-STAPA1 INTO BUFFER.

REPLACE '$' WITH X_EDIDS-STAPA2 INTO BUFFER.

REPLACE '$' WITH X_EDIDS-STAPA3 INTO BUFFER.

REPLACE '$' WITH X_EDIDS-STAPA4 INTO BUFFER.

ENDIF.

IF T100-TEXT CA '&'.

REPLACE '&' WITH X_EDIDS-STAPA1 INTO BUFFER.

REPLACE '&' WITH X_EDIDS-STAPA2 INTO BUFFER.

REPLACE '&' WITH X_EDIDS-STAPA3 INTO BUFFER.

REPLACE '&' WITH X_EDIDS-STAPA4 INTO BUFFER.

ENDIF.

CONDENSE BUFFER.

MOVE BUFFER TO X_MESG.

APPEND X_MESG TO IT_MESG.

CLEAR X_MESG.

ENDLOOP.[/code]

regards

Vijay

Former Member
0 Kudos

U can use FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send data through mail.

U will find lots of examples in SDN.

Cheers

Ankur