Age: 160 Joined: 04 Oct 2007 Posts: 1218 Location: Санкт-Петербург
Posted: Fri May 14, 2010 12:28 pm Post subject: Create and assign new process code
Create and assign new process code for message type MBGMCR
1. Create a new Process Code ZE_MBGMCR - WE42
2. Create the module ZE_BAPI_IDOC_INPUT1 (by coping BAPI_IDOC_INPUT1)
to make changes in the table IDOC_DATA: the field Production Date (PROD_DATE) should be empty if the field Storage Location (STGE_LOC) equal L001 or L002.
3. Define attributes for the module ZE_BAPI_IDOC_INPUT1 - BD51
4. Assign Functional module ZE_BAPI_IDOC_INPUT1, Message type ZE_MBGMCR and IDOC type MBGMCR… - WE57
5. Assign Functional Module ZE_BAPI_IDOC_INPUT1 to Process Code ZE_MBGMCR - BD67.
6. Make correspondent changes in Partner profile. WE20
Code:
FUNCTION ze_bapi_idoc_input1.
*"----------------------------------------------------------------------
*"*"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
*"----------------------------------------------------------------------
CONSTANTS:
c_mbgmcr TYPE edidc-mestyp VALUE 'MBGMCR',
c_e1bp2017_gm_item_create TYPE edi_segnam
VALUE 'E1BP2017_GM_ITEM_CREATE'.
FIELD-SYMBOLS: <edidd> TYPE edidd,
<e1bp2017_gm_item_create> TYPE e1bp2017_gm_item_create.
CASE idoc_contrl-mestyp.
WHEN c_mbgmcr.
READ TABLE idoc_data ASSIGNING <edidd>
WITH KEY segnam = c_e1bp2017_gm_item_create.
CHECK <edidd> IS ASSIGNED.
ASSIGN <edidd>-sdata TO <e1bp2017_gm_item_create> CASTING.
CHECK <e1bp2017_gm_item_create> IS ASSIGNED.
IF <e1bp2017_gm_item_create>-stge_loc EQ 'L001' OR
<e1bp2017_gm_item_create>-stge_loc EQ 'L002'.
CLEAR <e1bp2017_gm_item_create>-prod_date.
ENDIF.
ENDCASE.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.