cancel
Showing results for 
Search instead for 
Did you mean: 

Vertical Lines for last Three Records

former_member251546
Participant
0 Kudos

hi,

Guys

I have dev the smart form... in my final itab ive got 23 records.. i need last three records much hve vertical lines..

how to do it...Plz let me know

Regards

Accepted Solutions (1)

Accepted Solutions (1)

former_member217544
Active Contributor
0 Kudos

Hi Balaji,

Is your problem not solved with your earlier posts?

Like separating the last 3 lines into an internal table..

Regards,

Swarna Munukoti

former_member251546
Participant
0 Kudos

Hi,

Thank you swarna..

I got the solution for first page. but not second page.

my form has two pages. first page disign is deffer than second page..

Fisrst page has only to0 20 cust .... But second page itab has 17 branches which is top 20 cust..so

If you have time , Plz tell me how to do it..

Regards

former_member217544
Active Contributor
0 Kudos

Hi Balaji,

Can you provide an example of how your internal table looks with 2 r3 branches?

Regards,

Swarna Munukoti

former_member251546
Participant
0 Kudos

Hi

Thank you for responce.

i think, this text will not give the right desing.. if u dont mind, give me ur mail id.. i will send the screen shot..

Branch Sold to party Selling price Cost price Gross profit GP

India xyx 100 80 20 80%

abc 100 80 20 80%

Subtot 200 160 40 90%

Others 100 80 20 80%

Grand total 300 240 60 90%

Australia xyx 100 80 20 80%

abc 100 80 20 80%

Subtot 200 160 40 90%

Others 100 80 20 80%

Grand total 300 240 60 90%

I need the vertical lines for subtot others grandtot

Regards

former_member217544
Active Contributor
0 Kudos

Hi Balaji,

Thats fine. I understand the design except one query,

If you consider the first branch:

India xyx 100 80 20 80%

<blank> abc 100 80 20 80%

<blank> Subtot 200 160 40 90%

<blank>Others 100 80 20 80%

<blank> Grand total 300 240 60 90%

The first field where the value is INDIA in first row, will be balnk for other rows till next branch (eg.:AUSTRALIA) comes. Am i correct?

Regards,

Swarna Munukoti.

former_member251546
Participant
0 Kudos

Hi,

Yes ur right..100%.. ur right..

Branch name doesnt repeated twice...

I did calc manually for the subtot , Others, Grand tot..

End of itab..iam appending the subtot + Others + grand tot...

like 17 branches.....

I am in hanging.. how to solve this prob...

Thank you for responce..

Regards

former_member217544
Active Contributor
0 Kudos

Hi Balaji,

Try this way:

If you have 17 branches, create an internal table with 17 records. lets say it_17.

Now create a loop node with thsi internal table.

- Under this loop create a program lines node

- first table node - to hold the records of each branch except last 3 lines

- second table node- to hold last 3 records of the each branch

(design these tables as per your requirement)

Now keep this logic in your program lines node:


LOOP AT zs_sf1 INTO wa_sf1.
  wa_new = wa_sf1-carrid.
  IF sy-tabix eq 1.
    wa_old = wa_sf1-carrid.
  ELSE.
    IF wa_new eq ' '.
      delete zs_sf1 INDEX sy-tabix.
    ELSE.
      describe table zs_sf2 lines count.
      IF count ge 2.
        count3 = count - 2.
        append lines of zs_sf2 from count3 to count to zs_sf3_last3.
        count3 = count3 - 1.
        append lines of zs_sf2 from 1 to count3 to zs_sf3.
        delete zs_sf1 INDEX 1.
        exit.
      ENDIF.
    ENDIF.
  ENDIF.
APPEND wa_sf1 to zs_sf2.
ENDLOOP.

In the table node one include zs_sf3 as internal table

and in second table node include zs_sf3_last3 as internal table.

So, the logic goes like this:

In first iteration of it_17:

zs_sf3 holds the records of first branch

and zs_sf3_last3 holds last 3 records of first branch

and the table node prints the first branch data

In second iteration of it_17:

zs_sf3 holds the records of second branch

and zs_sf3_last3 holds last 3 records of second branch

and the table node prints the second branch data

And this loop continues for 17 branches.

(Declare the internal tables and work areas in the global data section, and pass them as input/output paramaters while using in program lines node)

Regards,

Swarna Munukoti.

Edited by: Swarna Munukoti on Feb 4, 2010 7:35 AM

former_member251546
Participant
0 Kudos

Hi,

Good day swarna

How r u? Hope ur doing well. A small favour to me.

A small problem in alv report. plz advice me. I done alv report but client has changed the requirement.

He Needs the report first record displays Item total. and then displays iteams list. so. i worte the code as below as. but its not working.

My itab data looks like below.

Mtpos Ktgrm_d Des Value

Znam bomag xyz 10

Znam bomag fdfj 10

Nam bomag fjfff 20

znam volvo fdkfjkd 40

nam volvo erje 30

in my report i need to disply based on the ktgrm_d which is part name. No need to display the mt pos.

Iam doing the at new also based on ktgrm_d. so report should be like

Ktgrm_d Des Value

Bomag 40 "total values"

Bomag 10 "these are items

Bomag 10

Bomag 20

volvo 70 "total values

Volvo 40

volvo 30

Can you guide me plz. send me smaple code if uve time.

CLEAR: lwa_out5.

REFRESH: lt_machine_sales4.

DATA: lwa_out1 type zsalessm.

SORT lt_machine_sales BY ktgrm_d ascending.

LOOP AT lt_machine_sales INTO lwa_out5.

lwa_out1 = lwa_out5.

AT NEW ktgrm_d.

SUM.

lwa_out5-sales_qty = lwa_out5-sales_qty * -1.

lwa_out5-act_sales_p = lwa_out5-act_sales_p * -1.

lwa_out5-act_cos_p = lwa_out5-act_cos_p * -1.

lwa_out5-act_gross_p = lwa_out5-act_gross_p * -1.

lwa_out5-act_gross_perc_P = lwa_out5-act_gross_perc_p * -1.

lwa_out5-netwr = lwa_out5-netwr * -1.

APPEND lwa_out5 TO lt_machine_sales4.

clear:lwa_out5.

ENDAT.

Append lwa_out1 To lt_machine_sales4.

clear:lwa_out1.

ENDLOOP.

Regards

former_member217544
Active Contributor
0 Kudos

Hi Balaji,

Check if this helps you. This is done with the same sflight example. try to map with your internal tables.

 
DATA: zsflight_out TYPE TABLE OF sflight,
      wa_zsflight_out TYPE sflight,
      zs_sf1 type TABLE OF sflight,
      zs_sf2 type TABLE OF sflight,
      wa_total TYPE sflight-price,
      fg TYPE c.

select * FROM sflight INTO TABLE zsflight_out.
BREAK-POINT.
  sort zsflight_out by connid. " Connid should eb replaced by the field - Ktgrm_d

LOOP AT zsflight_out INTO wa_zsflight_out .

  at END OF connid.
  sum.
  wa_total = wa_zsflight_out-price.  " price should be replaced by field - Value
  fg = 'X'.
  endat.

  append wa_zsflight_out to zs_sf1.
IF fg = 'X'.
  wa_zsflight_out-price = wa_total.
  append wa_zsflight_out to zs_sf2.
  APPEND LINES OF zs_sf1 to zs_sf2.
  clear fg.
  refresh zs_sf1[].
  CLEAR wa_total.
ENDIF.

ENDLOOP.
BREAK-POINT.

Regards,

Swarna Munukoti

former_member251546
Participant
0 Kudos

Hi,

good day swarna


Thank you for supporting me. I got a prob in smart form. Ive dev the smart form and dev the custom programme for that form.
my final itab got items with subtotal. Just iam passing the final itab to smart form. there iam using directly.

my requirement is i need to get the all sub tottal records should be bold/color.... how to make it? subtotal will be come end of the item. ive 8 iteams.. its like a


my final itab data
Items
--------
A           10
A           10
A           10 
Subtot    30         "should be yellow color /bold
B            10
B            10
b            10
subtot     30     " should be yellow color /bold

I coded in smart form level as below as. but it doesnt work out.
if &lwa_out-ktgrm_d& = 'subtotal'.
s2  &lwa_out-ktgrm_d&                            "bold pharagraph format
else
s4 &lwa_out-ktgrm_d&                             " normal pharagraph format
endif
 

Plz advice me

Thank you

Answers (1)

Answers (1)

Abhijit74
Active Contributor
0 Kudos

hI,

[Please go through this. You will get the answer.|;

Thnaks,

Abhijit