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: 

Check internal table for some value

Former Member
0 Kudos
206

HI,

I have internal table with 3 deep structure inside and i want to scan the table if i have field type

tims search if the have ':' if so omit it, and the same for dats '-'.

What is the best way to do that?

type                                    data type
SWW_CD 	        DATS
SWW_CT	        TIMS

e.g.

IF I have time like

18:20:33

i want to turn it to 182033

and the same for date

2009-01-28

20090128

Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos
98

Use the following code

Loop through the internal tables and you can translate using the following

Translate SWW_CD using '- ' .

condense SWW_CD no-gaps.

Translate SWW_CT Using '. '.

condense SWW_CT no-gaps.

Regards,

Krishnakumar

6 REPLIES 6

Former Member
0 Kudos
99

Use the following code

Loop through the internal tables and you can translate using the following

Translate SWW_CD using '- ' .

condense SWW_CD no-gaps.

Translate SWW_CT Using '. '.

condense SWW_CT no-gaps.

Regards,

Krishnakumar

0 Kudos
98

Hi Krishna kumar ,

This is the only way ? to loop and replace the fields ?

I ask it because the table i have, had deep inside deep inside deep ....structure inside.

There is FM OR Method that can help with that?

Regards

Former Member
0 Kudos
98

Hi,

Try using the syntax REPLACE IN TABLE itab...

Thanks

Naren

0 Kudos
98

HI,

i can to do this on the data type because i have loots of diff fields of time and dates ,

So instead of asking about every fields , check if the fields data type is is tims or dats and replace it.

Regards

0 Kudos
98

HI Everyone,

Any idea about that?

Regards

0 Kudos
98

hi,

check this

DATA date TYPE sy-datum.
DATA date1 type char8.
DATA time TYPE sy-uzeit.
DATA time1 type char6 .
date = sy-datum.
time = sy-uzeit.
date1 = date.
time1 = time.

Write:/ date1.
Write:/ time1.