2007 Jun 19 2:45 PM
hi all,
i have a flat file and in that there r multiple records of type '3' and in that i want to move some text which is at t_data-fld+359(80) to w_data-zmardesc.
the below code is working fine but it is moving the last record text only. but i want for the first record.
plz suggest what to do.
IF T_DATA-FLD+1(1) = '3'.
W_DATA-ZMARDESC = T_DATA-FLD+359(80).
ENDIF.
regards,
siri.
Message was edited by:
sireesha yalamanchili
2007 Jun 19 2:50 PM
If ur using loop then Check something like this.....
IF SY-TABIX EQ 1.
IF T_DATA-FLD+1(1) = '3'.
W_DATA-ZMARDESC = T_DATA-FLD+359(80).
ELSE.
EXIT.
ENDIF.Hope this helps...
hi all,
i have a flat file and in that there r multiple records of type '3' and in that i want to move some text which is at t_data-fld+359(80) to w_data-zmardesc.
the below code is working fine but it is moving the last record text only. but i want for the first record.
plz suggest what to do.
IF T_DATA-FLD+1(1) = '3'.
W_DATA-ZMARDESC = T_DATA-FLD+359(80).
ENDIF.
regards,
siri.
Message was edited by:
sireesha yalamanchili
2007 Jun 19 2:48 PM
try this..
<b>data : flag(1).</b>
IF T_DATA-FLD+1(1) = '3'.
<b>if flag ne 'X'.</b>
W_DATA-ZMARDESC = T_DATA-FLD+359(80).
<b>flag = 'X'.</b>
ENDIF.
endif.
Message was edited by:
Chandrasekhar Jagarlamudi
Message was edited by:
Chandrasekhar Jagarlamudi
2007 Jun 19 2:50 PM
If ur using loop then Check something like this.....
IF SY-TABIX EQ 1.
IF T_DATA-FLD+1(1) = '3'.
W_DATA-ZMARDESC = T_DATA-FLD+359(80).
ELSE.
EXIT.
ENDIF.Hope this helps...
2007 Jun 19 2:55 PM
2007 Jun 19 2:56 PM
try this
<b>data : flag(1).</b>
IF T_DATA-FLD+1(1) = '3'.
<b>if flag ne 'X'.</b>
W_DATA-ZMARDESC = T_DATA-FLD+359(80).
<b>flag = 'X'.</b>
ENDIF.
endif.
2007 Jun 19 2:59 PM
hi,
what is this flag concept could you plz explain.
regards,
siri.
2007 Jun 19 3:06 PM
first time the FLAG will be space ,
IF T_DATA-FLD+1(1) = '3'. " enters IF condition when condition met
if flag ne 'X'. " as flag is SPACE for first time it will continue,
"second time when it comes flag will be X , so it will
"not enter and you will have the first record data
W_DATA-ZMARDESC = T_DATA-FLD+359(80).
flag = 'X'.
ENDIF.
endif.
2007 Jun 19 2:59 PM
Helo, you can do like this:
<b>READ TABLE T_DATA INDEX 1</b>
IF T_DATA-FLD+1(1) = '3'.
W_DATA-ZMARDESC = T_DATA-FLD+359(80).
ENDIF.
Or if you need, use the sort command before the read.
Regards
Message was edited by:
Rodrigo Paisante
Message was edited by:
Rodrigo Paisante
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |