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

Check this

Former Member
0 Likes
501

Hi,

In my output list assume dat dere r 10 rows.say 1st, 2nd and 5th r blanks and remaining ones contain some info.

Now my requirement is i need to club all dese blanks and show it in one row.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
475

put like this .

loop at itab where matnr eq ''.

put ur logic here.

endloop.

Regards

Prabhu

put like this .

loop at itab where matnr eq ''.

put ur logic here.

endloop.

Regards

Prabhu

3 REPLIES 3
Read only

Former Member
0 Likes
476

put like this .

loop at itab where matnr eq ''.

put ur logic here.

endloop.

Regards

Prabhu

Read only

Former Member
0 Likes
475

Hi,

Just sort the internal table. If the entire row is appended as blank, then it would come at the bottom.

So that would be segregated at the end.

SORT ITAB.

But if you want to club all the blanks and display it in one row, still it would be blank. So do you want to display a blank record.

Best regards,

Prashant

Read only

Former Member
0 Likes
475

even if you add all the blank lines the result is also a Blank line. i am not getting why you are adding them ?

here is the logic to print ONLY 1 blank line on the output.

just say SORT ITAB.

then your blank lines will come first.

then write them.

SORT ITAB.
DATA : V_FLAG  TYPE C.
CLEAR V_FLAG.
loop at itab.
  if ITAB IS INITIAL. 
    if V_FLAG IS INITIAL.
       V_FLAG = 'X'.
       WRITE :/ ITAB. 
 "this is a blank line,print first time.
    endif.
  ELSE.
    WRITE  ITAB.
  ENDIF.
endloop.

here i am checking ITAB is initial and V_FLAG is initial. this will work for the first blank line and the empty line will be printed on the output. for next empty ITAB,w e are not printing any blank line on the output.

Regards

srikanth