Skip to Content
author's profile photo Former Member
Former Member

EDI 850 inbound process orders

when an inbound order is getting created i want check if the PO number already exists, if PO is already created i want the idoc to throw a error.

we are using the z process code inside which i am using the FM : IDOC_INPUT_ORDERS. Now where should i check for duplicate PO an write an error message... please help it very very urgent.

I have pasted the process we are following.please help i will be greatful

FUNCTION zidoc_input_orders.

*"----------------------------------------------------------------------

*"*"Local Interface:

*" 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

*" VALUE(DOCUMENT_NUMBER) LIKE VBAK-VBELN

*" TABLES

*" IDOC_CONTRL STRUCTURE EDIDC

*" IDOC_DATA STRUCTURE EDIDD

*" IDOC_STATUS STRUCTURE BDIDOCSTAT

*" RETURN_VARIABLES STRUCTURE BDWFRETVAR

*" SERIALIZATION_INFO STRUCTURE BDI_SER

*" EDI_TEXT STRUCTURE EDIORDTXT1 OPTIONAL

*" EDI_TEXT_LINES STRUCTURE EDIORDTXT2 OPTIONAL

*"----------------------------------------------------------------------

CALL FUNCTION 'IDOC_INPUT_ORDERS'

EXPORTING

input_method = input_method

mass_processing = mass_processing

IMPORTING

workflow_result = workflow_result

application_variable = application_variable

in_update_task = in_update_task

call_transaction_done = call_transaction_done

document_number = document_number

TABLES

idoc_contrl = idoc_contrl

idoc_data = idoc_data

idoc_status = idoc_status

return_variables = return_variables

serialization_info = serialization_info

edi_text = edi_text

edi_text_lines = edi_text_lines.

*Trigger Event

WAIT UP TO 1 SECONDS.

DATA : ls_edidc TYPE edidc,

ls_edids TYPE bdidocstat,

lv_objkey TYPE sweinstcou-objkey.

READ TABLE idoc_contrl INTO ls_edidc INDEX 1.

READ TABLE idoc_status INTO ls_edids WITH KEY docnum = ls_edidc-docnum

status = '51'.

IF sy-subrc = 0.

lv_objkey = ls_edids-docnum.

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

objtype = 'ZIDOCORDER'

objkey = lv_objkey

event = 'ZINPUTERROROCCURRED'.

COMMIT WORK.

ENDIF.

ENDFUNCTION.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jan 09, 2014 at 07:38 AM

    Hi

    Use EXIT_SAPLVEDA_011 and fill DERRTAB for the same

    Nabheet

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Nabheet Madan

      i have activated in cmod and checked even in the program, but when it triggers there th sy-subrc=4 and skips the the include, so i tried to manually change it to '0' in debbuging mode but still it skips the include and goes to end function.

      please help.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.