on 11-25-2008 7:00 AM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.