2007 Jul 06 6:27 AM
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
2007 Jul 06 6:41 AM
Hi,
Try using CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB instead of c_tab..
Regards,
Abhijit
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
2007 Jul 06 6:29 AM
Hi,
There must be something wrong in the Upload FM of your file. Just paste your whole code.
Regards,
Atish
2007 Jul 06 6:40 AM
2007 Jul 06 6:41 AM
Hi,
You can split.
Can you just paste your code so that I can tell you what is wrong.
Regards,
Atish
2007 Jul 06 6:41 AM
Hi,
Try using CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB instead of c_tab..
Regards,
Abhijit
2007 Jul 06 6:44 AM
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
2007 Jul 06 9:07 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |