cancel
Showing results for 
Search instead for 
Did you mean: 

problem in the abap cod for READ_TEXT FM SQ02 - outbound delivery header text

former_member328595
Active Participant
0 Kudos

Hi

I am trying to read some text from outbound delivery header text a query.

in the FM : READ_TEXT parameters are like this :

result of READ_TEXT

for this in the SQ02 I joined the STXL and STXH

then added the additional field by this code

DATA: BEGIN OF HTEXT OCCURS 50.
INCLUDE STRUCTURE THEAD.
DATA END OF HTEXT.
DATA: BEGIN OF T_READ_LINE OCCURS 50.
INCLUDE STRUCTURE TLINE.
DATA: END OF T_READ_LINE.
READ TABLE T_READ_LINE INDEX 4. "read the line value

DATA: TDNAME like STXH-TDNAME,
gs_lines TYPE tline,
Textclient type String.

CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'Z007'
LANGUAGE = '멡'
NAME = TDNAME
OBJECT = 'VBBK'
IMPORTING
HEADER = HTEXT
TABLES
LINES = T_READ_LINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.

IF SY-SUBRC = 0.
CLEAR gs_lines.
LOOP AT T_read_line INTO gs_lines.
Concatenate textclient gs_lines-tdline into textclient .
ENDLOOP.
ENDIF.

but it doesn't work???. result of SQ01:

rajkumarnarasimman
Active Contributor
0 Kudos
"I don't know much about ABAP debugging. How should I debug the infoset?

Place the debugger inside READ_TEXT fm and the cursor will stop during query executing.

it doesn't work.I have the next result:

Check the Language field also whether 'FA' is passed. Just for example, I gave random value and without checking you are passing the same in your system. Assign your variable/value in L_VBLNR and check it.

former_member328595
Active Participant
0 Kudos

debugging result

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Ali,

Please find the below comments.

DATA: GV_NAME TYPE THEAD-TDNAME.
select VBELN from LIKP into GV_name.
endselect.

In the above code, without any condition, the object(GV_NAME) is filled. Inside the query, you already have STXH, hope you can use the same.

CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'Z007'
LANGUAGE = '멡'
NAME = GV_name

When exporting Language, pass the value Farsi Language key stored in T002 table. When you are execting from SE37, it will work even if you pass in F or 'FA' or 'فى'. But when you use READ_TEXT fm, always do pass the key which is maintained in T002 table. Else you can fetch the language key also from STXH table, since already the table is available.

If you still face the problem, place breakpoint inside READ_TEXT as shown below and check the comparison by executing the QUERY and SE37 for FM READ_TEXT.

Regards

Rajkumar Narasimman

former_member328595
Active Participant
0 Kudos

look at this please :

former_member328595
Active Participant
0 Kudos

READ_TEXT

rajkumarnarasimman
Active Contributor
0 Kudos

The debugging is suggested to check the comparision between actual SE37 and query execution. If still not solved, may be you want to check with SAP people, by raising customer help /OSS to SAP

Accepted Solutions (0)

Answers (3)

Answers (3)

rajkumarnarasimman
Active Contributor

Hi Ali,

After cheking your above code, it looks for variable TDNAME value is not passed in READ_TEXT Function. Kindly check and pass the pass the value for TDNAME variable. Even after passing the value, if still problem exists use conversion exit to fill zeros for variable TDNAME. Use debugger for better troubleshooting.

DATA: TDNAME like STXH-TDNAME,
gs_lines TYPE tline,
Textclient type String.

DATA L_VBLNR TYPE VBELN_VF. 
L_VBLNR = '12345566'.    "Assign value

"Conversion exit to fill zero
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input         = L_VBLNR
     IMPORTING
       OUTPUT        = L_VBLNR.

"Assign value
TDNAME = L_VBLNR.

CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'Z007'
LANGUAGE = '멡'
NAME = TDNAME
OBJECT = 'VBBK'

raymond_giuseppi
Active Contributor
0 Kudos
  • What's your SAP version (with Farsi language installed)
  • Which value does FM CONVERSION_EXIT_ISOLA_INPUT return with input = 'FA' ([U+BA61])
  • Which exception is raised by READ_TEXT
former_member328595
Active Participant
0 Kudos

I don't know much about ABAP debugging. How should I debug the infoset?