Documentation View

We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!

/AFS/SIMGMM_BADIPOSE - BADI for Bapicall in AFS Transaction for PO-Split

/AFS/SIMGMM_BADIPOSE - BADI for Bapicall in AFS Transaction for PO-Split

CPI1466 during Backup   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

Business Add-In for the AFS PO Split Transaction

Methods:

  • MAP_EXTENSIONIN_HEADER: This method is used to fill and change customer fields of structure CI_EKKODB. Header data is provided via import parameter IM_HEADER. The method is only processed when a new purchase order is created.
  • MAP_EXTENSIONIN_ITEM: This method is used to fill and change customer fields of structure CI_EKPODB. Item data is provided for the interface via import parameter IM_ITEM. If this is a target item for a new purchase order, parameter IM_NEW_PO is 'X' . If the target item is in the same purchase order, the parameter has value ' '. Parameter IM_NEW_ITEM has value 'X' for a target item and ' ' for a source item. The export parameter EX_EXTENSION_ITEM is used for a later call of BAPI_PO_CHANGE/BAPI_PO_CREATE1, interface parameter EXTENSION.
  • MAP_EXTENSIONIN_SCHEDULE: This method is used to fill customer fields on schedule level. Schedule data is provided by parameter IM_DATA . If this is a target item for a new purchase order, parameter IM_NEW_PO is 'X' . If the target item is in the same purchase order, the parameter has value ' '. Parameter IM_NEW_SCHEDULE has value 'X' for a schedule of a target item and ' ' for a schedule of a source item. IM_AFS has value 'X' for an AFS item and ' ' for a standard item.
  • FCODE_CUSTOMER1: This method is executed when the BAdI button is selected in the PO Split Transaction. Data cannot be changed. Parameter IM_ITEM_DATA contains data for selected items. Parameter IM_SCHEDULE_DATA contains data for schedules.
  • FCODE_CUSTOMER2: This method is executed when the BAdI button is selected in the PO Split Transaction. Data cannot be changed. Parameter IM_ITEM_DATA contains data for selected items. Parameter IM_SCHEDULE_DATA contains data for schedules.
  • FCODE_CUSTOMER3: This method is executed when the BAdI button is selected in the PO Split Transaction. Data cannot be changed. Parameter IM_ITEM_DATA contains data for selected items. Parameter IM_SCHEDULE_DATA contains data for schedules.
  • BAPI_HEADER_DATA: This method is called before the BAPI call. If a new purchase order is created, header data can be changed here. Parameter IM_HEADER is filled with header data from the screen. The change parameters CH_HEADER_BAPI and CH_HEADERX_BAPI are used at interface of BAPI_PO_CREATE1.
  • BAPI_SCHEDULE_DATA: This method can be used to change data before it is mapped to the BAPI's interface structure. ,,,,,,,,,,,,,,,,,,,,
Parameters:,,
  • IM_HEADER:,,Header data of the source or target purchase order

  • IM_ITEM: Data for the related item

  • IM_NEW_PO: 'X' if schedule is in a new purchase order; ' ' if the schedule is in the same PO

  • IM_NEW_ITEM: 'X' for a target item; ' ' for a source item

  • CH_SCHEDULEX: X-Structure for schedule

  • CH_SCHEDULE: Schedule data

  • BAPI_ITEM_DATA: With this method additional data can be provided to BAPI's interface.
Parameters:,,
  • IM_HEADER: Header data of source or target purchase order

  • IM_SOURCE:,,Item data of source item

  • IM_TARGET:,,Item data of target item (blank for existing item)

  • IM_NEW_PO: 'X' if target item is in a new purchase order; ' ' if target item is in the same purchase order

  • IM_NEW_ITEM: 'X' for a target item; ' ' for a source item

  • CHECK_INPUT: With this method, the system checks the values entered in customer fields. You can use this method to check the fields in structure /AFS/MMSCR_PO_ITEM_EXIT / /AFS/MMSCR_PO_ITEM_EXIT_NEW. If an exception DATA_INVALID is raisedthe system generates an error message.

There is no default implementation.

Example

  • map_extensionin_item: A field Z_CUSTOMER (of type CHAR3) of structure CI_EKPODB (and consequently of database table EKPO) should be set to Value 'XYZ' for an existing item 20 of PO 4500001234. Z_CUSTOMER is the first or the only field of structure CI_EKPODB.,,,,

...

DATA: ls_ext TYPE bapiparex.

IF im_new_po IS initial AND im_new_item IS initial.,,

ls_ext-structure = 'BAPI_TE_MEPOITEM'.

ls_ext-valuepart1+0(5) = im_item-ebelp.

ls_ext-valuepart1+5(3) = 'XYZ'.

APPEND ls_ext TO ex_extension_item.

CLEAR ls_ext.

ls_ext-structure = 'BAPI_TE_MEPOITEMX'.

ch_ext-valuepart1+0(5) = im_item-ebelp.

ch_ext-valuepart1+5(1) = 'X'.

APPEND ls_ext TO ex_extension_item.

ENDIF.

...

  • FCODE_CUSTOMER1: If a purchase order references a purchase requisition, the system displays the purchase requisition if the user selects the corresponding button.
  • BAPI_HEADER_DATA: Field EKKO-BEDAT for the new purchase order is filled with the date from source purchase order. Field DOC_DATE of parameter CH_HEADER_BAPI is filled with IM_HEADER-BEDAT. Field DOC_DATE of parameter CH_HEADERX_BAPI is set to 'X'.
  • BAPI_ITEM_DATA: Manual account assignment data is copied if the target item is in the same purchase order and the source purchase order does not reference a purchase requisition. For IM_NEW_PO = ' ' , IM_NEW_ITEM ='X' and the source item are filled with the account assignment export parameter for account assignment and X-structure for account assignment. To get the proper data format, BAPI_PO_CHANGE can be called where only the purchase order number in interface is filled. This call is read-only.
  • BAPI_SCHEDULE_DATA: For a source item and its schedule, set the Delivery Complete Indicator (DCI). Do this if IM_NEW_PO = ' ' and IM_NEW_ITEM = ' ' field CH_SCHEDULE-J_3AELIKZ and CH_SCHEDULEX-J_3AELIKZ are set to 'X'.





PERFORM Short Reference   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 7040 Date: 20211201 Time: 191028     sap01-206 ( 120 ms )