Skip to Content
author's profile photo Former Member
Former Member

How to update values in domain?

Hi All,

Is there any FM or BAPI or any other logic to update the values of domain?

For example, I have 4 values in my domain and i want to add 5th value to it. How we can do this....Please help me out.

Thanks in advance,

Srilakshmi.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 11:13 AM

    Hi Srilakshmi,

    Try these function modules.

    RPY_DOMAIN_INSERT

    RPY_DOMAIN_UPDATE

    Best Regards,

    Ram.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 11:14 AM

    try to get access key and do it......

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Srilakshmi,

      I have run this code and i was able to update the domain values successfully. The parameter that you need to change would be,

      DOMA_INF-VALUEEXIST = 'X'.

      In the Import structure, pass this value. Also you need to pass the value for shorttext in the structure. This is the domain short text. if you dont pass this, the domain text will be blank and it will throw an error.

      doma_inf-shorttext = 'Domain for testing Purpose'.

      Once you pass these two you should be able to update the domain values successfully. For your reference i am ataching the code that i had modified.

      DATA DD07V_TAB LIKE DD07V OCCURS 2 WITH HEADER LINE.
      DATA DOMA_INF LIKE RPY_DOMA.
      DATA DOMA_VALUES LIKE RPY_DVAL OCCURS 2 WITH HEADER LINE.
      
      DOMA_INF-DOMANAME = 'ZTEST_RAM'.
      DOMA_INF-LANGUAGE = 'E'.
      DOMA_INF-DATATYPE = 'CHAR'.
      DOMA_INF-LENGTH = '4'.
      DOMA_INF-OUTPUTLEN = '4'.
      DOMA_INF-VALUEEXIST = 'X'.   " This is important
      DOMA_INF-SHORTTEXT = 'DOMAIN FOR TESTING PURPOSE'. " This is also important.
      
      DOMA_VALUES-DOMANAME = 'ZTEST_RAM'.
      DOMA_VALUES-VALPOS = '0001'.
      DOMA_VALUES-LANGUAGE = 'E'.
      DOMA_VALUES-DDTEXT = 'TEST'.
      DOMA_VALUES-DOMVALUE_L = 'RAM'.
      APPEND DOMA_VALUES.
      CLEAR DOMA_VALUES.
      
      DOMA_VALUES-DOMANAME = 'ZTEST_RAM'.
      DOMA_VALUES-VALPOS = '0002'.
      DOMA_VALUES-LANGUAGE = 'E'.
      DOMA_VALUES-DDTEXT = 'TEST2'.
      DOMA_VALUES-DOMVALUE_L = 'TEST'.
      APPEND DOMA_VALUES.
      CLEAR DOMA_VALUES.
      
      CALL FUNCTION 'RPY_DOMAIN_UPDATE'
        EXPORTING
          ACTIVATION_TYPE        = 'A'
          DOMA_NAME              = 'ZTEST_RAM'
          DOMA_INF               = DOMA_INF
          LANGUAGE               = SY-LANGU
        TABLES
          DOMA_VALUES            = DOMA_VALUES
       EXCEPTIONS
         CANCELLED              = 1
         NOT_EXIST              = 2
         PERMISSION_ERROR       = 3
         ILLEGAL_TYPE           = 4
         OTHERS                 = 5.
      IF SY-SUBRC <> 0.
        WRITE:/ SY-MSGNO.
      ENDIF.
      

      Best Regards,

      Ram.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.