cancel
Showing results for 
Search instead for 
Did you mean: 

Delivery Address..in smart form

Former Member
0 Kudos

Hi ,

I need Delivery address to be printed with logic

If adrnr is maintained for any 1 line item for the given ebeln then use that adrnr to fetch the address from adrc table else get the plant address

To get the plant address

L_EKKO-RESWK = P_WERKS.

L_EKKO-BSAKZ = 'T'.

CALL FUNCTION 'MM_ADDRESS_GET'

EXPORTING

I_EKKO = L_EKKO

IMPORTING

E_ADDRESS = L_ADDRESS

E_SADR = P_SADR.

Please Guide me the logic .

Regards,

Neelima.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

If ADRNR is maintained for EBELN. Then write like this.

if not EKKO-ADRNR is initial.

select single * from adrc where ADDRNUMBER = EKKO-ADRNR.

Else.

select single * from T001W where werks = P_WERKS.

if sy-subrc is initial.

select single * from adrc where ADDRNUMBER = T001W-ADRNR.

endif.

endif.

Former Member
0 Kudos

Hi usha,

Then how to fetch plant address ? no need of that CALL FUNCTION 'MM_ADDRESS_GET'

Regards,

Neelima.

Former Member
0 Kudos

HI,

p_werks is u r parameter.so u have a value in that.

Then u can select the ADRNR from T001W based on u r plant.

select single * from T001W where werks = p_werks.

if sy-subrc is initial.

select single * from adrc where addrnumber = t001w-adrnr.

endif.

From ADRC u can print required fields.

Eg : ADRC-NAME1,ADRC-NAME2,......etc