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

Why does thid code not work?

Former Member
0 Likes
861

LOOP AT gt_1 INTO gs_1.

WRITE: / gs_1-created_at+0(8).

gs_1-created_at = gs_1-created_at+0(8).

IF gs_1-created_at IN s_date.

APPEND gs_1 TO gt_11.

ELSE.

ENDIF.

ENDLOOP.

I do not just get the first eight positions. Why?

7 REPLIES 7
Read only

Former Member
0 Likes
836

LOOP AT gt_1 INTO gs_1.

WRITE: / gs_1-created_at+0(8).

gs_1-created_at = gs_1-created_at+0(8).

IF <b>gs_1-created_at IN s_date.</b>

APPEND gs_1 TO gt_11.

ELSE.

ENDIF.

ENDLOOP.

this will certainly fail , because that is date field...

but in different format, bold one will fail...

Read only

andreas_mann3
Active Contributor
0 Likes
836

Hi Linn,

in which structure ?

what stands in gs_1-created_at in line 4 of your coding ?

-i think there's no error in your coding

Andreas

Message was edited by: Andreas Mann

Read only

Former Member
0 Likes
836

gs_1-created_at what is the format..

i mean what is the data type , and length,..

please give the declaration of that...

regards

vijay

Read only

0 Likes
836

The code does not fail but I do not get the eight first positions.

Read only

0 Likes
836

what is in gs_1-created_at, again ?

a date ?

pls post an example.

Andreas

Read only

0 Likes
836

yeah , that won't fail...

assume you have date is 10.10.2004 or 10/10/2004

then what you will get if you use

<b>char+0(8)</b> the out put will be <b>10/10/</b>

but you will not get the correct thing..

thats what i meant..

Read only

Former Member
0 Likes
836

Hi,

You can compare the value like,

gs_1-created+0(8) = s_date-low, provided the date format of both are same,

Rgds,