Application Development 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: 

How do I append Internal table to XSTRING

Former Member
0 Kudos

Hi,

I want to append an Internal table to XSTRING which is part of table.

Here is what I want to do.

ls_xrobjdata-mandt = sy-mandt.

ls_xrobjdata-docnum = '0000000000000001'.

ls_xrobjdata-objcmptable = 'LTAK'.

ls_xrobjdata-objectdata = LT_LTAK.

objectdata field is defined as XSTRING and LT_LTAK is an Internal table.I want to do this in 46C and 47 systems.

Thanks in advance.

5 REPLIES 5

Former Member
0 Kudos

What is the definition/structure of ls_xrobjdata?

0 Kudos

Hi Srinivas,

Here is structure.

MANDT MANDT

DOCNUM EDI_DOCNUM

OBJCMPTABLE TYPENAME

OBJECTDATA TR_XSTRING

Main problem is with Object data as it has XSTRING type of data element.

Nilesh

Former Member
0 Kudos

You can not add an internal table to xstring. Internal table is a data with structure where a xstring is nothing but a string of type x.

You can append each line of interal table. But that may not achieve any thing to solve your problem.

Your issue is not technical but in the way you are trying to do something.

0 Kudos

Hi Nilesh,

You can achieve this with the following statement:

<b>EXPORT</b> lt_ltak <b>TO DATA BUFFER</b> ls_xrobjdata-objectdata.

This way lt_talk will be converted to xString.

But keep in mind that the generated xString is dependent of the system hardware. Which mean the xString will be different on application server running Intel vs Sun. Simply because the byte code (Big or Little endian) is used in the algorithm.

Sincerely,

Alain

Former Member
0 Kudos

Seems to be so:

call function 'SCMS_TEXT_TO_XSTRING'
   importing
      buffer   = ls_xrobjdata-objectdata
   tables
      text_tab = lt_ltak.

Regards,

Evgeni