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 Error 51

Former Member
0 Likes
1,458

Hi Gurus,

I am writing some code in an exit to check the netweight values for variable weight within certain interval.this exit is in function module

IDOC_INPUT_DELVRY. So the values to check are coming from an Idoc (Inbound) .Now my requirement is to provide error message of 51 to the Idoc.

Here i have coded as :

IF lv_result NE ' '.

IF lv_var <= lv_result AND lv_result <= lv_var1.

ELSE .

MESSAGE text-001 TYPE 'E'.

where text-001 = "Variable weight not available in interval definition."

But when i see the error in the generated Idoc i get this error:

"Variable weight not available in interval definition Variable weight not"

So basically the error gets repeated.

Can anyone rectify this or is there any other method to send the error.

Hi Gurus,

I am writing some code in an exit to check the netweight values for variable weight within certain interval.this exit is in function module

IDOC_INPUT_DELVRY. So the values to check are coming from an Idoc (Inbound) .Now my requirement is to provide error message of 51 to the Idoc.

Here i have coded as :

IF lv_result NE ' '.

IF lv_var <= lv_result AND lv_result <= lv_var1.

ELSE .

MESSAGE text-001 TYPE 'E'.

where text-001 = "Variable weight not available in interval definition."

But when i see the error in the generated Idoc i get this error:

"Variable weight not available in interval definition Variable weight not"

So basically the error gets repeated.

Can anyone rectify this or is there any other method to send the error.

9 REPLIES 9
Read only

Former Member
0 Likes
1,391

HI,

Probably the text-001 is getting assigned twice somehow.

I would recommend you create a message in SE91 instead of using the text-001 or check if the text-001 has any value before assigning the value to it.

regards,

Advait

Read only

0 Likes
1,391

But this text comes from the Text Elements.so there is no way we can clear it.

Read only

shishupalreddy
Active Contributor
0 Likes
1,391

Hello ,

Could you please populate the messages (May be E,W,I) into Idocs Status records Instead of using MESSAGE statement .So that once Idoc Processed you can see the status ..

Hope it is helpfull ..

Regards,

Read only

0 Likes
1,391

I can pass the message type as 51 to the idoc status records but where to pass the message itself. Can u please tell me in which field i can pass these 2 values. May be the table is EDIDC.

Thanks in advance.

Read only

0 Likes
1,391

you can use the following code :

IF SY-SUBRC <> 0. " Something failed

CLEAR T_PROT.

T_PROT-VBELN = VBELN_VL. " delivery number

T_PROT-MSGID = SY-MSGID.

T_PROT-MSGTY = SY-MSGTY.

T_PROT-MSGNO = SY-MSGNO.

T_PROT-MSGV1 = SY-MSGV1.

T_PROT-MSGV2 = SY-MSGV2.

T_PROT-MSGV3 = SY-MSGV3.

T_PROT-MSGV4 = SY-MSGV4.

APPEND T_PROT.

ENDIF.

the T_PROT is a table with messages . It refers to the structure prott. Its also passed to the user exit functions as changing parameter called 'PROCESSING_PROTOCOL'.

regards,

Advait

Read only

0 Likes
1,391

But PROCESSING_PROTOCOL is in the EXPORTING part. So i cannot use it.

i have IDOC_CONTROL as changing.

Read only

0 Likes
1,391

Hello ,

See the below code

Maintain the Mesasge within a Message class and provide the same as below .

idoc_status-docnum = idoc_contrl-docnum.

idoc_status-segnum = tb_segnum.

idoc_status-status = '51'.

idoc_status-msgty = <MESg-type>.

idoc_status-msgid = <Mesgid>.

idoc_status-msgno = <Msgnumber>.

idoc_status-msgv1 = <msgv1>..

idoc_status-msgv2 = <-message_v2>.

idoc_status-msgv3 = <message_v3>.

idoc_status-msgv4 = <-message_v4>.

Hope it is helpful ..

Regards,

Read only

0 Likes
1,391

Yes , its not Changing you are right, but you can still append your message to that parameter as it is importing when called and exporting in the function itself. So if you append anything to the T_PROX , it will be imported in the program IDOC_INPUT_DELVRY and later processed in the subroutine PERFORM DGMSD_UPDATE, when it updates the messages to the status records.

regards,

Advait

Read only

Former Member
0 Likes
1,391

Solved