Data entry validations for IDocs
Inbound IDocs don't check the amount of units before it executes the picking, so it is possible to execute the picking for a quantity greater than the maximun of the amount in the document position. How can this be resolved?
FUNCTION ZSD_IDOC_INPUT_PICKING. *"---------------------------------------------------------------------- *"*"Globale Schnittstelle: *" 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 *" TABLES *" IDOC_CONTRL STRUCTURE EDIDC *" IDOC_DATA STRUCTURE EDIDD *" IDOC_STATUS STRUCTURE BDIDOCSTAT *" RETURN_VARIABLES STRUCTURE BDWFRETVAR *" SERIALIZATION_INFO STRUCTURE BDI_SER OPTIONAL *" EXCEPTIONS *" WRONG_FUNCTION_CALLED *" OTHERS *"---------------------------------------------------------------------- Data: myerror. Clear myerror. Loop at idoc_data. **** verify the segments if not OK. Myerror = 'X'. .. Fill IDOC_status with the error message and set IDOC_STATUS-STATUS = 51 ! Exit. Endif. Endloop. If myerror eq space. CALL FUNCTION 'ZSD_IDOC_INPUT_PICKING' IMPORTING INPUT_METHOD = INPUT_METHOD MASS_PROCESSING = MASS_PROCESSING ....... .. Endif. Endfunction. ****
In order to use it with standard inbound processing you need to execute:
BD51 and add the function to the list of allowed inbound functions
WE42 create a new processing code for inbound to use in partner profiles
WE20