cancel
Showing results for 
Search instead for 
Did you mean: 

Ship To (Delivery address)

Former Member
0 Kudos

Hi,

I am working on Custom Smartform PO. I got struck at Delivery address(Ship to) window. The scenario is if all the items have same delivery address then the delivery address should be printed at the header level in the Ship to window but if the delivery address is different for different items then we have to print it at item level .ie; prin after every item its delivery addres.

its urgent..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

u have to check for a condition...take an temp internal table and move the records and delete adjecent duplicates reocrds and check count of table entry...if it is 1 then use the data to print in Main Window...If the count is more than 1 then print in the item detail data.

Former Member
0 Kudos

hi ramesh ,

wat is the table from which i have to pick th eentries from and wat is the key field.

Former Member
0 Kudos

Hi.

In the PO you can do the following in the initialization of your form assuming you are using the standard SAP program and data structure. If ship_to_unique is 'X' then you can print delivery address on header. If not, then on item level.


* Ship-to party
READ TABLE sf_po-ship_to INTO ship_to_head INDEX 1.
IF sy-subrc = 0.
  ship_to_unique = 'X'.
  LOOP AT sf_po-ship_to
  INTO ls_ship_to_dummy
  WHERE partner_no NE ship_to_head-partner_no OR
  addr_no    NE ship_to_head-addr_no    OR
  pers_no    NE ship_to_head-pers_no.
    CLEAR ship_to_unique.
    EXIT.
  ENDLOOP.
ENDIF.

BR

Niklas

Former Member
0 Kudos

niklas ,

if u have the full code can u send across to me ...

it will solve my problem..

Former Member
0 Kudos

Hi again.

That is the full code for how we do it.

Just declare ship_to_unique in global data as type c.

In the ship_to window put in condition: ship_to_unique = 'X'

On the item level, create a new row and set condition ship_to_unique <> 'X'.

In the row write code to get the address for that item and print it in a cell.

Hope this helps.

BR

Niklas

Former Member
0 Kudos

hey wat did u declare in the table

sf_po-ship_to

ship_to_head

Former Member
0 Kudos

Hi.

SF_PO is the structure that SAP provides to your PO. It is found under Form Interface; import.

I do not alter the contents of sf_po_ship_to -> it is provided by the print program authored by SAP:

ship_to_head is just a work area used to be able to print the address in the address window.

BR

Niklas

Former Member
0 Kudos

Hi,

Thats gr8.

I have a scenario in standard PO (ZMEDRUCK) is that

i have 10 items for 1 PO number 1000001 for different delevery address.

If i want to print the PO, it should comes as different deliverd to address for same PO number.

i.e....

PO no: 111

it has 10

20

30

40

50

60

line items.

10,20,30 is for 1 location.

40,50,60 for the other.

while taking printout.

it should print PO: 111

10

20

30

grouped to 1 delivery.

and rest should print from first page.

Point will be rewarded.

Esaki

Answers (0)