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

separated by pipe in datasets

Former Member
0 Likes
447

Hi al,

I am using 'PIPE' addition in datasets. But the problem is if there is nodata end of file , pipe sysmbol was not coming. if it is happend in middile of data, pipe was coming .

but end of file it was coming ..please help.

Example.

123|sgjg|X|| | jdgsdjj|35|

still i have 3 fileds end of file ...that is blank data, then it will give pipe sysmbol with that lengh.

correct : 123|sgjg|X|| | jdgsdjj|35| | | |

regasds,

Aj

pl

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
421

May this way


data : begin of itab occurs 0.
data : matnr   like mara-matnr.
data : pipe1   type c value '|'.
data : ersda   like mara-ersda.
data : piple2  type c value '|'.
data : ernam  like mara-ernam.
data : pipe3  type c value '|'.
data : end of itab.

data : begin of itab1 occurs 0.
data : fields(100) type c.
data : end of itab1.

loop at itab.
  move itab to itab1.
  append itab1.
endloop.
.....
,.,,.,
......

loop at itab1.
   open dataset
   transfer itab1.
endloop.

Hi al,

I am using 'PIPE' addition in datasets. But the problem is if there is nodata end of file , pipe sysmbol was not coming. if it is happend in middile of data, pipe was coming .

but end of file it was coming ..please help.

Example.

123|sgjg|X|| | jdgsdjj|35|

still i have 3 fileds end of file ...that is blank data, then it will give pipe sysmbol with that lengh.

correct : 123|sgjg|X|| | jdgsdjj|35| | | |

regasds,

Aj

pl

2 REPLIES 2
Read only

former_member194669
Active Contributor
0 Likes
422

May this way


data : begin of itab occurs 0.
data : matnr   like mara-matnr.
data : pipe1   type c value '|'.
data : ersda   like mara-ersda.
data : piple2  type c value '|'.
data : ernam  like mara-ernam.
data : pipe3  type c value '|'.
data : end of itab.

data : begin of itab1 occurs 0.
data : fields(100) type c.
data : end of itab1.

loop at itab.
  move itab to itab1.
  append itab1.
endloop.
.....
,.,,.,
......

loop at itab1.
   open dataset
   transfer itab1.
endloop.

Read only

Former Member
0 Likes
421

Hi ajay,

try something like this

Field-symbols :  <fs_field> TYPE ANY.
DATA : l_field(255).
DATA : transfer_stru(1000).

 LOOP AT i_final.
        DO.
          ASSIGN COMPONENT sy-index OF STRUCTURE i_final TO <fs_field>.
          IF sy-subrc EQ 0.
            MOVE <fs_field> TO l_field.
            CONDENSE l_field.
            CONCATENATE transfer_stru '|' l_field INTO transfer_stru.
            CLEAR l_field.
          ELSE.
            EXIT.
          ENDIF.
        ENDDO.
        SHIFT transfer_stru LEFT.
        TRANSFER transfer_stru TO v_file.
        CLEAR transfer_stru.
      ENDLOOP.