The purpose of this document is for adding,updating a custom field to the workmanager application and download to the mobile device.
Step I: ERP Changes
1. Goto WorkOrder master table AUFK and click on the existing .include Structure CI_AUFK to add Custom field.
2. Adjust the modified standard table in SE14. Click on Active and Adjust Database.
3. Go to SE37. Enter the related BAPI name “/SYCLO/PM_DOWORKORDER2_GET” display and check the table parameter ET_WORKORDER_HEADER.
4. Check whether the table parameter ET_WORKORDER_HEADER type /SYCLO/PM_CAUFV_STR reflects the new field
5. Now the custom field should be updated in a standard way,for this the BADI 'IBAPI_ALM_ORD_MODIFY' can be implemented
SELECTION-SCREEN BEGIN OF block blk with FRAME title text-001.
PARAMETERS:p_aufnr type aufnr.
SELECTION-SCREEN end of BLOCK blk.
DATA: WA_METHODS TYPE BAPI_ALM_ORDER_METHOD,
ITAB_METHODS LIKE TABLE OF WA_METHODS.
DATA: ITAB_RETURN TYPE TABLE OF BAPIRET2 WITH HEADER LINE,
ITAB_NUMBERS TYPE TABLE OF BAPI_ALM_NUMBERS WITH HEADER LINE,
OBJECT_TAB TYPE TABLE OF BAPI_ALM_ORDER_HEADERS_I WITH HEADER LINE,
WA_OBJECT_TAB LIKE BAPI_ALM_ORDER_HEADERS_I ,
OBJECT_TAB_UP TYPE TABLE OF BAPI_ALM_ORDER_HEADERS_UP WITH HEADER LINE. .
DATA: Z_EXTENSION_IN TYPE TABLE OF BAPIPAREX WITH HEADER LINE.
DATA:ORDER_ID TYPE AUFNR,
WA_BAPI_TE_AUFK TYPE BAPI_TE_AUFK.
ORDER_ID = p_aufnr. ""'000000819754'. " Example
Z_EXTENSION_IN-STRUCTURE = 'BAPI_TE_AUFK'.
WA_BAPI_TE_AUFK-ORDERID = ORDER_ID. " Order ID
WA_BAPI_TE_AUFK-DUMMY_CI_AUFK = 'X'. " Custom field
WA_BAPI_TE_AUFK-ZZXY = 'X'. " Custom field
Z_EXTENSION_IN-VALUEPART1(12) = WA_BAPI_TE_AUFK-ORDERID.
Z_EXTENSION_IN-VALUEPART1+12(1) = WA_BAPI_TE_AUFK-DUMMY_CI_AUFK.
Z_EXTENSION_IN-VALUEPART1+13(1) = WA_BAPI_TE_AUFK-ZZXY.
APPEND Z_EXTENSION_IN.
CLEAR Z_EXTENSION_IN.
OBJECT_TAB-ORDERID = p_aufnr. "'000000819754'.
OBJECT_TAB-PRIORITY = '1'.
***object_tab-MN_WK_CTR = ' '.
APPEND OBJECT_TAB.
***
CLEAR WA_METHODS.
WA_METHODS-REFNUMBER = '000001'.
WA_METHODS-OBJECTTYPE = 'HEADER'.
WA_METHODS-METHOD = 'CHANGE'.
WA_METHODS-OBJECTKEY = p_aufnr. "'000000819754'.
APPEND WA_METHODS TO ITAB_METHODS.
CLEAR WA_METHODS.
*WA_METHODS-REFNUMBER = 1.
WA_METHODS-OBJECTTYPE = SPACE.
WA_METHODS-METHOD = 'SAVE'.
WA_METHODS-OBJECTKEY = SPACE.
APPEND WA_METHODS TO ITAB_METHODS.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
IT_METHODS = ITAB_METHODS
IT_HEADER = OBJECT_TAB
IT_HEADER_UP = OBJECT_TAB_UP
EXTENSION_IN = Z_EXTENSION_IN
RETURN = ITAB_RETURN
ET_NUMBERS = ITAB_NUMBERS.
IF SY-SUBRC = 0.
DATA : RETURN TYPE BAPIRET2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
* IMPORTING
* RETURN = return .
IF SY-SUBRC = 0.
* read table it_wmdvex into wa_wmdvex index 1.
WRITE: 'Successful'.
ELSE.
WRITE: / 'No data changed'.
ENDIF.
ENDIF.
All the above steps will add the custom field to the standard table and update it through the badi implementation
Step II:Config Panel Changes
1. Run the T-code '/n/syclo/configpanel' to open the agentry SAP Framework Configuration
2. Go to Mobile Data Object Configuration under Mobile Integration Settings. Expand the Standard Data Object
3. Select the appropriate data object “ SWM53_WORKORDER_GENERIC” and select ResultSet Field Selection tab
4. Expand the Field Catalog to select the corresponding table and drill down that table and check the “Field active” check box for the custom field
Step III: Agentry Changes
1.Go to agentry front end application. Add new property in “WorkOrder” Object
2. Add the new property to the “WorkOrder” List Screen to display the field
Step IV: Java Code Changes
1. Go to WorkOrder.java and do the necessary changes as follows
Step V: Publish the application,restart the server,reset the agentry test environment in order to see the changes and mobile device
User | Count |
---|---|
46 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
2 | |
2 |