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

Retrieve textname from characteristic value

Former Member
0 Likes
4,315

Hello,

I'm using FM read_text to get the documentation/long text for a characteristic value.

CALL FUNCTION 'READ_TEXT'
       EXPORTING
            id                      = c_tdid
            language                = c_tdspras
            name                    = ????
            object                  = c_tdobject
       TABLES
            lines                   = i_tline[]
       EXCEPTIONS
            id                      = 1
            language                = 2
            name                    = 3
            not_found               = 4
            object                  = 5
            reference_check         = 6
            wrong_access_to_archive = 7
            OTHERS                  = 8.

However, I don't know how to retrieve the textname of a specific characteristic value.

In transaction CT04, I go to the documentation and then header...

The textname written there is 00000003770001, but is it possible to get this text name using a FM/BAPI?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,097

This apparently doesn't work.

When you change the order of the values in CT04, the value CAWN-ATZHL also changes...

Hello,

I'm using FM read_text to get the documentation/long text for a characteristic value.

CALL FUNCTION 'READ_TEXT'
       EXPORTING
            id                      = c_tdid
            language                = c_tdspras
            name                    = ????
            object                  = c_tdobject
       TABLES
            lines                   = i_tline[]
       EXCEPTIONS
            id                      = 1
            language                = 2
            name                    = 3
            not_found               = 4
            object                  = 5
            reference_check         = 6
            wrong_access_to_archive = 7
            OTHERS                  = 8.

However, I don't know how to retrieve the textname of a specific characteristic value.

In transaction CT04, I go to the documentation and then header...

The textname written there is 00000003770001, but is it possible to get this text name using a FM/BAPI?

Thanks

12 REPLIES 12
Read only

former_member438956
Active Participant
0 Likes
3,097

Hi glenn,

put the characteristic name in cabn table and get atinn field from it. then query cawn table and get atzhl field. concatenate the two fields(atinn and atzhl) and put into name parameter of fm 'READ_TEXT'.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = 'VALU'

language = 'E'

name = CONCATENATE(ATINN,ATZHL)

object = 'FEATURE'

TABLES

lines = i_tline[]

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

Hope it helps u.

Regards,

Anil N.

Read only

0 Likes
3,097

I will try your solution.

So there is no FM to get this internal value directly?

Read only

0 Likes
3,097

I'm now using this code:

* Definition
  DEFINE _convert_atinn.
    call function 'CONVERSION_EXIT_ATINN_INPUT'
         exporting
              input  = &1
         importing
              output = &2.
  END-OF-DEFINITION.


* Get internal value of characteristic
  _convert_atinn 'DEVICE_STATUS' lw_attin.

* Get internal value of characteristic value
  SELECT SINGLE atzhl
  FROM cawn
  INTO lw_atzhl
  WHERE atinn = lw_attin
      AND atwrt = 'AVAILABLE'.

* Concatenate the 2 values
  CONCATENATE lw_attin lw_atzhl INTO lw_name.

This is working fine.

Thanks

Read only

Former Member
0 Likes
3,097

hi glen,

The text name is nothing but the document number.

For example you want to read the header text of the PO, then text name will be PO number

and if you wnat to read the item text of the PO, then text name will be concatenation of PO item and PO number.

To see how a text name value is define dfor a particular text object and text id , goto STXH table and input your object and id . so that you can see what is the text names.

Thanks,

vamshi

Read only

Former Member
0 Likes
3,097

Yes u can use FM to change ur characteristic name into digits which u will pass in name parameter in READ_TEXT.

The FM is

CONVERSION_EXIT_ATINN_INPUT

EXPORTING

INPUT = ' charactername'

IMPORTING

OUTPUT = CHARNUMBER.

This character no. is to be passed to READ_TEXT in NAME parameter.

Read only

0 Likes
3,097

This does not work for characteristic values, only for characteristics.

E.g. I want to know the internal value of characteristic value 'AVAILABLE' of characteristic 'DEVICE_STATUS'

Read only

0 Likes
3,097

u use the first conversion routine which i posted earliner to get the number so eg. 000081

Now if the value is the first value of this character then u have to append 0001 to 00881

i.e. it becomes 00000000000008810001 (16 fields is the length of this).

Now u pass this value to ur read_text u'll get the right value for the characteristic value(if its 1st value and 0002 if its 2nd value and so on).

Read only

Former Member
0 Likes
3,097

Hello,

What all the inputst u have i.e sales order number, item or material number

use this FM

BAPI_CLASS_GET_CHARACTERISTICS

Read only

Former Member
0 Likes
3,097

check this table

/SAPHT/MESZPCHAR

HOPE U CAN GET THE TEXT NAME

cheers

s.janagar

Read only

Former Member
0 Likes
3,098

This apparently doesn't work.

When you change the order of the values in CT04, the value CAWN-ATZHL also changes...

Read only

0 Likes
3,097

Hi Glenn,

I got the solution to ur problem. Instead of concatenating atzhl with characteristic number (ATINN) concatenate (ATINN,TXTNR) and then pass into the name parameter of READ_TEXT. u will get TXTNR from CAWN table.

Hope it will solve ur problem.............

Regards,

Anil N.

Read only

0 Likes
3,097

Thanks a lot! That's indeed the solution!