Wednesday, July 31, 2013
First we need to create two objects.Check object creation here. Then use FM RH_RELATION_WRITE to create relationship between two objects.

LW_RELATION-PLVAR  = C_PLVAR.
        LW_RELATION-OTYPE  = C_QUALGROUP.
        LW_RELATION-OBJID  = LW_LIST-OBJID.
        LW_RELATION-ISTAT  = C_ISTAT.
        LW_RELATION-RSIGN  = C_BOTTOM_UP.
        LW_RELATION-RELAT  = C_SPL.
        LW_RELATION-BEGDA  = LV_BEGDA.
        LW_RELATION-ENDDA  = LV_ENDDA.
        LW_RELATION-SCLAS  = C_QUALGROUP.
        LW_RELATION-SOBID  = LW_LIST-OBJID_PQ.
        APPEND LW_RELATION TO LT_RELATIONS.
        CLEAR  LW_RELATION.
        "Create Relation between Qualification Group
        "and parent Qualification Group 
        CALL FUNCTION 'RH_RELATION_WRITE'
          TABLES
            RELATION             = LT_RELATIONS
            ERR_RELATION         = LT_ERELATIONS
          EXCEPTIONS
            NO_AUTHORITY         = 1
            RELATION_NOT_ALLOWED = 2
            OBJECT_NOT_FOUND     = 3
            WRONG_DATE_FORMAT    = 4
            TIME_NOT_VALID       = 5
            ERROR_DURING_INSERT  = 6
            UNDEFINED            = 7
            OTHERS               = 8.

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.