Add Relations in Operation using ‘BAPI_ALM_ORDER_MAINTAIN’

Hi Experts,

My scenario is to add Relationship in operation available in IW32 using bapi – BAPI_ALM_ORDER_MAINTAIN

             ls_methodsrefnumber = 000000
             ls_methodsmethod ‘SAVE’.
             ls_methodsobjectkey = 000004000001.
             APPEND ls_methods TO lt_methods.

             ls_methodsrefnumber = 000001.
             ls_methodsobjecttype ‘RELATION’.
             ls_methodsmethod ‘CREATE’.
            ls_methodsobjectkey = 00000400000100200000040000010030.
             APPEND ls_methods TO lt_methods.

             ls_operationsactivity = 0030.
             APPEND ls_operations TO lt_operations.

             ls_operations_upactivity ‘X’.
             APPEND ls_operations_up TO lt_operations_up.

             ls_relationorder_predecessor = 000004000001.
             ls_relationoperation_predecessor = 0020.
             ls_relationorder_successor = 000004000001.
             ls_relationoperation_successor = 0030.
             ls_relationrelation_type ‘FS’.
             ls_relationduration_relation_unit ‘H’.
             APPEND ls_relation TO lt_relation.

             ls_relation_uporder_predecessor ‘X’.
             ls_relation_upoperation_predecessor ‘X’.
             ls_relation_uporder_successor ‘X’.
             ls_relation_upoperation_successor ‘X’.
             ls_relation_uprelation_type ‘X’.
             ls_relation_upduration_relation_unit ‘X’.
             APPEND ls_relation_up TO lt_relation_up.

             CALL FUNCTION ‘BAPI_ALM_ORDER_MAINTAIN’
               TABLES
                 it_methods      lt_methods
                 it_operation    lt_operations
                 it_operation_up lt_operations_up
                 it_relation     lt_relation
                 it_relation_up  lt_relation_up
                 return          lt_return.

if i pass  ls_relationrelation_type ‘FS’. then i get error – Relationship type FS could not be converted to the internal format.
I checked some blogs where thy said to add conversion routine and change it to ‘NF’. did that and it gave errors: CN 801 Activity “0020” does not exist in network “000004000001”.

Why its treating maintenance order as Network. It works when i directly execute this bapi, but when i add this in my report then i get above errors. Want Relations to get added like :

shilpia_1-1710252585826.png

Need your expertise in resolving this.

Thanks

Scroll to Top