Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

domain value fetch

Former Member
0 Likes
1,128

hi all,

how can we fecth the domain values

inside the program.

regards

anver

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
1,081

hi,

chk this sample code.

DATA : BEGIN OF int_orient OCCURS 10,

domvalue_l LIKE dd07v-domvalue_l,

ddtext LIKE dd07v-ddtext,

END OF int_orient.

DATA: ZPETS_PORTORIEN type dd07l-domname,

int_values_table TYPE dd07v OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'GET_DOMAIN_VALUES'

EXPORTING

domname = 'ZPETS_PORTORIEN'

text = 'X'

TABLES

values_tab = int_values_table

EXCEPTIONS

no_values_found = 1

OTHERS = 2.

LOOP AT int_values_table.

int_orient-domvalue_l = int_values_table-domvalue_l.

int_orient-ddtext = int_values_table-ddtext .

append int_orient.

ENDLOOP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ZMPETS_PORT-PORTOREIN'

value_org = 'S'

TABLES

value_tab = int_orient

return_tab = int_ret

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

READ TABLE int_orient WITH KEY ddtext = int_ret-fieldval.

IF sy-subrc EQ 0.

zmpets_port-portorein = int_orient-domvalue_l.

wf_orient_text = int_ret-fieldval.

PERFORM f_update_values.

ENDIF.

rgds

anver

pls mark all helpful answers

hi all,

how can we fecth the domain values

inside the program.

regards

anver

9 REPLIES 9
Read only

Former Member
0 Likes
1,081

Hi shahana,

1. fm GET_DOMAIN_VALUES

regards,

amit m.

Read only

Former Member
0 Likes
1,081

Domain is just a type which describes the fields.

its output length ,

can you clarify ur requirement a bit more

Read only

Former Member
0 Likes
1,081

You will find them in the table DD07L

Thanks

Read only

Former Member
0 Likes
1,081

Hi, use the below code.

data: lt_caltype type standard table of DD07V with header line.

*--Domain Values for Calculation type for condition

CALL FUNCTION 'DDUT_DOMVALUES_GET'

EXPORTING

name = 'KRECH'

LANGU = SY-LANGU

  • TEXTS_ONLY = ' '

tables

dd07v_tab = lt_caltype

EXCEPTIONS

ILLEGAL_INPUT = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

perfectly it will work.reward the points,

Thanks

Eswar

Read only

Former Member
0 Likes
1,081

Use the FM <b>GET_DOMAIN_VALUES </b>.

Pass the Domian name and Text = 'X'. It will return you values maintained in domain + Text in VALUE_TAB.

Regards,

Prakash.

Read only

Former Member
0 Likes
1,081

Hi,

You will find them in <b>DD07L</b> table ..

Regards,

Santosh

Read only

Former Member
0 Likes
1,081

U should be able to get it from table DD07V.

SELECT DOMNAME VALPOS DOMVALUE_L DOMVALUE_H

into idomval

from dd07v

where domname = Domain Name

and ddlanguage = sy-langu.

Read only

Former Member
0 Likes
1,081

Hi,

use dd07l table to get domain values

Regards

amole

Read only

anversha_s
Active Contributor
0 Likes
1,082

hi,

chk this sample code.

DATA : BEGIN OF int_orient OCCURS 10,

domvalue_l LIKE dd07v-domvalue_l,

ddtext LIKE dd07v-ddtext,

END OF int_orient.

DATA: ZPETS_PORTORIEN type dd07l-domname,

int_values_table TYPE dd07v OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'GET_DOMAIN_VALUES'

EXPORTING

domname = 'ZPETS_PORTORIEN'

text = 'X'

TABLES

values_tab = int_values_table

EXCEPTIONS

no_values_found = 1

OTHERS = 2.

LOOP AT int_values_table.

int_orient-domvalue_l = int_values_table-domvalue_l.

int_orient-ddtext = int_values_table-ddtext .

append int_orient.

ENDLOOP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ZMPETS_PORT-PORTOREIN'

value_org = 'S'

TABLES

value_tab = int_orient

return_tab = int_ret

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

READ TABLE int_orient WITH KEY ddtext = int_ret-fieldval.

IF sy-subrc EQ 0.

zmpets_port-portorein = int_orient-domvalue_l.

wf_orient_text = int_ret-fieldval.

PERFORM f_update_values.

ENDIF.

rgds

anver

pls mark all helpful answers