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

IDOC Has Wrong Status

abdulbasit
SAP Mentor
SAP Mentor
0 Likes
5,023

Hi,

We are receiving an IDOC with message type Orders from another SAP system.

It the status records there is :

50 - Idoc Added

60 - Error During Syntax Check of IDOC

( I have disabled syntax check so it continues processing )

61 - Processing despite syntax errors

64 - IDOC ready to be transferred to application

62 - IDOC passed to application

51 - Error : Application document not posted

( In detail there is a message <b>"IDOC has wrong status"</b>

When I re-process IDOC it processes succesfully and creates an order.

I have debugged the code and seen that it gets wrong status error because of :

<i>FORM STATUS_CHECK USING PI_IDOC_STATUS LIKE EDIDC-STATUS

PI_DIRECT_CALL LIKE BDWF_PARAM-DIRECTCALL

CHANGING PE_STATUS_OK.

IF ( PI_DIRECT_CALL = C_TRUE

AND PI_IDOC_STATUS <> C_IDOC_STATUS_READY_POST

AND PI_IDOC_STATUS <> C_IDOC_STATUS_POSTPONED

AND PI_IDOC_STATUS <> C_IDOC_STATUS_ERR_IDOC_TO_APPL )

OR ( PI_DIRECT_CALL = C_FALSE

AND PI_IDOC_STATUS <> C_IDOC_STATUS_APPL_IN

AND PI_IDOC_STATUS <> C_IDOC_STATUS_POSTPONED

AND PI_IDOC_STATUS <> C_IDOC_STATUS_ERROR

AND PI_IDOC_STATUS <> C_IDOC_STATUS_EDITED ) .

PE_STATUS_OK = C_FALSE.

ELSE.

PE_STATUS_OK = C_TRUE.

ENDIF.

ENDFORM.</i>

How can I get rid of this error ? I have tried both processing from BD87 or processing with scheduled job.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Jelena_Perfiljeva
Active Contributor
3,394

Not sure if still remembers it after almost 10 years (either way not closing discussion seems very un-mentorly of him ), but I came across this error today and this is the first post found by Google, so just adding my solution for the future generations.

I got this error while trying to debug in WE19 (Inbound function module) and it drove me insane. But thanks to this thread I took another look at control record and noticed the 'Test flag' there. Turns out this flag needs to be on when using 'inbound FM' process. If only SAP message could give us a hint...

P.S. There is also the same flag in the partner profile. If you check this flag in the control record then it also needs to be checked in the profile. Otherwise you'll get 'profile not found' error.

11 REPLIES 11
Read only

Laxmana_Appana_
Active Contributor
0 Likes
3,394

Hi,

Syntax Check of IDOC fails due to

1.IDOC comes with wrong structure means mismatch in parent-child relationship.

2. if any segment min and max values are maintained as 1 and 100 , in actual IDOC for this segment if we get segments more than 100.

if the failure occured due to above cases ,open idoc in WE19 and remove extra segment or correct the structure (copy/paste segments) and reprocess the idoc. it will create new IDOC , but old idoc will be there in the system with errors only.

Could you explain what you are looking for ?

Regards

Appana

Message was edited by: L Appana

Read only

0 Likes
3,394

Hi,

Syntax error doesn't make problem since I have disabled the check syntax checkbox in the WE20.

Read only

ferry_lianto
Active Contributor
0 Likes
3,394

Hi Abdulbasit,

Please check the IDoc Control Record for EDIDC-DIRECT.

It seems missing the value for direction for IDoc transmission.

It should be populated with value '1' (Inbound).

Hope this will help.

Regards,

Ferry Lianto

Please reward points if helpful.

Read only

0 Likes
3,394

Hi Ferry,

EDIDC-DIRECT is 2 in the Control Record but in F4 it says 2 is inboud.

Is it 1 - inboud in your system ?

Thanks.

Read only

Manohar2u
Active Contributor
0 Likes
3,394

Can you check for any NOTES available for this program?

So If you re-process again does it create order??

Regds

Manohar

Read only

ferry_lianto
Active Contributor
0 Likes
3,394

Hi Abdulbasit,

Sorry ... typo error.

It should be '2' (inbound).

Does it solve the problem?

Regards,

Ferry Lianto

Read only

ferry_lianto
Active Contributor
0 Likes
3,394

Hi Abdulbasit,

Sorry ... typo error.

It should be '2' (inbound).

Does it solve the problem?

Regards,

Ferry Lianto

Read only

pravesh_jain3
Explorer
0 Likes
3,394

Have you resolved this issue. I am also facing same issue. Please guide.

Read only

Jelena_Perfiljeva
Active Contributor
3,395

Not sure if still remembers it after almost 10 years (either way not closing discussion seems very un-mentorly of him ), but I came across this error today and this is the first post found by Google, so just adding my solution for the future generations.

I got this error while trying to debug in WE19 (Inbound function module) and it drove me insane. But thanks to this thread I took another look at control record and noticed the 'Test flag' there. Turns out this flag needs to be on when using 'inbound FM' process. If only SAP message could give us a hint...

P.S. There is also the same flag in the partner profile. If you check this flag in the control record then it also needs to be checked in the profile. Otherwise you'll get 'profile not found' error.

Read only

0 Likes
3,394

Wow, Jelena, thanks for the answer

You made me think to check my old open threads. Who knows, someone might need the answer even after 10 years.

I've rewarded your points

Read only

0 Likes
3,394

Actually I find our project using the wrong message type deal with inbound idoc message,If you use DELFOR message type to deal DELINS message,you will also get 51 - Error : Application document not posted. when I changed the message type in WE20,status get green light.

Jelena Perfiljeva 's Best Answer is also a reason about this error,but not the only reason.