0% found this document useful (0 votes)
98 views1 page

FUNCTION Zidoc Input Zinv

This document contains the code for a FUNCTION module that processes an IDOC containing a sales order document. It loops through the IDOC segments and data to extract the sales order information. It then modifies the existing sales order in the database with the new data. The FUNCTION module sets the status and messages in the IDOC status table to indicate whether the order was successfully posted or not.

Uploaded by

MrconfusionSap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views1 page

FUNCTION Zidoc Input Zinv

This document contains the code for a FUNCTION module that processes an IDOC containing a sales order document. It loops through the IDOC segments and data to extract the sales order information. It then modifies the existing sales order in the database with the new data. The FUNCTION module sets the status and messages in the IDOC status table to indicate whether the order was successfully posted or not.

Uploaded by

MrconfusionSap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

FUNCTION zidoc_input_zinv.

*"---------------------------------------------------------------------*"*"Local Interface:
*" 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
*"---------------------------------------------------------------------* TABLES: E1CONTR.
DATA: wa_vbrk TYPE vbrk.
DATA: wa_z1vbrk TYPE z1vbrk.
DATA wa_edidc TYPE edidc.
LOOP AT idoc_contrl WHERE mestyp <> 'ZINV'.
RAISE wrong_function_called.
ENDLOOP.
LOOP AT idoc_data.
IF idoc_data-segnam EQ 'Z1VBRK'.
MOVE idoc_data-sdata TO wa_z1vbrk.
MOVE-CORRESPONDING wa_z1vbrk TO wa_vbrk.
ENDIF.
ENDLOOP.
MODIFY vbrk FROM wa_vbrk.
"Up to database.
READ TABLE idoc_contrl INTO wa_edidc.
CLEAR sy-subrc.
IF sy-subrc = 0.
idoc_status-status = '53'.
idoc_status-msgty = 'I'.
*
IDOC_STATUS-MSGID = 'B5ALE'.
idoc_status-msgv1 = 'Application Date Posted Successfully'.
* Info-IDoc wurde gebucht, Import kann angestoen werden.
* RETURN_VARIABLES-WF_PARAM = 'Continue_IDOCs'.
else.
idoc_status-status = '51'.
idoc_status-msgty = 'E'.
*
IDOC_STATUS-MSGID = 'B5ALE'.
idoc_status-msgv1 = 'Application Date could not be posted'.
endif.
idoc_status-docnum = wa_edidc-docnum.
APPEND idoc_status.
ENDFUNCTION.

You might also like