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

hI Regarding internal table

Former Member
0 Likes
845

Hi all

please help me on this

hi this is my code in that i am facing problem populating internal table t_mard.

t_tfile[] is tablimited stirg file.i.e it contains only one fileld of length 128

i am moving this data to internal table t_mard into fields matnr,werks,dlinl

it is not moving correctly .

it is moving all the data into t_mard-matnr field with# seperators

IF NOT T_TFILE[] IS INITIAL.

  • To split the data and store data in format of internal table t_mard

LOOP AT T_TFILE.

SPLIT T_TFILE

AT C_TAB

INTO T_MARD-MATNR

T_MARD-WERKS

T_MARD-LGORT

T_MARD-DLINL.

APPEND T_MARD.

ENDLOOP. "LOOP AT t_tfile

ENDIF. "IF NOT t_tfile[] IS INITIAL

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
827

Hi,

Try using CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB instead of c_tab..

Regards,

Abhijit

Hi,

Try using CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB instead of c_tab..

Regards,

Abhijit

6 REPLIES 6
Read only

Former Member
0 Likes
827

Hi,

There must be something wrong in the Upload FM of your file. Just paste your whole code.

Regards,

Atish

Read only

Former Member
0 Likes
827

hi all

i am using tab delimeter

how to split the data using tab

Read only

0 Likes
827

Hi,

You can split.

Can you just paste your code so that I can tell you what is wrong.

Regards,

Atish

Read only

Former Member
0 Likes
828

Hi,

Try using CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB instead of c_tab..

Regards,

Abhijit

Read only

Former Member
0 Likes
827

hi,

what is the tablimiter in your table!!

If you are not sure Check in debug mode, the tablimiter.

then Use SPLIT command

Eg:

LOOP AT ct_fplp INTO ls_fplpstring.

IF sy-tabix < 3.

CLEAR ls_fplpstring.

CONTINUE.

ENDIF.

*Spliting the File and appending internal table

SPLIT ls_fplpstring AT ',' INTO ls_fplp_itab-ordno

ls_fplp_itab-sdate

ls_fplp_itab-edate

ls_fplp_itab-matnr

ls_fplp_itab-locno

ls_fplp_itab-quan.

SEARCH ls_fplp_itab-quan FOR lv_comma.

IF sy-subrc = 0.

ls_fplp_itab-quan+sy-fdpos = space.

ENDIF.

APPEND ls_fplp_itab TO ct_fplp_itab.

CLEAR ls_fplp_itab.

CLEAR ls_fplpstring.

ENDLOOP.

rewards if useful,

regards,

nazeer

Read only

Former Member
0 Likes
827

Hi Abhijit,

I have solved the problem by changing it

Thanks & Regards

[email protected]