When you will develop interface, you will confirm that who is receiver.
In the company, SAP is receiver and we give interface to SRM. Our interface is open.
Divided the purchase order .
we can see the delivery order and submit it and the data will be transformed to SAP.
So it is successful when it displayed as follow.
we use ZRMM005 for querying delivery detail.
we can see the order .
ZRMM154 (it is so and we can move our inventory ).
ZRMM153(Confirm Bill)
Please download excel example from zrmm153. And put data and upload it . Vendor will read it by SRM.
ZRMM147(Query data from it )
The first is function group(zsrm01). Zsrm_rfc (it is my interface)
Function group is following. And I don’t copy RFC.
`FUNCTION ZYMSRM_LIFNR_MAINTAIN.
*"----------------------------------------------------------------------
"“本地接口:
*” IMPORTING
*" VALUE(LIFNR) TYPE LIFNR OPTIONAL
*" VALUE(BUKRS) TYPE BUKRS
*" VALUE(EKORG) TYPE EKORG
*" VALUE(KTOKK) TYPE KTOKK
*" VALUE(NAME1) TYPE AD_NAME1
*" VALUE(SORTL) TYPE AD_SORT1UL
*" VALUE(STRAS) TYPE AD_STREET
*" VALUE(ORT01) TYPE AD_CITY1
*" VALUE(PSTLZ) TYPE AD_PSTCD1
*" VALUE(LAND1) TYPE LAND1
*" VALUE(REGIO) TYPE REGIO
*" VALUE(SPRAS) TYPE SPRAS
*" VALUE(STCEG) TYPE STCEG
*" VALUE(AKONT) TYPE AKONT
*" VALUE(ZTERM) TYPE DZTERM
*" VALUE(ZSABE) TYPE DZSABE_K
*" VALUE(TLFNS) TYPE TLFNS
*" VALUE(TLFXS) TYPE TLFXS
*" VALUE(INTAD) TYPE INTAD
*" VALUE(WAERS) TYPE WAERS
*" EXPORTING
*" VALUE(RTN_CODE) TYPE BAPI_MTYPE
*" VALUE(RTN_MSG) TYPE BAPI_MSG
*" VALUE(OLIFNR) TYPE LIFNR
*"----------------------------------------------------------------------
zfmdatasave1 ‘ZSRM_LIFNR_MAINTAIN’.
zfmdatasave2 ‘B’.
COMMIT WORK .
DATA: p_option TYPE ctu_params ,
p_tcode LIKE sy-tcode .
DATA: return LIKE TABLE OF BAPIRET2 WITH HEADER LINE.
CALL FUNCTION ‘CONVERSION_EXIT_ALPHA_INPUT’
EXPORTING
input = regio
IMPORTING
output = regio.
p_option-dismode = ‘N’.
p_option-updmode = ‘S’.
p_option-nobinpt = ‘X’.
p_option-defsize = ‘X’.
IF lifnr IS INITIAL.
p_tcode = ‘XK01’.
ELSE.
p_tcode = ‘XK02’.
ENDIF.
IF p_tcode = ‘XK01’ .
PERFORM bdc_dynpro USING ‘SAPMF02K’ ‘0100’.
ELSE.
PERFORM bdc_dynpro USING ‘SAPMF02K’ ‘0101’.
ENDIF.
PERFORM bdc_field USING ‘BDC_OKCODE’ ‘/00’.
PERFORM bdc_field USING ‘RF02K-LIFNR’ lifnr.
PERFORM bdc_field USING ‘RF02K-BUKRS’ bukrs.
PERFORM bdc_field USING ‘RF02K-EKORG’ ekorg.
IF p_tcode = ‘XK01’.
PERFORM bdc_field USING ‘RF02K-KTOKK’ ktokk.
ELSE.
PERFORM bdc_field USING ‘RF02K-D0110’ ‘X’.
PERFORM bdc_field USING ‘RF02K-D0120’ ‘X’.
PERFORM bdc_field USING ‘RF02K-D0130’ ‘X’.
PERFORM bdc_field USING ‘WRF02K-D0380’ ‘X’.
PERFORM bdc_field USING ‘RF02K-D0210’ ‘X’.
PERFORM bdc_field USING ‘RF02K-D0215’ ‘X’.
PERFORM bdc_field USING ‘RF02K-D0220’ ‘X’.
PERFORM bdc_field USING ‘RF02K-D0610’ ‘X’.
PERFORM bdc_field USING ‘RF02K-D0310’ ‘X’.
PERFORM bdc_field USING ‘WRF02K-D0320’ ‘X’.
ENDIF.
PERFORM bdc_dynpro USING ‘SAPMF02K’ ‘0111’.
PERFORM bdc_field USING ‘BDC_OKCODE’ ‘/00’.
PERFORM bdc_field USING ‘SZA1_D0100-TITLE_MEDI’ ‘公司’.
PERFORM bdc_field USING ‘ADDR1_DATA-NAME1’ name1.
PERFORM bdc_field USING ‘ADDR1_DATA-SORT1’ sortl.
PERFORM bdc_field USING ‘ADDR1_DATA-STREET’ stras.
PERFORM bdc_field USING ‘ADDR1_DATA-POST_CODE1’ pstlz.
PERFORM bdc_field USING ‘ADDR1_DATA-CITY1’ ort01.
PERFORM bdc_field USING ‘ADDR1_DATA-COUNTRY’ land1.
PERFORM bdc_field USING ‘ADDR1_DATA-REGION’ regio.
PERFORM bdc_dynpro USING ‘SAPMF02K’ ‘0120’.
PERFORM bdc_field USING ‘BDC_OKCODE’ ‘=VW’.
PERFORM bdc_field USING ‘LFA1-STCEG’ stceg.
PERFORM bdc_dynpro USING ‘SAPMF02K’ ‘0130’.
PERFORM bdc_field USING ‘BDC_OKCODE’ ‘=VW’.
PERFORM bdc_dynpro USING ‘SAPMF02K’ ‘0380’.
PERFORM bdc_field USING ‘BDC_OKCODE’ ‘=VW’.
PERFORM bdc_dynpro USING ‘SAPMF02K’ ‘0210’.
PERFORM bdc_field USING ‘BDC_OKCODE’ ‘=VW’.
PERFORM bdc_field USING ‘LFB1-AKONT’ akont.
PERFORM bdc_dynpro USING ‘SAPMF02K’ ‘0215’.
PERFORM bdc_field USING ‘BDC_OKCODE’ ‘=VW’.
PERFORM bdc_field USING ‘LFB1-ZTERM’ zterm.
PERFORM bdc_field USING ‘LFB1-REPRF’ ‘X’.
PERFORM bdc_dynpro USING ‘SAPMF02K’ ‘0220’.
PERFORM bdc_field USING ‘BDC_OKCODE’ ‘=VW’.
PERFORM bdc_field USING ‘LFB1-ZSABE’ zsabe.
PERFORM bdc_field USING ‘LFB1-TLFNS’ tlfns.
PERFORM bdc_field USING ‘LFB1-TLFXS’ tlfxs.
PERFORM bdc_field USING ‘LFB1-INTAD’ intad.
PERFORM bdc_dynpro USING ‘SAPMF02K’ ‘0310’.
PERFORM bdc_field USING ‘BDC_OKCODE’ ‘=VW’.
PERFORM bdc_field USING ‘LFM1-WAERS’ waers.
PERFORM bdc_field USING ‘LFM1-ZTERM’ zterm.
PERFORM bdc_field USING ‘LFM1-WEBRE’ ‘X’.
PERFORM bdc_field USING ‘LFM1-KZAUT’ ‘X’.
PERFORM bdc_dynpro USING ‘SAPMF02K’ ‘0320’.
PERFORM bdc_field USING ‘BDC_OKCODE’ ‘=UPDA’.
CALL TRANSACTION p_tcode USING bdcdata
OPTIONS FROM p_option MESSAGES INTO messtab.
CALL FUNCTION ‘CONVERT_BDCMSGCOLL_TO_BAPIRET2’
TABLES
imt_bdcmsgcoll = messtab
ext_return = return.
LOOP AT return WHERE type CA ‘AEX’.
RTN_MSG = RTN_MSG && ‘/’ && return-message.
ENDLOOP.
IF RTN_MSG IS INITIAL.
IF lifnr IS INITIAL.
READ TABLE return WITH KEY id = ‘F2’ number = ‘175’.
olifnr = return-message_v1.
PERFORM alpha_output CHANGING olifnr.
ELSE.
READ TABLE return WITH KEY type = ‘S’.
ENDIF.
RTN_CODE = ‘S’.
RTN_MSG = return-message.
ELSE.
RTN_CODE = ‘E’.
SHIFT RTN_MSG.
ENDIF.
zfmdatasave2 ‘R’.
ENDFUNCTION.`
MM:(We will purchase material and transform inventory material