cancel
Showing results for 
Search instead for 
Did you mean: 

Address printing in table

Former Member
0 Kudos

Good morning all,

I am working with smartforms.

my requirement is to print customer number(KUNNR) customer address (ADRNR) and his sales order item data in a main window(Order number/item quantity net value ) .

what i am doing is i am looping my header structure which is having customer number and address number and inside the loop i am calling table with item loop.

for example wa_header and wa_item are the work areas of the

structures.so i am populating table like this.

loop at itab_header into wa_header.

table : loop at itab_item into wa_item where kunnr = header-kunnr.

my table is having 2 header loop coloumns and 4 item loop (table loop) coloumns like below.

coloumn1 :wa_header-KUNNR

coloumn2 :wa_header-ADRNR

coloumn3 :wa_itemVBELN

coloumn4 :wa_item-POSNR

coloumn5 :wa_item-KWMENG

coloumn6 :wa_item-Deliveruy number.

my requirement also includes: for every customer address i have to print his sales order numbers items and its details.

(For all this, adress should be printed only once)

my problem is : first record is printing allright :

from second record, as address is taking multiple rows to print my second resord is printing from end of the address row (might be 4th or 5th row like below).

kunnr ADRNR vbeln posnr kwmeng net value

1234 gopal 273122/10 546 237231

space street space space space

space city space space space

space postal code space space space

space space 3131231/20 657 2131331

space space 4354353/34 3424 2423432424

1235 gopal 1 273122/10 546 237231

space street space space space

space city space space space

space postal code space space space

space space 3131231/20 657 2131331

space space 4354353/34 3424 2423432424

Somthing like above .

but i dont want spaces which are in the bold as above shown :

i want to display like below

kunnr ADRNR vbeln posnr kwmeng net value

1234 gopal 273122/10 546 237231

space street 3131231/20 657 2131331

space city 4354353/34 3424 2423432424

space pstal code

1235 gopal 1 273122/10 546 237231

space street 3131231/20 657 2131331

space city 4354353/34 3424 2423432424

space postal code

I hope u understand my problem .

Can any one help me inthis please :

it is emergency for me.

all the helpfull answers are rewardfull.

Thanks and regards,

Gopal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

loop at w_kunnr.

get address from fm.

check number of line in address.

loop line times. ( take a dummy table and fill initial line for line times )

fill table line type with address line by line only at first fill kunnr.

endloop.

loop at item where ku.....

fill table line type.

endloop.

endloop.

Former Member
0 Kudos

Hi S.r.v.r.Kumar

thanks for the reply

can u please bit more elaborate the process.

regards,

Gopal

Answers (1)

Answers (1)

Former Member
0 Kudos

problem solved