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

String Problem

Former Member
0 Likes
1,409

Dear all,

i have taken one varible with type string.

but some data are cut out.

because length of data must be length of 300 approx.

can you suggest me that what type i declared varible.

that print the length of 300

plz reply me

16 REPLIES 16
Read only

FredericGirod
Active Contributor
0 Likes
1,371

where do you see data is cut ?

in debug ?

when you print ?

Read only

0 Likes
1,371

in debug...........

in printing no problem because i have taken table

Read only

Former Member
0 Likes
1,371

Can u paste the piece of code and output ?

Regards

Vinod

Read only

0 Likes
1,371

Talke an example

DATA:L_VAR TYPE char300.

DATA:BEGIN OF I_TAB OCCURS 0,

S TYPE STRING,

END OF I_TAB.

DO 30 TIMES.

I_TAB-S = 'Shalini-19'.

append I_TAB.

ENDDO.

loop at I_TAB.

CONCATENATE L_VAR I_TAB-S INTO L_VAR.

ENDLOOP.

Edited by: Shalini Singh on May 5, 2010 10:04 AM

Read only

0 Likes
1,371

Hi shailini

the problem is here



CONCATENATE L_VAR I_TAB-S INTO L_VAR.

you're trying to concatenate a char300 + string into a char300.....

is normal that it will take only the first 300 char.....

regards

Marco

Read only

0 Likes
1,371

Well then check this


report ztest line-size 1023.    " Add the required line size here

DATA:L_VAR TYPE string.

DATA:BEGIN OF I_TAB OCCURS 0,
S TYPE STRING,
END OF I_TAB.

DO 50 TIMES.
I_TAB-S = 'Shalini-19'.
append I_TAB.
ENDDO.

loop at I_TAB.
CONCATENATE L_VAR I_TAB-S INTO L_VAR.
ENDLOOP.

write: l_var.

Vikranth

Read only

0 Likes
1,371

I_TAB containing 30 line items of field Shalini-19.

Then, total character is 300.

but data print only 255.

plz. aplly it as a code and run.

Read only

0 Likes
1,371

But i want to print this variable through Smartform in table row.

Read only

0 Likes
1,371

Its because of the line-size addition in the report statement. Add the line-size like in my sample and check.

Read only

0 Likes
1,371

Hi shalini

use

DATA:L_VAR TYPE string.

i've tried and it work

if you want to print L_VAR into a smartforms, you must check

that the width of the window and od the table

can contain 300 and more char......

Marco

Read only

0 Likes
1,371

In Smartform its not working.......................................Take an Example

REPORT ZTEST line-size 1023.

DATA: fmname TYPE rs38l_fnam.

DATA:L_VAR TYPE string.

DATA:BEGIN OF I_TAB OCCURS 0,

S TYPE STRING,

END OF I_TAB.

DO 50 TIMES.

I_TAB-S = 'Shaliniii-19'.

append I_TAB.

ENDDO.

loop at I_TAB.

CONCATENATE L_VAR I_TAB-S INTO L_VAR.

ENDLOOP.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZTEST_smart'

IMPORTING

FM_NAME = fmname

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 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.

CALL FUNCTION fmname

EXPORTING

L_VAR = L_VAR

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5 .

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,371

>

> In Smartform its not working

As suggested check if the page width & window size is capable of accommodating the data.

Read only

0 Likes
1,371

Hi,

It is not working with smartform,

Read only

Former Member
0 Likes
1,371

Hi check the below code in which i'm storing 1000 characters.

DATA: fs_output1(1000) TYPE c.

CONCATENATE 'Parent Company Name'

'Shipping Point'

'Shipping City'

'Shipping State'

'Invoice'

'Invoice date'

'Sold To Customer'

'Sold To Customer Name'

'Sold To Customer Address1'

'Sold To Customer Address2'

'Sold To Customer City'

'Sold To Customer State'

'Sold To Customer Zip'

'Ship To Customer'

'Ship To Customer Name'

'Ship To Customer Address1'

'Ship To Customer Address2'

'Ship To City'

'Ship To State'

'Ship To Zip'

'Product'

'Product Description'

'Distributors Lot'

'Qty Shipped'

'Unit of Qty shipped'

'Unit of Measure for Calc'

'Qty in Gallons'

'Sales Order'

'Customer PO'

'Delivery'

'Service Partner ID'

into fs_output1 SEPARATED BY space.

write: fs_output1.

In this you can see fs_output1 will be holding 1000 characters.

when you see the output in this only 255 characters will be displayed if u write line-count 1023 in report statement then all the 1000 characters will be displayed. Orelse if u r sending the 300 characters into a file then no need to declare that line-count even.

Regards

VEnk@

Read only

rainer_hbenthal
Active Contributor
0 Likes
1,371

A string can hold 2 GB of data, thats for sure not the problem. Maybe your spool is cut due to your report settings,

Read only

Former Member
0 Likes
1,371

Hi shalini

define your varible of type char300.



DATA: my_var TYPE char300.

Best regards

Marco