Open SQL
DATA gv_address_via_carrier TYPE adrc.
CLEAR gv_address_via_carrier.
IF vttkvb-tknum IS NOT INITIAL. " Shipment Number
SELECT SINGLE *
FROM vtpa
INNER JOIN adrc
ON vtpa~adrnr = adrc~addrnumber
INTO CORRESPONDING FIELDS OF gv_address_via_carrier
WHERE vbeln = vttkvb-tknum
AND posnr = '000000'
AND parvw = 'SV'.
ENDIF.
Of course in case of more than one VIA forwarder do not use SELECT SINGLE, but fill internal table with just SELECT clause.
SAP SCRIPT form
/: ADDRESS PARAGRAPH AS
/: NAME &GV_ADDRESS_VIA_CARRIER-NAME1&, &GV_ADDRESS_VIA_CARRIER-NAME2
/: STREET &GV_ADDRESS_VIA_CARRIER-STREET&
/: CITY &GV_ADDRESS_VIA_CARRIER-CITY1(29)&
/: POSTCODE &GV_ADDRESS_VIA_CARRIER-POST_CODE1(10)&
/: COUNTRY &GV_ADDRESS_VIA_CARRIER-COUNTRY&
/: REGION &GV_ADDRESS_VIA_CARRIER-REGION&
/: ENDADDRESS
No comments:
Post a Comment