Transaction YPMI

User Documentation
PMI Interface
Process Flow and
Embedding of BAdI Methods
CIP 2 SAP
Siemens AG
Document status:
Date changed:
For internal use only!
Released
Feb 26, 2013
Page 1
Transaction YPMI
_
YPMI 1
Program YPPMD_MAIN
PBO 0100: METHOD
default_values_for_screen_100
modify_screen_attributes
FORM check_authority
AUTH Object 'V_VBAK_VKO'
PAI: METHOD check_authority
FORM y_handle_dynpro100_input
VKORG -> BUKRS -> Req. country
VKORG -> First entry in yypmi_relations
YYSES Parameter
‘RFCJSIC’?
METHOD select_yypmi_relations
Inactive
PMI Request via SICON
Active
Call FUNCTION
/SIE/SF_ED_PMI_PREP
Check mandatory fields and
sort options
Call FUNCTION
/SIE/SF_ED_PMI_REQUEST
PMI_REQUEST
Call FUNCTION
/SIE/SF_ED_PMI_DATA_CHECK
• For PRODAT IDOC
‘O’
• For PRICAT IDOC
‘O’
YPMI 2
PRODAT
PRICAT
Page 2
Transaction YPMI
_
YPMI 2
Program YPPMD_MAIN
Display IDOC Data e.g. in screen ‚Basic
Data‘:
PBO 0200: METHOD
modify_screen_attributes
FORM
y_save_product_and_common
Call FUNCTION
Y_PROCESS_MATERIAL
Update Material
Master?
PROCESS_MATERIAL
Failed
Display error messages in
popup
Successful
Save_Purchasing_Cond
Save_Sales_Cond
Page 3
Transaction VA01, etc.
_
Program SAPMV45A
MODULE VBAP-MATNR_PRUEFEN
YYSES Parameter
‘RFCJSIC’?
Inactive
PMI Request via SICON
Active
PMI Request via JSIC
FuGr /SIE/SF_ED_PMI
FUNCTION /SIE/SF_ED_PMI_SD
YTY01 Identifier
‘0066’?
Inactive
Return to Vaxx:
User must enter SAP MATNR
in field “Material”
Active
“Material” =
MARA-MATNR
exists, incl. MVKE
record?
Yes
Return to Vaxx:
Return SAP MATNR in field
“Material”
No
PMI_INTERFACE
Page 4
PMI_INTERFACE
FuGr /SIE/SF_ED_PMI
FUNCTION
/SIE/SF_ED_PMI_INTERFACE
Checks and Initialization
METHOD determine_sender_matnr
VKORG -> BUKRS -> Req. country
VKORG/VTWEG -> YYPMI_RELATIONS
 Request parameters
GS_YPPMD_FDBQUERY
METHOD
default_values_for_screen_100
Call FUNCTION
/SIE/SF_ED_PMI_PREP
Check mandatory fields and sort
options
Search SAP MATNR with MLFB and
options:
•
Several SAP MATNR exist
•
Unique SAP MATNR exists
including MVKE
•
Either no SAP MATNR or no
suitable MVKE record
YYSES Parameter
‘VAXX_VKORG ’?
Return to caller with error handling
Return to caller with SAP MATNR
No
Return to caller:
No PMI request for VKORG
INCLUDE zx_autchk_pmi_interface
For local authority checks
METHOD enable_pmi_in_so :
Possibility to suppress the PMI call
VAxx: Call FUNCTION
/SIE/SF_ED_PMI_INTERFACE_INT
DESTINATIONYes
'NONE'
PMI_INTERFACE_INT
MVKE created?
Yes
Return to call with SAP MATNR
in field ‘Material’
No
Display error messages in popup
In case of errors -> METHOD modify_message_parameters
Page 5
PMI_INTERFACE_INT
FuGr /SIE/SF_ED_PMI
FUNCTION
/SIE/SF_ED_PMI_INTERFACE_INT
Call FUNCTION
/SIE/SF_ED_PMI_REQUEST
PMI_REQUEST
Call FUNCTION
/SIE/SF_ED_PMI_DATA_CHECK
• For PRODAT IDOC
‘O’
PRODAT
‘O’
• For PRICAT IDOC
PRODAT &
PRICAT without
errors?
PRICAT
No
Return to caller for error handling
Yes
Call FUNCTION
Y_PROCESS_MATERIAL
Update Material
Master?
PROCESS_MATERIAL
Failed
Return to caller for
error handling
Successful
Save_Purchasing_Cond
Save_Sales_Cond
Page 6
PMI_REQUEST
FUNCTION
/SIE/SF_ED_PMI_REQUEST
FuGr /SIE/SF_ED_PMI
Determine RFC destination for JSIC call
/ YYSES ‚RFCJSIC‘
•
Prio1: For VKORG if defined
•
Prio 2: For Region if defined
•
Prio 3: Default for client
Determine
•
Host for RFC destination
•
PMI key / YYSES 'PMIKEY‚
•
Execution mode ‚run‘ or ‚test‘
Complete virtual YPMIRQ IDOC
Call Function /SIE/SF_CM_WS_PMIRQ
DESTINATION <Dest for JSIC>
Response status
YOSTAT?
METHOD modify_jsic_parameter
RFC: Call PMI via JSIC
Not ok ‘NOK’
Display error information
in popup
OK
METHOD prepare_idoc
Determine request type
METHOD modify_request_type
Store PRODAT and PRICAT in
T_PRODAT_IDOC & T_PRICAT_IDOC
Remark: PMI via JSIC is not calling METHOD select_online_source
See: FORM jsic_pmi_data_transfer
Page 7
PRODAT
FuGr YPPMD
FM Y_ED_IDOC_INPUT_PRODAT_N 1)
Determine message sender (NAD+MS)
and receiver (NAD+MR) ORGID
Initializations and SELECT customizing
B: Determine CS_UNIT of MS from
yypmi_relations
B: Determine SIE division of MS
METHOD prepare_idoc for tests
METHOD assign_group_to_orgid
Read YYPMI_RELATIONS for CS_UNIT
Read YYSES recip. indep. -> S_PARAM
For each item/material in the IDOC:
Read IDOC item data -> store in
SESMAX structures & tables
METHOD
no_update_for_selected_matno
Fill header data into structure
S_YYPPMDMAX
Determine MTART from YYSES
Determine SAP MATNR
METHOD modify_sesmax
METHOD determine_printform
METHOD determine_sortform
METHOD determine_sap_matnr
METHOD modify_request_type
Determine request type: O, I or M
Determine relevant sets of org. units
Determine SAP division
METHOD determine_division
METHOD modify_orgunits
METHOD determine_kreditor
Determine SAP supplier numbers
O: FORM
Derivations (V1)
DERIVATIONS_FOR_DISPLAY
Process
material?
No
Yes
‘O’
‘O’ or ‘B’ ? 1)
Next Item / material
B: End of IDOC processing
O: Return to caller
‘B’
PROCESS_MATERIAL
1) ‘O’ : Input method ‘O’ is used for PMI online requests
‘B’ : Input method ‘B’ is used for IDOC processing (in batch)
Page 8
Derivations
FuGr YPPMD
Determine Product Hierarchy
Call Function Y_DETERMINE_PRODH
METHOD determine_prodh
Determine Profit Center
Call Function Y_DETERMINE_PRCTR
METHOD determine_prctr
Determine material pricing group
Call Function Y_DETERMINE_KONDM
METHOD determine_kondm
V1) Store org. units in structure
S_YYPPMDMAX
Call Function
Y_ED_ORGUNITS_TO_PPMDMAX
V1) Determine Tax Classification
Call Function Y_GET_TAXKM
Determine sales and purchase status
Call Function
METHOD get_taxkm
METHOD determine_sales_status
Y_DERIVE_SALES_PURCHASE_STATUS
Variant V1) : Only relevant for FORM DERIVATIONS_FOR_DISPLAY
Page 9
PROCESS_MATERIAL
FuGr YPPMD
FUNCTION Y_PROCESS_MATERIAL
YYSES
fast_process
PPMD2
Inactive
Normal processing with FM
Y_ED_BAPI_CALL_PPMD
Active
Initializations for fast process, etc.
For each relevant set of org units:
Fill BAPI structures for one set of
org. units
FILL_BAPI_STR_SINGLE
Next set of org. units
Update all org. views of material with
BAPI_MATERIAL_SAVEREPLICA
METHOD user_modif_material_data
If MARA exists: Update export control
data (MAEX), future values, IPC URL,
battery data and SVHC codes
METHOD modify_maex_all
Material update
successful?
No
Error handling
Yes
Update IPC data
Update purchasing info records (PIR)
Update source list (SL)
Update listing
METHODs:
mod_pir_data_bef_aggregation
modify_pir_data
modify_bdcdata_pir
ework_after_call_ta
METHODs:
modify sourcelist_plants
modify_bdcdata_source_list
Rework_after_call_ta
Page 10
FILL_BAPI_STR_SINGLE
FuGr YPPMD
Adjust planned delivery time for
suppliers, get material views, etc.
Derive product hierarchy, profit center,
material pricing group and sales &
purchase status
Store org. units in structure
S_YYPPMDMAX
Call Function
Y_ED_ORGUNITS_TO_PPMDMAX
Fill BAPI structures dynamically, using
entries in YYPPMBAPI_MAND and
YYPPMDBAPI
METHOD
suppress_bapi_processing
Derivations
METHOD modify_max_structures
METHOD modify_yyppmdbapi
METHOD determine_existing_views
METHOD
modify_internal_yyppmdbapi
Process alternative units of measures,
raw material surcharges, futures values,
etc.
Determine tax classification
METHOD get_taxkm
Append BAPI structures for current set of
org. units to tables for mass update with
BAPI_MATERIAL_SAVEREPLICA
Prepare supplier data for update of PIR
Call Function Y_ED_FILL_EKITABLE
METHOD
modify_yyppmd_eki_entries
Page 11
PRICAT
FuGr YPPMD
FM Y_ED_IDOC_INPUT_PRICAT_N 1)
Determine message sender (NAD+MS)
and receiver (NAD+MR) ORGID
Initializations
METHOD prepare_idoc for tests
YYPMI_CONDITIONS
Select data from customizing tables
Determine owner of (all) material(s)
B: Determine SIE division of MS
B: Determine CS_UNIT of MS from
yypmi_relations:
METHOD assign_group_to_orgid
Read YYPMI_RELATIONS for CS_UNIT
Read YYSES -> S_PARAM
Read IDOC item data -> store in
SESMAX structures & tables
‘O’ or ‘B’ ?1)
FILL_YYCOND
‘O’
Return to caller
‘B’
B: Save sales conditions
Save_Cond_1
B: Save purchase conditions
Save_Cond_2
B: End of IDOC processing
1) ‘O’ : Input method ‘O’ is used for PMI online requests
‘B’ : Input method ‘B’ is used for IDOC processing (in batch)
Page 12
YYPMI_CONDITIONS
FuGr YPPMD
FM Y_EXTEND_YYPMI_CONDITIONS
Read table YYPMI_CONDITIONS,
YYSES, T685A and T681 and store
extended data in int. table
I_YYPMI_CONDITIONS
FILL_YYCOND
For each item/material in the IDOC:
Read IDOC item data -> store in
SESMAX structures & tables
Determine SAP MATNR
METHOD determine_printform
METHOD determine_sortform
METHOD determine_sap_matnr
Determine request type: O, I or M
METHOD modify_request_type
Determine relevant sets of org. units
METHOD modify_orgunits
Completion of I_YYCOND
METHOD modify_yycond_entries
Next Item / material
Modify I_YYCOND
METHOD user_cond_process
Page 13
Save_Cond_1
FuGr YPPMD
FM Y_SAVE_SALES_CONDITIONS
Process sales and purchase conditions
depending on S_PARAM and content of
I_YYCOND
Initializations
METHOD add_cond_process
B: Open BI session e.g. for VK15
METHOD modify_bi_name
For each relevant entry in I_YYCOND:
PS_PARAMINPUT_MM = ‘B’
or ‘C’ ?
‘No’
‘No’
‘Yes’
Fill pt_yypmi_purchase_conditions
METHOD determine_kreditor
PS_PARAMINPUT_SD = ‘B’
or ‘C’ ?
‘Yes’
Fill bdc_tab with data for TA VK15
METHOD modify_komg
Create or update sales conditions
METHOD modify_bi_name
METHOD rework_after_call_ta
Next condition record
Page 14
Save_Cond_2
FM Y_SAVE_PURCHASE_CONDITIONS
FuGr YPPMD
Process all purchase conditions in
PT_YYPMI_PURCHASE_CONDITIONS
B: Open BI session e.g. for ME12
METHOD modify_bi_name
For each entry in
PT_YYPMI_PURCHASE_CONDITION
Read PIR if existing
O: Purchase
condition exists?
‘Yes’
‘No’
Fill bdc_tab with data for TA ME12
METHOD modify_bdc_table
Create/ update purchase conditions
or
Delete purchase condition
METHOD modify_bi_name
or
METHOD modify_bdc_delete_pir
METHOD rework_after_call_ta
Next purchase condition
Page 15
Change History
Changes in Document Version 12.2
New document describing the process flow with fast process
(TTP687 PRODAT IN) and PMI Online via JSIC (TTP807)
TTP807,
TTP687
Feb 26, 2013
Page 16