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 - with standard function in customer function (IDOC_INPUT_ORDERS)

RingoSommer
Explorer
0 Likes
1,771

Hello folks

Is it possible that I create a standard function IDOC_INPUT_ORDERS into a customer function Z_IF_IDOC ...?

I have to do different checks into the customer function so that I will start the standard function into this.

I create the customer function with the same parameter as the standard function. The customer function is

register in the following transactions WE42 and WE57.

Well, the inbound IDoc start the customer function with the following status 50 and 64. After this start

the standard function with the following status 51 and there is a red light in BD87. The second start is successfull.

I have no idea where the problem is.

Example:

FUNCTION z_if_idoc_input... .
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD
*"     VALUE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC
*"  EXPORTING
*"     VALUE(WORKFLOW_RESULT) LIKE  BDWF_PARAM-RESULT
*"     VALUE(APPLICATION_VARIABLE) LIKE  BDWF_PARAM-APPL_VAR
*"     VALUE(IN_UPDATE_TASK) LIKE  BDWFAP_PAR-UPDATETASK
*"     VALUE(CALL_TRANSACTION_DONE) LIKE  BDWFAP_PAR-CALLTRANS
*"  TABLES
*"      IDOC_CONTRL STRUCTURE  EDIDC
*"      IDOC_DATA STRUCTURE  EDIDD
*"      IDOC_STATUS STRUCTURE  BDIDOCSTAT
*"      RETURN_VARIABLES STRUCTURE  BDWFRETVAR
*"      SERIALIZATION_INFO STRUCTURE  BDI_SER
*"  EXCEPTIONS
*"      WRONG_FUNCTION_CALLED
*"----------------------------------------------------------------------

*&----- check same input segments


...


*&----- call api "IDOC_INPUT_ORDERS"
   CALL FUNCTION 'IDOC_INPUT_ORDERS'
     EXPORTING
       input_method             = input_method
       mass_processing       = mass_processing
     IMPORTING
       workflow_result          = lv_workflow_result
       application_variable    = lv_application_variable
       in_update_task          = lv_in_update_task
       call_transaction_done = lv_call_transaction_done
       document_number      = lv_document_number
     TABLES
       idoc_contrl                 = idoc_contrl[]
       idoc_data                   = idoc_data[]
       idoc_status                = lt_idoc_status
       return_variables          = lt_return_variables
       serialization_info        = serialization_info[]
       edi_text                    = lt_edi_text
       edi_text_lines           = lt_edi_text_lines.



*&----- wirte the customer protocol with customer information


...


Many thanks in advance for some help or further information!


Bye Ringo

4 REPLIES 4
Read only

0 Likes
1,220

Hi Ringo,

Just copy the contents of the standard function module "IDOC_INPUT_ORDERS" and paste in in your custom function module "z......" instead of calling the function module inside yours.

Do let me know in case you still face any issue.

Thanks.

Regards,

Rachit.

Read only

0 Likes
1,220

Hello Rachit

Unfortunately , this is not possible but I checked the customer exits and I found the

EXIT_SAPLVEDA_004. I implemented my function in this function module because I need the

current sales document number for further checks and confirmation.

Well, it works.

Many thanks for your help and impluse.

Best regards

Ringo

Read only

DominikKraemer
Active Participant
0 Likes
1,220

Hello Ringo,

this should work fine as long as you not modify IDOC_STATUS.

Which code are you using in the block "*&----- wirte the customer protocol with customer information"?

Maybe try to take out all your own code and just leave the call to the standard FM in place. Then comment your code back in section by section to see from where the status 51 is being set.

Regards,

Dominik

Read only

0 Likes
1,220

Hello Dominik

I checked this idea but it doesnt work. Well, I have only my customer functionmodule as a frame and inside the standard functionmodule. When I test this in transaction WE19 function "Inbound function module" is everything fine but when I test this in function "Standard inbound" creates the system a message into BD87 - VG 223 IDoc & cannot be opened. When I'm looking into SM12 there is an entry with my user and the IDoc number.

In my coding are different enhancements - write a protocol into customer tables with further information for a better monitoring e.g. the real material number or the real vendor.

But this depends on the IDoc data - if everything fine then start the customer confirmation with

the new sales document number and other information or send a confirmation without new sales document and a particular message.

Many thanks for your help and impulse.

Best regards

Ringo