SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Create and assign new process code



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Interfaces | Интерфейсы
View previous topic :: View next topic  
Author Message
vga
Мастер
Мастер


Age: 170
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Fri May 14, 2010 12:28 pm    Post subject: Create and assign new process code Reply with quote

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.

  CALL FUNCTION 'BAPI_IDOC_INPUT1'
    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
    TABLES
      idoc_contrl           = idoc_contrl
      idoc_data             = idoc_data
      idoc_status           = idoc_status
      return_variables      = return_variables
      serialization_info    = serialization_info
    EXCEPTIONS
      wrong_function_called = 1
      OTHERS                = 2.

ENDFUNCTION.

_________________
Молитва - это запрос разработчику на изменение кода программы.
Back to top
View user's profile Send private message Blog Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Interfaces | Интерфейсы All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.