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: 

Inbound Idoc Status

Former Member
0 Kudos

Hi Gurus,

I have Inbound Idoc which is working fine ,

but it's status is showing

51 Error: Application document not posted.

What does this mean, My Idoc FM is doing all it's part which required.

Can any please suggest me .

Thanks ,

Raj

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Boss,

51 Status code is not a successful idoc, in status code below we the error description that u can see in we02 . so, first see that error description and tell me that . then only i can tell the solution.

With Regards,

Narasimha Rao.N

10 REPLIES 10

Former Member
0 Kudos

Hi Boss,

51 Status code is not a successful idoc, in status code below we the error description that u can see in we02 . so, first see that error description and tell me that . then only i can tell the solution.

With Regards,

Narasimha Rao.N

0 Kudos

Hi,

this is the error message I am geting in status .

"51 Error: Application document not posted

Message: No status record was passed to ALE by the application."

I am creating multiple deliveries as I am receiving order number, and then changing the delivery through BDC.

Is there is need of any manual Status coding?

It is working till my requirement, how to know what went wrong?

Thanks ,

Raj

0 Kudos

Hello,

I assume you are achieving the Creation of Multiple Deliveries by using a Custom Posting Program in which we will be passing the IDOC_STATUS under the TABLES tab of the Function Module.

Now, due to any reasons, if there is any error in BDC or the Validations to the Data contained in the IDoc, then we'll have to Pass an Explicit Status Record, lets say, I_IDOC_STATUS with the Message Number, Message Type & Message Class along with the Error Message Attributes / Variables such as MSGV1, MSGV2 and so on.

After the Function Module is executed, finally, before the ENDFUNCTION statement, we'll have to assign the I_IDOC_STATUS to IDOC_STATUS to update the Status Record with the Latest Information.

However, if there are no errors and the Deliveries are created / updated successfully, then we'll have to Pass 53 status along with the Delivery Numbers to the MSGV1, MSGV2 variables of the I_IDOC_STATUS Internal Table.

So, what I am trying to explain here is that, whether it is a success Status or Error Status, we must assign the I_IDOC_STATUS to IDOC_STATUS Internal table before the ENDFUNCTION Statement.

IDOC_STATUS[] = I_IDOC_STATUS[].

Otherwise, it'll give the same error "No Status Record Passed to ALE by the Application" as you've got.

Thanks and Regards,

Venkat Phani Prasad Konduri

0 Kudos

Hi Venkat,

I am using following code .

  • Fill Idoc Status.

if flag_error = c_true. " c_true ='X'.

idoc_status-msgty = message_error."value 'E',

else.

idoc_status-msgty = message_info."value 'I',

endif.

idoc_status-msgno = 101.

if flag_error = c_true." c_true ='X'.

idoc_status-status = c_idoc_status_error. " 51

else.

idoc_status-status = c_idoc_status_ok. " 53

endif.

append idoc_status.

endfunction.

Is it wrong ? or anything is missing ?

Thanks ,

Raj

0 Kudos

Hello,

What you've coded looks good. Another way of error Handling can be found as below. In the below Example, I am validating the Handling Unit Number got from the IDoc.

  • Validation for Handling Unit ID (EXIDV2 From IDOC) - Begin

CLEAR: i_vekp.

SELECT venum

exidv

exidv2

FROM vekp INTO CORRESPONDING FIELDS OF

TABLE i_vekp

WHERE venum NE space AND

exidv NE space AND

exidv2 = wa_z1ctrlmm-exidv2.

IF sy-subrc EQ 0.

DESCRIBE TABLE i_vekp.

IF sy-tfill GT 1.

CLEAR: wa_idoc_status.

CLEAR: wa_vendor.

READ TABLE i_vendor INTO wa_vendor INDEX 1.

ws_c_flag = c_x.

wa_idoc_status-docnum = wa_idoc_control-docnum.

wa_idoc_status-status = c_51.

wa_idoc_status-msgty = c_e.

wa_idoc_status-msgid = c_msgclas.

wa_idoc_status-msgno = '004'.

wa_idoc_status-msgv1 = wa_vendor-v_batch.

APPEND wa_idoc_status TO i_idoc_status.

CLEAR: wa_idoc_status.

Here, I am not updating the IDOC_STATUS directly. Instead, I've taken one Temporary Table I_IDOC_STATUS and finally, after all the Validations are done & all the Statuses are updated in the I_IDOC_STATUS, I am updating the IDOC_STATUS Table at the end of the Function module as below.

IF Err_Flag = space.

wa_idoc_status-docnum = wa_idoc_control-docnum.

wa_idoc_status-status = c_53.

wa_idoc_status-msgty = c_s.

wa_idoc_status-msgid = c_msgclas.

wa_idoc_status-msgno = '007'.

append wa_idoc_status to I_IDoc_status.

else.

wa_idoc_status-docnum = wa_idoc_control-docnum.

wa_idoc_status-status = c_51.

wa_idoc_status-msgty = c_e.

wa_idoc_status-msgid = c_msgclas.

wa_idoc_status-msgno = '004'.

append wa_idoc_status to I_IDoc_status.

endif.

IDOC_STATUS[] = I_IDOC_STATUS[].

ENDFUNCTION.

This is how a typical Error Handling technique should be while processing a Custom Inbound Function Module. At any point in time during the Function Module, catching the Message, either Success or Failure is important otherwise, you may end up posting the IDoc with Status 51 or 62 or 64 Status which doesn't make any sense.

Thanks and Regards,

Venkat Phani Prasad Konduri

Former Member
0 Kudos

The Error 51 is because the posting has not happened successfully.

There could be any reason for this.

Eg: If you are creting a sales order but the material coming in the Idoc does not exist.

Thus SO could not be created.

The idoc on the receiver end has arrived but further process is at halt.

YOu can see your error description by entering the IDOC number in WE02/WE09.

Hope this helps.

~Pranu

Former Member
0 Kudos

Hi,

Status 51 means the IDoc is not posted successfully and has not performed the update/create activity.

You need to see the error message against the top entry for status 51 in the status message and try to resolve the íssue.

example :

IDoc ORDERS can fail in status 51 if there is missing configuration settings for a customer who is not assigned to a particular Sales Organization that was sent in the IDoc.

regards,

Advait

Former Member
0 Kudos

Hello,

An IDoc may post with Status 51 for many reasons. Some of them would include:

1. There is a Syntax Check error (not in the Posting Program / Function Module but in the IDoc) which could be because of some of the Segment fields do not contain valid values.

2. Some of the Segments which are defined as Mandatory during IDoc definition are not populated at all due to unavailability of Incoming data.

3. Application Document that you are trying to Post is already locked for updation at the point when you tried to post the IDoc.

4. The Key Data such as Document Number / Org Data existing in the IDoc does not exist in SAP.

Above are some of the reasons why the IDoc could post with an Error Status 51. Please check your code and try posting the IDoc manually using WE19 Transaction. In debugging mode, you can check if all the Segments are populated correctly with valid Set of Data.

Hope it was helpful.

Thanks and Regards,

Venkat Phani Prasad Konduri

Former Member
0 Kudos

Go to BD87 enter the correct params and you will see the error.

Former Member
0 Kudos

Hi

I faced the smae issue-No status record was passed to ALE

My problem was solved when i cleared local n gloabl variable in pgm. When IDOC's are processed in a sequence, the local and some of the global variables in the memory are not refreshed. So clear each and every variable and internal table at start of the program and if yours is a custom development, then do not forget to populate the IDOC status table.

In case your problem is not solved, please let me know.